product.vue 47 KB

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