product-activi.vue 58 KB

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