product-activi.vue 58 KB

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