cart.vue 26 KB

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