index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  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. this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({ data: cartPramsData })}`)
  501. },
  502. hideModal() {
  503. this.modal = false
  504. },
  505. navToListPage(item) {
  506. this.$api.navigateTo(`/pages/goods/product?productId=${item.productId}`)
  507. },
  508. // 窗口高度-footer高度
  509. setScrollHeight() {
  510. const { windowHeight, pixelRatio } = uni.getSystemInfoSync()
  511. setTimeout(() => {
  512. const query = uni.createSelectorQuery().in(this)
  513. query.selectAll('.footer').boundingClientRect()
  514. query.exec(res => {
  515. this.windowHeight = windowHeight
  516. if (res[0][0]) {
  517. this.scrollHeight = windowHeight - res[0][0].height
  518. }
  519. })
  520. }, 500)
  521. }
  522. }
  523. }
  524. </script>
  525. <style lang="scss" scoped>
  526. .cart {
  527. padding-bottom: 100rpx;
  528. background: #f7f7f7;
  529. min-height: 100%;
  530. box-sizing: border-box;
  531. &.hasPaddingTop {
  532. padding-top: 170rpx;
  533. }
  534. .fixed {
  535. position: fixed;
  536. top: 0;
  537. flex: 0;
  538. z-index: 9999;
  539. }
  540. .cart-top {
  541. display: flex;
  542. justify-content: space-between;
  543. align-items: center;
  544. padding: 0 24rpx;
  545. width: 750rpx;
  546. height: 80rpx;
  547. background: #f7f7f7;
  548. box-sizing: border-box;
  549. .count {
  550. font-size: 30rpx;
  551. color: #333333;
  552. }
  553. .btn {
  554. display: flex;
  555. justify-content: center;
  556. align-items: center;
  557. width: 88rpx;
  558. height: 42rpx;
  559. background: #fff8fd;
  560. border: 1rpx solid #ff457b;
  561. border-radius: 24rpx;
  562. font-size: 26rpx;
  563. color: #ff457b;
  564. }
  565. }
  566. .receive-coupon {
  567. display: flex;
  568. justify-content: space-between;
  569. align-items: center;
  570. padding: 24rpx;
  571. background: #fff;
  572. .tip-text {
  573. width: 560rpx;
  574. font-size: 26rpx;
  575. color: #ff457b;
  576. white-space: nowrap;
  577. overflow: hidden;
  578. text-overflow: ellipsis;
  579. }
  580. .btn {
  581. width: 88rpx;
  582. height: 42rpx;
  583. background: linear-gradient(270deg, #f83c6c 0%, #fc32b4 100%);
  584. border-radius: 28rpx;
  585. font-size: 26rpx;
  586. color: #ffffff;
  587. text-align: center;
  588. line-height: 42rpx;
  589. }
  590. }
  591. .footer {
  592. position: fixed;
  593. bottom: 0;
  594. left: 0;
  595. z-index: 899;
  596. display: flex;
  597. justify-content: space-between;
  598. align-items: center;
  599. width: 100%;
  600. height: 100rpx;
  601. box-sizing: border-box;
  602. padding: 0 24rpx;
  603. border-top: 1rpx solid #eee;
  604. background: #ffffff;
  605. .radio {
  606. font-size: 36rpx;
  607. color: #b2b2b2;
  608. .icon-xuanze {
  609. color: #f83c6c;
  610. }
  611. .tip {
  612. font-size: 30rpx;
  613. color: #333333;
  614. margin-left: 6rpx;
  615. }
  616. }
  617. .row {
  618. &:nth-child(1) {
  619. font-size: 26rpx;
  620. color: #333333;
  621. .total-price {
  622. color: #ff457b;
  623. .delete{
  624. font-size: 20rpx;
  625. color: #999999;
  626. text-decoration: line-through;
  627. font-weight: normal;
  628. margin-left: 10rpx;
  629. }
  630. }
  631. }
  632. &:nth-child(2) {
  633. margin-top: 6rpx;
  634. font-size: 24rpx;
  635. color: #ff457b;
  636. }
  637. .discounted-price {
  638. margin-right: 32rpx;
  639. }
  640. }
  641. .submit {
  642. width: 210rpx;
  643. height: 80rpx;
  644. background: linear-gradient(90deg, #fc32b4 0%, #f83c6c 100%);
  645. border-radius: 40rpx;
  646. font-size: 30rpx;
  647. color: #ffffff;
  648. text-align: center;
  649. line-height: 80rpx;
  650. }
  651. .footer-del {
  652. width: 420rpx;
  653. height: 100rpx;
  654. position: absolute;
  655. padding-left: 200rpx;
  656. background: #ffffff;
  657. right: 0;
  658. top: 0;
  659. z-index: 1000;
  660. box-sizing: border-box;
  661. padding: 10rpx 0;
  662. display: flex;
  663. &.show {
  664. animation: showDelbtn 0s linear both;
  665. }
  666. &.none {
  667. animation: hideDelbtn 0s linear both;
  668. }
  669. .btn {
  670. flex: 1;
  671. margin: 0 8rpx;
  672. height: 100%;
  673. line-height: 80rpx;
  674. font-size: $font-size-28;
  675. color: #ffffff;
  676. text-align: center;
  677. float: left;
  678. border-radius: 40rpx;
  679. }
  680. .btn.btn-cancel {
  681. background: #f7f7f7;
  682. color: #b2b2b2;
  683. }
  684. .btn.btn-confirm {
  685. background: $btn-confirm;
  686. color: #ffffff;
  687. }
  688. @keyframes showDelbtn {
  689. 0% {
  690. transform: translateX(0);
  691. }
  692. 100% {
  693. transform: translateX(-100%);
  694. }
  695. }
  696. @keyframes hideDelbtn {
  697. 0% {
  698. transform: translateX(-100%);
  699. }
  700. 100% {
  701. transform: translateX(0);
  702. }
  703. }
  704. }
  705. }
  706. .discounted-ditail {
  707. padding: 52rpx 8rpx 0;
  708. .row {
  709. display: flex;
  710. justify-content: space-between;
  711. align-items: center;
  712. padding: 12rpx 0;
  713. text {
  714. font-size: 30rpx;
  715. color: #333333;
  716. &.red {
  717. color: #f94b4b;
  718. }
  719. }
  720. &.total {
  721. font-size: 30rpx;
  722. font-weight: 600;
  723. .price{
  724. .delete{
  725. font-size: 24rpx;
  726. color: #999999;
  727. text-decoration: line-through;
  728. font-weight: normal;
  729. margin-left: 10rpx;
  730. }
  731. }
  732. }
  733. }
  734. .tip {
  735. padding: 12rpx 0;
  736. font-size: 26rpx;
  737. color: #999999;
  738. }
  739. }
  740. .empty {
  741. height: 80vh;
  742. }
  743. }
  744. </style>