product.vue 40 KB

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