product-activi.vue 40 KB

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