product.vue 54 KB

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