product.vue 43 KB

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