product.vue 42 KB

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