product.vue 42 KB

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