product.vue 42 KB

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