product.vue 44 KB

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