product-activi.vue 40 KB

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