index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  1. <template>
  2. <view class="cart" :class="{ hasPaddingTop: cartTopFixed }">
  3. <tui-skeleton v-if="isRequest" loadingType="2"></tui-skeleton>
  4. <template v-if="!isEmpty">
  5. <template v-if="!isshowDelbtn">
  6. <!-- 商品统计 / 批量删除商品 -->
  7. <view :class="{ fixed: cartTopFixed }">
  8. <view class="cart-top">
  9. <view class="count">共{{ kindCount }}件商品</view>
  10. <view class="btn" @click="showDelManager">删除</view>
  11. </view>
  12. <!-- TODO -->
  13. <view class="receive-coupon">
  14. <view class="tip-text">{{ couponTipText }}</view>
  15. <view class="btn" @click="receiveCoupon">领券</view>
  16. </view>
  17. </view>
  18. </template>
  19. <!-- 购物车列表 -->
  20. <template v-for="(cart, index) in goodsList">
  21. <cm-cart-product
  22. class="product-list"
  23. :listType="listType"
  24. :key="index"
  25. :data="cart"
  26. vkey="productList"
  27. @chooseAll="chooseAllProduct"
  28. @chooseOne="chooseOneProduct"
  29. ></cm-cart-product>
  30. </template>
  31. <!-- 失效商品列表 -->
  32. <cm-cart-product
  33. class="product-list"
  34. :key="index"
  35. :data="failureList"
  36. :listType="failureListType"
  37. @chooseOne="chooseFailureProduct"
  38. v-if="failureList.length > 0"
  39. ></cm-cart-product>
  40. <!-- 底部按钮 -->
  41. <view class="footer">
  42. <view class="radio" @click="chooseAll">
  43. <text class="iconfont" :class="[isCheckAll ? 'icon-xuanze' : 'icon-weixuanze']"></text>
  44. <text class="tip">全选</text>
  45. </view>
  46. <template v-if="!isshowDelbtn">
  47. <view class="center">
  48. <view class="row">
  49. <text>总价:</text>
  50. <text class="total-price">
  51. <text>¥{{ finallyPrice | formatPrice }}</text>
  52. <text class="delete" v-if="allPrice > finallyPrice">¥{{ allPrice | formatPrice }}</text>
  53. </text>
  54. </view>
  55. <!-- TODO -->
  56. <view class="row" v-if="currentCouponIndex > -1 && currentCoupon">
  57. <text>共减</text>
  58. <text class="discounted-price">¥{{ currentCoupon.couponAmount | formatPrice }}</text>
  59. <text @click="showDiscountedDetail">优惠明细</text>
  60. <text
  61. class="iconfont"
  62. :class="showDitail ? 'tui-icon-arrowdown' : 'tui-icon-arrowup'"
  63. ></text>
  64. </view>
  65. </view>
  66. <view class="submit" @click="toConfirmation">去结算({{ allCount }})</view>
  67. </template>
  68. <view v-else class="footer-del">
  69. <view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
  70. <view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
  71. </view>
  72. </view>
  73. </template>
  74. <view class="empty" v-else>
  75. <cm-empty :image="StaticUrl + 'icon-empty-cart.png'" message="购物车空空的,快去逛逛吧~"></cm-empty>
  76. </view>
  77. <!-- 优惠券列表 TODO-->
  78. <cm-coupon-list
  79. title="优惠券"
  80. listType="search"
  81. :couponList="couponList"
  82. :visible="couponVisible"
  83. :btnUseType="2"
  84. @close="closeCouponList"
  85. @tabClick="couponListTabClick"
  86. @couponClick="couponClick"
  87. :tabs="couponListTabs"
  88. ></cm-coupon-list>
  89. <!-- 优惠明细 -->
  90. <cm-drawer
  91. title="优惠明细"
  92. :visible="showDitail"
  93. position="bottom"
  94. :offset="100"
  95. @close="showDitail = false"
  96. zIndex="99"
  97. >
  98. <template>
  99. <view class="discounted-ditail">
  100. <view class="row">
  101. <text>商品总额</text> <text>¥{{ allPrice | formatPrice }}</text>
  102. </view>
  103. <view class="row">
  104. <text>促销满减</text> <text class="red">-¥{{ discountedPrice | formatPrice }}</text>
  105. </view>
  106. <view class="row" v-if="currentCouponIndex > -1 && currentCoupon">
  107. <text>优惠券</text> <text class="red">-¥{{ currentCoupon.couponAmount | formatPrice }}</text>
  108. </view>
  109. <view class="row total">
  110. <text>总计</text>
  111. <text class="price">
  112. <text>¥{{ finallyPrice | formatPrice }}</text>
  113. </text>
  114. </view>
  115. <view class="tip"> 实际订单金额以结算页为准 </view>
  116. </view>
  117. </template>
  118. </cm-drawer>
  119. <!-- 操作弹窗 -->
  120. <tui-modal
  121. :show="modal"
  122. @click="handleClick"
  123. @cancel="hideModal"
  124. :content="contentModalText"
  125. color="#333"
  126. :size="32"
  127. shape="circle"
  128. :maskClosable="false"
  129. ></tui-modal>
  130. </view>
  131. </template>
  132. <script>
  133. import { isIntersect } from '@/common/util.js'
  134. import CmCouponList from '@/components/cm-module/cm-coupon-list/cm-coupon-list'
  135. import CmDrawer from '@/components/cm-module/cm-drawer/cm-drawer.vue'
  136. import CmCartProduct from '@/components/cm-module/cm-cart-product/cm-cart-product.vue'
  137. import CmEmpty from '@/components/cm-module/cm-empty/cm-empty.vue'
  138. import { mapGetters, mapActions, mapMutations } from 'vuex'
  139. import {
  140. fetchSelectedProducts,
  141. findCouponBySelected,
  142. canUseCoupon,
  143. getCountPrice,
  144. couponSort
  145. } from '@/common/couponUtil.js'
  146. export default {
  147. components: {
  148. CmCouponList,
  149. CmDrawer,
  150. CmCartProduct,
  151. CmEmpty
  152. },
  153. data() {
  154. return {
  155. StaticUrl: this.$Static,
  156. CustomBar: this.CustomBar, // 顶部导航栏高度
  157. popupShow: false,
  158. handlerPros: {}, //监听单挑促销商品
  159. isCheckAll: false, //是否全选
  160. allPrice: 0, //所有价格
  161. totalOriginalPrice: 0, //所有原价价
  162. reducedPrice: 0, //满减
  163. isshowDelbtn: false,
  164. scrollHeight: 'auto',
  165. modal: false,
  166. contentModalText: '',
  167. couponVisible: false,
  168. showDitail: false,
  169. listType: 'normal',
  170. failureListType: 'expired',
  171. scrollTop: 0,
  172. isRequest: true,
  173. currentCouponIndex: -1,
  174. selectedPoducts: [], //已勾选商品列表
  175. receiveCouponList: [], // 已领取优惠券
  176. ableCouponList: [], // 可领取优惠券
  177. canUseCouponList: [], // 当前选中商品可使用的优惠券
  178. currentTabIndex: 0
  179. }
  180. },
  181. computed: {
  182. ...mapGetters([
  183. 'hasLogin',
  184. 'isIphoneX',
  185. 'isEmpty',
  186. 'goodsList',
  187. 'failureList',
  188. 'kindCount',
  189. 'userId',
  190. 'cartIds',
  191. 'productIds'
  192. ]),
  193. //被选中的产品数量
  194. allCount() {
  195. return this.cartIds.length
  196. },
  197. cartTopFixed() {
  198. return this.scrollTop > 0 && !this.isshowDelbtn
  199. },
  200. currentCoupon() {
  201. return this.canUseCouponList[this.currentCouponIndex] || null
  202. },
  203. nextCoupon() {
  204. if (this.currentCouponIndex <= 0) {
  205. return this.currentCoupon
  206. } else {
  207. return this.canUseCouponList[this.currentCouponIndex - 1]
  208. }
  209. },
  210. discountedPrice() {
  211. return 0
  212. },
  213. finallyPrice() {
  214. if (this.currentCoupon) {
  215. const finallyPrice = this.allPrice - this.discountedPrice - this.currentCoupon.couponAmount
  216. return finallyPrice < 0 ? 0 : finallyPrice
  217. }
  218. return this.allPrice - this.discountedPrice
  219. },
  220. couponTipText() {
  221. if (this.currentCouponIndex <= -1) return ''
  222. if (this.currentCoupon === this.nextCoupon) {
  223. if (this.nextCoupon.noThresholdFlag === 1) {
  224. return `已享“减${this.currentCoupon.couponAmount}元”优惠券`
  225. }
  226. return `已享“满${this.currentCoupon.touchPrice}元减${this.currentCoupon.couponAmount}元”优惠券`
  227. }
  228. return `还差¥
  229. ${(this.nextCoupon.touchPrice - getCountPrice(this.selectedPoducts, this.nextCoupon)).toFixed(2)}
  230. 元可用“满${this.nextCoupon.touchPrice}元减${this.nextCoupon.couponAmount}元”优惠券`
  231. },
  232. couponList() {
  233. if (this.currentTabIndex === 0) {
  234. return couponSort(this.receiveCouponList)
  235. } else {
  236. return couponSort(this.ableCouponList)
  237. }
  238. },
  239. couponListTabs() {
  240. const tabs = []
  241. const receiveCount = this.receiveCouponList.length
  242. const ableCouponCount = this.ableCouponList.length
  243. if (receiveCount > 0) {
  244. tabs.push({ name: `已领取优惠券(${receiveCount})` })
  245. } else {
  246. tabs.push({ name: '已领取优惠券' })
  247. }
  248. if (ableCouponCount > 0) {
  249. tabs.push({ name: `可领取优惠券(${ableCouponCount})` })
  250. } else {
  251. tabs.push({ name: '可领取优惠券' })
  252. }
  253. return tabs
  254. }
  255. },
  256. filters: {
  257. totalprice(val, count) {
  258. //单件商品的价格 × 数量
  259. return (val * count).toFixed(2)
  260. }
  261. },
  262. watch: {
  263. //深度监听所有数据,每次改变重新计算总价和总数
  264. goodsList: {
  265. deep: true,
  266. handler(val, oldval) {
  267. this.totalPeice()
  268. this.resetCouponUtil()
  269. }
  270. },
  271. isshowDelbtn(val) {
  272. if (val) {
  273. this.failureListType = 'expired delete'
  274. this.listType = 'normal delete'
  275. } else {
  276. this.failureListType = 'expired'
  277. this.listType = 'normal'
  278. }
  279. }
  280. },
  281. //下拉刷新
  282. onPullDownRefresh() {
  283. this.initCart().finally(() => {
  284. setTimeout(() => {
  285. uni.stopPullDownRefresh()
  286. }, 500)
  287. })
  288. },
  289. onPageScroll(e) {
  290. this.scrollTop = e.scrollTop
  291. },
  292. onShow() {
  293. if (this.hasLogin) {
  294. this.initData()
  295. } else {
  296. this.$api.redirectTo('/pages/login/login')
  297. }
  298. },
  299. onLoad() {
  300. this.setScrollHeight()
  301. },
  302. methods: {
  303. ...mapActions('cart', ['initCart', 'removeFromCart']),
  304. ...mapMutations('cart', ['selectAllProduct', 'saveCartIds', 'selectAllFailure', 'saveProductIds']),
  305. initData() {
  306. this.saveCartIds([]) // 清空已选项
  307. this.saveProductIds([]) // 清空已选项
  308. this.isCheckAll = false
  309. this.isshowDelbtn = false
  310. // 初始化购物车后也要获取商品下的优惠券列表
  311. this.initCart()
  312. .then(() => {
  313. this.getCouponList()
  314. })
  315. .finally(() => {
  316. this.isRequest = false
  317. })
  318. },
  319. // 获取优惠券列表
  320. getCouponList() {
  321. if (this.isEmpty) return
  322. const productIds = []
  323. this.goodsList.forEach(shop => shop.productList.forEach(product => productIds.push(product.productId)))
  324. this.CouponService.GetCouponByProductIds({ userId: this.userId, productIds: productIds.join(',') }).then(
  325. res => {
  326. this.receiveCouponList = res.data.receiveCouponList
  327. this.ableCouponList = res.data.ableCouponList
  328. this.resetCouponUtil()
  329. }
  330. )
  331. },
  332. resetCouponUtil() {
  333. if (this.receiveCouponList.length <= 0) return
  334. this.selectedPoducts = fetchSelectedProducts(this.goodsList)
  335. this.canUseCouponList = findCouponBySelected(this.productIds, this.receiveCouponList)
  336. this.currentCouponIndex = canUseCoupon(0, this.productIds, this.canUseCouponList, this.selectedPoducts)
  337. },
  338. couponListTabClick(index) {
  339. this.currentTabIndex = index
  340. },
  341. couponClick() {
  342. // 领取优惠券
  343. if (this.currentTabIndex === 1) {
  344. this.getCouponList()
  345. } else {
  346. this.couponVisible = false
  347. }
  348. },
  349. // 领取优惠券弹窗
  350. receiveCoupon() {
  351. this.couponVisible = true
  352. this.getCouponList()
  353. },
  354. // 勾选单个失效商品
  355. chooseFailureProduct() {
  356. this.isSelectAll()
  357. },
  358. // 勾选供应商下所有商品
  359. chooseAllProduct() {
  360. this.isSelectAll()
  361. },
  362. // 勾选单核商品
  363. chooseOneProduct() {
  364. this.isSelectAll()
  365. },
  366. // 勾选全部商品
  367. chooseAll() {
  368. this.isCheckAll = !this.isCheckAll
  369. // 勾选所有有效商品
  370. this.selectAllProduct(this.isCheckAll)
  371. // 勾选所有失效商品
  372. if (this.isshowDelbtn) {
  373. this.selectAllFailure(this.isCheckAll)
  374. }
  375. this.isSelectAll()
  376. },
  377. // 判断是否全选商品
  378. isSelectAll() {
  379. // 是否勾选全部正常商品
  380. this.isCheckAll = this.goodsList.every(shop => shop.checked)
  381. if (this.isshowDelbtn) {
  382. this.isCheckAll = this.isCheckAll && this.failureList.every(product => product.productsChecked)
  383. }
  384. this.getCheckedProductId()
  385. },
  386. // 获取勾选商品的id
  387. getCheckedProductId() {
  388. const cartIds = []
  389. const productIds = []
  390. // 获取所有有效商品cartId
  391. this.goodsList.forEach(shop => {
  392. const ids = shop.productList.reduce((cartIds, prod) => {
  393. if (prod.productsChecked) {
  394. cartIds.push(prod.cartId)
  395. productIds.push(prod.productId)
  396. }
  397. return cartIds
  398. }, [])
  399. cartIds.push(...ids)
  400. })
  401. // 获取所有失效商品cartId
  402. if (this.isshowDelbtn) {
  403. const ids = this.failureList.reduce((cartIds, prod) => {
  404. if (prod.productsChecked) cartIds.push(prod.cartId)
  405. return cartIds
  406. }, [])
  407. cartIds.push(...ids)
  408. }
  409. this.saveProductIds(productIds) // 保存已选商品
  410. this.saveCartIds(cartIds)
  411. this.resetCouponUtil()
  412. },
  413. //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  414. totalPeice() {
  415. const priceObj = this.goodsList.reduce(
  416. (priceObj, shop) => {
  417. shop.productList.forEach(prod => {
  418. if (prod.productsChecked) {
  419. priceObj.totalOriginalPrice += prod.price * prod.productCount
  420. // 单品满减
  421. if (prod.promotion && prod.promotion.type * 1 === 1 && prod.promotion.mode * 1 === 2) {
  422. // 单品满减-重新计算供应商总价/满减金额
  423. if (prod.price * prod.productCount >= prod.promotion.touchPrice) {
  424. priceObj.reducedPrice += prod.promotion.reducedPrice
  425. }
  426. }
  427. }
  428. })
  429. priceObj.allPrice = priceObj.totalOriginalPrice - priceObj.reducedPrice
  430. return priceObj
  431. },
  432. {
  433. totalOriginalPrice: 0,
  434. reducedPrice: 0,
  435. allPrice: 0
  436. }
  437. )
  438. this.allPrice = priceObj.allPrice
  439. },
  440. //显示删除商品管理
  441. showDelManager() {
  442. this.isshowDelbtn = true
  443. },
  444. //隐藏删除商品管理
  445. hideDelManage() {
  446. this.selectAllFailure(false)
  447. this.isSelectAll()
  448. this.isshowDelbtn = false
  449. },
  450. //删除购物车商品
  451. deleteList() {
  452. if (this.cartIds.length <= 0) {
  453. return this.$util.msg('请选择要删除的商品~', 2000)
  454. } else {
  455. this.modal = true
  456. this.contentModalText = '确定删除选中的商品吗?'
  457. }
  458. },
  459. //从购物车移除商品
  460. handleClick(e) {
  461. if (e.index !== 1) return (this.modal = false)
  462. // 删除所有勾选的商品
  463. this.removeFromCart().finally(() => {
  464. this.isshowDelbtn = false
  465. })
  466. this.modal = false
  467. },
  468. // 关闭优惠券弹窗
  469. closeCouponList() {
  470. this.couponVisible = false
  471. },
  472. // 活动价弹窗
  473. clickPopupShow(pros, type) {
  474. if (pros.ladderList.length > 0) {
  475. this.popupShow = true
  476. this.handlerPros = pros
  477. }
  478. },
  479. // 优惠明细
  480. showDiscountedDetail() {
  481. this.showDitail = true
  482. },
  483. //跳转确认订单页面
  484. toConfirmation() {
  485. if (this.cartIds.length <= 0) {
  486. return this.$util.msg('请先选择结算商品~', 2000)
  487. }
  488. let cartPramsData = {
  489. allPrice: this.allPrice,
  490. allCount: this.allCount,
  491. cartIds: this.cartIds.join(','),
  492. productIds: this.productIds.join(','),
  493. productCount: ''
  494. }
  495. uni.setStorageSync('commitCartPramsData', cartPramsData)
  496. this.$api.navigateTo('/pages/order/create-order')
  497. },
  498. hideModal() {
  499. this.modal = false
  500. },
  501. navToListPage(item) {
  502. this.$api.navigateTo(`/pages/goods/product?productId=${item.productId}`)
  503. },
  504. // 窗口高度-footer高度
  505. setScrollHeight() {
  506. const { windowHeight, pixelRatio } = uni.getSystemInfoSync()
  507. setTimeout(() => {
  508. const query = uni.createSelectorQuery().in(this)
  509. query.selectAll('.footer').boundingClientRect()
  510. query.exec(res => {
  511. this.windowHeight = windowHeight
  512. if (res[0][0]) {
  513. this.scrollHeight = windowHeight - res[0][0].height
  514. }
  515. })
  516. }, 500)
  517. }
  518. }
  519. }
  520. </script>
  521. <style lang="scss" scoped>
  522. .cart {
  523. padding-bottom: 100rpx;
  524. background: #f7f7f7;
  525. min-height: 100%;
  526. box-sizing: border-box;
  527. &.hasPaddingTop {
  528. padding-top: 170rpx;
  529. }
  530. .fixed {
  531. position: fixed;
  532. top: 0;
  533. flex: 0;
  534. z-index: 9999;
  535. }
  536. .cart-top {
  537. display: flex;
  538. justify-content: space-between;
  539. align-items: center;
  540. padding: 0 24rpx;
  541. width: 750rpx;
  542. height: 80rpx;
  543. background: #f7f7f7;
  544. box-sizing: border-box;
  545. .count {
  546. font-size: 30rpx;
  547. color: #333333;
  548. }
  549. .btn {
  550. display: flex;
  551. justify-content: center;
  552. align-items: center;
  553. width: 88rpx;
  554. height: 42rpx;
  555. background: #fff8fd;
  556. border: 1rpx solid #ff457b;
  557. border-radius: 24rpx;
  558. font-size: 26rpx;
  559. color: #ff457b;
  560. }
  561. }
  562. .receive-coupon {
  563. display: flex;
  564. justify-content: space-between;
  565. align-items: center;
  566. padding: 24rpx;
  567. background: #fff;
  568. .tip-text {
  569. width: 560rpx;
  570. font-size: 26rpx;
  571. color: #ff457b;
  572. white-space: nowrap;
  573. overflow: hidden;
  574. text-overflow: ellipsis;
  575. }
  576. .btn {
  577. width: 88rpx;
  578. height: 42rpx;
  579. background: linear-gradient(270deg, #f83c6c 0%, #fc32b4 100%);
  580. border-radius: 28rpx;
  581. font-size: 26rpx;
  582. color: #ffffff;
  583. text-align: center;
  584. line-height: 42rpx;
  585. }
  586. }
  587. .footer {
  588. position: fixed;
  589. bottom: 0;
  590. left: 0;
  591. z-index: 899;
  592. display: flex;
  593. justify-content: space-between;
  594. align-items: center;
  595. width: 100%;
  596. height: 100rpx;
  597. box-sizing: border-box;
  598. padding: 0 24rpx;
  599. border-top: 1rpx solid #eee;
  600. background: #ffffff;
  601. .radio {
  602. font-size: 36rpx;
  603. color: #b2b2b2;
  604. .icon-xuanze {
  605. color: #f83c6c;
  606. }
  607. .tip {
  608. font-size: 30rpx;
  609. color: #333333;
  610. margin-left: 6rpx;
  611. }
  612. }
  613. .row {
  614. &:nth-child(1) {
  615. font-size: 26rpx;
  616. color: #333333;
  617. .total-price {
  618. color: #ff457b;
  619. .delete{
  620. font-size: 20rpx;
  621. color: #999999;
  622. text-decoration: line-through;
  623. font-weight: normal;
  624. margin-left: 10rpx;
  625. }
  626. }
  627. }
  628. &:nth-child(2) {
  629. margin-top: 6rpx;
  630. font-size: 24rpx;
  631. color: #ff457b;
  632. }
  633. .discounted-price {
  634. margin-right: 32rpx;
  635. }
  636. }
  637. .submit {
  638. width: 210rpx;
  639. height: 80rpx;
  640. background: linear-gradient(90deg, #fc32b4 0%, #f83c6c 100%);
  641. border-radius: 40rpx;
  642. font-size: 30rpx;
  643. color: #ffffff;
  644. text-align: center;
  645. line-height: 80rpx;
  646. }
  647. .footer-del {
  648. width: 420rpx;
  649. height: 100rpx;
  650. position: absolute;
  651. padding-left: 200rpx;
  652. background: #ffffff;
  653. right: 0;
  654. top: 0;
  655. z-index: 1000;
  656. box-sizing: border-box;
  657. padding: 10rpx 0;
  658. display: flex;
  659. &.show {
  660. animation: showDelbtn 0s linear both;
  661. }
  662. &.none {
  663. animation: hideDelbtn 0s linear both;
  664. }
  665. .btn {
  666. flex: 1;
  667. margin: 0 8rpx;
  668. height: 100%;
  669. line-height: 80rpx;
  670. font-size: $font-size-28;
  671. color: #ffffff;
  672. text-align: center;
  673. float: left;
  674. border-radius: 40rpx;
  675. }
  676. .btn.btn-cancel {
  677. background: #f7f7f7;
  678. color: #b2b2b2;
  679. }
  680. .btn.btn-confirm {
  681. background: $btn-confirm;
  682. color: #ffffff;
  683. }
  684. @keyframes showDelbtn {
  685. 0% {
  686. transform: translateX(0);
  687. }
  688. 100% {
  689. transform: translateX(-100%);
  690. }
  691. }
  692. @keyframes hideDelbtn {
  693. 0% {
  694. transform: translateX(-100%);
  695. }
  696. 100% {
  697. transform: translateX(0);
  698. }
  699. }
  700. }
  701. }
  702. .discounted-ditail {
  703. padding: 52rpx 8rpx 0;
  704. .row {
  705. display: flex;
  706. justify-content: space-between;
  707. align-items: center;
  708. padding: 12rpx 0;
  709. text {
  710. font-size: 30rpx;
  711. color: #333333;
  712. &.red {
  713. color: #f94b4b;
  714. }
  715. }
  716. &.total {
  717. font-size: 30rpx;
  718. font-weight: 600;
  719. .price{
  720. .delete{
  721. font-size: 24rpx;
  722. color: #999999;
  723. text-decoration: line-through;
  724. font-weight: normal;
  725. margin-left: 10rpx;
  726. }
  727. }
  728. }
  729. }
  730. .tip {
  731. padding: 12rpx 0;
  732. font-size: 26rpx;
  733. color: #999999;
  734. }
  735. }
  736. .empty {
  737. height: 80vh;
  738. }
  739. }
  740. </style>