index.vue 25 KB

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