product.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877
  1. <template>
  2. <view class="product" :style="{paddingBottom: userIdentity==1 && userIdentity == 3 ? '0rpx' :'188rpx',paddingTop:CustomBar+'px'}">
  3. <custom-p v-if="isHeaderPoduct"
  4. :systeminfo='systeminfo'
  5. :navbar-data='nvabarData'
  6. :headerBtnPosi ="headerBtnPosi"
  7. :headerColor="headerColor"
  8. :type="isShareType"
  9. :page='backPage'>
  10. </custom-p>
  11. <view class="product-topnav" v-if='isNavbarFiexd' :class="navbarFiexd" :style="{top:CustomBar +'px'}">
  12. <view class="search-input">
  13. <view class="gosearch-btn" :class="navbarFiexd" @click="this.$api.navigateTo(clickPath)">
  14. <view class="search-icon">
  15. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  16. </view>
  17. <view class="search-text">搜索商品/供应商/项目仪器</view>
  18. </view>
  19. </view>
  20. <view class="navbar">
  21. <view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 0 }" @click="tabClick(0)">
  22. <text>详情</text>
  23. <text class="line"></text>
  24. </view>
  25. <view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 1 }" @click="tabClick(1)">
  26. <text>服务项目</text>
  27. <text class="line"></text>
  28. </view>
  29. <view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 2 }" @click="tabClick(2)">
  30. <text>推荐</text>
  31. <text class="line"></text>
  32. </view>
  33. </view>
  34. </view>
  35. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
  36. <template v-else >
  37. <view class="cart-content empty" v-if="isInvalid">
  38. <view class="empty-container">
  39. <image class="empty-container-image" :src="productNoneImage" mode="aspectFit"></image>
  40. <text class="error-text">商品已失效,去商城逛逛别的吧~</text>
  41. <view class="login-btn" @click="goIndex">去商城</view>
  42. </view>
  43. </view>
  44. <view class="container-product tui-skeleton" v-else>
  45. <view class="container-product-main">
  46. <view class="product-top">
  47. <view class="banner-section">
  48. <uni-swiper-dot :info="productImage" :current="current" field="content" :mode="mode" >
  49. <swiper class="banner tui-banner tui-skeleton-rect" @change="swiperChange" :duration='800' :autoplay="false" :circular="true" >
  50. <swiper-item v-for="(item, index) in productImage" :key="index" class="banner-item">
  51. <image :src="item" @click="previewImg(index)" class="product-img" />
  52. </swiper-item>
  53. </swiper>
  54. <view class="swiper__dots-box">
  55. <tui-tag padding="12rpx 24rpx" type="translucent" shape="circleLeft" size="32rpx" :scaleMultiple="0.82" originRight>{{ current + 1 }}/{{ productImage.length }}</tui-tag>
  56. </view>
  57. </uni-swiper-dot>
  58. </view>
  59. <view class="product-wrap clearfix">
  60. <view class="wrap-top" :class="goodsData.isNoneDisabled ? 'none' : ''">
  61. <view class="wrap-top-price">
  62. <cm-price v-if="isRequest"
  63. :product="product"
  64. :userIdentity="userIdentity"
  65. :shopID= "shopID"
  66. :promotions="product.promotions"
  67. :ladderPriceList="ladderPriceList"/>
  68. </view>
  69. <view class="p-title tui-skeleton-fillet">
  70. <view class="mclap-tag" v-if="product.beautyActFlag == '1'">美博会</view>
  71. <view class="p-title-name" :class="product.beautyActFlag == '1' ? 'indent' : ''"> {{product.name == undefined ? '' : product.name}} </view>
  72. <button open-type="share" class="p-title-share tui-share-position" @tap="onShare">
  73. <view class=""><text class="iconfont icon-fenxiang1"></text></view>
  74. <view class="">分享</view>
  75. </button>
  76. </view>
  77. <view class="wrap-label" v-if="product.tagsList.length>0">
  78. <view class="label-a tui-skeleton-fillet" v-for="(label,index) in product.tagsList" :key="index">{{label}}</view>
  79. </view>
  80. <view class="product-seve">
  81. <text class="label">采美承诺:</text>
  82. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">无忧退货</text></text>
  83. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">快速退款</text></text>
  84. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">正品保证</text></text>
  85. </view>
  86. <view class="productRemarks" v-if="product.productRemarks!=''&&product.productRemarks!=null">
  87. 备注:{{product.productRemarks}}
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="product-item-none" v-if="goodsData.isNoneDisabled">
  93. <image class="none-image" :src="productNoneImage" mode=""></image>
  94. <view class="none-text">此商品已{{goodsData.disabledText}},请浏览以下推荐商品~</view>
  95. </view>
  96. <view class="product-parameter" @click="showPopup" v-if="!goodsData.isNoneDisabled">
  97. <text class="title">参数:</text>
  98. <text class="name">品牌 起订量 分类...</text>
  99. <text class="iconfont icon-xiayibu"></text>
  100. </view>
  101. <view class="product-supplier" v-if="isNoneSupplier" @click="goSupplier">
  102. <view class="logo"><img :src="shop.logo ? shop.logo :'https://static.caimei365.com/app/img/icon/icon-shoplogo.png'" alt=""></view>
  103. <view class="main">
  104. <view class="name">{{shop.name}}</view>
  105. <view class="massgs">
  106. <view class="label">满意度:</view>
  107. <view class="p-stars">
  108. <uni-stars :stars="6" :iconClass="iconClass" :iconColor="iconColor" :fontSize="36" :widthInfo="176"></uni-stars>
  109. </view>
  110. <view class="acount">
  111. <text>{{ shop.normalNum }}</text>件商品
  112. </view>
  113. </view>
  114. </view>
  115. <view class="right"><text class="iconfont icon-xiayibu"></text></view>
  116. </view>
  117. </view>
  118. <view class="product-details product-details0">
  119. <!-- 商品详情 -->
  120. <view class="title">
  121. <view class="title-tab">商品详情</view>
  122. </view>
  123. <view class="content tui-banner product-rich-text tui-skeleton-rect">
  124. <parser :html="html" :img-mode="widthFix" v-if="!goodsData.isNoneDisabled"></parser>
  125. <view class="product-rich-text-none" v-else>暂无商品信息</view>
  126. </view>
  127. </view>
  128. <view class="product-details service product-details1">
  129. <!-- 服务项目 -->
  130. <view class="title">
  131. <view class="title-tab">服务项目</view>
  132. </view>
  133. <view class="content service" v-if="product.productDetail.orderInfo || product.productDetail.serviceInfo">
  134. <cm-service :product="product.productDetail" v-if="isRequest"></cm-service>
  135. </view>
  136. <view class="content-none" v-else>
  137. <text>暂无服务项目</text>
  138. </view>
  139. </view>
  140. <view class="product-details recommend product-details2">
  141. <!-- 相关推荐 -->
  142. <view class="title">
  143. <view class="title-tab">相关推荐</view>
  144. </view>
  145. <view class="content hot">
  146. <recommend :query-productid="product.productID" :query-type="product.recommendType" v-if="isRequest"></recommend>
  147. </view>
  148. </view>
  149. <!-- 商品参数 -->
  150. <tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup()">
  151. <view class="tui-popup-box clearfix">
  152. <view class="title">商品参数</view>
  153. <div class="tui-popup-main">
  154. <scroll-view class="tui-popup-scroll" scroll-y="true">
  155. <view class="content-tr">
  156. <view class="content-td">起订量</view>
  157. <view class="content-th">{{product.minBuyNumber}}</view>
  158. </view>
  159. <view class="content-tr">
  160. <view class="content-td">品牌</view>
  161. <view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
  162. </view>
  163. <view class="content-tr">
  164. <view class="content-td">分类</view>
  165. <view class="content-th">{{product.typeName == null? '暂无' : product.typeName}}</view>
  166. </view>
  167. <view class="content-tr">
  168. <view class="content-td">包装规格</view>
  169. <view class="content-th">{{product.unit}}</view>
  170. </view>
  171. <view class="content-tr">
  172. <view class="content-td">商品编码</view>
  173. <view class="content-th">{{product.productCode}}</view>
  174. </view>
  175. <view class="content-tr">
  176. <view class="content-td">库存</view>
  177. <view class="content-th">{{product.stock}}</view>
  178. </view>
  179. <view class="content-tr" v-if="product.parametersList.length>0" v-for="(item, index) in product.parametersList" :key="index">
  180. <view class="content-td">{{item.paramsName}}</view>
  181. <view class="content-th">{{item.paramsContent}}</view>
  182. </view>
  183. </scroll-view>
  184. </div>
  185. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
  186. <view class="tui-flex-1">
  187. <view class="tui-button" @click="hidePopup()">收起</view>
  188. </view>
  189. </view>
  190. </view>
  191. </tui-bottom-popup>
  192. <!-- 底部按钮 -->
  193. <view class="menu" v-if="isShowButton">
  194. <view class="bottom-btn" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  195. <view class="bottom-le">
  196. <view class="item-bt" @click="this.$api.switchTabTo('/pages/tabBar/home/index')">
  197. <image src="../../static/icon-home-active@3x.png"></image>
  198. <text>首页</text>
  199. </view>
  200. <view class="item-bt" @click="goSupplier">
  201. <image src="../../static/icon-shop@3x.png"></image>
  202. <text>店铺</text>
  203. </view>
  204. <view class="item-bt" @click="buyProductCart()">
  205. <image src="https://static.caimei365.com/app/img/icon/icon-cart-active@3x.png"></image>
  206. <text>购物车</text>
  207. <text v-if="hasLogin && goodsData.cartCount>0"
  208. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  209. :class="[goodsData.cartCount < 10 ? 'goleft':'']">
  210. {{ goodsData.cartCount >= 100 ? '99+': goodsData.cartCount}}
  211. </text>
  212. <view class="animation-num" :class="isAnimation ? 'animation' : 'restion'">+1</view>
  213. </view>
  214. </view>
  215. <view class="bottom-ri">
  216. <button
  217. :disabled="goodsData.disabled"
  218. class="btn btn-cart"
  219. :class="[goodsData.disabled ? 'disabled':'']"
  220. @tap.stop="btnGetConfirm('add')">加入购物车</button>
  221. <button
  222. :disabled="goodsData.disabled"
  223. class="btn btn-bay"
  224. :class="[goodsData.disabled ? 'disabled':'']"
  225. @tap.stop="btnGetConfirm('buy')">立即购买</button>
  226. </view>
  227. </view>
  228. </view>
  229. <!--底部选择模态层弹窗组件 -->
  230. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" @tap="hideSpec">
  231. <!-- 遮罩层 -->
  232. <view class="mask"></view>
  233. <view class="layer" @tap.stop="discard" :style="{paddingBottom :isIphoneX ? '68rpx' : '36rpx',bottom:isIphoneX ?'-352rpx' : '-296rpx'}">
  234. <view class="content">
  235. <view class="layer-smimg">
  236. <image :src="product.mainImage" mode=""></image>
  237. </view>
  238. <view class="layer-nunbox">
  239. <view class="layer-nunbox-t" v-if="product.step === 2">
  240. <view class="text">*该商品只能以起订量的整数倍购买</view>
  241. </view>
  242. <view class="layer-nunbox-t">
  243. <view class="layer-nunbox-text">数量:</view>
  244. <view class="number-box">
  245. <view class="iconfont icon-jianhao" :class="[isQuantity==true?'disabled':'']" @click="changeCountSub()"></view>
  246. <input class="btn-input" type="number" v-model="number" maxlength='4' @blur="changeNumber($event)">
  247. <view class="iconfont icon-jiahao" :class="[isStock==true?'disabled':'']" @click="changeCountAdd()"></view>
  248. </view>
  249. </view>
  250. <view class="layer-nunbox-b">
  251. <view class="text">单价:
  252. <text class="p sm">¥</text>
  253. <text class="p bg">{{buyRetailPrice.toFixed(2)}}</text>
  254. </view>
  255. </view>
  256. </view>
  257. </view>
  258. <view class="btn"><view class="button" @click.stop="btnConfirm">确定</view></view>
  259. </view>
  260. </view>
  261. <!-- 侧边 -->
  262. <scroll-top :isScrollTop="isScrollTop" :bottom="200"></scroll-top>
  263. </view>
  264. </template>
  265. </view>
  266. </template>
  267. <script>
  268. import { mapState,mapMutations } from 'vuex'
  269. import customP from '@/components/cm-module/headerNavbar/header-poduct' //自定义导航
  270. import cmPrice from "@/components/cm-module/productDetails/cm-price.vue" //价格显示
  271. import cmAttributes from "@/components/cm-module/productDetails/cm-attributes.vue" //规格信息
  272. import parser from "@/components/jyf-Parser/index" //富文本处理
  273. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  274. import recommend from "@/components/cm-module/productDetails/recommend" //相关推荐
  275. import cmParameter from "@/components/cm-module/productDetails/cm-parameter" //相关参数
  276. import cmService from "@/components/cm-module/productDetails/cm-service" //服务项目
  277. import authorize from '@/common/config/authorize.js'
  278. import wxLogin from "@/common/config/wxLogin.js"
  279. import { debounce } from '@/common/config/common.js'
  280. var isPreviewImg;
  281. export default{
  282. components:{
  283. customP,
  284. parser,
  285. tuiSkeleton,
  286. recommend,
  287. cmPrice,
  288. cmAttributes,
  289. cmParameter,
  290. cmService
  291. },
  292. data(){
  293. return{
  294. clickPath:'/search/pages/search/search',
  295. html:'<div style="text-align: center;color:#333333;">暂无内容</div>',
  296. productNoneImage:'https://static.caimei365.com/app/img/icon/icon-pnone.png',
  297. mode:'round',
  298. iconClass:'icon-aixin',
  299. iconColor:'#ff9100',
  300. specClass: '',//规格弹窗css类,控制开关动画
  301. isBtnType:'',
  302. isRequest:false,
  303. isScrollTop:false,
  304. current:0,
  305. shopId:0,
  306. isShareType:'',
  307. isHeaderPoduct:false,
  308. isNavbarFiexd:false,
  309. navbarFiexd:'none',
  310. ladderPriceFlag:'',
  311. ladderPriceList:'',
  312. isInvalid:false,
  313. isEvaluate:false,
  314. isAnimation:false,
  315. skeletonShow:true,
  316. isQuantity:false,
  317. isStock:false,
  318. disabled:false,
  319. isNoneDisabled:false,
  320. tabCurrentIndex:0,
  321. userID:'',
  322. shopID:'',
  323. productID:0,
  324. userIdentity:0,//用户类型
  325. goodsData:{},//自定义数据
  326. shop:{},//供应商信息
  327. product:{},//采美
  328. productImage:[],
  329. retailPrice:0,
  330. buyRetailPrice:0,
  331. buyRetailPriceStep:1,
  332. stock:0,
  333. number:0,
  334. minBuyNumber:0,
  335. productsList:[],
  336. goodListData:[],
  337. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  338. systeminfo: this.setSysteminfo(), //获取设备信息
  339. isIphoneX:this.$store.state.isIphoneX,
  340. windowHeight: '',
  341. headerColor:false,
  342. backPage:1,
  343. nvabarData: { //顶部自定义导航
  344. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示
  345. title: '' // 导航栏 中间的标题
  346. },
  347. linkPath:'',
  348. CustomBar:this.CustomBar,// 顶部导航栏高度
  349. popupShow:false,//参数弹窗
  350. tabSelectFlag:false,
  351. sectionPropsArr: [],
  352. scrollTopArray:[],
  353. sectionTopRangeArr: [],
  354. winHeight:'',
  355. isShowButton:true,
  356. isNoneSupplier:false
  357. }
  358. },
  359. onLoad(option) {
  360. this.productID = option.id;//获取商品ID
  361. this.isShareType = option.type
  362. this.linkPath = option.path
  363. this.isHeaderPoduct = true
  364. if(option.page == 2){
  365. this.backPage = option.page
  366. }
  367. if(this.isShareType =='share'){
  368. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  369. console.log(wxResponse)
  370. if(wxResponse == 1){
  371. wxLogin.wxLoginAuthorize()
  372. }else{
  373. console.log(new Date +'用户未授权微信信息')
  374. }
  375. })
  376. }
  377. this.getWinHeight()
  378. },
  379. computed: {
  380. ...mapState(['hasLogin','isWxAuthorize','identity'])
  381. },
  382. methods:{
  383. initData(){// 初始化商品详情查询
  384. this.ProductService.queryProductDetils({userId:this.userID,productID:this.productID,identity:this.identity}).then(response =>{
  385. this.skeletonShow = false
  386. this.productImage=[];
  387. this.shop = response.data.shop
  388. this.shopId = response.data.shopID
  389. this.product = response.data
  390. //已删除/已冻结
  391. if(this.product.validFlag === '0'){
  392. this.isInvalid = true
  393. }
  394. this.ladderPriceFlag = this.product.ladderPriceFlag;
  395. this.html = this.product.productDetail == null ? this.html : this.$api.adaptRichTextImg(this.product.productDetail.detailInfo)
  396. this.stock = this.product.stock
  397. this.buyRetailPriceStep = this.product.step
  398. this.number = this.product.minBuyNumber
  399. this.minBuyNumber = this.product.minBuyNumber
  400. //处理商品图片列表
  401. this.product.imageList.forEach(item =>{
  402. this.productImage.push(item.image);
  403. })
  404. //购物车数量
  405. this.goodsData.cartCount = this.product.productCount
  406. //处理阶梯价格
  407. if(this.product.ladderPriceList!=null){
  408. this.ladderPriceList = this.product.ladderPriceList;
  409. }
  410. //拆分金额并转千分位格式显示
  411. if(this.product.retailPrice!=null){
  412. this.retailPrice = this.product.retailPrice.toFixed(2);
  413. this.buyRetailPrice = this.product.retailPrice;
  414. }
  415. //处理下架商品和售罄商品
  416. if(this.product.validFlag =='3' || this.product.validFlag =='10' || this.stock == 0 ){
  417. this.disabled = true
  418. this.isNoneDisabled = true
  419. }else{
  420. this.disabled = false
  421. this.isNoneDisabled = false
  422. this.goodsData.disabledText = ''
  423. }
  424. if(this.product.price1TextFlag == "1"){
  425. this.disabled = true
  426. }
  427. if(this.product.price1TextFlag == "2"){
  428. if(this.userIdentity == 4){
  429. this.disabled = true
  430. }else{
  431. this.disabled = false
  432. }
  433. }
  434. this.goodsData.disabled = this.disabled
  435. this.goodsData.isNoneDisabled = this.isNoneDisabled
  436. if(this.product.validFlag =='3'){
  437. this.goodsData.disabledText = '下架'
  438. }
  439. if(this.product.validFlag =='10'){
  440. this.goodsData.disabledText = '停售'
  441. }
  442. if(this.stock == 0){
  443. this.goodsData.disabledText = '售罄'
  444. }
  445. setTimeout(()=>{
  446. this.getSectionProps();
  447. },2000)
  448. this.isRequest = true
  449. }).catch(error =>{
  450. this.$util.msg(error.msg,2000);
  451. })
  452. },
  453. swiperChange(e) {//顶部商品图片切换
  454. const index = e.detail.current;
  455. this.current = index;
  456. },
  457. previewImg (index) {//顶部商品图片预览
  458. isPreviewImg = true
  459. let previewUrls = this.productImage
  460. uni.previewImage({
  461. current: index, //图片索引
  462. urls: previewUrls, //必须是http图片,本地图片无效
  463. longPressActions:''
  464. })
  465. },
  466. tabClick(index) {//商品详情&&供应商信息tab切换
  467. this.tabSelectFlag = true
  468. this.tabCurrentIndex = index;
  469. let classIndex = '.product-details'+index;
  470. uni.createSelectorQuery().select('.container-product-main').boundingClientRect((data)=>{//最外层盒子节点
  471.   uni.createSelectorQuery().select(classIndex).boundingClientRect((res)=>{//最外层盒子节点
  472.     uni.pageScrollTo({
  473.       duration:300,//过渡时间必须为0,uniapp bug,否则运行到手机会报错
  474.       scrollTop:res.top - data.top - 150,//滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
  475.     })
  476. setTimeout(()=>{
  477. this.tabSelectFlag = false;
  478. },500)
  479.   }).exec()
  480. }).exec()
  481. },
  482. handleContact(e){//跳转小程序客服
  483. },
  484. buyProductCart(){//底部购物车按钮点击
  485. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  486. if(wxResponse == 1){
  487. if(this.hasLogin){
  488. this.$api.navigateTo('/pages/goods/cart')
  489. }else{
  490. this.$api.navigateTo('/pages/login/login?type=1')
  491. }
  492. }else{
  493. this.$api.navigateTo('/pages/authorization/authorization?type=1')
  494. }
  495. })
  496. },
  497. btnGetConfirm(type){//加入购物车&&立即购买点击
  498. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  499. if(wxResponse == 1){
  500. if(this.hasLogin){
  501. this.showSpec(type);
  502. }else{
  503. this.$api.navigateTo('/pages/login/login?type=1')
  504. }
  505. }else{
  506. this.$api.navigateTo('/pages/authorization/authorization?type=1')
  507. }
  508. })
  509. },
  510. changeCountAdd(){//popup弹窗数量增加按钮
  511. if(this.buyRetailPriceStep == 2){
  512. this.number+=this.minBuyNumber
  513. }else{
  514. this.number++
  515. }
  516. this.processActivityPrice()
  517. },
  518. changeCountSub(){//popup弹窗数量减按钮
  519. if(this.number<=this.minBuyNumber){
  520. this.number= this.minBuyNumber
  521. this.isQuantity =true
  522. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  523. return
  524. }else{
  525. if(this.buyRetailPriceStep == 2){
  526. this.number-=this.minBuyNumber
  527. }else{
  528. this.number--
  529. }
  530. this.processActivityPrice()
  531. this.isQuantity =false
  532. }
  533. },
  534. changeNumber(e){
  535. let _value = e.detail.value;
  536. if(!this.$api.isNumber(_value)){
  537. this.number = this.minBuyNumber
  538. }else if(_value < this.minBuyNumber){
  539. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  540. this.number = this.minBuyNumber
  541. }else if( _value % this.minBuyNumber !=0 ){
  542. this.$util.msg(`购买量必须为起订量的整数倍`,2000);
  543. this.number = this.minBuyNumber
  544. }else{
  545. this.number = e.detail.value
  546. }
  547. this.processActivityPrice()
  548. },
  549. processActivityPrice(){//单独处理活动价格和阶梯价格
  550. if(this.ladderPriceFlag == '0' && this.product.actStatus == 0 || this.product.actStatus == 1){
  551. this.buyRetailPrice = this.product.retailPrice
  552. }else{
  553. this.ladderPriceList.forEach((item,index)=>{
  554. if(this.number>=item.buyNum){
  555. this.buyRetailPrice = item.buyPrice
  556. }
  557. })
  558. }
  559. },
  560. showSpec(type) {//显示选择数量确认弹窗
  561. this.isBtnType = type
  562. this.specClass = 'show';
  563. },
  564. hideSpec() {//关闭选择数量确认弹窗
  565. this.specClass = 'hide';
  566. setTimeout(() => {
  567. this.specClass = 'none';
  568. }, 200);
  569. },
  570. btnConfirm() {//加入购物车&&立即购买跳转订单页并关闭弹窗
  571. if(this.isBtnType == 'add'){
  572. this.getAddProductCart()
  573. }else{
  574. this.toConfirmation()
  575. }
  576. },
  577. toConfirmation(){//跳转确认订单页面
  578. this.specClass = 'hide';
  579. let productStp ={
  580. allPrice:this.number*this.buyRetailPrice,
  581. allCount:this.number,
  582. productID:this.product.productID,
  583. productCount:this.number
  584. }
  585. this.$api.navigateTo(`/pages/user/order/create-order?type=prodcut&data=${JSON.stringify({data:productStp})}`)
  586. setTimeout(() => {
  587. this.specClass = 'none';
  588. }, 200);
  589. },
  590. getAddProductCart(){//增加购物车成功和toast弹窗提示成功
  591. this.ProductService.shoppingAddCart({productID:this.productID,userID:this.userID,productCount:this.number}).then(response => {
  592. this.specClass = 'hide';
  593. this.$util.msg('加入购物车成功',1500,true,'success')
  594. this.isAnimation = true
  595. setTimeout(() => {this.specClass = 'none'}, 200)
  596. setTimeout(() => {this.isAnimation = false},2000)
  597. this.goodsData.cartCount = response.data;
  598. }).catch(error =>{
  599. this.$util.msg(error.msg,2000);
  600. })
  601. },
  602. navToLogin(){
  603. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  604. if(wxResponse == 1){
  605. this.$store.commit('setLoginType',8)
  606. this.$store.commit('setLoginProductId',this.productID)
  607. this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
  608. }else{
  609. this.$api.navigateTo('/pages/authorization/authorization?type=1')
  610. }
  611. })
  612. },
  613. setHeaderBtnPosi(){
  614. // 获得胶囊按钮位置信息
  615. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  616. return headerBtnPosi
  617. },
  618. setSysteminfo(){
  619. let systeminfo;
  620. uni.getSystemInfo({ // 获取设备信息
  621. success: (res) => {
  622. systeminfo = res
  623. },
  624. })
  625. return systeminfo
  626. },
  627. goIndex(){//商城首页
  628. uni.switchTab({
  629. url: '/pages/tabBar/home/index'
  630. });
  631. },
  632. goSupplier(){//跳供应商资料页
  633. this.$api.navigateTo('/supplier/pages/user/my-shop?shopId='+this.shopId)
  634. },
  635. discard(){
  636. //丢弃
  637. },
  638. onShare(res){//分享转发
  639. if (res.from === 'button') {
  640. // 来自页面内转发按钮
  641. }
  642. return {
  643. title: `${this.product.name}`,
  644. path: `pages/goods/product?type=share&id=${this.productID}`,
  645. imageUrl:`${this.productImage[0]}`
  646. }
  647. },
  648. showPopup(){
  649. this.popupShow = true
  650. },
  651. hidePopup(){
  652. this.popupShow = false
  653. },
  654. getSectionProps() {//获取每个tab对应区域的scrollTop值
  655. let className = '.product-details',
  656. sectionPropsArr = [];
  657. uni.createSelectorQuery().select('.container-product-main').boundingClientRect((data)=>{//最外层盒子节点
  658.   uni.createSelectorQuery().selectAll(className).boundingClientRect((res)=>{//最外层盒子节点
  659. res.forEach((item, index) => {
  660. sectionPropsArr.push({
  661. className: `${className}${index}`,
  662. scrollTop: item.top - data.top - 150
  663. })
  664. })
  665. this.sectionPropsArr = sectionPropsArr;
  666. this.sectionTopRangeArr = this.getSectionRange(sectionPropsArr);
  667.   }).exec()
  668. }).exec()
  669. },
  670. getSectionRange(arr) {// 获取每个tab对应区域的区间
  671. let sectionScrollTopList = [];
  672. for(let i = 0; i < arr.length; i++) {
  673. let thisScrollTop = arr[i].scrollTop;
  674. if(i < arr.length - 1) {
  675. let nextScrollTop = arr[i+1].scrollTop;
  676. if(i == 0) {
  677. sectionScrollTopList.push(`0-${thisScrollTop}`);
  678. } else if(i == arr.length - 1){
  679. sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop - this.winHeight}`);
  680. } else {
  681. sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop}`);
  682. }
  683. } else {
  684. sectionScrollTopList.push(`${thisScrollTop}-${thisScrollTop+500}`);
  685. }
  686. }
  687. return sectionScrollTopList;
  688. },
  689. activeTab: debounce((top, _this)=> {//当滑动时也能同步激活tab
  690. const { sectionTopRangeArr } = _this;
  691. if(sectionTopRangeArr.length > 0) {
  692. sectionTopRangeArr.forEach((item, index) => {
  693. let splitItem = item.split('-'),
  694. openInterval = Number(splitItem[0]),
  695. closedInterval = Number(splitItem[1]);
  696. if(top >= openInterval && top < closedInterval) {
  697. _this.tabCurrentIndex = index;
  698. }
  699. })
  700. }
  701. },100, true),
  702. getWinHeight() {
  703. this.winHeight = wx.getSystemInfoSync().windowHeight;
  704. },
  705. },
  706. onPageScroll(e){//实时获取到滚动的值
  707. const { scrollTop } = e;
  708. if(!this.tabSelectFlag) {
  709. this.activeTab(scrollTop, this);
  710. }
  711. if(e.scrollTop>60){
  712. this.headerColor = true
  713. this.navbarFiexd = 'fixed'
  714. this.isNavbarFiexd = true
  715. this.nvabarData={
  716. showCapsule: 1,
  717. title: '商品详情',
  718. }
  719. }else{
  720. this.headerColor = false
  721. this.isNavbarFiexd = false
  722. this.navbarFiexd = 'none'
  723. this.nvabarData={
  724. showCapsule: 1,
  725. title: '',
  726. }
  727. }
  728. if(e.scrollTop>700){
  729. this.isScrollTop = true
  730. }else{
  731. this.isScrollTop = false
  732. }
  733. },
  734. onShareAppMessage(res){//分享转发
  735. if (res.from === 'button') {
  736. // 来自页面内转发按钮
  737. }
  738. return {
  739. title: `${this.product.name}`,
  740. path: `pages/goods/product?type=share&id=${this.productID}`,
  741. imageUrl:`${this.productImage[0]}`
  742. }
  743. },
  744. onShow() {
  745. this.$api.getStorage().then((resolve) => {
  746. this.userID = resolve.userId ? resolve.userId : '';
  747. this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 0
  748. this.shopID = resolve.shopId ? resolve.shopId : '';
  749. if(this.userIdentity == 0 || this.userIdentity == 2 || this.userIdentity == 4){
  750. this.isShowButton = true
  751. }else{
  752. this.isShowButton = false
  753. }
  754. if (isPreviewImg) {
  755. isPreviewImg = false;
  756. return;
  757. } else {
  758. this.initData();
  759. }
  760. }).catch(error =>{
  761. this.initData();
  762. })
  763. }
  764. }
  765. </script>
  766. <style lang="scss">
  767. page{
  768. background-color: #FFFFFF;
  769. }
  770. .banner-section{
  771. width: 100%;
  772. height: 750rpx;
  773. position: relative;
  774. }
  775. .banner{
  776. width: 100%;
  777. height: 750rpx;
  778. .product-img{
  779. width: 750rpx;
  780. }
  781. image {
  782. width: 100%;
  783. height: 100%;
  784. }
  785. }
  786. .swiper__dots-box{
  787. position: absolute;
  788. color: #fff;
  789. bottom: 30rpx;
  790. right: 0;
  791. }
  792. .product-wrap{
  793. width: 100%;
  794. height: auto;
  795. padding: 24rpx 0 0 0;
  796. background-color: #FFFFFF;
  797. border-bottom: 20rpx solid #F7F7F7;
  798. .productRemarks{
  799. height: 48rpx;
  800. width: 100%;
  801. float: left;
  802. line-height: 48rpx;
  803. font-size: 24rpx;
  804. color: #999999;
  805. text-align: left;
  806. }
  807. .wrap-top{
  808. width: 702rpx;
  809. padding: 0 24rpx;
  810. height: auto;
  811. float: left;
  812. padding-bottom:20rpx;
  813. border-bottom: 1px solid #F8F8F8;
  814. &.none{
  815. .p-title{
  816. color:#999999
  817. }
  818. }
  819. .p-title{
  820. width: 100%;
  821. height: auto;
  822. float: left;
  823. position: relative;
  824. .p-title-name{
  825. width:602rpx;
  826. height: auto;
  827. float: left;
  828. line-height:48rpx;
  829. font-size: $font-size-28;
  830. color: $text-color;
  831. -o-text-overflow: ellipsis;
  832. text-overflow: ellipsis;
  833. display: -webkit-box;
  834. word-break: break-all;
  835. -webkit-box-orient: vertical;
  836. -webkit-line-clamp: 2;
  837. overflow: hidden;
  838. &.indent{
  839. text-indent: 95rpx;
  840. }
  841. }
  842. .mclap-tag{
  843. display: block;
  844. width: 84rpx;
  845. height: 32rpx;
  846. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  847. border-radius: 4rpx 48rpx 4px 4px;
  848. line-height: 32rpx;
  849. font-size: $font-size-22;
  850. color: #FFFFFF;
  851. text-align: center;
  852. position: absolute;
  853. left: 0;
  854. top: 6rpx;
  855. }
  856. .p-title-share{
  857. width: 96rpx;
  858. height: 96rpx;
  859. position: absolute;
  860. right: 0;
  861. text-align: center;
  862. color: #999999;
  863. font-size: $font-size-24;
  864. box-sizing: border-box;
  865. display: block;
  866. background: transparent;
  867. border-radius: 0;
  868. border: 0;
  869. margin: 0;
  870. padding: 8rpx 0;
  871. z-index: 990;
  872. .icon-fenxiang1{
  873. font-size: $font-size-34;
  874. }
  875. }
  876. .tui-share-btn::after {
  877. border: 0;
  878. }
  879. }
  880. .wrap-main-text{
  881. line-height: 56rpx;
  882. color: #FF2A2A;
  883. font-size: $font-size-26;
  884. display: block;
  885. float: left;
  886. font-weight: normal;
  887. }
  888. .wrap-main-none{
  889. display: block;
  890. width: 256rpx;
  891. height: 44rpx;
  892. padding-left: 20rpx;
  893. border-radius: 11rpx;
  894. background: $btn-confirm;
  895. float: right;
  896. line-height: 44rpx;
  897. color: #FFFFFF;
  898. text-align: center;
  899. font-size: $font-size-24;
  900. }
  901. .p-price-none{
  902. height: 44rpx;
  903. line-height: 44rpx;
  904. float: left;
  905. font-size: $font-size-24;
  906. color: #666;
  907. text-decoration: line-through;
  908. margin-left: 8rpx;
  909. }
  910. .p-minBuy{
  911. height: 44rpx;
  912. line-height: 44rpx;
  913. float: right;
  914. padding: 0 18rpx;
  915. border-radius: 22rpx;
  916. background-color: #f7f7f7;
  917. color: #7F7F7F;
  918. font-size: 24rpx;
  919. text-align: center;
  920. .min-text{
  921. margin: 0 6rpx;
  922. }
  923. }
  924. .p-login{
  925. height: 56rpx;
  926. line-height: 56rpx;
  927. color: $color-system;
  928. font-size: $font-size-24;
  929. &.grade{
  930. .price-left{
  931. float: left;
  932. .none{
  933. display: block;
  934. font-size: $font-size-20;
  935. line-height: 48rpx;
  936. color: #4A4B54;
  937. float: left;
  938. font-weight: bold;
  939. margin-left: 5rpx;
  940. text{
  941. letter-spacing: 4rpx;
  942. font-size: $font-size-32;
  943. }
  944. }
  945. }
  946. }
  947. .p-no{
  948. float: left;
  949. margin-right: 5rpx;
  950. font-size: $font-size-28;
  951. color: $text-color;
  952. }
  953. .p-login-btn{
  954. display: block;
  955. height: 44rpx;
  956. padding: 0 10rpx 0 20rpx;
  957. border-radius: 11rpx;
  958. background: $btn-confirm;
  959. float: right;
  960. line-height: 44rpx;
  961. color: #FFFFFF;
  962. text-align: center;
  963. font-size: $font-size-24;
  964. }
  965. }
  966. }
  967. .wrap-label{
  968. float: left;
  969. width: 100%;
  970. box-sizing: border-box;
  971. .label-a{
  972. padding: 0 18rpx;
  973. line-height: 32rpx;
  974. font-size: $font-size-20;
  975. color:$color-system;
  976. text-align: center;
  977. border-radius: 6rpx;
  978. background:#ffe6dc;
  979. margin: 0 20rpx 15rpx 0;
  980. display: inline-block;
  981. }
  982. }
  983. .wrap-top-price{
  984. float: left;
  985. width: 100%;
  986. box-sizing: border-box;
  987. .wrap-main-item{
  988. width: 100%;
  989. height: 56rpx;
  990. .p-price{
  991. height: 56rpx;
  992. line-height: 56rpx;
  993. float: left;
  994. color: #FF2A2A;
  995. font-weight: bold;
  996. &.none{
  997. text-decoration: line-through;
  998. color: #999999;
  999. font-weight: normal;
  1000. }
  1001. .txt{
  1002. margin:0 2rpx;
  1003. }
  1004. .txt.sm{
  1005. font-size: $font-size-26;
  1006. }
  1007. .txt.big{
  1008. font-size: $font-size-34;
  1009. }
  1010. }
  1011. }
  1012. .floor-item-act{
  1013. height: 56rpx;
  1014. text-align: center;
  1015. box-sizing: border-box;
  1016. float: left;
  1017. padding:10rpx 0;
  1018. margin-left: 10rpx;
  1019. .floor-tags{
  1020. float: right;
  1021. height: 28rpx;
  1022. border-radius: 6rpx;
  1023. background-color: #FFFFFF;
  1024. line-height: 28rpx;
  1025. color: $color-system;
  1026. text-align: center;
  1027. display: inline-block;
  1028. padding:0 16rpx;
  1029. font-size: $font-size-20;
  1030. margin-left: 15rpx;
  1031. border: 1px solid #E15616;
  1032. }
  1033. }
  1034. .floor-item-btn{
  1035. float: left;
  1036. height: 40rpx;
  1037. margin-top: 8rpx;
  1038. margin-left: 10rpx;
  1039. .btn{
  1040. line-height: 40rpx;
  1041. padding: 0 20rpx;
  1042. height: 40rpx;
  1043. background: $btn-confirm;
  1044. color: #FFFFFF;
  1045. font-size: $font-size-20;
  1046. border-radius: 4rpx;
  1047. }
  1048. }
  1049. }
  1050. .wrap-info{
  1051. float: left;
  1052. width: 702rpx;
  1053. padding: 24rpx 24rpx 0 24rpx;
  1054. border-bottom: 1px solid #F8F8F8;
  1055. .info-viewT{
  1056. width: 100%;
  1057. min-height: 40rpx;
  1058. font-size: $font-size-28;
  1059. color: $text-color;
  1060. line-height: 40rpx;
  1061. text-align: left;
  1062. &.none{
  1063. color: #999999;
  1064. }
  1065. .info-viewL{
  1066. min-width: 350rpx;
  1067. float: left;
  1068. margin-bottom: 24rpx;
  1069. }
  1070. .info-viewR{
  1071. min-width: 352rpx;
  1072. float: left;
  1073. margin-bottom: 24rpx;
  1074. }
  1075. }
  1076. .info-viewB{
  1077. width: 100%;
  1078. height: auto;
  1079. }
  1080. .info-f{
  1081. width: 50%;
  1082. float: left;
  1083. font-size: $font-size-28;
  1084. color: $text-color;
  1085. line-height: 40rpx;
  1086. margin-bottom: 24rpx;
  1087. text-align: left;
  1088. }
  1089. }
  1090. }
  1091. .product-seve{
  1092. width: 100%;
  1093. height: 60rpx;
  1094. background-color: #FFFFFF;
  1095. position: relative;
  1096. display: flex;
  1097. line-height: 60rpx;
  1098. .label{
  1099. font-size: $font-size-28;
  1100. color: #333333;
  1101. }
  1102. .iconfont{
  1103. color: #fea785;
  1104. margin-right: 20rpx;
  1105. font-size: $font-size-22;
  1106. }
  1107. .text{
  1108. font-size: $font-size-22;
  1109. color: #fea785;
  1110. margin-left: 10rpx;
  1111. }
  1112. }
  1113. .product-item-none{
  1114. min-height: 348rpx;
  1115. display: flex;
  1116. flex-direction: column;
  1117. align-items: center;
  1118. border-bottom: 20rpx solid #F7F7F7;
  1119. box-sizing: border-box;
  1120. padding: 40rpx 0;
  1121. .none-image{
  1122. width: 284rpx;
  1123. height: 225rpx;
  1124. }
  1125. .none-text{
  1126. text-align: center;
  1127. font-size: $font-size-28;
  1128. color: #fea785;
  1129. line-height: 40rpx;
  1130. }
  1131. }
  1132. .product-parameter{
  1133. width: 702rpx;
  1134. height: 90rpx;
  1135. padding: 0 24rpx;
  1136. background-color: #FFFFFF;
  1137. position: relative;
  1138. display: flex;
  1139. border-bottom: 20rpx solid #F7F7F7;
  1140. .title{
  1141. line-height: 90rpx;
  1142. display: inline-block;
  1143. float: left;
  1144. font-size: $font-size-28;
  1145. color: #666666;
  1146. }
  1147. .name{
  1148. float: right;
  1149. line-height: 90rpx;
  1150. display: inline-block;
  1151. float: left;
  1152. font-size: $font-size-28;
  1153. color: $text-color;
  1154. float: right;
  1155. padding-right: 48rpx;
  1156. overflow: hidden;
  1157. text-overflow:ellipsis;
  1158. white-space: nowrap;
  1159. text-align: right;
  1160. }
  1161. .icon-xiayibu{
  1162. line-height: 90rpx;
  1163. display: inline-block;
  1164. position: absolute;
  1165. width: 48rpx;
  1166. top: 0;
  1167. right: 0;
  1168. color: #b2b2b2;
  1169. }
  1170. }
  1171. .product-supplier{
  1172. width: 100%;
  1173. height: 174rpx;
  1174. padding: 30rpx 24rpx;
  1175. box-sizing: border-box;
  1176. background-color: #FFFFFF;
  1177. position: relative;
  1178. box-sizing: border-box;
  1179. border-bottom: 20rpx solid #F7F7F7;
  1180. .logo{
  1181. width: 128rpx;
  1182. height: 92rpx;
  1183. float: left;
  1184. border: 1px solid #efefef;
  1185. border-radius: 6rpx;
  1186. image{
  1187. width: 100%;
  1188. height: 100%;
  1189. display: block;
  1190. border-radius: 6rpx;
  1191. }
  1192. }
  1193. .main{
  1194. width: 470rpx;
  1195. height: 92rpx;
  1196. float: left;
  1197. margin-left: 20rpx;
  1198. .name{
  1199. width: 100%;
  1200. line-height: 46rpx;
  1201. float: left;
  1202. font-size: $font-size-28;
  1203. color: $text-color;
  1204. float: right;
  1205. overflow: hidden;
  1206. text-overflow:ellipsis;
  1207. white-space: nowrap;
  1208. text-align: left;
  1209. }
  1210. .massgs{
  1211. width: 100%;
  1212. line-height: 46rpx;
  1213. float: left;
  1214. font-size: $font-size-24;
  1215. color: #999999;
  1216. .label{
  1217. float: left;
  1218. }
  1219. .p-stars{
  1220. float: left;
  1221. margin-left: 20rpx;
  1222. }
  1223. .acount{
  1224. float: right;
  1225. text{
  1226. color: $color-system;
  1227. }
  1228. }
  1229. }
  1230. }
  1231. .icon-xiayibu{
  1232. line-height: 154rpx;
  1233. display: inline-block;
  1234. position: absolute;
  1235. width: 48rpx;
  1236. top: 0;
  1237. right: 0;
  1238. color: #b2b2b2;
  1239. }
  1240. }
  1241. .product-details {
  1242. width: 100%;
  1243. background: #FFFFFF;
  1244. border-bottom: 20rpx solid #F7F7F7;
  1245. &.service{
  1246. border-bottom: none;
  1247. }
  1248. &.recommend{
  1249. background-color: #F7F7F7;
  1250. border-bottom: none;
  1251. .title{
  1252. .title-tab{
  1253. background-color: #F7F7F7;
  1254. color: $text-color;
  1255. }
  1256. }
  1257. }
  1258. .product-rich-text-none{
  1259. box-sizing: border-box;
  1260. padding: 0 24rpx;
  1261. text-align: left;
  1262. font-size: 24rpx;
  1263. color: #999999;
  1264. line-height: 60rpx;
  1265. }
  1266. .content-none{
  1267. width: 100%;
  1268. height: 80rpx;
  1269. line-height: 80rpx;
  1270. text-align: left;
  1271. font-size: $font-size-26;
  1272. color: #999999;
  1273. box-sizing: border-box;
  1274. padding: 0 24rpx;
  1275. }
  1276. .title{
  1277. width: 100%;
  1278. box-sizing: border-box;
  1279. padding: 0 24rpx;
  1280. .title-tab{
  1281. width: 100%;
  1282. height: 100rpx;
  1283. background: #fff;
  1284. z-index: 10;
  1285. font-size: $font-size-30;
  1286. text-align: left;
  1287. color: $text-color;
  1288. line-height: 100rpx;
  1289. font-weight: 600;
  1290. }
  1291. .title-msg{
  1292. width: 100%;
  1293. height: 236rpx;
  1294. padding: 18rpx;
  1295. background-color: rgba(225,86,22, 0.1);
  1296. color: $color-system;
  1297. box-sizing: border-box;
  1298. margin-bottom: 30rpx;
  1299. .tit{
  1300. line-height: 46rpx;
  1301. font-size: $font-size-24;
  1302. text-align: left;
  1303. }
  1304. .txt{
  1305. line-height: 38rpx;
  1306. font-size: $font-size-20;
  1307. text-align: justify;
  1308. }
  1309. }
  1310. }
  1311. .content{
  1312. width: 100%;
  1313. background-color: #FFFFFF;
  1314. }
  1315. }
  1316. .isLower{
  1317. width: 100%;
  1318. height: 116rpx;
  1319. line-height: 116rpx;
  1320. text-align: center;
  1321. color: #000000;
  1322. font-size: $font-size-32;
  1323. font-weight: bold;
  1324. }
  1325. .bottom-btn{
  1326. width: 100%;
  1327. height: 100rpx;
  1328. position: fixed;
  1329. bottom: 0;
  1330. left: 0;
  1331. background: #FFFFFF;
  1332. z-index: 99;
  1333. .bottom-le{
  1334. width: 300rpx;
  1335. height: 100rpx;
  1336. padding:10rpx 20rpx 10rpx 0;
  1337. float: left;
  1338. box-sizing: border-box;
  1339. .item-bt{
  1340. width: 80rpx;
  1341. height: 100%;
  1342. margin-right:15rpx;
  1343. display: flex;
  1344. float: left;
  1345. flex-direction: column;
  1346. align-items: center;
  1347. justify-content: center;
  1348. font-size: $font-size-22;
  1349. color: $text-color;
  1350. line-height: 34rpx;
  1351. position: relative;
  1352. .animation-num{
  1353. font-size:$font-size-32 ;
  1354. color: #FF2A2A;
  1355. position: absolute;
  1356. top: -12rpx;
  1357. right: 4rpx;
  1358. font-weight: bold;
  1359. }
  1360. .animation{
  1361. animation: showAmnation 2.2s ease-in-out both;
  1362. }
  1363. .restion{
  1364. animation: hideAmnation 1s ease-in-out both;
  1365. }
  1366. .icon-num{
  1367. position: absolute;
  1368. right:-12rpx;
  1369. top: -5rpx;
  1370. }
  1371. .icon-num.goleft{
  1372. right: 2rpx;
  1373. }
  1374. &:last-child{
  1375. margin-right: 0;
  1376. }
  1377. image {
  1378. width: 44rpx;
  1379. height: 44rpx;
  1380. }
  1381. button.contact-btn{
  1382. width: 100%;
  1383. height: 100%;
  1384. margin: 0;
  1385. padding: 0;
  1386. display: flex;
  1387. flex-direction: column;
  1388. align-items: center;
  1389. justify-content: center;
  1390. box-sizing: border-box;
  1391. font-size: $font-size-24;
  1392. text-align: center;
  1393. text-decoration: none;
  1394. line-height: 34rpx;
  1395. border-radius: 0;
  1396. -webkit-tap-highlight-color: transparent;
  1397. overflow: hidden;
  1398. color: $text-color;
  1399. background-color:#FFFFFF;
  1400. }
  1401. }
  1402. }
  1403. .bottom-ri{
  1404. width: 450rpx;
  1405. height: 100%;
  1406. float: right;
  1407. display: flex;
  1408. box-sizing: border-box;
  1409. padding: 13rpx 20rpx 13rpx 0;
  1410. .btn{
  1411. flex: 1;
  1412. width: 200rpx;
  1413. line-height: 80rpx;
  1414. text-align: center;
  1415. font-size: $font-size-24;
  1416. color: #FFFFFF;
  1417. }
  1418. .btn-cart{
  1419. background-color: #ffe6dc;
  1420. color: $color-system;
  1421. border-radius: 42rpx 0 0 42rpx;
  1422. }
  1423. .btn-cart.disabled{
  1424. background-color: #E1E1E1;
  1425. color: #FFFFFF;
  1426. }
  1427. .btn-bay{
  1428. background:linear-gradient(to right, #f28f31 0%, #e15616 100%);
  1429. border-radius: 0 42rpx 42rpx 0;
  1430. }
  1431. .btn-bay.disabled{
  1432. background: linear-gradient(135deg,rgba(242,143,49,0.5) 0%,rgba(225,86,22,0.5) 100%);
  1433. }
  1434. }
  1435. }
  1436. .uni-badge--small {
  1437. -webkit-transform: scale(.8);
  1438. -ms-transform: scale(.8);
  1439. transform: scale(.8);
  1440. -webkit-transform-origin: center center;
  1441. -ms-transform-origin: center center;
  1442. transform-origin: center center;
  1443. }
  1444. .uni-badge {
  1445. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  1446. -webkit-box-sizing: border-box;
  1447. box-sizing: border-box;
  1448. font-size: 12px;
  1449. line-height: 1;
  1450. display: inline-block;
  1451. padding: 3px 6px;
  1452. color: #333;
  1453. border-radius: 100px;
  1454. background-color: #f1f1f1;
  1455. }
  1456. .uni-badge-error {
  1457. color: #fff;
  1458. background-color: #dd524d;
  1459. }
  1460. .product-topnav{
  1461. width: 100%;
  1462. height: 174rpx;
  1463. box-sizing: border-box;
  1464. background: #FFFFFF;
  1465. z-index: 1000;
  1466. position: fixed;
  1467. opacity: 1;
  1468. left: 0;
  1469. &.fixed{
  1470. animation: showFixedColor 0.1s ease-in-out both;
  1471. }
  1472. &.none{
  1473. animation: hideFixedColor 0.1s ease-in-out both;
  1474. }
  1475. .navbar {
  1476. width: 100%;
  1477. height: 60rpx;
  1478. box-sizing: border-box;
  1479. padding: 0 24rpx;
  1480. display: flex;
  1481. .nav-item {
  1482. display: flex;
  1483. flex: 1;
  1484. justify-content: center;
  1485. align-items: center;
  1486. height: 60rpx;
  1487. font-size: $font-size-28;
  1488. color: $text-color;
  1489. position: relative;
  1490. float: left;
  1491. position: relative;
  1492. .line{
  1493. width: 60rpx;
  1494. height: 2px;
  1495. border-radius: 1px;
  1496. background: #FFFFFF;
  1497. position: absolute;
  1498. bottom: 0;
  1499. left: 50%;
  1500. margin-left: -30rpx;
  1501. }
  1502. &.current{
  1503. color:$color-system;
  1504. .line{
  1505. background: $color-system;
  1506. }
  1507. }
  1508. }
  1509. }
  1510. .search-input{
  1511. width: 100%;
  1512. height: 114rpx;
  1513. padding:24rpx;
  1514. box-sizing: border-box;
  1515. .gosearch-btn{
  1516. width: 100%;
  1517. height: 100%;
  1518. border-radius: 40rpx;
  1519. margin: 0 auto;
  1520. font-size: 26rpx;
  1521. line-height: 66rpx;
  1522. color: #B2B2B2;
  1523. position: relative;
  1524. box-sizing: border-box;
  1525. padding-left: 66rpx;
  1526. &.fixed{
  1527. background: rgba(70,70,70,0.1);
  1528. }
  1529. &.none{
  1530. background: rgba(70,70,70,0.1);
  1531. }
  1532. .search-icon{
  1533. width: 66rpx;
  1534. height: 66rpx;
  1535. position:absolute ;
  1536. left: 0;
  1537. top: 2rpx;
  1538. text-align: center;
  1539. line-height: 66rpx;
  1540. .icon-iconfonticonfontsousuo1{
  1541. margin:0 6rpx;
  1542. font-size: $font-size-34;
  1543. color: #B2B2B2;
  1544. z-index: 10;
  1545. }
  1546. }
  1547. .search-text{
  1548. font-size: $font-size-24;
  1549. line-height: 66rpx;
  1550. color: #B2B2B2;
  1551. }
  1552. }
  1553. }
  1554. }
  1555. @keyframes showFixedColor {
  1556. 0% {background: rgba(255,255,255,0);}
  1557. 50% {background: rgba(255,255,255,0.5);}
  1558. 100% {background: rgba(255,255,255,1);}
  1559. }
  1560. @keyframes hideFixedColor {
  1561. 0% {background: rgba(255,255,255,1);}
  1562. 50% {background: rgba(255,255,255,0.5);}
  1563. 100% {background: rgba(255,255,255,0);}
  1564. }
  1565. /* 加入购物模态层*/
  1566. @keyframes showPopup {
  1567. 0% {
  1568. opacity: 0;
  1569. }
  1570. 100% {
  1571. opacity: 1;
  1572. }
  1573. }
  1574. @keyframes hidePopup {
  1575. 0% {
  1576. opacity: 1;
  1577. }
  1578. 100% {
  1579. opacity: 0;
  1580. }
  1581. }
  1582. @keyframes showLayer {
  1583. 0% {
  1584. transform: translateY(0);
  1585. }
  1586. 100% {
  1587. transform: translateY(-100%);
  1588. }
  1589. }
  1590. @keyframes hideLayer {
  1591. 0% {
  1592. transform: translateY(-100%);
  1593. }
  1594. 100% {
  1595. transform: translateY(0);
  1596. }
  1597. }
  1598. @keyframes showAmnation {
  1599. 0% {
  1600. top: -12rpx;
  1601. opacity: 0;
  1602. }
  1603. 50% {
  1604. top: -60rpx;
  1605. opacity: 1;
  1606. }
  1607. 100% {
  1608. top: -100rpx;
  1609. opacity: 0;
  1610. }
  1611. }
  1612. @keyframes hideAmnation {
  1613. 0% {
  1614. top: -100rpx;
  1615. opacity: 0;
  1616. }
  1617. 100% {
  1618. top: -12rpx;
  1619. opacity: 0;
  1620. }
  1621. }
  1622. .popup {
  1623. position: fixed;
  1624. top: 0;
  1625. width: 100%;
  1626. height: 100%;
  1627. z-index: 999;
  1628. display: none;
  1629. .mask{
  1630. position: fixed;
  1631. top: 0;
  1632. width: 100%;
  1633. height: 100%;
  1634. z-index: 21;
  1635. background-color: rgba(0, 0, 0, 0.6);
  1636. }
  1637. .layer {
  1638. position: fixed;
  1639. z-index: 22;
  1640. bottom: -294rpx;
  1641. width: 702rpx;
  1642. padding: 24rpx 24rpx 36rpx 24rpx;
  1643. height: 260rpx;
  1644. border-radius: 20rpx 20rpx 0 0;
  1645. background-color: #fff;
  1646. display: flex;
  1647. flex-wrap: wrap;
  1648. align-content: space-between;
  1649. .content {
  1650. width: 100%;
  1651. }
  1652. .btn {
  1653. width: 100%;
  1654. height: 88rpx;
  1655. margin-top: 20rpx;
  1656. .button {
  1657. width: 100%;
  1658. height: 88rpx;
  1659. color: #fff;
  1660. display: flex;
  1661. align-items: center;
  1662. justify-content: center;
  1663. background: $btn-confirm;
  1664. font-size: $font-size-28;
  1665. border-radius: 44rpx;
  1666. }
  1667. }
  1668. }
  1669. &.show {
  1670. display: block;
  1671. .mask{
  1672. animation: showPopup 0.2s linear both;
  1673. }
  1674. .layer {
  1675. animation: showLayer 0.2s linear both;
  1676. }
  1677. }
  1678. &.hide {
  1679. display: block;
  1680. .mask{
  1681. animation: hidePopup 0.2s linear both;
  1682. }
  1683. .layer {
  1684. animation: hideLayer 0.2s linear both;
  1685. }
  1686. }
  1687. &.none {
  1688. display: none;
  1689. }
  1690. &.service {
  1691. .row {
  1692. margin: 30upx 0;
  1693. .title {
  1694. font-size: 30upx;
  1695. margin: 10upx 0;
  1696. }
  1697. .description {
  1698. font-size: 28upx;
  1699. color: #999;
  1700. }
  1701. }
  1702. }
  1703. .layer-smimg{
  1704. width: 114rpx;
  1705. height: 114rpx;
  1706. float: left;
  1707. border-radius: 10rpx;
  1708. margin-right: 24rpx;
  1709. image{
  1710. width: 114rpx;
  1711. height: 114rpx;
  1712. border-radius: 10rpx;
  1713. }
  1714. }
  1715. .layer-nunbox{
  1716. justify-content: space-between;
  1717. align-items: center;
  1718. width: 536rpx;
  1719. height: auto;
  1720. float: left;
  1721. .layer-nunbox-t{
  1722. width: 100%;
  1723. height:44rpx;
  1724. position:relative;
  1725. display: flex;
  1726. margin-bottom: 10rpx;
  1727. .text{
  1728. font-size: $font-size-24;
  1729. line-height: 48rpx;
  1730. color: #999999;
  1731. }
  1732. .layer-nunbox-text{
  1733. line-height: 44rpx;
  1734. font-size: $font-size-28;
  1735. }
  1736. .number-box{
  1737. display: flex;
  1738. justify-content: center;
  1739. align-items: center;
  1740. border:2rpx solid #ffe6dc;
  1741. border-radius: 30rpx;
  1742. height: 48rpx;
  1743. margin-left: 20rpx;
  1744. .iconfont{
  1745. font-size: $font-size-24;
  1746. padding:0 18rpx;
  1747. color: #999999;
  1748. text-align: center;
  1749. line-height: 48rpx;
  1750. font-weight: bold;
  1751. background: #fef6f3;
  1752. &.icon-jianhao{
  1753. border-radius: 30rpx 0 0 30rpx;
  1754. }
  1755. &.icon-jiahao{
  1756. border-radius: 0 30rpx 30rpx 0;
  1757. }
  1758. }
  1759. .btn-input{
  1760. width: 62rpx;
  1761. height: 48rpx;
  1762. line-height: 48rpx;
  1763. background: #FFFFFF;
  1764. border-radius: 4rpx;
  1765. text-align: center;
  1766. font-size: $font-size-28;
  1767. }
  1768. }
  1769. .product-step{
  1770. position: absolute;
  1771. left: 45rpx;
  1772. bottom: 0;
  1773. height: 44rpx;
  1774. background: #FFFFFF;
  1775. }
  1776. }
  1777. .layer-nunbox-b{
  1778. width: 100%;
  1779. height:44rpx;
  1780. margin-top: 13rpx;
  1781. }
  1782. .text{
  1783. line-height: 44rpx;
  1784. font-size: $font-size-28;
  1785. .p{
  1786. color: #FF2A2A;
  1787. }
  1788. .p:first-child{
  1789. margin-left: 30rpx;
  1790. }
  1791. .p.sm{
  1792. font-size: $font-size-24;
  1793. }
  1794. }
  1795. }
  1796. }
  1797. .tui-popup-box {
  1798. position: relative;
  1799. box-sizing: border-box;
  1800. min-height: 220rpx;
  1801. padding:0rpx 24rpx 0 24rpx;
  1802. .title{
  1803. font-size: $font-size-34;
  1804. color: $text-color;
  1805. line-height: 88rpx;
  1806. text-align: center;
  1807. float: left;
  1808. width: 100%;
  1809. height: 88rpx;
  1810. }
  1811. .tui-popup-main{
  1812. width: 100%;
  1813. float: left;
  1814. .tui-popup-scroll{
  1815. width: 100%;
  1816. height: 500rpx;
  1817. .content-tr{
  1818. width: 100%;
  1819. min-height: 58rpx;
  1820. line-height: 58rpx;
  1821. display: flex;
  1822. .content-td{
  1823. display: flex;
  1824. flex: 3;
  1825. font-size: $font-size-26;
  1826. color: #999999;
  1827. line-height: 58rpx;
  1828. text-align: left;
  1829. }
  1830. .content-th{
  1831. display: flex;
  1832. flex: 7;
  1833. font-size: $font-size-26;
  1834. color: #333333;
  1835. line-height: 58rpx;
  1836. text-align: left;
  1837. padding-left: 10rpx;
  1838. }
  1839. }
  1840. }
  1841. }
  1842. }
  1843. .tui-popup-btn {
  1844. width: 100%;
  1845. height: auto;
  1846. float: left;
  1847. margin-top: 24rpx;
  1848. .tui-button{
  1849. width: 100%;
  1850. height: 88rpx;
  1851. background: $btn-confirm;
  1852. line-height: 88rpx;
  1853. text-align: center;
  1854. color: #FFFFFF;
  1855. font-size: $font-size-28;
  1856. border-radius: 44rpx;
  1857. }
  1858. }
  1859. /*富文本样式*/
  1860. rich-text.p{
  1861. width: 702rpx !important;
  1862. padding: 0 24rpx;
  1863. text-align: justify;
  1864. }
  1865. rich-text.img{
  1866. width: 100%;
  1867. height: auto;
  1868. }
  1869. </style>