cart.vue 26 KB

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