product.vue 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876
  1. <template>
  2. <view class="product" :style="{paddingBottom: userIdentity==1 && userIdentity == 3 ? '0rpx' :'188rpx',paddingTop:CustomBar+'px'}">
  3. <custom-p v-if="isHeaderPoduct"
  4. :systeminfo='systeminfo'
  5. :navbar-data='nvabarData'
  6. :headerBtnPosi ="headerBtnPosi"
  7. :headerColor="headerColor"
  8. :type="isShareType"
  9. :page='backPage'>
  10. </custom-p>
  11. <view class="product-topnav" v-if='isNavbarFiexd' :class="navbarFiexd" :style="{top:CustomBar +'px'}">
  12. <view class="search-input">
  13. <view class="gosearch-btn" :class="navbarFiexd" @click="this.$api.navigateTo(clickPath)">
  14. <view class="search-icon">
  15. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  16. </view>
  17. <view class="search-text">搜索商品/项目仪器</view>
  18. </view>
  19. </view>
  20. <view class="navbar">
  21. <view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 0 }" @click="tabClick(0)">
  22. <text>详情</text>
  23. <text class="line"></text>
  24. </view>
  25. <view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 1 }" @click="tabClick(1)">
  26. <text>服务项目</text>
  27. <text class="line"></text>
  28. </view>
  29. <view class="nav-item tui-skeleton-fillet" :class="{ current: tabCurrentIndex === 2 }" @click="tabClick(2)">
  30. <text>推荐</text>
  31. <text class="line"></text>
  32. </view>
  33. </view>
  34. </view>
  35. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
  36. <template v-else >
  37. <view class="cart-content empty" v-if="isInvalid">
  38. <view class="empty-container">
  39. <image class="empty-container-image" :src="productNoneImage" mode="aspectFit"></image>
  40. <text class="error-text">商品已失效,去商城逛逛别的吧~</text>
  41. <view class="login-btn" @click="goIndex">去商城</view>
  42. </view>
  43. </view>
  44. <view class="container-product tui-skeleton" v-else>
  45. <view class="container-product-main">
  46. <view class="product-top">
  47. <view class="banner-section">
  48. <uni-swiper-dot :info="productImage" :current="current" field="content" :mode="mode" >
  49. <swiper class="banner tui-banner tui-skeleton-rect" @change="swiperChange" :duration='800' :autoplay="false" :circular="true" >
  50. <swiper-item v-for="(item, index) in productImage" :key="index" class="banner-item">
  51. <image :src="item" @click="previewImg(index)" class="product-img" />
  52. </swiper-item>
  53. </swiper>
  54. <view class="swiper__dots-box">
  55. <tui-tag padding="12rpx 24rpx" type="translucent" shape="circleLeft" size="32rpx" :scaleMultiple="0.82" originRight>{{ current + 1 }}/{{ productImage.length }}</tui-tag>
  56. </view>
  57. </uni-swiper-dot>
  58. </view>
  59. <view class="product-wrap clearfix">
  60. <view class="wrap-top" :class="goodsData.isNoneDisabled ? 'none' : ''">
  61. <view class="wrap-top-price">
  62. <cm-price v-if="isRequest"
  63. :product="product"
  64. :userIdentity="userIdentity"
  65. :shopID= "shopID"
  66. :promotions="product.promotions"
  67. :ladderPriceList="ladderPriceList"/>
  68. </view>
  69. <view class="p-title tui-skeleton-fillet">
  70. <view class="mclap-tag" v-if="product.beautyActFlag == '1'">美博会</view>
  71. <view class="p-title-name" :class="product.beautyActFlag == '1' ? 'indent' : ''"> {{product.name == undefined ? '' : product.name}} </view>
  72. <button open-type="share" class="p-title-share tui-share-position" @tap="onShare">
  73. <view class=""><text class="iconfont icon-fenxiang1"></text></view>
  74. <view class="">分享</view>
  75. </button>
  76. </view>
  77. <view class="wrap-label" v-if="product.tagsList.length>0">
  78. <view class="label-a tui-skeleton-fillet" v-for="(label,index) in product.tagsList" :key="index">{{label}}</view>
  79. </view>
  80. <view class="product-seve">
  81. <text class="label">采美承诺:</text>
  82. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">无忧退货</text></text>
  83. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">快速退款</text></text>
  84. <text class="iconfont icon-dui tui-skeleton-rect"><text class="text">正品保证</text></text>
  85. </view>
  86. <view class="productRemarks" v-if="product.productRemarks!=''&&product.productRemarks!=null">
  87. 备注:{{product.productRemarks}}
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="product-item-none" v-if="goodsData.isNoneDisabled">
  93. <image class="none-image" :src="productNoneImage" mode=""></image>
  94. <view class="none-text">此商品已{{goodsData.disabledText}},请浏览以下推荐商品~</view>
  95. </view>
  96. <view class="product-parameter" @click="showPopup" v-if="!goodsData.isNoneDisabled">
  97. <text class="title">参数:</text>
  98. <text class="name">品牌 起订量 分类...</text>
  99. <text class="iconfont icon-xiayibu"></text>
  100. </view>
  101. <view class="product-supplier" v-if="isNoneSupplier" @click="goSupplier">
  102. <view class="logo"><img :src="shop.logo ? shop.logo :'https://static.caimei365.com/app/img/icon/icon-shoplogo.png'" alt=""></view>
  103. <view class="main">
  104. <view class="name">{{shop.name}}</view>
  105. <view class="massgs">
  106. <view class="label">满意度:</view>
  107. <view class="p-stars">
  108. <uni-stars :stars="6" :iconClass="iconClass" :iconColor="iconColor" :fontSize="36" :widthInfo="176"></uni-stars>
  109. </view>
  110. <view class="acount">
  111. <text>{{ shop.normalNum }}</text>件商品
  112. </view>
  113. </view>
  114. </view>
  115. <view class="right"><text class="iconfont icon-xiayibu"></text></view>
  116. </view>
  117. </view>
  118. <view class="product-details product-details0">
  119. <!-- 商品详情 -->
  120. <view class="title">
  121. <view class="title-tab">商品详情</view>
  122. </view>
  123. <view class="content tui-banner product-rich-text tui-skeleton-rect">
  124. <parser :html="html" :img-mode="widthFix" v-if="!goodsData.isNoneDisabled"></parser>
  125. <view class="product-rich-text-none" v-else>暂无商品信息</view>
  126. </view>
  127. </view>
  128. <view class="product-details service product-details1">
  129. <!-- 服务项目 -->
  130. <view class="title">
  131. <view class="title-tab">服务项目</view>
  132. </view>
  133. <view class="content service" v-if="product.productDetail.orderInfo || product.productDetail.serviceInfo">
  134. <cm-service :product="product.productDetail" v-if="isRequest"></cm-service>
  135. </view>
  136. <view class="content-none" v-else>
  137. <text>暂无服务项目</text>
  138. </view>
  139. </view>
  140. <view class="product-details recommend product-details2">
  141. <!-- 相关推荐 -->
  142. <view class="title">
  143. <view class="title-tab">相关推荐</view>
  144. </view>
  145. <view class="content hot">
  146. <recommend :query-productid="product.productID" :query-type="product.recommendType" v-if="isRequest"></recommend>
  147. </view>
  148. </view>
  149. <!-- 商品参数 -->
  150. <tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup()">
  151. <view class="tui-popup-box clearfix">
  152. <view class="title">商品参数</view>
  153. <div class="tui-popup-main">
  154. <scroll-view class="tui-popup-scroll" scroll-y="true">
  155. <view class="content-tr">
  156. <view class="content-td">起订量</view>
  157. <view class="content-th">{{product.minBuyNumber}}</view>
  158. </view>
  159. <view class="content-tr">
  160. <view class="content-td">品牌</view>
  161. <view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
  162. </view>
  163. <view class="content-tr">
  164. <view class="content-td">分类</view>
  165. <view class="content-th">{{product.typeName == null? '暂无' : product.typeName}}</view>
  166. </view>
  167. <view class="content-tr">
  168. <view class="content-td">包装规格</view>
  169. <view class="content-th">{{product.unit}}</view>
  170. </view>
  171. <view class="content-tr">
  172. <view class="content-td">商品编码</view>
  173. <view class="content-th">{{product.productCode}}</view>
  174. </view>
  175. <view class="content-tr">
  176. <view class="content-td">库存</view>
  177. <view class="content-th">{{product.stock}}</view>
  178. </view>
  179. <view class="content-tr" v-if="product.parametersList.length>0" v-for="(item, index) in product.parametersList" :key="index">
  180. <view class="content-td">{{item.paramsName}}</view>
  181. <view class="content-th">{{item.paramsContent}}</view>
  182. </view>
  183. </scroll-view>
  184. </div>
  185. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
  186. <view class="tui-flex-1">
  187. <view class="tui-button" @click="hidePopup()">收起</view>
  188. </view>
  189. </view>
  190. </view>
  191. </tui-bottom-popup>
  192. <!-- 底部按钮 -->
  193. <view class="menu" v-if="isShowButton">
  194. <view class="bottom-btn" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  195. <view class="bottom-le">
  196. <view class="item-bt" @click="this.$api.switchTabTo('/pages/tabBar/home/index')">
  197. <image src="../../static/icon-home-active@3x.png"></image>
  198. <text>首页</text>
  199. </view>
  200. <view class="item-bt" @click="goSupplier">
  201. <image src="../../static/icon-shop@3x.png"></image>
  202. <text>店铺</text>
  203. </view>
  204. <view class="item-bt" @click="buyProductCart()">
  205. <image src="https://static.caimei365.com/app/img/icon/icon-cart-active@3x.png"></image>
  206. <text>购物车</text>
  207. <text v-if="hasLogin && goodsData.cartCount>0"
  208. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  209. :class="[goodsData.cartCount < 10 ? 'goleft':'']">
  210. {{ goodsData.cartCount >= 100 ? '99+': goodsData.cartCount}}
  211. </text>
  212. <view class="animation-num" :class="isAnimation ? 'animation' : 'restion'">+1</view>
  213. </view>
  214. </view>
  215. <view class="bottom-ri">
  216. <button
  217. :disabled="goodsData.disabled"
  218. class="btn btn-cart"
  219. :class="[goodsData.disabled ? 'disabled':'']"
  220. @tap.stop="btnGetConfirm('add')">加入购物车</button>
  221. <button
  222. :disabled="goodsData.disabled"
  223. class="btn btn-bay"
  224. :class="[goodsData.disabled ? 'disabled':'']"
  225. @tap.stop="btnGetConfirm('buy')">立即购买</button>
  226. </view>
  227. </view>
  228. </view>
  229. <!--底部选择模态层弹窗组件 -->
  230. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" @tap="hideSpec">
  231. <!-- 遮罩层 -->
  232. <view class="mask"></view>
  233. <view class="layer" @tap.stop="discard" :style="{paddingBottom :isIphoneX ? '68rpx' : '36rpx',bottom:isIphoneX ?'-352rpx' : '-296rpx'}">
  234. <view class="content">
  235. <view class="layer-smimg">
  236. <image :src="product.mainImage" mode=""></image>
  237. </view>
  238. <view class="layer-nunbox">
  239. <view class="layer-nunbox-t" v-if="product.step === 2">
  240. <view class="text">*该商品只能以起订量的整数倍购买</view>
  241. </view>
  242. <view class="layer-nunbox-t">
  243. <view class="layer-nunbox-text">数量:</view>
  244. <view class="number-box">
  245. <view class="iconfont icon-jianhao" :class="[isQuantity==true?'disabled':'']" @click="changeCountSub()"></view>
  246. <input class="btn-input" type="number" v-model="number" maxlength='4' @blur="changeNumber($event)">
  247. <view class="iconfont icon-jiahao" :class="[isStock==true?'disabled':'']" @click="changeCountAdd()"></view>
  248. </view>
  249. </view>
  250. <view class="layer-nunbox-b">
  251. <view class="text">单价:
  252. <text class="p sm">¥</text>
  253. <text class="p bg">{{buyRetailPrice.toFixed(2)}}</text>
  254. </view>
  255. </view>
  256. </view>
  257. </view>
  258. <view class="btn"><view class="button" @click.stop="btnConfirm">确定</view></view>
  259. </view>
  260. </view>
  261. <!-- 侧边 -->
  262. <scroll-top :isScrollTop="isScrollTop" :bottom="200"></scroll-top>
  263. </view>
  264. </template>
  265. </view>
  266. </template>
  267. <script>
  268. import { mapState,mapMutations } from 'vuex'
  269. import customP from '@/components/cm-module/headerNavbar/header-poduct' //自定义导航
  270. import cmPrice from "@/components/cm-module/productDetails/cm-price.vue" //价格显示
  271. import cmAttributes from "@/components/cm-module/productDetails/cm-attributes.vue" //规格信息
  272. import parser from "@/components/jyf-Parser/index" //富文本处理
  273. import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
  274. import recommend from "@/components/cm-module/productDetails/recommend" //相关推荐
  275. import cmParameter from "@/components/cm-module/productDetails/cm-parameter" //相关参数
  276. import cmService from "@/components/cm-module/productDetails/cm-service" //服务项目
  277. import authorize from '@/common/config/authorize.js'
  278. import wxLogin from "@/common/config/wxLogin.js"
  279. import { debounce } from '@/common/config/common.js'
  280. var isPreviewImg;
  281. export default{
  282. components:{
  283. customP,
  284. parser,
  285. tuiSkeleton,
  286. recommend,
  287. cmPrice,
  288. cmAttributes,
  289. cmParameter,
  290. cmService
  291. },
  292. data(){
  293. return{
  294. clickPath:'/search/pages/search/search',
  295. html:'<div style="text-align: center;color:#333333;">暂无内容</div>',
  296. productNoneImage:'https://static.caimei365.com/app/img/icon/icon-pnone.png',
  297. mode:'round',
  298. iconClass:'icon-aixin',
  299. iconColor:'#ff9100',
  300. specClass: '',//规格弹窗css类,控制开关动画
  301. isBtnType:'',
  302. isRequest:false,
  303. isScrollTop:false,
  304. current:0,
  305. shopId:0,
  306. isShareType:'',
  307. isHeaderPoduct:false,
  308. isNavbarFiexd:false,
  309. navbarFiexd:'none',
  310. ladderPriceFlag:'',
  311. ladderPriceList:'',
  312. isInvalid:false,
  313. isEvaluate:false,
  314. isAnimation:false,
  315. skeletonShow:true,
  316. isQuantity:false,
  317. isStock:false,
  318. disabled:false,
  319. isNoneDisabled:false,
  320. tabCurrentIndex:0,
  321. userID:'',
  322. shopID:'',
  323. productID:0,
  324. userIdentity:0,//用户类型
  325. goodsData:{},//自定义数据
  326. shop:{},//供应商信息
  327. product:{},//采美
  328. productImage:[],
  329. retailPrice:0,
  330. buyRetailPrice:0,
  331. buyRetailPriceStep:1,
  332. stock:0,
  333. number:0,
  334. minBuyNumber:0,
  335. productsList:[],
  336. goodListData:[],
  337. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  338. systeminfo: this.setSysteminfo(), //获取设备信息
  339. isIphoneX:this.$store.state.isIphoneX,
  340. windowHeight: '',
  341. headerColor:false,
  342. backPage:1,
  343. nvabarData: { //顶部自定义导航
  344. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示
  345. title: '' // 导航栏 中间的标题
  346. },
  347. linkPath:'',
  348. CustomBar:this.CustomBar,// 顶部导航栏高度
  349. popupShow:false,//参数弹窗
  350. tabSelectFlag:false,
  351. sectionPropsArr: [],
  352. scrollTopArray:[],
  353. sectionTopRangeArr: [],
  354. winHeight:'',
  355. isShowButton:true,
  356. isNoneSupplier:false
  357. }
  358. },
  359. onLoad(option) {
  360. this.productID = option.id;//获取商品ID
  361. this.isShareType = option.type
  362. this.linkPath = option.path
  363. this.isHeaderPoduct = true
  364. if(option.page == 2){
  365. this.backPage = option.page
  366. }
  367. if(this.isShareType =='share'){
  368. authorize.checkLogin()
  369. .then(res => {
  370. wxLogin.wxLoginAuthorize()
  371. })
  372. .catch(err => {
  373. console.log(new Date +'用户未授权微信信息')
  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.checkLogin()
  485. .then(res => {
  486. if(this.hasLogin){
  487. this.$api.navigateTo('/pages/goods/cart')
  488. }else{
  489. this.$api.navigateTo('/pages/login/login?type=1')
  490. }
  491. })
  492. .catch(err => {
  493. this.$api.navigateTo('/pages/authorization/authorization?type=1')
  494. })
  495. },
  496. btnGetConfirm(type){//加入购物车&&立即购买点击
  497. authorize.checkLogin()
  498. .then(res => {
  499. if(this.hasLogin){
  500. this.showSpec(type);
  501. }else{
  502. this.$api.navigateTo('/pages/login/login?type=1')
  503. }
  504. })
  505. .catch(err => {
  506. this.$api.navigateTo('/pages/authorization/authorization?type=1')
  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.checkLogin()
  603. .then(res => {
  604. this.$store.commit('setLoginType',8)
  605. this.$store.commit('setLoginProductId',this.productID)
  606. this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
  607. })
  608. .catch(err => {
  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>