product.vue 42 KB

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