cart.vue 26 KB

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