product.vue 50 KB

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