index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  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 | formatPrice }}</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 | 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 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. totalprice(val, count) {
  259. //单件商品的价格 × 数量
  260. return (val * count).toFixed(2)
  261. }
  262. },
  263. watch: {
  264. //深度监听所有数据,每次改变重新计算总价和总数
  265. goodsList: {
  266. deep: true,
  267. handler(val, oldval) {
  268. this.totalPeice()
  269. this.resetCouponUtil()
  270. }
  271. },
  272. isshowDelbtn(val) {
  273. if (val) {
  274. this.failureListType = 'expired delete'
  275. this.listType = 'normal delete'
  276. } else {
  277. this.failureListType = 'expired'
  278. this.listType = 'normal'
  279. }
  280. }
  281. },
  282. //下拉刷新
  283. onPullDownRefresh() {
  284. this.initCart().finally(() => {
  285. setTimeout(() => {
  286. uni.stopPullDownRefresh()
  287. }, 2000)
  288. })
  289. },
  290. onPageScroll(e) {
  291. this.scrollTop = e.scrollTop
  292. },
  293. onShow() {
  294. if (this.hasLogin) {
  295. this.initData()
  296. } else {
  297. this.$api.redirectTo('/pages/login/login')
  298. }
  299. },
  300. onLoad() {
  301. this.setScrollHeight()
  302. },
  303. methods: {
  304. ...mapActions('cart', ['initCart', 'removeFromCart']),
  305. ...mapMutations('cart', ['selectAllProduct', 'saveCartIds', 'selectAllFailure', 'saveProductIds']),
  306. initData() {
  307. this.saveCartIds([]) // 清空已选项
  308. this.saveProductIds([]) // 清空已选项
  309. this.isCheckAll = false
  310. this.isshowDelbtn = false
  311. // 初始化购物车后也要获取商品下的优惠券列表
  312. this.initCart()
  313. .then(() => {
  314. this.getCouponList()
  315. })
  316. .finally(() => {
  317. this.isRequest = false
  318. })
  319. },
  320. // 获取优惠券列表
  321. getCouponList() {
  322. if (this.isEmpty) return
  323. const productIds = []
  324. this.goodsList.forEach(shop => shop.productList.forEach(product => productIds.push(product.productId)))
  325. this.CouponService.GetCouponByProductIds({ userId: this.userId, productIds: productIds.join(',') }).then(
  326. res => {
  327. this.receiveCouponList = res.data.receiveCouponList
  328. this.ableCouponList = res.data.ableCouponList
  329. this.resetCouponUtil()
  330. }
  331. )
  332. },
  333. resetCouponUtil() {
  334. if (this.receiveCouponList.length <= 0) return
  335. this.selectedPoducts = fetchSelectedProducts(this.goodsList)
  336. this.canUseCouponList = findCouponBySelected(this.productIds, this.receiveCouponList)
  337. this.currentCouponIndex = canUseCoupon(0, this.productIds, this.canUseCouponList, this.selectedPoducts)
  338. },
  339. couponListTabClick(index) {
  340. this.currentTabIndex = index
  341. },
  342. couponClick() {
  343. // 领取优惠券
  344. if (this.currentTabIndex === 1) {
  345. this.getCouponList()
  346. } else {
  347. this.couponVisible = false
  348. }
  349. },
  350. // 领取优惠券弹窗
  351. receiveCoupon() {
  352. this.couponVisible = true
  353. this.getCouponList()
  354. },
  355. // 勾选单个失效商品
  356. chooseFailureProduct() {
  357. this.isSelectAll()
  358. },
  359. // 勾选供应商下所有商品
  360. chooseAllProduct() {
  361. this.isSelectAll()
  362. },
  363. // 勾选单核商品
  364. chooseOneProduct() {
  365. this.isSelectAll()
  366. },
  367. // 勾选全部商品
  368. chooseAll() {
  369. this.isCheckAll = !this.isCheckAll
  370. // 勾选所有有效商品
  371. this.selectAllProduct(this.isCheckAll)
  372. // 勾选所有失效商品
  373. if (this.isshowDelbtn) {
  374. this.selectAllFailure(this.isCheckAll)
  375. }
  376. this.isSelectAll()
  377. },
  378. // 判断是否全选商品
  379. isSelectAll() {
  380. // 是否勾选全部正常商品
  381. this.isCheckAll = this.goodsList.every(shop => shop.checked)
  382. if (this.isshowDelbtn) {
  383. this.isCheckAll = this.isCheckAll && this.failureList.every(product => product.productsChecked)
  384. }
  385. this.getCheckedProductId()
  386. },
  387. // 获取勾选商品的id
  388. getCheckedProductId() {
  389. const cartIds = []
  390. const productIds = []
  391. // 获取所有有效商品cartId
  392. this.goodsList.forEach(shop => {
  393. const ids = shop.productList.reduce((cartIds, prod) => {
  394. if (prod.productsChecked) {
  395. cartIds.push(prod.cartId)
  396. productIds.push(prod.productId)
  397. }
  398. return cartIds
  399. }, [])
  400. cartIds.push(...ids)
  401. })
  402. // 获取所有失效商品cartId
  403. if (this.isshowDelbtn) {
  404. const ids = this.failureList.reduce((cartIds, prod) => {
  405. if (prod.productsChecked) cartIds.push(prod.cartId)
  406. return cartIds
  407. }, [])
  408. cartIds.push(...ids)
  409. }
  410. this.saveProductIds(productIds) // 保存已选商品
  411. this.saveCartIds(cartIds)
  412. this.resetCouponUtil()
  413. },
  414. //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
  415. totalPeice() {
  416. const priceObj = this.goodsList.reduce(
  417. (priceObj, shop) => {
  418. shop.productList.forEach(prod => {
  419. if (prod.productsChecked) {
  420. priceObj.totalOriginalPrice += prod.price * prod.productCount
  421. // 单品满减
  422. if (prod.promotion && prod.promotion.type * 1 === 1 && prod.promotion.mode * 1 === 2) {
  423. // 单品满减-重新计算供应商总价/满减金额
  424. if (prod.price * prod.productCount >= prod.promotion.touchPrice) {
  425. priceObj.reducedPrice += prod.promotion.reducedPrice
  426. }
  427. }
  428. }
  429. })
  430. priceObj.allPrice = priceObj.totalOriginalPrice - priceObj.reducedPrice
  431. return priceObj
  432. },
  433. {
  434. totalOriginalPrice: 0,
  435. reducedPrice: 0,
  436. allPrice: 0
  437. }
  438. )
  439. this.allPrice = priceObj.allPrice
  440. },
  441. //显示删除商品管理
  442. showDelManager() {
  443. this.isshowDelbtn = true
  444. },
  445. //隐藏删除商品管理
  446. hideDelManage() {
  447. this.selectAllFailure(false)
  448. this.isSelectAll()
  449. this.isshowDelbtn = false
  450. },
  451. //删除购物车商品
  452. deleteList() {
  453. if (this.cartIds.length <= 0) {
  454. return this.$util.msg('请选择要删除的商品~', 2000)
  455. } else {
  456. this.modal = true
  457. this.contentModalText = '确定删除选中的商品吗?'
  458. }
  459. },
  460. //从购物车移除商品
  461. handleClick(e) {
  462. if (e.index !== 1) return (this.modal = false)
  463. // 删除所有勾选的商品
  464. this.removeFromCart().finally(() => {
  465. this.isshowDelbtn = false
  466. })
  467. this.modal = false
  468. },
  469. // 关闭优惠券弹窗
  470. closeCouponList() {
  471. this.couponVisible = false
  472. },
  473. // 活动价弹窗
  474. clickPopupShow(pros, type) {
  475. if (pros.ladderList.length > 0) {
  476. this.popupShow = true
  477. this.handlerPros = pros
  478. }
  479. },
  480. // 优惠明细
  481. showDiscountedDetail() {
  482. this.showDitail = true
  483. },
  484. //跳转确认订单页面
  485. toConfirmation() {
  486. if (this.cartIds.length <= 0) {
  487. return this.$util.msg('请先选择结算商品~', 2000)
  488. }
  489. let cartPramsData = {
  490. allPrice: this.allPrice,
  491. allCount: this.allCount,
  492. cartIds: this.cartIds.join(','),
  493. productIds: this.productIds.join(','),
  494. productCount: ''
  495. }
  496. uni.setStorageSync('commitCartPramsData', cartPramsData)
  497. this.$api.navigateTo('/pages/order/create-order')
  498. },
  499. hideModal() {
  500. this.modal = false
  501. },
  502. navToListPage(item) {
  503. this.$api.navigateTo(`/pages/goods/product?productId=${item.productId}`)
  504. },
  505. // 窗口高度-footer高度
  506. setScrollHeight() {
  507. const { windowHeight, pixelRatio } = uni.getSystemInfoSync()
  508. setTimeout(() => {
  509. const query = uni.createSelectorQuery().in(this)
  510. query.selectAll('.footer').boundingClientRect()
  511. query.exec(res => {
  512. this.windowHeight = windowHeight
  513. if (res[0][0]) {
  514. this.scrollHeight = windowHeight - res[0][0].height
  515. }
  516. })
  517. }, 500)
  518. }
  519. }
  520. }
  521. </script>
  522. <style lang="scss" scoped>
  523. .cart {
  524. padding-bottom: 100rpx;
  525. background: #f7f7f7;
  526. min-height: 100%;
  527. box-sizing: border-box;
  528. &.hasPaddingTop {
  529. padding-top: 170rpx;
  530. }
  531. .fixed {
  532. position: fixed;
  533. top: 0;
  534. flex: 0;
  535. z-index: 9999;
  536. }
  537. .cart-top {
  538. display: flex;
  539. justify-content: space-between;
  540. align-items: center;
  541. padding: 0 24rpx;
  542. width: 750rpx;
  543. height: 80rpx;
  544. background: #f7f7f7;
  545. box-sizing: border-box;
  546. .count {
  547. font-size: 30rpx;
  548. color: #333333;
  549. }
  550. .btn {
  551. display: flex;
  552. justify-content: center;
  553. align-items: center;
  554. width: 88rpx;
  555. height: 42rpx;
  556. background: #fff8fd;
  557. border: 1rpx solid #ff457b;
  558. border-radius: 24rpx;
  559. font-size: 26rpx;
  560. color: #ff457b;
  561. }
  562. }
  563. .receive-coupon {
  564. display: flex;
  565. justify-content: space-between;
  566. align-items: center;
  567. padding: 24rpx;
  568. background: #fff;
  569. .tip-text {
  570. width: 560rpx;
  571. font-size: 26rpx;
  572. color: #ff457b;
  573. white-space: nowrap;
  574. overflow: hidden;
  575. text-overflow: ellipsis;
  576. }
  577. .btn {
  578. width: 88rpx;
  579. height: 42rpx;
  580. background: linear-gradient(270deg, #f83c6c 0%, #fc32b4 100%);
  581. border-radius: 28rpx;
  582. font-size: 26rpx;
  583. color: #ffffff;
  584. text-align: center;
  585. line-height: 42rpx;
  586. }
  587. }
  588. .footer {
  589. position: fixed;
  590. bottom: 0;
  591. left: 0;
  592. z-index: 899;
  593. display: flex;
  594. justify-content: space-between;
  595. align-items: center;
  596. width: 100%;
  597. height: 100rpx;
  598. box-sizing: border-box;
  599. padding: 0 24rpx;
  600. border-top: 1rpx solid #eee;
  601. background: #ffffff;
  602. .radio {
  603. font-size: 36rpx;
  604. color: #b2b2b2;
  605. .icon-xuanze {
  606. color: #f83c6c;
  607. }
  608. .tip {
  609. font-size: 30rpx;
  610. color: #333333;
  611. margin-left: 6rpx;
  612. }
  613. }
  614. .row {
  615. &:nth-child(1) {
  616. font-size: 26rpx;
  617. color: #333333;
  618. .total-price {
  619. color: #ff457b;
  620. .delete{
  621. font-size: 20rpx;
  622. color: #999999;
  623. text-decoration: line-through;
  624. font-weight: normal;
  625. margin-left: 10rpx;
  626. }
  627. }
  628. }
  629. &:nth-child(2) {
  630. margin-top: 6rpx;
  631. font-size: 24rpx;
  632. color: #ff457b;
  633. }
  634. .discounted-price {
  635. margin-right: 32rpx;
  636. }
  637. }
  638. .submit {
  639. width: 210rpx;
  640. height: 80rpx;
  641. background: linear-gradient(90deg, #fc32b4 0%, #f83c6c 100%);
  642. border-radius: 40rpx;
  643. font-size: 30rpx;
  644. color: #ffffff;
  645. text-align: center;
  646. line-height: 80rpx;
  647. }
  648. .footer-del {
  649. width: 420rpx;
  650. height: 100rpx;
  651. position: absolute;
  652. padding-left: 200rpx;
  653. background: #ffffff;
  654. right: 0;
  655. top: 0;
  656. z-index: 1000;
  657. box-sizing: border-box;
  658. padding: 10rpx 0;
  659. display: flex;
  660. &.show {
  661. animation: showDelbtn 0s linear both;
  662. }
  663. &.none {
  664. animation: hideDelbtn 0s linear both;
  665. }
  666. .btn {
  667. flex: 1;
  668. margin: 0 8rpx;
  669. height: 100%;
  670. line-height: 80rpx;
  671. font-size: $font-size-28;
  672. color: #ffffff;
  673. text-align: center;
  674. float: left;
  675. border-radius: 40rpx;
  676. }
  677. .btn.btn-cancel {
  678. background: #f7f7f7;
  679. color: #b2b2b2;
  680. }
  681. .btn.btn-confirm {
  682. background: $btn-confirm;
  683. color: #ffffff;
  684. }
  685. @keyframes showDelbtn {
  686. 0% {
  687. transform: translateX(0);
  688. }
  689. 100% {
  690. transform: translateX(-100%);
  691. }
  692. }
  693. @keyframes hideDelbtn {
  694. 0% {
  695. transform: translateX(-100%);
  696. }
  697. 100% {
  698. transform: translateX(0);
  699. }
  700. }
  701. }
  702. }
  703. .discounted-ditail {
  704. padding: 52rpx 8rpx 0;
  705. .row {
  706. display: flex;
  707. justify-content: space-between;
  708. align-items: center;
  709. padding: 12rpx 0;
  710. text {
  711. font-size: 30rpx;
  712. color: #333333;
  713. &.red {
  714. color: #f94b4b;
  715. }
  716. }
  717. &.total {
  718. font-size: 30rpx;
  719. font-weight: 600;
  720. .price{
  721. .delete{
  722. font-size: 24rpx;
  723. color: #999999;
  724. text-decoration: line-through;
  725. font-weight: normal;
  726. margin-left: 10rpx;
  727. }
  728. }
  729. }
  730. }
  731. .tip {
  732. padding: 12rpx 0;
  733. font-size: 26rpx;
  734. color: #999999;
  735. }
  736. }
  737. .empty {
  738. height: 80vh;
  739. }
  740. }
  741. </style>