product.vue 48 KB

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