product.vue 42 KB

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