product-activi.vue 40 KB

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