product.vue 40 KB

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