product.vue 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905
  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" v-if="hasLogin">
  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 && product.productDetail.detailInfo"></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" v-if="hasLogin">
  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" v-if="hasLogin">
  172. <view class="content-td">商品编码</view>
  173. <view class="content-th">{{product.productCode}}</view>
  174. </view>
  175. <view class="content-tr" v-if="hasLogin">
  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. <button class="item-bt" open-type="contact" @click="handleContact">
  201. <image src="../../static/severs@3x.png"></image>
  202. <text>客服</text>
  203. </button>
  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. computed: {
  360. ...mapState(['hasLogin','isWxAuthorize','identity'])
  361. },
  362. onLoad(option) {
  363. this.productId = option.id;//获取商品ID
  364. this.isShareType = option.type
  365. this.linkPath = option.path
  366. this.isHeaderPoduct = true
  367. if(option.page == 2){
  368. this.backPage = option.page
  369. }
  370. if(this.isShareType =='share'){
  371. wxLogin.wxLoginAuthorize()
  372. }
  373. this.getWinHeight()
  374. },
  375. methods:{
  376. initData(){// 初始化商品详情查询
  377. this.ProductService.QueryProductDetils(
  378. {
  379. userId:this.userId,
  380. productId:this.productId,
  381. identity:this.identity,
  382. }
  383. )
  384. .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 || this.product.validFlag ==10){
  392. this.isInvalid = true
  393. }else if(this.product.validFlag === 9){
  394. if(this.userIdentity == 1){
  395. this.isInvalid = false
  396. }else{
  397. this.isInvalid = true
  398. }
  399. }
  400. this.ladderPriceFlag = this.product.ladderPriceFlag;
  401. this.html = this.product.productDetail == null ? this.html : this.$api.adaptRichTextImg(this.product.productDetail.detailInfo)
  402. this.stock = this.product.stock
  403. this.buyRetailPriceStep = this.product.step
  404. this.number = this.product.minBuyNumber
  405. this.minBuyNumber = this.product.minBuyNumber
  406. //处理商品图片列表
  407. this.product.imageList.forEach(item =>{
  408. this.productImage.push(item.image);
  409. })
  410. //购物车数量
  411. this.goodsData.cartCount = this.product.productCount
  412. //处理阶梯价格
  413. if(this.product.ladderPriceList!=null){
  414. this.ladderPriceList = this.product.ladderPriceList;
  415. }
  416. //拆分金额并转千分位格式显示
  417. if(this.product.price!=null){
  418. this.retailPrice = this.product.price.toFixed(2);
  419. this.buyRetailPrice = this.product.price;
  420. }
  421. //处理下架商品和售罄商品
  422. if(this.product.validFlag ==3 || this.stock == 0){
  423. this.isNoneDisabled = true
  424. this.disabled = true
  425. }else{
  426. this.disabled = false
  427. this.isNoneDisabled = false
  428. this.goodsData.disabledText = ''
  429. }
  430. if(this.product.priceFlag == 1){
  431. this.disabled = true
  432. }else if(this.product.priceFlag == 2){
  433. if(this.userIdentity == 4){
  434. this.disabled = true
  435. }else{
  436. this.disabled = false
  437. }
  438. }else{
  439. this.disabled = false
  440. }
  441. this.goodsData.disabled = this.disabled
  442. this.goodsData.isNoneDisabled = this.isNoneDisabled
  443. if(this.product.validFlag ==3){
  444. this.goodsData.disabledText = '下架'
  445. }
  446. if(this.product.validFlag ==10){
  447. this.goodsData.disabledText = '停售'
  448. }
  449. if(this.stock == 0){
  450. this.goodsData.disabledText = '售罄'
  451. }
  452. console.log(this.disabled);
  453. setTimeout(()=>{
  454. this.getSectionProps();
  455. },2000)
  456. this.isRequest = true
  457. })
  458. .catch(error =>{
  459. this.$util.msg(error.msg,2000);
  460. })
  461. },
  462. swiperChange(e) {//顶部商品图片切换
  463. const index = e.detail.current;
  464. this.current = index;
  465. },
  466. previewImg (index) {//顶部商品图片预览
  467. isPreviewImg = true
  468. let previewUrls = this.productImage
  469. uni.previewImage({
  470. current: index, //图片索引
  471. urls: previewUrls, //必须是http图片,本地图片无效
  472. longPressActions:''
  473. })
  474. },
  475. tabClick(index) {//商品详情&&供应商信息tab切换
  476. this.tabSelectFlag = true
  477. this.tabCurrentIndex = index;
  478. let classIndex = '.product-details'+index;
  479. uni.createSelectorQuery().select('.container-product-main').boundingClientRect((data)=>{//最外层盒子节点
  480.   uni.createSelectorQuery().select(classIndex).boundingClientRect((res)=>{//最外层盒子节点
  481.     uni.pageScrollTo({
  482.       duration:300,//过渡时间必须为0,uniapp bug,否则运行到手机会报错
  483.       scrollTop:res.top - data.top - 150,//滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
  484.     })
  485. setTimeout(()=>{
  486. this.tabSelectFlag = false;
  487. },500)
  488.   }).exec()
  489. }).exec()
  490. },
  491. handleContact(e){//跳转小程序客服
  492. console.log(e.detail.path)
  493. console.log(e.detail.query)
  494. },
  495. buyProductCart(){//底部购物车按钮点击
  496. if(this.hasLogin){
  497. // 友盟埋点商品详情购物车入口点击事件
  498. if(process.env.NODE_ENV != 'development'){
  499. this.$uma.trackEvent('Um_Event_ProductShoppingCart', {
  500. Um_Key_PageName: '去购物车',
  501. Um_Key_SourcePage: '商品详情购物车入口',
  502. })
  503. }
  504. this.$api.navigateTo('/pages/goods/cart')
  505. }else{
  506. this.$api.navigateTo('/pages/login/login?type=1')
  507. }
  508. },
  509. btnGetConfirm(type){//加入购物车&&立即购买点击
  510. if(this.hasLogin){
  511. switch(type){
  512. case 'add':
  513. // 友盟埋点商品详情加入购物车点击事件
  514. if(process.env.NODE_ENV != 'development'){
  515. this.$uma.trackEvent('Um_Event_ProductAddCart', {
  516. Um_Key_PageName: '加入购物车',
  517. Um_Key_SourcePage: '商品详情',
  518. Um_Key_ProductID:`${this.product.productId}`
  519. })
  520. }
  521. break;
  522. case 'buy':
  523. // 友盟埋点商品详情立即购买点击事件
  524. if(process.env.NODE_ENV != 'development'){
  525. this.$uma.trackEvent('Um_Event_ProductBuyConfirm', {
  526. Um_Key_PageName: '立即购买',
  527. Um_Key_SourcePage: '商品详情',
  528. Um_Key_ProductID:`${this.product.productId}`
  529. })
  530. }
  531. break;
  532. }
  533. this.showSpec(type);
  534. }else{
  535. this.$api.navigateTo('/pages/login/login?type=1')
  536. }
  537. },
  538. changeCountAdd(){//popup弹窗数量增加按钮
  539. if(this.buyRetailPriceStep == 2){
  540. this.number+=this.minBuyNumber
  541. }else{
  542. this.number++
  543. }
  544. this.processActivityPrice()
  545. },
  546. changeCountSub(){//popup弹窗数量减按钮
  547. if(this.number<=this.minBuyNumber){
  548. this.number= this.minBuyNumber
  549. this.isQuantity =true
  550. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  551. return
  552. }else{
  553. if(this.buyRetailPriceStep == 2){
  554. this.number-=this.minBuyNumber
  555. }else{
  556. this.number--
  557. }
  558. this.processActivityPrice()
  559. this.isQuantity =false
  560. }
  561. },
  562. changeNumber(e){
  563. let _value = e.detail.value;
  564. if(!this.$api.isNumber(_value)){
  565. this.number = this.minBuyNumber
  566. }else if(_value < this.minBuyNumber){
  567. this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
  568. this.number = this.minBuyNumber
  569. }else if( _value % this.minBuyNumber !=0 ){
  570. this.$util.msg(`购买量必须为起订量的整数倍`,2000);
  571. this.number = this.minBuyNumber
  572. }else{
  573. this.number = e.detail.value
  574. }
  575. this.processActivityPrice()
  576. },
  577. processActivityPrice(){//单独处理活动价格和阶梯价格
  578. if(this.ladderPriceFlag == '0' && this.product.actStatus == 0 || this.product.actStatus == 1){
  579. this.buyRetailPrice = this.product.price
  580. }else{
  581. this.ladderPriceList.forEach((item,index)=>{
  582. if(this.number>=item.buyNum){
  583. this.buyRetailPrice = item.buyPrice
  584. }
  585. })
  586. }
  587. },
  588. showSpec(type) {//显示选择数量确认弹窗
  589. this.isBtnType = type
  590. this.specClass = 'show';
  591. if (this.ladderPriceFlag) {
  592. this.processActivityPrice()
  593. }
  594. },
  595. hideSpec() {//关闭选择数量确认弹窗
  596. this.specClass = 'hide';
  597. setTimeout(() => {
  598. this.specClass = 'none';
  599. }, 200);
  600. },
  601. btnConfirm() {//加入购物车&&立即购买跳转订单页并关闭弹窗
  602. // 友盟埋点商品详情确认购买商品点击事件
  603. if(process.env.NODE_ENV != 'development'){
  604. this.$uma.trackEvent('Um_Event_ProductShoppingConfirm', {
  605. Um_Key_PageName: '商品购买确认',
  606. Um_Key_SourcePage: '商品详情',
  607. Um_Key_ProductID:`${this.product.productId}`
  608. })
  609. }
  610. if(this.isBtnType == 'add'){
  611. this.getAddProductCart()
  612. }else{
  613. this.toConfirmation()
  614. }
  615. },
  616. toConfirmation(){//跳转确认订单页面
  617. this.specClass = 'hide';
  618. let productStp ={
  619. allPrice:this.number*this.buyRetailPrice,
  620. allCount:this.number,
  621. productID:this.product.productId,
  622. productCount:this.number
  623. }
  624. this.$api.navigateTo(`/pages/user/order/create-order?type=prodcut&data=${JSON.stringify({data:productStp})}`)
  625. setTimeout(() => {
  626. this.specClass = 'none';
  627. }, 200);
  628. },
  629. getAddProductCart(){//增加购物车成功和toast弹窗提示成功
  630. this.ProductService.shoppingAddCart({productID:this.productId,userID:this.userId,productCount:this.number}).then(response => {
  631. this.specClass = 'hide';
  632. this.$util.msg('加入购物车成功',1500,true,'success')
  633. this.isAnimation = true
  634. setTimeout(() => {this.specClass = 'none'}, 200)
  635. setTimeout(() => {this.isAnimation = false},2000)
  636. this.goodsData.cartCount = response.data;
  637. }).catch(error =>{
  638. this.$util.msg(error.msg,2000);
  639. })
  640. },
  641. setHeaderBtnPosi(){
  642. // 获得胶囊按钮位置信息
  643. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  644. return headerBtnPosi
  645. },
  646. setSysteminfo(){
  647. let systeminfo;
  648. uni.getSystemInfo({ // 获取设备信息
  649. success: (res) => {
  650. systeminfo = res
  651. },
  652. })
  653. return systeminfo
  654. },
  655. goIndex(){//商城首页
  656. uni.switchTab({
  657. url: '/pages/tabBar/home/index'
  658. });
  659. },
  660. goSupplier(){//跳供应商资料页
  661. this.$api.navigateTo('/supplier/pages/user/my-shop?shopId='+this.shopId)
  662. },
  663. discard(){
  664. //丢弃
  665. },
  666. onShare(res){//分享转发
  667. if (res.from === 'button') {
  668. // 来自页面内转发按钮
  669. }
  670. return {
  671. title: `${this.product.name}`,
  672. path: `pages/goods/product?type=share&id=${this.productId}`,
  673. imageUrl:`${this.productImage[0]}`
  674. }
  675. },
  676. showPopup(){
  677. this.popupShow = true
  678. },
  679. hidePopup(){
  680. this.popupShow = false
  681. },
  682. getSectionProps() {//获取每个tab对应区域的scrollTop值
  683. let className = '.product-details',
  684. sectionPropsArr = [];
  685. uni.createSelectorQuery().select('.container-product-main').boundingClientRect((data)=>{//最外层盒子节点
  686.   uni.createSelectorQuery().selectAll(className).boundingClientRect((res)=>{//最外层盒子节点
  687. res.forEach((item, index) => {
  688. sectionPropsArr.push({
  689. className: `${className}${index}`,
  690. scrollTop: item.top - data.top - 150
  691. })
  692. })
  693. this.sectionPropsArr = sectionPropsArr;
  694. this.sectionTopRangeArr = this.getSectionRange(sectionPropsArr);
  695.   }).exec()
  696. }).exec()
  697. },
  698. getSectionRange(arr) {// 获取每个tab对应区域的区间
  699. let sectionScrollTopList = [];
  700. for(let i = 0; i < arr.length; i++) {
  701. let thisScrollTop = arr[i].scrollTop;
  702. if(i < arr.length - 1) {
  703. let nextScrollTop = arr[i+1].scrollTop;
  704. if(i == 0) {
  705. sectionScrollTopList.push(`0-${thisScrollTop}`);
  706. } else if(i == arr.length - 1){
  707. sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop - this.winHeight}`);
  708. } else {
  709. sectionScrollTopList.push(`${thisScrollTop}-${nextScrollTop}`);
  710. }
  711. } else {
  712. sectionScrollTopList.push(`${thisScrollTop}-${thisScrollTop+500}`);
  713. }
  714. }
  715. return sectionScrollTopList;
  716. },
  717. activeTab: debounce((top, _this)=> {//当滑动时也能同步激活tab
  718. const { sectionTopRangeArr } = _this;
  719. if(sectionTopRangeArr.length > 0) {
  720. sectionTopRangeArr.forEach((item, index) => {
  721. let splitItem = item.split('-'),
  722. openInterval = Number(splitItem[0]),
  723. closedInterval = Number(splitItem[1]);
  724. if(top >= openInterval && top < closedInterval) {
  725. _this.tabCurrentIndex = index;
  726. }
  727. })
  728. }
  729. },100, true),
  730. getWinHeight() {
  731. this.winHeight = wx.getSystemInfoSync().windowHeight;
  732. },
  733. },
  734. onPageScroll(e){//实时获取到滚动的值
  735. const { scrollTop } = e;
  736. if(!this.tabSelectFlag) {
  737. this.activeTab(scrollTop, this);
  738. }
  739. if(e.scrollTop>60){
  740. this.headerColor = true
  741. this.navbarFiexd = 'fixed'
  742. this.isNavbarFiexd = true
  743. this.nvabarData={
  744. showCapsule: 1,
  745. title: '商品详情',
  746. }
  747. }else{
  748. this.headerColor = false
  749. this.isNavbarFiexd = false
  750. this.navbarFiexd = 'none'
  751. this.nvabarData={
  752. showCapsule: 1,
  753. title: '',
  754. }
  755. }
  756. if(e.scrollTop>700){
  757. this.isScrollTop = true
  758. }else{
  759. this.isScrollTop = false
  760. }
  761. },
  762. onShareAppMessage(res){//分享转发
  763. if (res.from === 'button') {
  764. // 来自页面内转发按钮
  765. }
  766. return {
  767. title: `${this.product.name}`,
  768. path: `pages/goods/product?type=share&id=${this.productId}`,
  769. imageUrl:`${this.productImage[0]}`
  770. }
  771. },
  772. onShow() {
  773. this.$api.getStorage().then((resolve) => {
  774. this.userId = resolve.userId ? resolve.userId : '';
  775. this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 0
  776. this.shopID = resolve.shopId ? resolve.shopId : '';
  777. if(this.userIdentity == 0 || this.userIdentity == 2 || this.userIdentity == 4){
  778. this.isShowButton = true
  779. }else{
  780. this.isShowButton = false
  781. }
  782. if (isPreviewImg) {
  783. isPreviewImg = false;
  784. return;
  785. } else {
  786. this.initData();
  787. }
  788. }).catch(error =>{
  789. this.initData();
  790. })
  791. }
  792. }
  793. </script>
  794. <style lang="scss">
  795. page{
  796. background-color: #FFFFFF;
  797. }
  798. .banner-section{
  799. width: 100%;
  800. height: 750rpx;
  801. position: relative;
  802. }
  803. .banner{
  804. width: 100%;
  805. height: 750rpx;
  806. .product-img{
  807. width: 750rpx;
  808. }
  809. image {
  810. width: 100%;
  811. height: 100%;
  812. }
  813. }
  814. .swiper__dots-box{
  815. position: absolute;
  816. color: #fff;
  817. bottom: 30rpx;
  818. right: 0;
  819. }
  820. .product-wrap{
  821. width: 100%;
  822. height: auto;
  823. padding: 24rpx 0 0 0;
  824. background-color: #FFFFFF;
  825. border-bottom: 20rpx solid #F7F7F7;
  826. .productRemarks{
  827. height: 48rpx;
  828. width: 100%;
  829. float: left;
  830. line-height: 48rpx;
  831. font-size: 24rpx;
  832. color: #999999;
  833. text-align: left;
  834. }
  835. .wrap-top{
  836. width: 702rpx;
  837. padding: 0 24rpx;
  838. height: auto;
  839. float: left;
  840. padding-bottom:20rpx;
  841. border-bottom: 1px solid #F8F8F8;
  842. &.none{
  843. .p-title{
  844. color:#999999
  845. }
  846. }
  847. .p-title{
  848. width: 100%;
  849. height: auto;
  850. float: left;
  851. position: relative;
  852. .p-title-name{
  853. width:602rpx;
  854. height: auto;
  855. float: left;
  856. line-height:48rpx;
  857. font-size: $font-size-28;
  858. color: $text-color;
  859. -o-text-overflow: ellipsis;
  860. text-overflow: ellipsis;
  861. display: -webkit-box;
  862. word-break: break-all;
  863. -webkit-box-orient: vertical;
  864. -webkit-line-clamp: 2;
  865. overflow: hidden;
  866. &.indent{
  867. text-indent: 95rpx;
  868. }
  869. }
  870. .mclap-tag{
  871. display: block;
  872. width: 84rpx;
  873. height: 32rpx;
  874. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  875. border-radius: 4rpx 48rpx 4px 4px;
  876. line-height: 32rpx;
  877. font-size: $font-size-22;
  878. color: #FFFFFF;
  879. text-align: center;
  880. position: absolute;
  881. left: 0;
  882. top: 6rpx;
  883. }
  884. .p-title-share{
  885. width: 96rpx;
  886. height: 96rpx;
  887. position: absolute;
  888. right: 0;
  889. text-align: center;
  890. color: #999999;
  891. font-size: $font-size-24;
  892. box-sizing: border-box;
  893. display: block;
  894. background: transparent;
  895. border-radius: 0;
  896. border: 0;
  897. margin: 0;
  898. padding: 8rpx 0;
  899. z-index: 990;
  900. .icon-fenxiang1{
  901. font-size: $font-size-34;
  902. }
  903. }
  904. .tui-share-btn::after {
  905. border: 0;
  906. }
  907. }
  908. .wrap-main-text{
  909. line-height: 56rpx;
  910. color: #FF2A2A;
  911. font-size: $font-size-26;
  912. display: block;
  913. float: left;
  914. font-weight: normal;
  915. }
  916. .wrap-main-none{
  917. display: block;
  918. width: 256rpx;
  919. height: 44rpx;
  920. padding-left: 20rpx;
  921. border-radius: 11rpx;
  922. background: $btn-confirm;
  923. float: right;
  924. line-height: 44rpx;
  925. color: #FFFFFF;
  926. text-align: center;
  927. font-size: $font-size-24;
  928. }
  929. .p-price-none{
  930. height: 44rpx;
  931. line-height: 44rpx;
  932. float: left;
  933. font-size: $font-size-24;
  934. color: #666;
  935. text-decoration: line-through;
  936. margin-left: 8rpx;
  937. }
  938. .p-minBuy{
  939. height: 44rpx;
  940. line-height: 44rpx;
  941. float: right;
  942. padding: 0 18rpx;
  943. border-radius: 22rpx;
  944. background-color: #f7f7f7;
  945. color: #7F7F7F;
  946. font-size: 24rpx;
  947. text-align: center;
  948. .min-text{
  949. margin: 0 6rpx;
  950. }
  951. }
  952. .p-login{
  953. height: 56rpx;
  954. line-height: 56rpx;
  955. color: $color-system;
  956. font-size: $font-size-24;
  957. &.grade{
  958. .price-left{
  959. float: left;
  960. .none{
  961. display: block;
  962. font-size: $font-size-20;
  963. line-height: 48rpx;
  964. color: #4A4B54;
  965. float: left;
  966. font-weight: bold;
  967. margin-left: 5rpx;
  968. text{
  969. letter-spacing: 4rpx;
  970. font-size: $font-size-32;
  971. }
  972. }
  973. }
  974. }
  975. .p-no{
  976. float: left;
  977. margin-right: 5rpx;
  978. font-size: $font-size-28;
  979. color: $text-color;
  980. }
  981. .p-login-btn{
  982. display: block;
  983. height: 44rpx;
  984. padding: 0 10rpx 0 20rpx;
  985. border-radius: 11rpx;
  986. background: $btn-confirm;
  987. float: right;
  988. line-height: 44rpx;
  989. color: #FFFFFF;
  990. text-align: center;
  991. font-size: $font-size-24;
  992. }
  993. }
  994. }
  995. .wrap-label{
  996. float: left;
  997. width: 100%;
  998. box-sizing: border-box;
  999. .label-a{
  1000. padding: 0 18rpx;
  1001. line-height: 32rpx;
  1002. font-size: $font-size-20;
  1003. color:$color-system;
  1004. text-align: center;
  1005. border-radius: 6rpx;
  1006. background:#ffe6dc;
  1007. margin: 0 20rpx 15rpx 0;
  1008. display: inline-block;
  1009. }
  1010. }
  1011. .wrap-top-price{
  1012. float: left;
  1013. width: 100%;
  1014. box-sizing: border-box;
  1015. .wrap-main-item{
  1016. width: 100%;
  1017. height: 56rpx;
  1018. .p-price{
  1019. height: 56rpx;
  1020. line-height: 56rpx;
  1021. float: left;
  1022. color: #FF2A2A;
  1023. font-weight: bold;
  1024. &.none{
  1025. text-decoration: line-through;
  1026. color: #999999;
  1027. font-weight: normal;
  1028. }
  1029. .txt{
  1030. margin:0 2rpx;
  1031. }
  1032. .txt.sm{
  1033. font-size: $font-size-26;
  1034. }
  1035. .txt.big{
  1036. font-size: $font-size-34;
  1037. }
  1038. }
  1039. }
  1040. .floor-item-act{
  1041. height: 56rpx;
  1042. text-align: center;
  1043. box-sizing: border-box;
  1044. float: left;
  1045. padding:10rpx 0;
  1046. margin-left: 10rpx;
  1047. .floor-tags{
  1048. float: right;
  1049. height: 28rpx;
  1050. border-radius: 6rpx;
  1051. background-color: #FFFFFF;
  1052. line-height: 28rpx;
  1053. color: $color-system;
  1054. text-align: center;
  1055. display: inline-block;
  1056. padding:0 16rpx;
  1057. font-size: $font-size-20;
  1058. margin-left: 15rpx;
  1059. border: 1px solid #E15616;
  1060. }
  1061. }
  1062. .floor-item-btn{
  1063. float: left;
  1064. height: 40rpx;
  1065. margin-top: 8rpx;
  1066. margin-left: 10rpx;
  1067. .btn{
  1068. line-height: 40rpx;
  1069. padding: 0 20rpx;
  1070. height: 40rpx;
  1071. background: $btn-confirm;
  1072. color: #FFFFFF;
  1073. font-size: $font-size-20;
  1074. border-radius: 4rpx;
  1075. }
  1076. }
  1077. }
  1078. .wrap-info{
  1079. float: left;
  1080. width: 702rpx;
  1081. padding: 24rpx 24rpx 0 24rpx;
  1082. border-bottom: 1px solid #F8F8F8;
  1083. .info-viewT{
  1084. width: 100%;
  1085. min-height: 40rpx;
  1086. font-size: $font-size-28;
  1087. color: $text-color;
  1088. line-height: 40rpx;
  1089. text-align: left;
  1090. &.none{
  1091. color: #999999;
  1092. }
  1093. .info-viewL{
  1094. min-width: 350rpx;
  1095. float: left;
  1096. margin-bottom: 24rpx;
  1097. }
  1098. .info-viewR{
  1099. min-width: 352rpx;
  1100. float: left;
  1101. margin-bottom: 24rpx;
  1102. }
  1103. }
  1104. .info-viewB{
  1105. width: 100%;
  1106. height: auto;
  1107. }
  1108. .info-f{
  1109. width: 50%;
  1110. float: left;
  1111. font-size: $font-size-28;
  1112. color: $text-color;
  1113. line-height: 40rpx;
  1114. margin-bottom: 24rpx;
  1115. text-align: left;
  1116. }
  1117. }
  1118. }
  1119. .product-seve{
  1120. width: 100%;
  1121. height: 60rpx;
  1122. background-color: #FFFFFF;
  1123. position: relative;
  1124. display: flex;
  1125. line-height: 60rpx;
  1126. .label{
  1127. font-size: $font-size-28;
  1128. color: #333333;
  1129. }
  1130. .iconfont{
  1131. color: #fea785;
  1132. margin-right: 20rpx;
  1133. font-size: $font-size-22;
  1134. }
  1135. .text{
  1136. font-size: $font-size-22;
  1137. color: #fea785;
  1138. margin-left: 10rpx;
  1139. }
  1140. }
  1141. .product-item-none{
  1142. min-height: 348rpx;
  1143. display: flex;
  1144. flex-direction: column;
  1145. align-items: center;
  1146. border-bottom: 20rpx solid #F7F7F7;
  1147. box-sizing: border-box;
  1148. padding: 40rpx 0;
  1149. .none-image{
  1150. width: 284rpx;
  1151. height: 225rpx;
  1152. }
  1153. .none-text{
  1154. text-align: center;
  1155. font-size: $font-size-28;
  1156. color: #fea785;
  1157. line-height: 40rpx;
  1158. }
  1159. }
  1160. .product-parameter{
  1161. width: 702rpx;
  1162. height: 90rpx;
  1163. padding: 0 24rpx;
  1164. background-color: #FFFFFF;
  1165. position: relative;
  1166. display: flex;
  1167. border-bottom: 20rpx solid #F7F7F7;
  1168. .title{
  1169. line-height: 90rpx;
  1170. display: inline-block;
  1171. float: left;
  1172. font-size: $font-size-28;
  1173. color: #666666;
  1174. }
  1175. .name{
  1176. float: right;
  1177. line-height: 90rpx;
  1178. display: inline-block;
  1179. float: left;
  1180. font-size: $font-size-28;
  1181. color: $text-color;
  1182. float: right;
  1183. padding-right: 48rpx;
  1184. overflow: hidden;
  1185. text-overflow:ellipsis;
  1186. white-space: nowrap;
  1187. text-align: right;
  1188. }
  1189. .icon-xiayibu{
  1190. line-height: 90rpx;
  1191. display: inline-block;
  1192. position: absolute;
  1193. width: 48rpx;
  1194. top: 0;
  1195. right: 0;
  1196. color: #b2b2b2;
  1197. }
  1198. }
  1199. .product-supplier{
  1200. width: 100%;
  1201. height: 174rpx;
  1202. padding: 30rpx 24rpx;
  1203. box-sizing: border-box;
  1204. background-color: #FFFFFF;
  1205. position: relative;
  1206. box-sizing: border-box;
  1207. border-bottom: 20rpx solid #F7F7F7;
  1208. .logo{
  1209. width: 128rpx;
  1210. height: 92rpx;
  1211. float: left;
  1212. border: 1px solid #efefef;
  1213. border-radius: 6rpx;
  1214. image{
  1215. width: 100%;
  1216. height: 100%;
  1217. display: block;
  1218. border-radius: 6rpx;
  1219. }
  1220. }
  1221. .main{
  1222. width: 470rpx;
  1223. height: 92rpx;
  1224. float: left;
  1225. margin-left: 20rpx;
  1226. .name{
  1227. width: 100%;
  1228. line-height: 46rpx;
  1229. float: left;
  1230. font-size: $font-size-28;
  1231. color: $text-color;
  1232. float: right;
  1233. overflow: hidden;
  1234. text-overflow:ellipsis;
  1235. white-space: nowrap;
  1236. text-align: left;
  1237. }
  1238. .massgs{
  1239. width: 100%;
  1240. line-height: 46rpx;
  1241. float: left;
  1242. font-size: $font-size-24;
  1243. color: #999999;
  1244. .label{
  1245. float: left;
  1246. }
  1247. .p-stars{
  1248. float: left;
  1249. margin-left: 20rpx;
  1250. }
  1251. .acount{
  1252. float: right;
  1253. text{
  1254. color: $color-system;
  1255. }
  1256. }
  1257. }
  1258. }
  1259. .icon-xiayibu{
  1260. line-height: 154rpx;
  1261. display: inline-block;
  1262. position: absolute;
  1263. width: 48rpx;
  1264. top: 0;
  1265. right: 0;
  1266. color: #b2b2b2;
  1267. }
  1268. }
  1269. .product-details {
  1270. width: 100%;
  1271. background: #FFFFFF;
  1272. border-bottom: 20rpx solid #F7F7F7;
  1273. &.service{
  1274. border-bottom: none;
  1275. }
  1276. &.recommend{
  1277. background-color: #F7F7F7;
  1278. border-bottom: none;
  1279. .title{
  1280. .title-tab{
  1281. background-color: #F7F7F7;
  1282. color: $text-color;
  1283. }
  1284. }
  1285. }
  1286. .product-rich-text-none{
  1287. box-sizing: border-box;
  1288. padding: 0 24rpx;
  1289. text-align: left;
  1290. font-size: 24rpx;
  1291. color: #999999;
  1292. line-height: 60rpx;
  1293. }
  1294. .content-none{
  1295. width: 100%;
  1296. height: 80rpx;
  1297. line-height: 80rpx;
  1298. text-align: left;
  1299. font-size: $font-size-26;
  1300. color: #999999;
  1301. box-sizing: border-box;
  1302. padding: 0 24rpx;
  1303. }
  1304. .title{
  1305. width: 100%;
  1306. box-sizing: border-box;
  1307. padding: 0 24rpx;
  1308. .title-tab{
  1309. width: 100%;
  1310. height: 100rpx;
  1311. background: #fff;
  1312. z-index: 10;
  1313. font-size: $font-size-30;
  1314. text-align: left;
  1315. color: $text-color;
  1316. line-height: 100rpx;
  1317. font-weight: 600;
  1318. }
  1319. .title-msg{
  1320. width: 100%;
  1321. height: 236rpx;
  1322. padding: 18rpx;
  1323. background-color: rgba(225,86,22, 0.1);
  1324. color: $color-system;
  1325. box-sizing: border-box;
  1326. margin-bottom: 30rpx;
  1327. .tit{
  1328. line-height: 46rpx;
  1329. font-size: $font-size-24;
  1330. text-align: left;
  1331. }
  1332. .txt{
  1333. line-height: 38rpx;
  1334. font-size: $font-size-20;
  1335. text-align: justify;
  1336. }
  1337. }
  1338. }
  1339. .content{
  1340. width: 100%;
  1341. background-color: #FFFFFF;
  1342. }
  1343. }
  1344. .isLower{
  1345. width: 100%;
  1346. height: 116rpx;
  1347. line-height: 116rpx;
  1348. text-align: center;
  1349. color: #000000;
  1350. font-size: $font-size-32;
  1351. font-weight: bold;
  1352. }
  1353. .bottom-btn{
  1354. width: 100%;
  1355. height: 100rpx;
  1356. position: fixed;
  1357. bottom: 0;
  1358. left: 0;
  1359. background: #FFFFFF;
  1360. z-index: 99;
  1361. .bottom-le{
  1362. width: 300rpx;
  1363. height: 100rpx;
  1364. padding:10rpx 20rpx 10rpx 0;
  1365. float: left;
  1366. box-sizing: border-box;
  1367. .item-bt{
  1368. width: 80rpx;
  1369. height: 100%;
  1370. margin-right:15rpx;
  1371. display: flex;
  1372. float: left;
  1373. flex-direction: column;
  1374. align-items: center;
  1375. justify-content: center;
  1376. font-size: $font-size-22;
  1377. color: $text-color;
  1378. line-height: 34rpx;
  1379. position: relative;
  1380. .animation-num{
  1381. font-size:$font-size-32 ;
  1382. color: #FF2A2A;
  1383. position: absolute;
  1384. top: -12rpx;
  1385. right: 4rpx;
  1386. font-weight: bold;
  1387. }
  1388. .animation{
  1389. animation: showAmnation 2.2s ease-in-out both;
  1390. }
  1391. .restion{
  1392. animation: hideAmnation 1s ease-in-out both;
  1393. }
  1394. .icon-num{
  1395. position: absolute;
  1396. right:-12rpx;
  1397. top: -5rpx;
  1398. }
  1399. .icon-num.goleft{
  1400. right: 2rpx;
  1401. }
  1402. &:last-child{
  1403. margin-right: 0;
  1404. }
  1405. image {
  1406. width: 44rpx;
  1407. height: 44rpx;
  1408. }
  1409. button.contact-btn{
  1410. width: 100%;
  1411. height: 100%;
  1412. margin: 0;
  1413. padding: 0;
  1414. display: flex;
  1415. flex-direction: column;
  1416. align-items: center;
  1417. justify-content: center;
  1418. box-sizing: border-box;
  1419. font-size: $font-size-24;
  1420. text-align: center;
  1421. text-decoration: none;
  1422. line-height: 34rpx;
  1423. border-radius: 0;
  1424. -webkit-tap-highlight-color: transparent;
  1425. overflow: hidden;
  1426. color: $text-color;
  1427. background-color:#FFFFFF;
  1428. }
  1429. }
  1430. }
  1431. .bottom-ri{
  1432. width: 450rpx;
  1433. height: 100%;
  1434. float: right;
  1435. display: flex;
  1436. box-sizing: border-box;
  1437. padding: 13rpx 20rpx 13rpx 0;
  1438. .btn{
  1439. flex: 1;
  1440. width: 200rpx;
  1441. line-height: 80rpx;
  1442. text-align: center;
  1443. font-size: $font-size-24;
  1444. color: #FFFFFF;
  1445. }
  1446. .btn-cart{
  1447. background-color: #ffe6dc;
  1448. color: $color-system;
  1449. border-radius: 42rpx 0 0 42rpx;
  1450. }
  1451. .btn-cart.disabled{
  1452. background-color: #E1E1E1;
  1453. color: #FFFFFF;
  1454. }
  1455. .btn-bay{
  1456. background:linear-gradient(to right, #f28f31 0%, #e15616 100%);
  1457. border-radius: 0 42rpx 42rpx 0;
  1458. }
  1459. .btn-bay.disabled{
  1460. background: linear-gradient(135deg,rgba(242,143,49,0.5) 0%,rgba(225,86,22,0.5) 100%);
  1461. }
  1462. }
  1463. }
  1464. .uni-badge--small {
  1465. -webkit-transform: scale(.8);
  1466. -ms-transform: scale(.8);
  1467. transform: scale(.8);
  1468. -webkit-transform-origin: center center;
  1469. -ms-transform-origin: center center;
  1470. transform-origin: center center;
  1471. }
  1472. .uni-badge {
  1473. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  1474. -webkit-box-sizing: border-box;
  1475. box-sizing: border-box;
  1476. font-size: 12px;
  1477. line-height: 1;
  1478. display: inline-block;
  1479. padding: 3px 6px;
  1480. color: #333;
  1481. border-radius: 100px;
  1482. background-color: #f1f1f1;
  1483. }
  1484. .uni-badge-error {
  1485. color: #fff;
  1486. background-color: #dd524d;
  1487. }
  1488. .product-topnav{
  1489. width: 100%;
  1490. height: 174rpx;
  1491. box-sizing: border-box;
  1492. background: #FFFFFF;
  1493. z-index: 1000;
  1494. position: fixed;
  1495. opacity: 1;
  1496. left: 0;
  1497. &.fixed{
  1498. animation: showFixedColor 0.1s ease-in-out both;
  1499. }
  1500. &.none{
  1501. animation: hideFixedColor 0.1s ease-in-out both;
  1502. }
  1503. .navbar {
  1504. width: 100%;
  1505. height: 60rpx;
  1506. box-sizing: border-box;
  1507. padding: 0 24rpx;
  1508. display: flex;
  1509. .nav-item {
  1510. display: flex;
  1511. flex: 1;
  1512. justify-content: center;
  1513. align-items: center;
  1514. height: 60rpx;
  1515. font-size: $font-size-28;
  1516. color: $text-color;
  1517. position: relative;
  1518. float: left;
  1519. position: relative;
  1520. .line{
  1521. width: 60rpx;
  1522. height: 2px;
  1523. border-radius: 1px;
  1524. background: #FFFFFF;
  1525. position: absolute;
  1526. bottom: 0;
  1527. left: 50%;
  1528. margin-left: -30rpx;
  1529. }
  1530. &.current{
  1531. color:$color-system;
  1532. .line{
  1533. background: $color-system;
  1534. }
  1535. }
  1536. }
  1537. }
  1538. .search-input{
  1539. width: 100%;
  1540. height: 114rpx;
  1541. padding:24rpx;
  1542. box-sizing: border-box;
  1543. .gosearch-btn{
  1544. width: 100%;
  1545. height: 100%;
  1546. border-radius: 40rpx;
  1547. margin: 0 auto;
  1548. font-size: 26rpx;
  1549. line-height: 66rpx;
  1550. color: #B2B2B2;
  1551. position: relative;
  1552. box-sizing: border-box;
  1553. padding-left: 66rpx;
  1554. &.fixed{
  1555. background: rgba(70,70,70,0.1);
  1556. }
  1557. &.none{
  1558. background: rgba(70,70,70,0.1);
  1559. }
  1560. .search-icon{
  1561. width: 66rpx;
  1562. height: 66rpx;
  1563. position:absolute ;
  1564. left: 0;
  1565. top: 2rpx;
  1566. text-align: center;
  1567. line-height: 66rpx;
  1568. .icon-iconfonticonfontsousuo1{
  1569. margin:0 6rpx;
  1570. font-size: $font-size-34;
  1571. color: #B2B2B2;
  1572. z-index: 10;
  1573. }
  1574. }
  1575. .search-text{
  1576. font-size: $font-size-24;
  1577. line-height: 66rpx;
  1578. color: #B2B2B2;
  1579. }
  1580. }
  1581. }
  1582. }
  1583. @keyframes showFixedColor {
  1584. 0% {background: rgba(255,255,255,0);}
  1585. 50% {background: rgba(255,255,255,0.5);}
  1586. 100% {background: rgba(255,255,255,1);}
  1587. }
  1588. @keyframes hideFixedColor {
  1589. 0% {background: rgba(255,255,255,1);}
  1590. 50% {background: rgba(255,255,255,0.5);}
  1591. 100% {background: rgba(255,255,255,0);}
  1592. }
  1593. /* 加入购物模态层*/
  1594. @keyframes showPopup {
  1595. 0% {
  1596. opacity: 0;
  1597. }
  1598. 100% {
  1599. opacity: 1;
  1600. }
  1601. }
  1602. @keyframes hidePopup {
  1603. 0% {
  1604. opacity: 1;
  1605. }
  1606. 100% {
  1607. opacity: 0;
  1608. }
  1609. }
  1610. @keyframes showLayer {
  1611. 0% {
  1612. transform: translateY(0);
  1613. }
  1614. 100% {
  1615. transform: translateY(-100%);
  1616. }
  1617. }
  1618. @keyframes hideLayer {
  1619. 0% {
  1620. transform: translateY(-100%);
  1621. }
  1622. 100% {
  1623. transform: translateY(0);
  1624. }
  1625. }
  1626. @keyframes showAmnation {
  1627. 0% {
  1628. top: -12rpx;
  1629. opacity: 0;
  1630. }
  1631. 50% {
  1632. top: -60rpx;
  1633. opacity: 1;
  1634. }
  1635. 100% {
  1636. top: -100rpx;
  1637. opacity: 0;
  1638. }
  1639. }
  1640. @keyframes hideAmnation {
  1641. 0% {
  1642. top: -100rpx;
  1643. opacity: 0;
  1644. }
  1645. 100% {
  1646. top: -12rpx;
  1647. opacity: 0;
  1648. }
  1649. }
  1650. .popup {
  1651. position: fixed;
  1652. top: 0;
  1653. width: 100%;
  1654. height: 100%;
  1655. z-index: 999;
  1656. display: none;
  1657. .mask{
  1658. position: fixed;
  1659. top: 0;
  1660. width: 100%;
  1661. height: 100%;
  1662. z-index: 21;
  1663. background-color: rgba(0, 0, 0, 0.6);
  1664. }
  1665. .layer {
  1666. position: fixed;
  1667. z-index: 22;
  1668. bottom: -294rpx;
  1669. width: 702rpx;
  1670. padding: 24rpx 24rpx 36rpx 24rpx;
  1671. height: 260rpx;
  1672. border-radius: 20rpx 20rpx 0 0;
  1673. background-color: #fff;
  1674. display: flex;
  1675. flex-wrap: wrap;
  1676. align-content: space-between;
  1677. .content {
  1678. width: 100%;
  1679. }
  1680. .btn {
  1681. width: 100%;
  1682. height: 88rpx;
  1683. margin-top: 20rpx;
  1684. .button {
  1685. width: 100%;
  1686. height: 88rpx;
  1687. color: #fff;
  1688. display: flex;
  1689. align-items: center;
  1690. justify-content: center;
  1691. background: $btn-confirm;
  1692. font-size: $font-size-28;
  1693. border-radius: 44rpx;
  1694. }
  1695. }
  1696. }
  1697. &.show {
  1698. display: block;
  1699. .mask{
  1700. animation: showPopup 0.2s linear both;
  1701. }
  1702. .layer {
  1703. animation: showLayer 0.2s linear both;
  1704. }
  1705. }
  1706. &.hide {
  1707. display: block;
  1708. .mask{
  1709. animation: hidePopup 0.2s linear both;
  1710. }
  1711. .layer {
  1712. animation: hideLayer 0.2s linear both;
  1713. }
  1714. }
  1715. &.none {
  1716. display: none;
  1717. }
  1718. &.service {
  1719. .row {
  1720. margin: 30upx 0;
  1721. .title {
  1722. font-size: 30upx;
  1723. margin: 10upx 0;
  1724. }
  1725. .description {
  1726. font-size: 28upx;
  1727. color: #999;
  1728. }
  1729. }
  1730. }
  1731. .layer-smimg{
  1732. width: 114rpx;
  1733. height: 114rpx;
  1734. float: left;
  1735. border-radius: 10rpx;
  1736. margin-right: 24rpx;
  1737. image{
  1738. width: 114rpx;
  1739. height: 114rpx;
  1740. border-radius: 10rpx;
  1741. }
  1742. }
  1743. .layer-nunbox{
  1744. justify-content: space-between;
  1745. align-items: center;
  1746. width: 536rpx;
  1747. height: auto;
  1748. float: left;
  1749. .layer-nunbox-t{
  1750. width: 100%;
  1751. height:44rpx;
  1752. position:relative;
  1753. display: flex;
  1754. margin-bottom: 10rpx;
  1755. .text{
  1756. font-size: $font-size-24;
  1757. line-height: 48rpx;
  1758. color: #999999;
  1759. }
  1760. .layer-nunbox-text{
  1761. line-height: 44rpx;
  1762. font-size: $font-size-28;
  1763. }
  1764. .number-box{
  1765. display: flex;
  1766. justify-content: center;
  1767. align-items: center;
  1768. border:2rpx solid #ffe6dc;
  1769. border-radius: 30rpx;
  1770. height: 48rpx;
  1771. margin-left: 20rpx;
  1772. .iconfont{
  1773. font-size: $font-size-24;
  1774. padding:0 18rpx;
  1775. color: #999999;
  1776. text-align: center;
  1777. line-height: 48rpx;
  1778. font-weight: bold;
  1779. background: #fef6f3;
  1780. &.icon-jianhao{
  1781. border-radius: 30rpx 0 0 30rpx;
  1782. }
  1783. &.icon-jiahao{
  1784. border-radius: 0 30rpx 30rpx 0;
  1785. }
  1786. }
  1787. .btn-input{
  1788. width: 62rpx;
  1789. height: 48rpx;
  1790. line-height: 48rpx;
  1791. background: #FFFFFF;
  1792. border-radius: 4rpx;
  1793. text-align: center;
  1794. font-size: $font-size-28;
  1795. }
  1796. }
  1797. .product-step{
  1798. position: absolute;
  1799. left: 45rpx;
  1800. bottom: 0;
  1801. height: 44rpx;
  1802. background: #FFFFFF;
  1803. }
  1804. }
  1805. .layer-nunbox-b{
  1806. width: 100%;
  1807. height:44rpx;
  1808. margin-top: 13rpx;
  1809. }
  1810. .text{
  1811. line-height: 44rpx;
  1812. font-size: $font-size-28;
  1813. .p{
  1814. color: #FF2A2A;
  1815. }
  1816. .p:first-child{
  1817. margin-left: 30rpx;
  1818. }
  1819. .p.sm{
  1820. font-size: $font-size-24;
  1821. }
  1822. }
  1823. }
  1824. }
  1825. .tui-popup-box {
  1826. position: relative;
  1827. box-sizing: border-box;
  1828. min-height: 220rpx;
  1829. padding:0rpx 24rpx 0 24rpx;
  1830. .title{
  1831. font-size: $font-size-34;
  1832. color: $text-color;
  1833. line-height: 88rpx;
  1834. text-align: center;
  1835. float: left;
  1836. width: 100%;
  1837. height: 88rpx;
  1838. }
  1839. .tui-popup-main{
  1840. width: 100%;
  1841. float: left;
  1842. .tui-popup-scroll{
  1843. width: 100%;
  1844. height: 500rpx;
  1845. .content-tr{
  1846. width: 100%;
  1847. min-height: 58rpx;
  1848. line-height: 58rpx;
  1849. display: flex;
  1850. .content-td{
  1851. display: flex;
  1852. flex: 3;
  1853. font-size: $font-size-26;
  1854. color: #999999;
  1855. line-height: 58rpx;
  1856. text-align: left;
  1857. }
  1858. .content-th{
  1859. display: flex;
  1860. flex: 7;
  1861. font-size: $font-size-26;
  1862. color: #333333;
  1863. line-height: 58rpx;
  1864. text-align: left;
  1865. padding-left: 10rpx;
  1866. }
  1867. }
  1868. }
  1869. }
  1870. }
  1871. .tui-popup-btn {
  1872. width: 100%;
  1873. height: auto;
  1874. float: left;
  1875. margin-top: 24rpx;
  1876. .tui-button{
  1877. width: 100%;
  1878. height: 88rpx;
  1879. background: $btn-confirm;
  1880. line-height: 88rpx;
  1881. text-align: center;
  1882. color: #FFFFFF;
  1883. font-size: $font-size-28;
  1884. border-radius: 44rpx;
  1885. }
  1886. }
  1887. /*富文本样式*/
  1888. rich-text.p{
  1889. width: 702rpx !important;
  1890. padding: 0 24rpx;
  1891. text-align: justify;
  1892. }
  1893. rich-text.img{
  1894. width: 100%;
  1895. height: auto;
  1896. }
  1897. </style>