index.vue 24 KB

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