product.vue 50 KB

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