detail.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612
  1. <template>
  2. <view class="container">
  3. <view class="carousel">
  4. <swiper indicator-active-color="#2AAC34" indicator-dots circular=true duration="400">
  5. <swiper-item class="swiper-item" v-for="(item,index) in goods.sliderImage" :key="index">
  6. <view class="image-wrapper">
  7. <image :src="item.url" class="loaded" mode="aspectFit"></image>
  8. </view>
  9. </swiper-item>
  10. </swiper>
  11. </view>
  12. <view class="seckill-section" v-if="seckill.show && !options.isIntegral">
  13. <view class="left">
  14. <view class="price">
  15. <view>
  16. <text>¥</text>
  17. <text style="font-size: 46rpx;line-height: 44rpx;">{{seckill.price.split('.')[0]}}</text>
  18. <text>.{{seckill.price.split('.')[1]}}</text>
  19. </view>
  20. <view class="orign-price">
  21. ¥{{seckill.otPrice}}
  22. </view>
  23. </view>
  24. <view class="sold">
  25. <text>已抢{{seckill.sales}}件</text>
  26. <view class="tag">
  27. 限时秒杀
  28. </view>
  29. </view>
  30. </view>
  31. <view class="right">
  32. <text style="color:#eb0909;text-align:center;padding-bottom:6px;">距结束还剩:</text>
  33. <view>
  34. <text>{{seckill.hour<10?('0'+seckill.hour):seckill.hour}}</text>
  35. <text>:</text>
  36. <text>{{seckill.minute<10?('0'+seckill.minute):seckill.minute}}</text>
  37. <text>:</text>
  38. <text>{{seckill.second<10?('0'+seckill.second):seckill.second}}</text>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="introduce-section">
  43. <view>
  44. <text class="text-2-cut "
  45. style="font-size: 36rpx;font-weight: bold; line-height: 50rpx;color: #333333;display: inline-block;">{{goods.storeName}}
  46. </text>
  47. <text style="float: right;color:red" v-if="goods.kxStockVo.stock<=10">
  48. 仅剩{{goods.kxStockVo.stock}}{{goods.unitName}}
  49. </text>
  50. </view>
  51. <view class="flex align-start justify-between padding-top-sm">
  52. <view class="text-cut" style="width: 580rpx;font-size: 28rpx;line-height: 40rpx;color: #8D8E99;">
  53. {{goods.storeInfo}}
  54. </view>
  55. <view class="flex">
  56. <view @click="toFavorite" style="text-align: center;">
  57. <image :src="goods.collect?'../../static/product/collect-active.png':'../../static/product/collect.png'"
  58. mode="aspectFit" style="width: 42rpx;height: 42rpx;"></image>
  59. <view style="font-size: 20rpx;line-height: 28rpx;padding-top: 10rpx;">收藏</view>
  60. </view>
  61. <view @click="shareShow = 1" style="text-align: center;padding-left: 40rpx;padding-right: 6rpx;">
  62. <image src="../../static/product/share.png" mode="aspectFit" style="width: 42rpx;height: 42rpx;"></image>
  63. <view style="font-size: 20rpx;line-height: 28rpx;padding-top: 10rpx;">分享</view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="flex align-center justify-between ">
  68. <view class="" v-if="!options.isIntegral">
  69. <view class="flex align-center">
  70. <view v-if="!options.isIntegral" class="text-green"
  71. style="font-size: 40rpx;line-height: 56rpx;font-weight: 600;">
  72. ¥{{goods.kxStockVo.price}}
  73. </view>
  74. <view v-if="options.isIntegral" class="text-red"
  75. style="font-size: 40rpx;line-height: 56rpx;font-weight: 600;">
  76. {{goods.integral}}积分
  77. </view>
  78. <view class="bg-gradual-orange margin-left-sm" v-if="zhekou >= 0 && zhekou < 10.0"
  79. style="border-radius: 4rpx;padding: 0 8rpx;line-height: 34rpx;font-size: 24rpx;">
  80. {{zhekou}}折
  81. </view>
  82. <view v-if="!(seckill.show || options.isIntegral || goods.groupShop)">
  83. <text class="vip-money" v-if="goods.kxStockVo.vipPrice && goods.kxStockVo.vipPrice > 0">¥{{ goods.kxStockVo.vipPrice || goods.kxStockVo.vipPrice }}</text>
  84. <image src="../../static/user/V.png" class="image" v-if="goods.kxStockVo.vipPrice && goods.kxStockVo.vipPrice > 0" />
  85. </view>
  86. </view>
  87. <view style="font-size: 28rpx;color: #8D8E99;line-height: 40rpx;text-decoration: line-through;padding: 10rpx;"
  88. v-if="zhekou >= 0 && zhekou < 10.0">
  89. ¥{{goods.otPrice}}/{{goods.unitName}}
  90. </view>
  91. </view>
  92. <view class="" v-if="options.isIntegral">
  93. <view class="flex align-center">
  94. <view class="text-red" style="font-size: 40rpx;line-height: 56rpx;font-weight: 600;">
  95. {{goods.integral}}积分
  96. </view>
  97. </view>
  98. </view>
  99. <view style="font-size: 28rpx;color: #8D8E99;line-height: 40rpx;">
  100. {{goods.kxStockVo.sales}}人购买
  101. </view>
  102. </view>
  103. </view>
  104. <!-- 团购分享 -->
  105. <button v-if="goods.groupShop" class="share-section" open-type="share">
  106. <view class="share-icon">
  107. <text class="yticon icon-xingxing"></text>
  108. </view>
  109. <text class="tit">{{goods.groupShop.minimumNumber}}人成团,已有{{goods.groupShop.alreadyBuyNumber}}人参团</text>
  110. <text class="yticon icon-bangzhu1"></text>
  111. <view class="share-btn">
  112. 告诉TA
  113. <text class="yticon icon-you"></text>
  114. </view>
  115. </button>
  116. <view v-if="goods.skuList && goods.skuList.length>1 && !options.isIntegral" class="c-list"
  117. style="padding: 0 34rpx 0 30rpx;">
  118. <view style="justify-content: space-between;" class="c-row b-b" @click="toggleSpec">
  119. <view class="flex align-center">
  120. <view class="tit">购买类型</view>
  121. <view style="font-size: 28rpx;line-height: 40rpx;color: #FE9F43;">
  122. {{selectedSku.storeName?selectedSku.storeName:'请选择'}}
  123. </view>
  124. </view>
  125. <text class="yticon icon-you"></text>
  126. </view>
  127. <view v-if="couponList.length > 0" @click="toggleMask('show')" class="c-row b-b">
  128. <text class="tit">优惠券</text>
  129. <text class="con t-r" style="font-size: 28rpx;line-height: 40rpx;color: #FE9F43;">领取优惠券</text>
  130. <text class="yticon icon-you"></text>
  131. </view>
  132. <view class="c-row b-b" style="align-items: flex-start;">
  133. <text class="tit">配送费用</text>
  134. <view
  135. v-if="goods.freightTemplate && goods.freightTemplate.freightTemplateDO.defaultFreePrice == 0 && !goods.freightTemplate.freightTemplateDO.defaultFirstMoney"
  136. class="con-list">
  137. 全场免配送费
  138. </view>
  139. <view
  140. v-if="goods.freightTemplate && goods.freightTemplate.freightTemplateDO.defaultFreePrice == 0 && goods.freightTemplate.freightTemplateDO.defaultFirstMoney"
  141. class="con-list">
  142. 单笔购买满¥{{goods.freightTemplate.freightTemplateDO.defaultFirstMoney }}元,全场免配送费
  143. </view>
  144. <view v-else class="con-list">
  145. <text>单笔购买满¥{{goods.freightTemplate.freightTemplateDO.defaultFirstMoney }}元起送,配送费{{goods.freightTemplate.freightTemplateDO.defaultFreePrice }}元</text>
  146. <text
  147. v-if="goods.freightTemplate.freightTemplateDO.defaultContinueMoney > 0">{{goods.freightTemplate.freightTemplateDO.defaultFirstNum }}公里以外,每1公里,增加配送费¥{{goods.freightTemplate.freightTemplateDO.defaultContinueMoney }}元</text>
  148. </view>
  149. </view>
  150. <!-- <view class="c-row b-b">
  151. <text class="tit">规格</text>
  152. <text class="con t-r ">{{goods.unit}}</text>
  153. </view> -->
  154. <view v-for="(item, index) in goods.attributeList" :key="index" class="c-row b-b">
  155. <text class="tit">{{item.attribute}}</text>
  156. <view class="bz-list con">
  157. <text>{{item.value}}</text>
  158. </view>
  159. </view>
  160. </view>
  161. <!-- 评价 -->
  162. <view v-if="goods.appraisePage && goods.appraisePage.rows.length > 0" class="eva-section">
  163. <view class="e-header">
  164. <text class="tit">评价</text>
  165. <text>({{goods.appraisePage.rows.length}})</text>
  166. <text @click="navAllAppraise" class="tip">全部评论</text>
  167. <text class="yticon icon-you"></text>
  168. </view>
  169. <view class="eva-box">
  170. <image class="portrait"
  171. :src="goods.appraisePage.rows[0].userAvatar ? goods.appraisePage.rows[0].userAvatar : '/static/user/touxiang-@2x.png'"
  172. mode="aspectFill"></image>
  173. <view class="right">
  174. <text
  175. class="name">{{goods.appraisePage.rows[0].userNickName?goods.appraisePage.rows[0].userNickName:('用户' + goods.appraisePage.rows[0].userId)}}</text>
  176. <text class="con">{{goods.appraisePage.rows[0].content}}</text>
  177. <view class="bot">
  178. <text class="attr">购买类型:{{goods.appraisePage.rows[0].productName}}</text>
  179. <text class="time">{{goods.appraisePage.rows[0].createTime}}</text>
  180. </view>
  181. </view>
  182. </view>
  183. </view>
  184. <view class="detail-desc padding-lr">
  185. <!-- <view class="d-header">
  186. <text>图文详情</text>
  187. </view> -->
  188. <view class="text-black padding-tb-lg " style="line-height: 50rpx;font-size: 36rpx;font-weight: bold;">
  189. 商品详情
  190. </view>
  191. <rich-text style="font-size: 28rpx;" :nodes="detail"></rich-text>
  192. </view>
  193. <view class="bg-white flex align-end"
  194. style="position: fixed;bottom: 0;width: 750rpx;height: 98rpx;padding-left: 38rpx;">
  195. <view @click="navCart" class="flex align-end" style="width: 346rpx;height: 98rpx;padding-bottom: 16rpx;">
  196. <view style="position: relative;">
  197. <image src="../../static/tab-icon/tab3_2.png" mode="aspectFit" style="width: 56rpx;height: 52rpx;"></image>
  198. <view v-if="cartNum" class="badge round">{{cartNum}}</view>
  199. </view>
  200. <view style="font-size: 28rpx;line-height: 40rpx;color: #8D8E99;padding-left: 40rpx;">
  201. 已选{{cartNum}}件
  202. </view>
  203. </view>
  204. <!-- <button type="primary" class=" action-btn no-border buy-now-btn" @click="buy">{{ goods.groupShop ? '立即参团' : '立即购买'}}</button>-->
  205. <view @click="buy" style="font-size: 28rpx;line-height: 40rpx;width: 404rpx;height: 98rpx;"
  206. class="flex align-center justify-center bg-blue ">
  207. {{ goods.groupShop ? '立即参团' : '立即购买'}}
  208. </view>
  209. <view @click="addCart" style="font-size: 28rpx;line-height: 40rpx;width: 404rpx;height: 98rpx;"
  210. class="flex align-center justify-center bg-green ">
  211. 加入购物车
  212. </view>
  213. </view>
  214. <view class="mask" :class="maskState===0 ? 'none' : maskState===1 ? 'show' : ''" @click="toggleMask">
  215. <view class="mask-content" @click.stop.prevent="stopPrevent">
  216. <view @click="obtainCoupon(index)" class="coupon-item" v-for="(item,index) in couponList" :key="index">
  217. <view class="con">
  218. <view class="left">
  219. <text class="title">{{item.title}}</text>
  220. <text v-if="item.endTime" class="time">在{{item.endTime}}前有效。
  221. 可领{{item.isPermanent?'不限制':'1'}}张,已领{{item.nowCount}}张</text>
  222. <text v-if="!item.endTime"
  223. class="time">在领取后{{item.couponTime}}天内有效。可领{{item.isPermanent?'不限制':'1'}}张,已领{{item.nowCount}}张</text>
  224. </view>
  225. <view class="right">
  226. <text class="price">{{item.couponPrice}}</text>
  227. <text>满{{item.useMinPrice }}可用</text>
  228. </view>
  229. <view class="circle l"></view>
  230. <view class="circle r"></view>
  231. </view>
  232. <text class="tips">{{item.categoryTitle?'限' + item.categoryTitle + '可用': '全品类可用'}}</text>
  233. </view>
  234. </view>
  235. </view>
  236. <!-- 分享弹窗 -->
  237. <!-- #ifdef MP-WEIXIN -->
  238. <view class="mask" :class="shareShow===0 ? 'none' : shareShow===1 ? 'show' : ''" @click="toggleMask1">
  239. <view class="mask-content bg-white" style="z-index: 999999;" @click.stop.prevent="stopPrevent">
  240. <view class="flex align-center justify-center" style="padding: 60rpx 0 50rpx 0;">
  241. <image src="../../static/line.png" mode="aspectFit" style="width: 100rpx;height: 2rpx;"></image>
  242. <view style="padding: 0 12rpx 0 16rpx;font-size: 30rpx;line-height: 42rpx;color: #333333;">分享至</view>
  243. <image src="../../static/line.png" mode="aspectFit" style="width: 100rpx;height: 2rpx;"></image>
  244. </view>
  245. <view class="solid-bottom flex flex-wrap" style="padding: 0 0 50rpx 40rpx;margin: 0 44rpx 0 42rpx;">
  246. <view @click="share('miniwechat')" style="text-align: center;">
  247. <button open-type="share" class="round" style="width: 88rpx;height: 88rpx;padding: 0;">
  248. <image class="round" src="../../static/login/weixindefuben@3x.png" mode="aspectFit"
  249. style="width: 88rpx;height: 88rpx;"></image>
  250. </button>
  251. <view style="font-size: 24rpx;line-height: 34rpx;color: #999999;padding-top: 26rpx;">微信</view>
  252. </view>
  253. </view>
  254. <view @click="toggleMask1" class="flex justify-center align-center"
  255. style="padding: 34rpx 0 24rpx;font-size: 30rpx;line-height: 42rpx;color: #333333;">
  256. 取消
  257. </view>
  258. </view>
  259. </view>
  260. <!-- #endif -->
  261. <!-- #ifdef H5 -->
  262. <view class="maskH5" :class="shareShow===0 ? 'none' : shareShow===1 ? 'show' : ''" @click="toggleMask1">
  263. <image style="float: right;" src="../../static/login/share.png"></image>
  264. </view>
  265. <!-- #endif -->
  266. <!-- 规格-模态层弹窗 -->
  267. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent">
  268. <!-- 遮罩层 -->
  269. <view class="mask"></view>
  270. <view class="layer attr-content" @click.stop="stopPrevent">
  271. <view class="a-t">
  272. <image v-if="selectedSku.image" :src="JSON.parse(selectedSku.image)[0].url"></image>
  273. <view class="right">
  274. <text class="price">¥{{ selectedSku.price }}</text>
  275. <text class="stock">库存:{{selectedSku.stock}}件</text>
  276. <view class="selected">
  277. 已选:
  278. <text>
  279. {{selectedSku.storeName}}
  280. </text>
  281. </view>
  282. </view>
  283. </view>
  284. <view class="attr-list">
  285. <!-- <text>规格</text> -->
  286. <view class="item-list">
  287. <text v-for="(skuItem, skuIndex) in goods.skuList" :key="skuIndex" class="tit"
  288. :class="{selected: skuIndex === selectedSkuIndex}" @click="selectSpec(skuItem, skuIndex)">
  289. {{skuItem.storeName}}
  290. </text>
  291. </view>
  292. </view>
  293. <button class="btn" @click="toggleSpec">完成</button>
  294. </view>
  295. </view>
  296. </view>
  297. </template>
  298. <script>
  299. import uParse from '@/components/u-parse/u-parse.vue';
  300. import {
  301. mapState
  302. } from 'vuex'
  303. import {
  304. getRestTime
  305. } from '../../util/index.js'
  306. export default {
  307. components: {
  308. uParse
  309. },
  310. data() {
  311. return {
  312. goods: {
  313. freightTemplate: {
  314. freightTemplateDO: {}
  315. },
  316. skuList: [],
  317. categoryList: [],
  318. appraisePage: undefined,
  319. kxStockVo: {
  320. price: 1,
  321. sales: 1,
  322. vipPrice: 0
  323. },
  324. sliderImage: [],
  325. attributeList: [],
  326. description: ''
  327. },
  328. isVip: false,
  329. specClass: 'none',
  330. specSelected: [],
  331. selectedSku: {},
  332. selectedSkuIndex: -1,
  333. toggleCallback: undefined,
  334. maskState: 0, //优惠券面板显示状态
  335. couponList: [],
  336. submiting: false,
  337. cartNum: 0,
  338. shareShow: 0,
  339. zhekou: -1,
  340. detail: '',
  341. options: '',
  342. defalutPrice: 0,
  343. seckill: {
  344. id: 0,
  345. show: false,
  346. price: '0.00',
  347. otPrice: '0.00',
  348. sales: 0,
  349. hour: 0,
  350. minute: 0,
  351. second: 0
  352. }
  353. };
  354. },
  355. onShow() {
  356. this.isVip = this.$api.isVip()
  357. },
  358. computed: {
  359. ...mapState(['storageId'])
  360. },
  361. async onLoad(options) {
  362. const that = this
  363. that.options = options
  364. uni.showLoading({
  365. title: '正在加载'
  366. })
  367. await that.$api.request('get', 'product/app/getGoodsByStorage', {
  368. productId: options.id,
  369. groupShopId: options.gid ? options.gid : '',
  370. storageId: options.storageId ? options.storageId : this.storageId
  371. }, failres => {
  372. that.$api.msg(failres.msg)
  373. uni.hideLoading()
  374. }).then(res => {
  375. this.constituentContent(res)
  376. uni.hideLoading()
  377. })
  378. //3.5接口改造中 暂时屏蔽
  379. // that.$api.request('coupon', 'getObtainableCoupon').then(res => {
  380. // that.couponList = res.data
  381. // })
  382. this.countCart()
  383. //this.getSeckillByStorage(options)
  384. },
  385. onShareAppMessage() {
  386. return {
  387. title: (this.goods.groupShop ? '立即拼团-' : '好货分享-') + this.goods.storeName,
  388. imageUrl: this.goods.img,
  389. path: '/pages/product/detail?id=' + this.goods.id + (this.goods.groupShop ? '&gid=' + this.goods.groupShop.id :
  390. '') + '&storageId=' + this.$store.state.storageId
  391. }
  392. },
  393. methods: {
  394. constituentContent(res) {
  395. var that = this
  396. that.goods = res.data;
  397. that.goods.sliderImage = JSON.parse(res.data.sliderImage);
  398. that.defalutPrice = that.goods.kxStockVo.price
  399. that.zhekou = ((res.data.kxStockVo.price / res.data.otPrice) * 10).toFixed(1)
  400. that.detail = res.data.description ? res.data.description.replace(/<img/gi,
  401. '<img style="max-width:100%;height:auto;margin:0 auto;display:block"') : res.data.description
  402. // that.zhekou = ((30/90)*10).toFixed(1)
  403. //默认选中多规格的那个
  404. if (that.goods.specType === 1) {
  405. for (let i = 0; i < that.goods.skuList.length; i++) {
  406. if (that.goods.skuList[i].id === this.goods.id) {
  407. that.selectedSku = this.goods.skuList[i]
  408. that.selectedSkuIndex = i
  409. }
  410. }
  411. }
  412. if (that.goods.groupShop) {
  413. //若存在团购信息,将价格更新到团购价格
  414. that.goods.kxStockVo.price = parseFloat(that.goods.groupShop.minPrice)
  415. that.goods.vipPrice = that.goods.groupShop.minPrice
  416. }
  417. if (that.goods.storeSeckill) {
  418. //若存在秒杀信息,将价格更新到秒杀价格
  419. that.goods.kxStockVo.price = parseFloat(that.goods.storeSeckill.price)
  420. that.goods.vipPrice = that.goods.storeSeckill.vipPrice
  421. this.seckill.show = true
  422. const {
  423. price,
  424. otPrice,
  425. sales,
  426. seckillStopTime,
  427. id
  428. } = that.goods.storeSeckill
  429. this.seckill.price = price
  430. this.seckill.otPrice = otPrice
  431. this.seckill.sales = sales
  432. this.seckill.id = id
  433. this.getRestTime(seckillStopTime)
  434. }
  435. },
  436. onLoadMethon(options) {
  437. const that = this
  438. uni.showLoading({
  439. title: '正在加载'
  440. })
  441. that.$api.request('get', 'product/app/getGoodsByStorage', {
  442. productId: options.id,
  443. groupShopId: options.gid ? options.gid : '',
  444. storageId: options.storageId ? options.storageId : this.storageId
  445. }, failres => {
  446. that.$api.msg(failres.msg)
  447. uni.hideLoading()
  448. }).then(res => {
  449. this.constituentContent(res)
  450. uni.hideLoading()
  451. })
  452. //3.5接口改造中 暂时屏蔽
  453. // that.$api.request('coupon', 'getObtainableCoupon').then(res => {
  454. // that.couponList = res.data
  455. // })
  456. this.countCart()
  457. //this.getSeckillByStorage(options)
  458. },
  459. getSeckillByStorage(options) {
  460. this.$api.request('get', 'product/app/getSeckillByStorage', {
  461. productId: options.id,
  462. storageId: options.storageId ? options.storageId : this.storageId
  463. }).then(({
  464. data
  465. }) => {
  466. const {
  467. storeSeckill
  468. } = data
  469. if (storeSeckill) {
  470. this.seckill.show = true
  471. const {
  472. price,
  473. otPrice,
  474. sales,
  475. seckillStopTime,
  476. id
  477. } = storeSeckill
  478. this.seckill.price = price
  479. this.seckill.otPrice = otPrice
  480. this.seckill.sales = sales
  481. this.seckill.id = id
  482. this.getRestTime(seckillStopTime)
  483. }
  484. })
  485. },
  486. getRestTime(time) {
  487. const that = this
  488. const restTime = getRestTime(time)
  489. this.seckill.hour = restTime[0]
  490. this.seckill.minute = restTime[1]
  491. this.seckill.second = restTime[2]
  492. if (this.$_timer) {
  493. clearTimeout(this.$_timer)
  494. this.$_timer = null
  495. }
  496. if (restTime[0] > 0 || restTime[1] > 0 || restTime[2] > 0) {
  497. this.$_timer = setTimeout(() => {
  498. this.getRestTime(time)
  499. }, 1000)
  500. } else {
  501. this.seckill.id = 0
  502. this.seckill.show = false
  503. that.goods.kxStockVo.price = that.defalutPrice
  504. }
  505. },
  506. //统计购物车数量
  507. countCart() {
  508. this.$api.request('get', 'cart/app/countCart', {
  509. storageId: this.$store.state.storageId
  510. }).then(res => {
  511. this.cartNum = res.data
  512. }).catch(err => {
  513. this.$api.msg('请求失败,请稍后再试')
  514. })
  515. },
  516. //切换到购物车页面
  517. navCart() {
  518. uni.switchTab({
  519. url: "../cart/cart"
  520. })
  521. },
  522. //分享{
  523. share(type) {
  524. console.log(type)
  525. if (type == 'miniwechat') {
  526. uni.showShareMenu({
  527. title: (this.goods.groupShop ? '立即拼团-' : '好货分享-') + this.goods.storeName,
  528. imageUrl: this.goods.img,
  529. path: '/pages/product/detail?id=' + this.goods.id + (this.goods.groupShop ? '&gid=' + this.goods
  530. .groupShop.id : '')
  531. })
  532. }
  533. },
  534. toggleMask(type) {
  535. let timer = type === 'show' ? 10 : 300;
  536. let state = type === 'show' ? 1 : 0;
  537. this.maskState = 2;
  538. setTimeout(() => {
  539. this.maskState = state;
  540. }, timer)
  541. },
  542. toggleMask1(type) {
  543. let timer = type === 'show' ? 10 : 300;
  544. let state = type === 'show' ? 1 : 0;
  545. this.shareShow = 2;
  546. setTimeout(() => {
  547. this.shareShow = state;
  548. }, timer)
  549. },
  550. //领取优惠券
  551. obtainCoupon(index) {
  552. const that = this
  553. that.$api.request('get', 'coupon/app/obtainCoupon', {
  554. couponId: that.couponList[index].id
  555. }).then(res => {
  556. that.$api.msg('领取成功')
  557. that.couponList[index].nowCount++
  558. that.toggleMask()
  559. })
  560. },
  561. //规格弹窗开关
  562. toggleSpec(e) {
  563. if (this.specClass === 'show') {
  564. this.specClass = 'hide';
  565. setTimeout(() => {
  566. this.specClass = 'none';
  567. if (this.toggleCallback) {
  568. this.toggleCallback()
  569. this.toggleCallback = undefined
  570. }
  571. }, 150);
  572. //判断出id变了,重新调用接口
  573. if (this.selectedSku.id != this.goods.id) {
  574. this.options.id = this.selectedSku.id
  575. this.onLoadMethon(this.options);
  576. }
  577. } else if (this.specClass === 'none') {
  578. this.specClass = 'show';
  579. if (!this.selectedSku.storeName) {
  580. this.selectedSku = this.goods.skuList[0]
  581. this.selectedSkuIndex = 0
  582. }
  583. }
  584. },
  585. //选择规格
  586. selectSpec(skuItem, skuIndex) {
  587. this.selectedSku = skuItem
  588. this.selectedSkuIndex = skuIndex
  589. },
  590. //加入购物车
  591. addCart(e) {
  592. //不再按规格
  593. const that = this
  594. that.$api.request('get', 'cart/app/addCartItem', {
  595. productId: that.goods.kxStockVo.productId,
  596. // activityId:that.goods.skuDto.activityId,
  597. // couponId:that.goods.skuDto.couponId,
  598. num: 1
  599. }).then(res => {
  600. if (that.goods.groupShop) {
  601. that.$api.msg('从购物车结算不会参加团购')
  602. return;
  603. }
  604. if (that.seckill.id) {
  605. that.$api.msg('从购物车结算不会参加秒杀')
  606. return;
  607. }
  608. if (that.options.isIntegral) {
  609. that.$api.msg('从购物车结算不会参加积分兑换')
  610. return
  611. } else {
  612. that.$api.msg('添加购物车成功')
  613. this.cartNum++
  614. that.$store.commit('addCart', this.cartNum)
  615. uni.setTabBarBadge({
  616. index: 2,
  617. text: this.cartNum + ''
  618. })
  619. }
  620. })
  621. return
  622. if (!that.selectedSku.id) {
  623. that.specClass = 'none'
  624. that.toggleSpec()
  625. that.toggleCallback = that.addCart
  626. } else {
  627. //添加到购车车
  628. that.$api.request('get', 'cart/app/addCartItem', {
  629. productId: that.selectedSku.productId,
  630. num: 1
  631. }).then(res => {
  632. if (that.goods.groupShop) {
  633. that.$api.msg('从购物车结算不会参加团购')
  634. } else {
  635. that.$api.msg('添加购物车成功')
  636. }
  637. })
  638. }
  639. },
  640. //收藏
  641. toFavorite() {
  642. const that = this
  643. if (that.goods.collect) {
  644. //取消收藏
  645. that.goods.collect = false
  646. this.$api.request('post', 'user/userCollect/deleteCollect', {
  647. productId: that.goods.id
  648. }).then(res => {
  649. this.$api.msg('已取消收藏')
  650. })
  651. } else {
  652. //添加收藏
  653. that.goods.collect = true
  654. this.$api.request('post', 'user/userCollect/addCollect', {
  655. productId: that.goods.id
  656. }).then(res => {
  657. this.$api.msg('已收藏')
  658. })
  659. }
  660. },
  661. buy() {
  662. const that = this
  663. // if (!that.selectedSku.id) {
  664. // that.specClass = 'none'
  665. // that.toggleSpec()
  666. // that.toggleCallback = that.buy
  667. // } else {
  668. let skuItem = {
  669. productAttrId: that.goods.kxStockVo.productAttrId,
  670. cartNum: 1,
  671. title: that.goods.title,
  672. otPrice: that.goods.otPrice,
  673. price: that.goods.kxStockVo.price,
  674. vipPrice: that.goods.kxStockVo.vipPrice,
  675. productAttrName: that.goods.storeName,
  676. productImg: that.goods.image,
  677. productAttrImg: that.goods.image,
  678. stock: that.goods.kxStockVo.stock,
  679. productId: that.goods.id,
  680. categoryId: that.goods.cateId,
  681. cateIdList: that.goods.cateIdList,
  682. giveIntegral: that.goods.giveIntegral
  683. }
  684. if (this.$api.isVip()) {
  685. skuItem['price'] = that.goods.kxStockVo.vipPrice
  686. }
  687. if (that.goods.groupShop) {
  688. skuItem['groupShopId'] = that.goods.groupShop.id
  689. skuItem['price'] = that.goods.groupShop.minPrice
  690. }
  691. if (that.seckill.id) {
  692. skuItem['seckillId'] = that.seckill.id
  693. skuItem['price'] = that.seckill.price
  694. }
  695. if (that.options.isIntegral) {
  696. skuItem['isIntegral'] = that.goods.isIntegral
  697. skuItem['integral'] = that.goods.integral
  698. skuItem['price'] = 0
  699. }
  700. let skuList = [1]
  701. skuList[0] = skuItem
  702. that.$api.globalData.productList = skuList
  703. uni.navigateTo({
  704. url: `/pages/order/create?takeway=buy`
  705. })
  706. },
  707. //查看所有评价
  708. navAllAppraise() {
  709. uni.navigateTo({
  710. url: `/pages/product/appraise?productId=${this.goods.id}&firstpage=${JSON.stringify(this.goods.appraisePage)}`
  711. })
  712. },
  713. timeFormat(time) {
  714. var date = new Date(parseInt(time));
  715. var month = date.getMonth() + 1 > 9 ? date.getMonth() + 1 : '0' + parseInt(date.getMonth() + 1)
  716. var day = date.getDate() > 9 ? date.getDate() : '0' + date.getDate()
  717. return date.getFullYear() + '-' + month + '-' + day
  718. },
  719. stopPrevent() {}
  720. },
  721. }
  722. </script>
  723. <style lang='scss' scoped>
  724. .seckill-section {
  725. width: 100%;
  726. height: 138rpx;
  727. display: flex;
  728. .left {
  729. width: 554rpx;
  730. height: 100%;
  731. display: flex;
  732. flex-direction: column;
  733. justify-content: center;
  734. color: #fff;
  735. font-size: 26rpx;
  736. line-height: 26rpx;
  737. background: linear-gradient(-30deg, #ff1f2e, #f52c6c);
  738. flex-shrink: 0;
  739. padding: 0 32rpx;
  740. .price {
  741. display: flex;
  742. align-items: flex-end;
  743. .orign-price {
  744. font-size: 26rpx;
  745. line-height: 26rpx;
  746. padding: 0 20rpx;
  747. box-sizing: border-box;
  748. text-decoration: line-through;
  749. }
  750. }
  751. .sold {
  752. width: 100%;
  753. height: 46rpx;
  754. padding-left: 4rpx;
  755. display: flex;
  756. align-items: flex-end;
  757. justify-content: space-between;
  758. color: hsla(0, 0%, 100%, .8);
  759. font-weight: 400;
  760. font-size: 26rpx;
  761. .tag {
  762. transform: scale(0.94);
  763. padding: 8rpx;
  764. margin: 0px;
  765. font-size: 24rpx;
  766. line-height: 24rpx;
  767. display: flex;
  768. align-items: center;
  769. justify-content: center;
  770. border-radius: 6rpx;
  771. flex-shrink: 0;
  772. position: relative;
  773. color: #fff;
  774. }
  775. .tag::after {
  776. content: " ";
  777. position: absolute;
  778. width: 200%;
  779. height: 200%;
  780. transform: scale(.5) translateZ(0);
  781. transform-origin: 0 0;
  782. box-sizing: border-box;
  783. left: 0;
  784. top: 0;
  785. border-radius: 12rpx;
  786. border: 1px solid #fff
  787. }
  788. }
  789. }
  790. .right {
  791. flex: 1;
  792. background-color: #ffe5e5;
  793. font-size: 24rpx;
  794. display: flex;
  795. flex-direction: column;
  796. align-items: center;
  797. justify-content: center;
  798. }
  799. }
  800. page {
  801. background: $page-color-base;
  802. padding-bottom: 160upx;
  803. }
  804. .badge {
  805. background-color: #FF473C;
  806. width: 32rpx;
  807. height: 32rpx;
  808. color: #fff;
  809. font-size: 22rpx;
  810. line-height: 32rpx;
  811. text-align: center;
  812. position: absolute;
  813. left: 42rpx;
  814. bottom: 32rpx;
  815. }
  816. .bg-gradual-orange {
  817. background-image: linear-gradient(180deg, #FE9F43, #FC6620);
  818. color: #fff;
  819. }
  820. .icon-you {
  821. font-size: $font-base + 2upx;
  822. color: #888;
  823. }
  824. .carousel {
  825. height: 414rpx;
  826. position: relative;
  827. swiper {
  828. height: 100%;
  829. }
  830. .image-wrapper {
  831. width: 100%;
  832. height: 100%;
  833. }
  834. .swiper-item {
  835. display: flex;
  836. justify-content: center;
  837. align-content: center;
  838. height: 750upx;
  839. overflow: hidden;
  840. image {
  841. width: 100%;
  842. height: 100%;
  843. }
  844. }
  845. }
  846. /* 标题简介 */
  847. .introduce-section {
  848. background: #fff;
  849. padding: 32rpx 34rpx 0 30rpx;
  850. .title {
  851. font-size: 32upx;
  852. color: $font-color-dark;
  853. height: 50upx;
  854. line-height: 50upx;
  855. }
  856. .price-box {
  857. display: flex;
  858. align-items: baseline;
  859. height: 64upx;
  860. padding: 10upx 0;
  861. font-size: 26upx;
  862. color: $uni-color-primary;
  863. }
  864. .price {
  865. font-size: $font-lg + 2upx;
  866. }
  867. .m-price {
  868. margin: 0 12upx;
  869. color: $font-color-light;
  870. text-decoration: line-through;
  871. }
  872. .coupon-tip {
  873. align-items: center;
  874. padding: 4upx 10upx;
  875. background: $uni-color-primary;
  876. font-size: $font-sm;
  877. color: #fff;
  878. border-radius: 6upx;
  879. line-height: 1;
  880. transform: translateY(-4upx);
  881. }
  882. .bot-row {
  883. display: flex;
  884. align-items: center;
  885. height: 50upx;
  886. font-size: $font-sm;
  887. color: $font-color-light;
  888. text {
  889. flex: 1;
  890. }
  891. }
  892. }
  893. /* 分享 */
  894. .share-section {
  895. display: flex;
  896. align-items: center;
  897. color: $font-color-base;
  898. background: linear-gradient(left, #fdf5f6, #fbebf6);
  899. padding: 12upx 30upx;
  900. .share-icon {
  901. display: flex;
  902. align-items: center;
  903. width: 70upx;
  904. height: 30upx;
  905. line-height: 1;
  906. border: 1px solid $uni-color-primary;
  907. border-radius: 4upx;
  908. position: relative;
  909. overflow: hidden;
  910. font-size: 22upx;
  911. color: $uni-color-primary;
  912. &:after {
  913. content: '';
  914. width: 50upx;
  915. height: 50upx;
  916. border-radius: 50%;
  917. left: -20upx;
  918. top: -12upx;
  919. position: absolute;
  920. background: $uni-color-primary;
  921. }
  922. }
  923. .icon-xingxing {
  924. position: relative;
  925. z-index: 1;
  926. font-size: 24upx;
  927. margin-left: 2upx;
  928. margin-right: 10upx;
  929. color: #fff;
  930. line-height: 1;
  931. }
  932. .tit {
  933. font-size: 28rpx;
  934. line-height: 40rpx;
  935. /* margin-left: 10upx; */
  936. color: #8D8E99;
  937. font-weight: bold;
  938. }
  939. .icon-bangzhu1 {
  940. padding: 10upx;
  941. font-size: 30upx;
  942. line-height: 1;
  943. }
  944. .share-btn {
  945. flex: 1;
  946. text-align: right;
  947. font-size: $font-sm;
  948. color: $uni-color-primary;
  949. }
  950. .icon-you {
  951. font-size: $font-sm;
  952. margin-left: 4upx;
  953. color: $uni-color-primary;
  954. }
  955. }
  956. .c-list {
  957. font-size: $font-sm + 2upx;
  958. color: $font-color-base;
  959. background: #fff;
  960. .c-row {
  961. display: flex;
  962. align-items: center;
  963. padding: 28upx 6rpx 34rpx 8rpx;
  964. position: relative;
  965. }
  966. .tit {
  967. width: 140upx;
  968. font-size: 28rpx;
  969. line-height: 40rpx;
  970. /* margin-left: 10upx; */
  971. color: #8D8E99;
  972. font-weight: 550;
  973. }
  974. .con {
  975. flex: 1;
  976. color: $font-color-dark;
  977. .selected-text {
  978. margin-right: 10upx;
  979. }
  980. }
  981. .bz-list {
  982. height: 40upx;
  983. font-size: $font-sm+2upx;
  984. color: $font-color-dark;
  985. text {
  986. display: inline-block;
  987. margin-right: 30upx;
  988. }
  989. }
  990. .con-list {
  991. flex: 1;
  992. display: flex;
  993. flex-direction: column;
  994. color: $font-color-dark;
  995. line-height: 40upx;
  996. }
  997. .red {
  998. color: $uni-color-primary;
  999. }
  1000. }
  1001. /* 评价 */
  1002. .eva-section {
  1003. display: flex;
  1004. flex-direction: column;
  1005. padding: 20upx 30upx;
  1006. background: #fff;
  1007. margin-top: 16upx;
  1008. .e-header {
  1009. display: flex;
  1010. align-items: center;
  1011. height: 70upx;
  1012. font-size: $font-sm + 2upx;
  1013. color: $font-color-light;
  1014. .tit {
  1015. font-size: $font-base + 2upx;
  1016. color: $font-color-dark;
  1017. margin-right: 4upx;
  1018. }
  1019. .tip {
  1020. flex: 1;
  1021. text-align: right;
  1022. }
  1023. .icon-you {
  1024. margin-left: 10upx;
  1025. }
  1026. }
  1027. }
  1028. .eva-box {
  1029. display: flex;
  1030. padding: 20upx 0;
  1031. .portrait {
  1032. flex-shrink: 0;
  1033. width: 80upx;
  1034. height: 80upx;
  1035. border-radius: 100px;
  1036. }
  1037. .right {
  1038. flex: 1;
  1039. display: flex;
  1040. flex-direction: column;
  1041. font-size: $font-base;
  1042. color: $font-color-base;
  1043. padding-left: 26upx;
  1044. .con {
  1045. font-size: $font-base;
  1046. color: $font-color-dark;
  1047. padding: 20upx 0;
  1048. }
  1049. .bot {
  1050. display: flex;
  1051. justify-content: space-between;
  1052. font-size: $font-sm;
  1053. color: $font-color-light;
  1054. }
  1055. }
  1056. }
  1057. /* 详情 */
  1058. .detail-desc {
  1059. background: #fff;
  1060. margin-top: 16upx;
  1061. width: 750upx;
  1062. padding-bottom: 80upx;
  1063. .d-header {
  1064. display: flex;
  1065. justify-content: center;
  1066. align-items: center;
  1067. height: 80upx;
  1068. font-size: $font-base + 2upx;
  1069. color: $font-color-dark;
  1070. position: relative;
  1071. text {
  1072. padding: 0 20upx;
  1073. background: #fff;
  1074. position: relative;
  1075. z-index: 1;
  1076. }
  1077. &:after {
  1078. position: absolute;
  1079. left: 50%;
  1080. top: 50%;
  1081. transform: translateX(-50%);
  1082. width: 300upx;
  1083. height: 0;
  1084. content: '';
  1085. border-bottom: 1px solid #ccc;
  1086. }
  1087. }
  1088. }
  1089. /* 规格选择弹窗 */
  1090. .attr-content {
  1091. padding: 10upx 30upx;
  1092. .a-t {
  1093. display: flex;
  1094. image {
  1095. width: 170upx;
  1096. height: 170upx;
  1097. flex-shrink: 0;
  1098. margin-top: -40upx;
  1099. border-radius: 8upx;
  1100. ;
  1101. }
  1102. .right {
  1103. display: flex;
  1104. flex-direction: column;
  1105. padding-left: 24upx;
  1106. font-size: $font-sm + 2upx;
  1107. color: $font-color-base;
  1108. line-height: 42upx;
  1109. .price {
  1110. font-size: $font-lg;
  1111. color: $uni-color-primary;
  1112. margin-bottom: 10upx;
  1113. }
  1114. .selected-text {
  1115. margin-right: 10upx;
  1116. }
  1117. }
  1118. }
  1119. .attr-list {
  1120. display: flex;
  1121. flex-direction: column;
  1122. font-size: $font-base + 2upx;
  1123. color: $font-color-base;
  1124. padding-top: 30upx;
  1125. padding-left: 10upx;
  1126. }
  1127. .item-list {
  1128. padding: 20upx 0 0;
  1129. display: flex;
  1130. flex-wrap: wrap;
  1131. text {
  1132. display: flex;
  1133. align-items: center;
  1134. justify-content: center;
  1135. background: #eee;
  1136. margin-right: 20upx;
  1137. margin-bottom: 20upx;
  1138. border-radius: 100upx;
  1139. min-width: 60upx;
  1140. height: 60upx;
  1141. padding: 0 20upx;
  1142. font-size: $font-base;
  1143. color: $font-color-dark;
  1144. }
  1145. .selected {
  1146. background: #fbebee;
  1147. color: $uni-color-primary;
  1148. }
  1149. }
  1150. }
  1151. /* 弹出层 */
  1152. .popup {
  1153. position: fixed;
  1154. left: 0;
  1155. top: 0;
  1156. right: 0;
  1157. bottom: 0;
  1158. z-index: 99;
  1159. &.show {
  1160. display: block;
  1161. .mask {
  1162. animation: showPopup 0.2s linear both;
  1163. }
  1164. .layer {
  1165. animation: showLayer 0.2s linear both;
  1166. }
  1167. }
  1168. &.hide {
  1169. .mask {
  1170. animation: hidePopup 0.2s linear both;
  1171. }
  1172. .layer {
  1173. animation: hideLayer 0.2s linear both;
  1174. }
  1175. }
  1176. &.none {
  1177. display: none;
  1178. }
  1179. .mask {
  1180. position: fixed;
  1181. top: 0;
  1182. width: 100%;
  1183. height: 60%;
  1184. z-index: 1;
  1185. background-color: rgba(0, 0, 0, 0.4);
  1186. }
  1187. .layer {
  1188. position: fixed;
  1189. z-index: 99;
  1190. bottom: 0;
  1191. width: 100%;
  1192. min-height: 30vh;
  1193. border-radius: 10upx 10upx 0 0;
  1194. background-color: #fff;
  1195. .btn {
  1196. height: 66upx;
  1197. line-height: 66upx;
  1198. border-radius: 100upx;
  1199. background: $uni-color-primary;
  1200. font-size: $font-base + 2upx;
  1201. color: #fff;
  1202. margin: 30upx auto 20upx;
  1203. }
  1204. }
  1205. @keyframes showPopup {
  1206. 0% {
  1207. opacity: 0;
  1208. }
  1209. 100% {
  1210. opacity: 1;
  1211. }
  1212. }
  1213. @keyframes hidePopup {
  1214. 0% {
  1215. opacity: 1;
  1216. }
  1217. 100% {
  1218. opacity: 0;
  1219. }
  1220. }
  1221. @keyframes showLayer {
  1222. 0% {
  1223. transform: translateY(120%);
  1224. }
  1225. 100% {
  1226. transform: translateY(0%);
  1227. }
  1228. }
  1229. @keyframes hideLayer {
  1230. 0% {
  1231. transform: translateY(0);
  1232. }
  1233. 100% {
  1234. transform: translateY(120%);
  1235. }
  1236. }
  1237. }
  1238. /* 底部操作菜单 */
  1239. .page-bottom {
  1240. position: fixed;
  1241. left: 30upx;
  1242. bottom: 30upx;
  1243. z-index: 95;
  1244. display: flex;
  1245. justify-content: center;
  1246. align-items: center;
  1247. width: 690upx;
  1248. height: 100upx;
  1249. background: rgba(255, 255, 255, .9);
  1250. box-shadow: 0 0 20upx 0 rgba(0, 0, 0, .5);
  1251. border-radius: 16upx;
  1252. .p-b-btn {
  1253. display: flex;
  1254. flex-direction: column;
  1255. align-items: center;
  1256. justify-content: center;
  1257. font-size: $font-sm;
  1258. color: $font-color-base;
  1259. width: 96upx;
  1260. height: 80upx;
  1261. .yticon {
  1262. font-size: 40upx;
  1263. line-height: 48upx;
  1264. color: $font-color-light;
  1265. }
  1266. &.active,
  1267. &.active .yticon {
  1268. color: $uni-color-primary;
  1269. }
  1270. .icon-fenxiang2 {
  1271. font-size: 42upx;
  1272. transform: translateY(-2upx);
  1273. }
  1274. .icon-shoucang {
  1275. font-size: 46upx;
  1276. }
  1277. }
  1278. .action-btn-group {
  1279. display: flex;
  1280. height: 76upx;
  1281. border-radius: 100px;
  1282. overflow: hidden;
  1283. box-shadow: 0 20upx 40upx -16upx #fa436a;
  1284. box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  1285. background: linear-gradient(to right, #ffac30, #fa436a, #F56C6C);
  1286. margin-left: 20upx;
  1287. position: relative;
  1288. &:after {
  1289. content: '';
  1290. position: absolute;
  1291. top: 50%;
  1292. right: 50%;
  1293. transform: translateY(-50%);
  1294. height: 28upx;
  1295. width: 0;
  1296. border-right: 1px solid rgba(255, 255, 255, .5);
  1297. }
  1298. .action-btn {
  1299. display: flex;
  1300. align-items: center;
  1301. justify-content: center;
  1302. width: 180upx;
  1303. height: 100%;
  1304. font-size: $font-base;
  1305. padding: 0;
  1306. border-radius: 0;
  1307. background: transparent;
  1308. }
  1309. }
  1310. }
  1311. /* 优惠券面板 */
  1312. .mask {
  1313. display: flex;
  1314. align-items: flex-end;
  1315. position: fixed;
  1316. left: 0;
  1317. top: var(--window-top);
  1318. bottom: 0;
  1319. width: 100%;
  1320. background: rgba(0, 0, 0, 0);
  1321. z-index: 9995;
  1322. transition: .3s;
  1323. .mask-content {
  1324. width: 100%;
  1325. min-height: 30vh;
  1326. max-height: 70vh;
  1327. background: #f3f3f3;
  1328. transform: translateY(100%);
  1329. transition: .3s;
  1330. overflow-y: scroll;
  1331. }
  1332. &.none {
  1333. display: none;
  1334. }
  1335. &.show {
  1336. background: rgba(0, 0, 0, .4);
  1337. .mask-content {
  1338. transform: translateY(0);
  1339. }
  1340. }
  1341. }
  1342. .maskH5 {
  1343. align-items: flex-end;
  1344. position: fixed;
  1345. left: 0;
  1346. top: var(--window-top);
  1347. bottom: 0;
  1348. width: 100%;
  1349. background: rgba(0, 0, 0, 0);
  1350. z-index: 9995;
  1351. transition: .3s;
  1352. .mask-content {
  1353. width: 100%;
  1354. min-height: 30vh;
  1355. max-height: 70vh;
  1356. background: #f3f3f3;
  1357. transform: translateY(100%);
  1358. transition: .3s;
  1359. overflow-y: scroll;
  1360. }
  1361. &.none {
  1362. display: none;
  1363. }
  1364. &.show {
  1365. background: rgba(0, 0, 0, .4);
  1366. .mask-content {
  1367. transform: translateY(0);
  1368. }
  1369. }
  1370. }
  1371. /* 优惠券列表 */
  1372. .coupon-item {
  1373. display: flex;
  1374. flex-direction: column;
  1375. margin: 20upx 24upx;
  1376. background: #fff;
  1377. .con {
  1378. display: flex;
  1379. align-items: center;
  1380. position: relative;
  1381. height: 120upx;
  1382. padding: 0 30upx;
  1383. &:after {
  1384. position: absolute;
  1385. left: 0;
  1386. bottom: 0;
  1387. content: '';
  1388. width: 100%;
  1389. height: 0;
  1390. border-bottom: 1px dashed #f3f3f3;
  1391. transform: scaleY(50%);
  1392. }
  1393. }
  1394. .left {
  1395. display: flex;
  1396. flex-direction: column;
  1397. justify-content: center;
  1398. flex: 1;
  1399. overflow: hidden;
  1400. height: 100upx;
  1401. }
  1402. .title {
  1403. font-size: 32upx;
  1404. color: $font-color-dark;
  1405. margin-bottom: 10upx;
  1406. }
  1407. .time {
  1408. font-size: 24upx;
  1409. color: $font-color-light;
  1410. }
  1411. .right {
  1412. display: flex;
  1413. flex-direction: column;
  1414. justify-content: center;
  1415. align-items: center;
  1416. font-size: 26upx;
  1417. color: $font-color-base;
  1418. height: 100upx;
  1419. }
  1420. .price {
  1421. font-size: 44upx;
  1422. color: $base-color;
  1423. &:before {
  1424. content: '¥';
  1425. font-size: 34upx;
  1426. }
  1427. }
  1428. .tips {
  1429. font-size: 24upx;
  1430. color: $font-color-light;
  1431. line-height: 60upx;
  1432. padding-left: 30upx;
  1433. }
  1434. .circle {
  1435. position: absolute;
  1436. left: -6upx;
  1437. bottom: -10upx;
  1438. z-index: 10;
  1439. width: 20upx;
  1440. height: 20upx;
  1441. background: #f3f3f3;
  1442. border-radius: 100px;
  1443. &.r {
  1444. left: auto;
  1445. right: -6upx;
  1446. }
  1447. }
  1448. }
  1449. .rich-img {
  1450. width: 100%;
  1451. height: auto;
  1452. margin: 0;
  1453. padding: 0;
  1454. line-height: 0px;
  1455. }
  1456. button::after {
  1457. border: none;
  1458. }
  1459. .vip-money {
  1460. font-size: 24rpx;
  1461. color: #282828;
  1462. font-weight: bold;
  1463. margin-top: 10rpx;
  1464. }
  1465. .vip-money + .image {
  1466. width: 46rpx;
  1467. height: 21rpx;
  1468. margin-left: 5rpx;
  1469. }
  1470. </style>