product-activi.vue 57 KB

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