product.vue 42 KB

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