cart.vue 27 KB

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