product.vue 58 KB

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