product.vue 40 KB

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