product.vue 41 KB

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