product.vue 58 KB

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