product.vue 48 KB

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