product-activi.vue 57 KB

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