product.vue 42 KB

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