product-activi.vue 40 KB

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