product.vue 40 KB

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