product.vue 42 KB

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