product.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905
  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. 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. margin-top: 5rpx;
  1030. .floor-tags {
  1031. float: right;
  1032. height: 28rpx;
  1033. border-radius: 6rpx;
  1034. background-color: #ffffff;
  1035. line-height: 28rpx;
  1036. text-align: center;
  1037. display: inline-block;
  1038. padding: 0 16rpx;
  1039. font-size: $font-size-20;
  1040. margin-left: 15rpx;
  1041. color: #ff2a2a;
  1042. border: 1px solid #ff2a2a;
  1043. }
  1044. }
  1045. .floor-item-btn {
  1046. float: left;
  1047. height: 40rpx;
  1048. margin-top: 8rpx;
  1049. margin-left: 10rpx;
  1050. .btn {
  1051. line-height: 40rpx;
  1052. padding: 0 20rpx;
  1053. height: 40rpx;
  1054. background: $btn-confirm;
  1055. color: #ffffff;
  1056. font-size: $font-size-20;
  1057. border-radius: 4rpx;
  1058. }
  1059. }
  1060. }
  1061. .wrap-info {
  1062. float: left;
  1063. width: 702rpx;
  1064. padding: 24rpx 24rpx 0 24rpx;
  1065. border-bottom: 1px solid #f8f8f8;
  1066. .info-viewT {
  1067. width: 100%;
  1068. min-height: 40rpx;
  1069. font-size: $font-size-28;
  1070. color: $text-color;
  1071. line-height: 40rpx;
  1072. text-align: left;
  1073. &.none {
  1074. color: #999999;
  1075. }
  1076. .info-viewL {
  1077. min-width: 350rpx;
  1078. float: left;
  1079. margin-bottom: 24rpx;
  1080. }
  1081. .info-viewR {
  1082. min-width: 352rpx;
  1083. float: left;
  1084. margin-bottom: 24rpx;
  1085. }
  1086. }
  1087. .info-viewB {
  1088. width: 100%;
  1089. height: auto;
  1090. }
  1091. .info-f {
  1092. width: 50%;
  1093. float: left;
  1094. font-size: $font-size-28;
  1095. color: $text-color;
  1096. line-height: 40rpx;
  1097. margin-bottom: 24rpx;
  1098. text-align: left;
  1099. }
  1100. }
  1101. }
  1102. .product-seve {
  1103. width: 100%;
  1104. height: 60rpx;
  1105. background-color: #ffffff;
  1106. position: relative;
  1107. display: flex;
  1108. line-height: 60rpx;
  1109. padding: 0 24rpx;
  1110. box-sizing: border-box;
  1111. .label {
  1112. font-size: $font-size-28;
  1113. color: #333333;
  1114. }
  1115. .iconfont {
  1116. color: #999999;
  1117. margin-right: 20rpx;
  1118. font-size: $font-size-22;
  1119. }
  1120. .text {
  1121. font-size: $font-size-22;
  1122. color: #999999;
  1123. margin-left: 10rpx;
  1124. }
  1125. }
  1126. .product-item-none {
  1127. min-height: 348rpx;
  1128. display: flex;
  1129. flex-direction: column;
  1130. align-items: center;
  1131. border-bottom: 20rpx solid #f7f7f7;
  1132. box-sizing: border-box;
  1133. padding: 40rpx 0;
  1134. .none-image {
  1135. width: 284rpx;
  1136. height: 225rpx;
  1137. }
  1138. .none-text {
  1139. text-align: center;
  1140. font-size: $font-size-28;
  1141. color: #fea785;
  1142. line-height: 40rpx;
  1143. }
  1144. }
  1145. .product-parameter {
  1146. width: 702rpx;
  1147. height: 90rpx;
  1148. background-color: #ffffff;
  1149. position: relative;
  1150. display: flex;
  1151. border-bottom: 20rpx solid #f7f7f7;
  1152. .title {
  1153. line-height: 90rpx;
  1154. display: inline-block;
  1155. float: left;
  1156. font-size: $font-size-28;
  1157. color: #666666;
  1158. }
  1159. .name {
  1160. float: right;
  1161. line-height: 90rpx;
  1162. display: inline-block;
  1163. float: left;
  1164. font-size: $font-size-28;
  1165. color: $text-color;
  1166. float: right;
  1167. padding-right: 48rpx;
  1168. overflow: hidden;
  1169. text-overflow: ellipsis;
  1170. white-space: nowrap;
  1171. text-align: right;
  1172. }
  1173. .icon-chakangengduo {
  1174. line-height: 90rpx;
  1175. display: inline-block;
  1176. position: absolute;
  1177. width: 48rpx;
  1178. top: 0;
  1179. right: 0;
  1180. color: #b2b2b2;
  1181. }
  1182. }
  1183. .product-supplier {
  1184. width: 100%;
  1185. height: 174rpx;
  1186. padding: 30rpx 24rpx;
  1187. box-sizing: border-box;
  1188. background-color: #ffffff;
  1189. position: relative;
  1190. box-sizing: border-box;
  1191. border-bottom: 20rpx solid #f7f7f7;
  1192. .logo {
  1193. width: 128rpx;
  1194. height: 92rpx;
  1195. float: left;
  1196. border: 1px solid #efefef;
  1197. border-radius: 6rpx;
  1198. image {
  1199. width: 100%;
  1200. height: 100%;
  1201. display: block;
  1202. border-radius: 6rpx;
  1203. }
  1204. }
  1205. .main {
  1206. width: 470rpx;
  1207. height: 92rpx;
  1208. float: left;
  1209. margin-left: 20rpx;
  1210. .name {
  1211. width: 100%;
  1212. line-height: 46rpx;
  1213. float: left;
  1214. font-size: $font-size-28;
  1215. color: $text-color;
  1216. float: right;
  1217. overflow: hidden;
  1218. text-overflow: ellipsis;
  1219. white-space: nowrap;
  1220. text-align: left;
  1221. }
  1222. .massgs {
  1223. width: 100%;
  1224. line-height: 46rpx;
  1225. float: left;
  1226. font-size: $font-size-24;
  1227. color: #999999;
  1228. .label {
  1229. float: left;
  1230. }
  1231. .p-stars {
  1232. float: left;
  1233. margin-left: 20rpx;
  1234. }
  1235. .acount {
  1236. float: right;
  1237. text {
  1238. color: $color-system;
  1239. }
  1240. }
  1241. }
  1242. }
  1243. .icon-chakangengduo {
  1244. line-height: 154rpx;
  1245. display: inline-block;
  1246. position: absolute;
  1247. width: 48rpx;
  1248. top: 0;
  1249. right: 0;
  1250. color: #b2b2b2;
  1251. }
  1252. }
  1253. .product-details {
  1254. width: 100%;
  1255. background: #ffffff;
  1256. border-bottom: 20rpx solid #f7f7f7;
  1257. &.service {
  1258. border-bottom: none;
  1259. }
  1260. &.recommend {
  1261. background-color: #f7f7f7;
  1262. border-bottom: none;
  1263. .title {
  1264. .title-tab {
  1265. background-color: #f7f7f7;
  1266. color: $text-color;
  1267. }
  1268. }
  1269. }
  1270. .product-rich-text-none {
  1271. box-sizing: border-box;
  1272. padding: 0 24rpx;
  1273. text-align: left;
  1274. font-size: 24rpx;
  1275. color: #999999;
  1276. line-height: 60rpx;
  1277. }
  1278. .content-none {
  1279. width: 100%;
  1280. height: 80rpx;
  1281. line-height: 80rpx;
  1282. text-align: left;
  1283. font-size: $font-size-26;
  1284. color: #999999;
  1285. box-sizing: border-box;
  1286. padding: 0 24rpx;
  1287. }
  1288. .title {
  1289. width: 100%;
  1290. box-sizing: border-box;
  1291. padding: 0 24rpx;
  1292. .title-tab {
  1293. width: 100%;
  1294. height: 100rpx;
  1295. background: #fff;
  1296. z-index: 10;
  1297. font-size: $font-size-30;
  1298. text-align: left;
  1299. color: $text-color;
  1300. line-height: 100rpx;
  1301. font-weight: 600;
  1302. }
  1303. .title-msg {
  1304. width: 100%;
  1305. height: 236rpx;
  1306. padding: 18rpx;
  1307. background-color: rgba(225, 86, 22, 0.1);
  1308. color: $color-system;
  1309. box-sizing: border-box;
  1310. margin-bottom: 30rpx;
  1311. .tit {
  1312. line-height: 46rpx;
  1313. font-size: $font-size-24;
  1314. text-align: left;
  1315. }
  1316. .txt {
  1317. line-height: 38rpx;
  1318. font-size: $font-size-20;
  1319. text-align: justify;
  1320. }
  1321. }
  1322. }
  1323. .content {
  1324. width: 100%;
  1325. background-color: #ffffff;
  1326. }
  1327. }
  1328. .isLower {
  1329. width: 100%;
  1330. height: 116rpx;
  1331. line-height: 116rpx;
  1332. text-align: center;
  1333. color: #000000;
  1334. font-size: $font-size-32;
  1335. font-weight: bold;
  1336. }
  1337. .bottom-btn {
  1338. width: 100%;
  1339. height: 100rpx;
  1340. position: fixed;
  1341. bottom: 0;
  1342. left: 0;
  1343. background: #ffffff;
  1344. z-index: 99;
  1345. .bottom-le {
  1346. width: 300rpx;
  1347. height: 100rpx;
  1348. padding: 10rpx 20rpx 10rpx 0;
  1349. float: left;
  1350. box-sizing: border-box;
  1351. .item-bt {
  1352. width: 80rpx;
  1353. height: 100%;
  1354. margin-right: 15rpx;
  1355. display: flex;
  1356. float: left;
  1357. flex-direction: column;
  1358. align-items: center;
  1359. justify-content: center;
  1360. font-size: $font-size-22;
  1361. color: $text-color;
  1362. line-height: 34rpx;
  1363. position: relative;
  1364. .animation-num {
  1365. font-size: $font-size-32;
  1366. color: #ff2a2a;
  1367. position: absolute;
  1368. top: -12rpx;
  1369. right: 4rpx;
  1370. font-weight: bold;
  1371. }
  1372. .animation {
  1373. animation: showAmnation 2.2s ease-in-out both;
  1374. }
  1375. .restion {
  1376. animation: hideAmnation 1s ease-in-out both;
  1377. }
  1378. .icon-num {
  1379. position: absolute;
  1380. right: -12rpx;
  1381. top: -5rpx;
  1382. }
  1383. .icon-num.goleft {
  1384. right: 2rpx;
  1385. }
  1386. &:last-child {
  1387. margin-right: 0;
  1388. }
  1389. image {
  1390. width: 44rpx;
  1391. height: 44rpx;
  1392. }
  1393. button.contact-btn {
  1394. width: 100%;
  1395. height: 100%;
  1396. margin: 0;
  1397. padding: 0;
  1398. display: flex;
  1399. flex-direction: column;
  1400. align-items: center;
  1401. justify-content: center;
  1402. box-sizing: border-box;
  1403. font-size: $font-size-24;
  1404. text-align: center;
  1405. text-decoration: none;
  1406. line-height: 34rpx;
  1407. border-radius: 0;
  1408. -webkit-tap-highlight-color: transparent;
  1409. overflow: hidden;
  1410. color: $text-color;
  1411. background-color: #ffffff;
  1412. }
  1413. }
  1414. }
  1415. .bottom-ri {
  1416. width: 450rpx;
  1417. height: 100%;
  1418. float: right;
  1419. display: flex;
  1420. box-sizing: border-box;
  1421. padding: 13rpx 20rpx 13rpx 0;
  1422. .btn {
  1423. flex: 1;
  1424. width: 200rpx;
  1425. line-height: 80rpx;
  1426. text-align: center;
  1427. font-size: $font-size-24;
  1428. color: #ffffff;
  1429. }
  1430. .btn-cart {
  1431. background-color: #ffe6dc;
  1432. color: $color-system;
  1433. border-radius: 42rpx 0 0 42rpx;
  1434. }
  1435. .btn-cart.disabled {
  1436. background-color: #e1e1e1;
  1437. color: #ffffff;
  1438. }
  1439. .btn-bay {
  1440. background: linear-gradient(to right, #f28f31 0%, #e15616 100%);
  1441. border-radius: 0 42rpx 42rpx 0;
  1442. }
  1443. .btn-bay.disabled {
  1444. background: linear-gradient(
  1445. 135deg,
  1446. rgba(242, 143, 49, 0.5) 0%,
  1447. rgba(225, 86, 22, 0.5) 100%
  1448. );
  1449. }
  1450. }
  1451. }
  1452. .uni-badge--small {
  1453. -webkit-transform: scale(0.8);
  1454. -ms-transform: scale(0.8);
  1455. transform: scale(0.8);
  1456. -webkit-transform-origin: center center;
  1457. -ms-transform-origin: center center;
  1458. transform-origin: center center;
  1459. }
  1460. .uni-badge {
  1461. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  1462. -webkit-box-sizing: border-box;
  1463. box-sizing: border-box;
  1464. font-size: 12px;
  1465. line-height: 1;
  1466. display: inline-block;
  1467. padding: 3px 6px;
  1468. color: #333;
  1469. border-radius: 100px;
  1470. background-color: #f1f1f1;
  1471. }
  1472. .uni-badge-error {
  1473. color: #fff;
  1474. background-color: #dd524d;
  1475. }
  1476. .product-topnav {
  1477. width: 100%;
  1478. height: 80rpx;
  1479. box-sizing: border-box;
  1480. background: #ffffff;
  1481. z-index: 1000;
  1482. position: fixed;
  1483. opacity: 1;
  1484. left: 0;
  1485. top: 0;
  1486. &.fixed {
  1487. animation: showFixedColor 0.1s ease-in-out both;
  1488. }
  1489. &.none {
  1490. animation: hideFixedColor 0.1s ease-in-out both;
  1491. }
  1492. .navbar {
  1493. width: 100%;
  1494. height: 60rpx;
  1495. box-sizing: border-box;
  1496. padding: 0 24rpx;
  1497. display: flex;
  1498. .nav-item {
  1499. display: flex;
  1500. flex: 1;
  1501. justify-content: center;
  1502. align-items: center;
  1503. height: 60rpx;
  1504. font-size: $font-size-28;
  1505. color: $text-color;
  1506. position: relative;
  1507. float: left;
  1508. position: relative;
  1509. .line {
  1510. width: 60rpx;
  1511. height: 2px;
  1512. border-radius: 1px;
  1513. background: #ffffff;
  1514. position: absolute;
  1515. bottom: 0;
  1516. left: 50%;
  1517. margin-left: -30rpx;
  1518. }
  1519. &.current {
  1520. color: $color-system;
  1521. .line {
  1522. background: $color-system;
  1523. }
  1524. }
  1525. }
  1526. }
  1527. .search-input {
  1528. width: 100%;
  1529. height: 114rpx;
  1530. padding: 24rpx;
  1531. box-sizing: border-box;
  1532. .gosearch-btn {
  1533. width: 100%;
  1534. height: 100%;
  1535. border-radius: 40rpx;
  1536. margin: 0 auto;
  1537. font-size: 26rpx;
  1538. line-height: 66rpx;
  1539. color: #b2b2b2;
  1540. position: relative;
  1541. box-sizing: border-box;
  1542. padding-left: 66rpx;
  1543. &.fixed {
  1544. background: rgba(70, 70, 70, 0.1);
  1545. }
  1546. &.none {
  1547. background: rgba(70, 70, 70, 0.1);
  1548. }
  1549. .search-icon {
  1550. width: 66rpx;
  1551. height: 66rpx;
  1552. position: absolute;
  1553. left: 0;
  1554. top: 2rpx;
  1555. text-align: center;
  1556. line-height: 66rpx;
  1557. .icon-sousuo {
  1558. margin: 0 6rpx;
  1559. font-size: $font-size-34;
  1560. color: #b2b2b2;
  1561. z-index: 10;
  1562. }
  1563. }
  1564. .search-text {
  1565. font-size: $font-size-24;
  1566. line-height: 66rpx;
  1567. color: #b2b2b2;
  1568. }
  1569. }
  1570. }
  1571. }
  1572. @keyframes showFixedColor {
  1573. 0% {
  1574. background: rgba(255, 255, 255, 0);
  1575. }
  1576. 50% {
  1577. background: rgba(255, 255, 255, 0.5);
  1578. }
  1579. 100% {
  1580. background: rgba(255, 255, 255, 1);
  1581. }
  1582. }
  1583. @keyframes hideFixedColor {
  1584. 0% {
  1585. background: rgba(255, 255, 255, 1);
  1586. }
  1587. 50% {
  1588. background: rgba(255, 255, 255, 0.5);
  1589. }
  1590. 100% {
  1591. background: rgba(255, 255, 255, 0);
  1592. }
  1593. }
  1594. /* 加入购物模态层*/
  1595. @keyframes showPopup {
  1596. 0% {
  1597. opacity: 0;
  1598. }
  1599. 100% {
  1600. opacity: 1;
  1601. }
  1602. }
  1603. @keyframes hidePopup {
  1604. 0% {
  1605. opacity: 1;
  1606. }
  1607. 100% {
  1608. opacity: 0;
  1609. }
  1610. }
  1611. @keyframes showLayer {
  1612. 0% {
  1613. transform: translateY(0);
  1614. }
  1615. 100% {
  1616. transform: translateY(-100%);
  1617. }
  1618. }
  1619. @keyframes hideLayer {
  1620. 0% {
  1621. transform: translateY(-100%);
  1622. }
  1623. 100% {
  1624. transform: translateY(0);
  1625. }
  1626. }
  1627. @keyframes showAmnation {
  1628. 0% {
  1629. top: -12rpx;
  1630. opacity: 0;
  1631. }
  1632. 50% {
  1633. top: -60rpx;
  1634. opacity: 1;
  1635. }
  1636. 100% {
  1637. top: -100rpx;
  1638. opacity: 0;
  1639. }
  1640. }
  1641. @keyframes hideAmnation {
  1642. 0% {
  1643. top: -100rpx;
  1644. opacity: 0;
  1645. }
  1646. 100% {
  1647. top: -12rpx;
  1648. opacity: 0;
  1649. }
  1650. }
  1651. .popup {
  1652. position: fixed;
  1653. top: 0;
  1654. width: 100%;
  1655. height: 100%;
  1656. z-index: 999;
  1657. display: none;
  1658. .mask {
  1659. position: fixed;
  1660. top: 0;
  1661. width: 100%;
  1662. height: 100%;
  1663. z-index: 21;
  1664. background-color: rgba(0, 0, 0, 0.6);
  1665. }
  1666. .layer {
  1667. position: fixed;
  1668. z-index: 22;
  1669. bottom: -294rpx;
  1670. width: 702rpx;
  1671. padding: 24rpx 24rpx 36rpx 24rpx;
  1672. height: 260rpx;
  1673. border-radius: 20rpx 20rpx 0 0;
  1674. background-color: #fff;
  1675. display: flex;
  1676. flex-wrap: wrap;
  1677. align-content: space-between;
  1678. .content {
  1679. width: 100%;
  1680. }
  1681. .btn {
  1682. width: 100%;
  1683. height: 88rpx;
  1684. margin-top: 20rpx;
  1685. .button {
  1686. width: 100%;
  1687. height: 88rpx;
  1688. color: #fff;
  1689. display: flex;
  1690. align-items: center;
  1691. justify-content: center;
  1692. background: $btn-confirm;
  1693. font-size: $font-size-28;
  1694. border-radius: 44rpx;
  1695. }
  1696. }
  1697. }
  1698. &.show {
  1699. display: block;
  1700. .mask {
  1701. animation: showPopup 0.2s linear both;
  1702. }
  1703. .layer {
  1704. animation: showLayer 0.2s linear both;
  1705. }
  1706. }
  1707. &.hide {
  1708. display: block;
  1709. .mask {
  1710. animation: hidePopup 0.2s linear both;
  1711. }
  1712. .layer {
  1713. animation: hideLayer 0.2s linear both;
  1714. }
  1715. }
  1716. &.none {
  1717. display: none;
  1718. }
  1719. &.service {
  1720. .row {
  1721. margin: 30upx 0;
  1722. .title {
  1723. font-size: 30upx;
  1724. margin: 10upx 0;
  1725. }
  1726. .description {
  1727. font-size: 28upx;
  1728. color: #999;
  1729. }
  1730. }
  1731. }
  1732. .layer-smimg {
  1733. width: 114rpx;
  1734. height: 114rpx;
  1735. float: left;
  1736. border-radius: 10rpx;
  1737. margin-right: 24rpx;
  1738. image {
  1739. width: 114rpx;
  1740. height: 114rpx;
  1741. border-radius: 10rpx;
  1742. }
  1743. }
  1744. .layer-nunbox {
  1745. justify-content: space-between;
  1746. align-items: center;
  1747. width: 536rpx;
  1748. height: auto;
  1749. float: left;
  1750. .layer-nunbox-t {
  1751. width: 100%;
  1752. height: 44rpx;
  1753. position: relative;
  1754. display: flex;
  1755. margin-bottom: 10rpx;
  1756. .text {
  1757. font-size: $font-size-24;
  1758. line-height: 48rpx;
  1759. color: #999999;
  1760. }
  1761. .layer-nunbox-text {
  1762. line-height: 44rpx;
  1763. font-size: $font-size-28;
  1764. }
  1765. .number-box {
  1766. display: flex;
  1767. justify-content: center;
  1768. align-items: center;
  1769. border: 2rpx solid #ffe6dc;
  1770. border-radius: 30rpx;
  1771. height: 48rpx;
  1772. margin-left: 20rpx;
  1773. .iconfont {
  1774. font-size: $font-size-24;
  1775. padding: 0 18rpx;
  1776. color: #999999;
  1777. text-align: center;
  1778. line-height: 48rpx;
  1779. font-weight: bold;
  1780. background: #fef6f3;
  1781. &.icon-jianhao {
  1782. border-radius: 30rpx 0 0 30rpx;
  1783. }
  1784. &.icon-jiahao {
  1785. border-radius: 0 30rpx 30rpx 0;
  1786. }
  1787. }
  1788. .btn-input {
  1789. width: 62rpx;
  1790. height: 48rpx;
  1791. line-height: 48rpx;
  1792. background: #ffffff;
  1793. border-radius: 4rpx;
  1794. text-align: center;
  1795. font-size: $font-size-28;
  1796. }
  1797. }
  1798. .product-step {
  1799. position: absolute;
  1800. left: 45rpx;
  1801. bottom: 0;
  1802. height: 44rpx;
  1803. background: #ffffff;
  1804. }
  1805. }
  1806. .layer-nunbox-b {
  1807. width: 100%;
  1808. height: 44rpx;
  1809. margin-top: 13rpx;
  1810. }
  1811. .text {
  1812. line-height: 44rpx;
  1813. font-size: $font-size-28;
  1814. .p {
  1815. color: #ff2a2a;
  1816. }
  1817. .p:first-child {
  1818. margin-left: 30rpx;
  1819. }
  1820. .p.sm {
  1821. font-size: $font-size-24;
  1822. }
  1823. }
  1824. }
  1825. }
  1826. .tui-popup-box {
  1827. position: relative;
  1828. box-sizing: border-box;
  1829. min-height: 220rpx;
  1830. padding: 0rpx 24rpx 0 24rpx;
  1831. .title {
  1832. font-size: $font-size-34;
  1833. color: $text-color;
  1834. line-height: 88rpx;
  1835. text-align: center;
  1836. float: left;
  1837. width: 100%;
  1838. height: 88rpx;
  1839. }
  1840. .tui-popup-main {
  1841. width: 100%;
  1842. float: left;
  1843. .tui-popup-scroll {
  1844. width: 100%;
  1845. height: 500rpx;
  1846. .content-tr {
  1847. width: 100%;
  1848. min-height: 58rpx;
  1849. line-height: 58rpx;
  1850. display: flex;
  1851. .content-td {
  1852. display: flex;
  1853. flex: 3;
  1854. font-size: $font-size-26;
  1855. color: #999999;
  1856. line-height: 58rpx;
  1857. text-align: left;
  1858. }
  1859. .content-th {
  1860. display: flex;
  1861. flex: 7;
  1862. font-size: $font-size-26;
  1863. color: #333333;
  1864. line-height: 58rpx;
  1865. text-align: left;
  1866. padding-left: 10rpx;
  1867. }
  1868. }
  1869. }
  1870. }
  1871. }
  1872. .tui-popup-btn {
  1873. width: 100%;
  1874. height: auto;
  1875. float: left;
  1876. margin-top: 24rpx;
  1877. .tui-button {
  1878. width: 100%;
  1879. height: 88rpx;
  1880. background: $btn-confirm;
  1881. line-height: 88rpx;
  1882. text-align: center;
  1883. color: #ffffff;
  1884. font-size: $font-size-28;
  1885. border-radius: 44rpx;
  1886. }
  1887. }
  1888. /*富文本样式*/
  1889. rich-text.p {
  1890. width: 702rpx !important;
  1891. padding: 0 24rpx;
  1892. text-align: justify;
  1893. }
  1894. rich-text.img {
  1895. width: 100%;
  1896. height: auto;
  1897. }
  1898. </style>