cart.vue 26 KB

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