product.vue 42 KB

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