product.vue 56 KB

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