product.vue 42 KB

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