product-activi.vue 40 KB

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