product.vue 40 KB

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