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