product.vue 42 KB

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