index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. <template>
  2. <view class="pages">
  3. <!-- head -->
  4. <sklineHeader title="购物车"></sklineHeader>
  5. <view class="cart-body">
  6. <!-- 内容 -->
  7. <scroll-view
  8. scroll-y
  9. class="cart-list"
  10. type="custom"
  11. :bounces="false"
  12. @scrolltolower="onreachBottom">
  13. <sticky-header>
  14. <!-- 头部 -->
  15. <view class="cart-head" v-if="total>0">
  16. <view class="cart-head-left">共<text>{{total}}</text>款商品</view>
  17. <view class="cart-head-right">
  18. <view class="cart-head-btton blue" @click="editAll">
  19. <text>{{editFlag?'完成':'编辑'}}</text>
  20. </view>
  21. </view>
  22. </view>
  23. </sticky-header>
  24. <productItem
  25. v-for="(item, index) in list"
  26. :key="index"
  27. :list="item"
  28. @changeQty="changeQty"
  29. @check="chooseItem"
  30. @editQty="editQty"
  31. @remove="removeCart">
  32. </productItem>
  33. <!-- loading -->
  34. <view class="loading-bar" v-if="total>0 && status!='loading'">{{noDataText}}</view>
  35. <view class="empty-bar" v-if="total==0 && status!='loading'" @click="goBack">
  36. <image mode="aspectFit" :src="empty.imgUrl"></image>
  37. <view>{{empty.tip}}</view>
  38. </view>
  39. </scroll-view>
  40. <!-- 底部 -->
  41. <view class="cart-footer" v-if="total>0">
  42. <view class="cart-footer-box">
  43. <view class="cart-footer-left">
  44. <view class="cart-footer-left-all" @click="chooseAll">
  45. <view class="cart-footer-left-all-icon">
  46. <uni-icons v-if="allDisabled&&!editFlag" type="circle-filled" size="24" color="#ccc"></uni-icons>
  47. <uni-icons v-else :type="allChecked?'checkbox-filled':'circle'" size="24" :color="allChecked?'#dd0000':'#666'"></uni-icons>
  48. </view>
  49. <view class="cart-footer-left-all-text">
  50. <text>全选</text>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="cart-footer-right">
  55. <view class="cart-footer-left-price" v-if="!editFlag && totalAmount">
  56. <view class="flex align_center">
  57. <view class="cart-footer-left-price-text">
  58. <text>合计:</text>
  59. </view>
  60. <view class="cart-footer-left-price-num">
  61. ¥<text>{{Number(totalAmount).toFixed(2).toString().split('.')[0]}}</text>.{{Number(totalAmount).toFixed(2).toString().split('.')[1]}}
  62. </view>
  63. </view>
  64. <view class="flex align_center" v-if="totalDiscount||totalCoupon">
  65. <view class="cart-footer-left-price-text1">
  66. <text v-if="totalDiscount">优惠:¥{{Number(totalDiscount).toFixed(2)}}</text>
  67. <text v-if="totalCoupon">代金券:¥{{Number(totalCoupon).toFixed(2)}}</text>
  68. </view>
  69. </view>
  70. </view>
  71. <view v-else></view>
  72. <view class="cart-footer-right-button">
  73. <button class="btns" :loading="loading" v-if="!editFlag" type="warn" size="mini" @click="settlement">去结算({{totalNum}})</button>
  74. <button v-else class="btns" type="warn" plain size="mini" @click="batchRemove">删除({{totalSel}})</button>
  75. </view>
  76. </view>
  77. </view>
  78. <view :style="{height:safeAreaBottom+'px'}"></view>
  79. </view>
  80. </view>
  81. <!-- 修改数量弹框 -->
  82. <uni-popup ref="showPopu" type="center" :maskClick="false">
  83. <view class="popu-content">
  84. <view class="popu-close" @click="closePopu">
  85. <uni-icons size="26" type="closeempty"></uni-icons>
  86. </view>
  87. <view class="popu-content-title flex align_center justify_center"><text>修改商品数量</text></view>
  88. <view class="popu-content-num flex align_center justify_center">
  89. <uni-number-box v-model="curEditRow.qty" :size="28" :input-width="280" :input-height="70" :min="1" :max="999"></uni-number-box>
  90. </view>
  91. <view class="popu-content-btn">
  92. <view class="popu-content-btn-item cancelBtn" @click="closePopu">取消</view>
  93. <view class="popu-content-btn-item okbtn" @click="changeSingQty">确定</view>
  94. </view>
  95. </view>
  96. </uni-popup>
  97. </view>
  98. </template>
  99. <script>
  100. import {
  101. mapState,
  102. mapMutations,
  103. } from 'vuex'
  104. import productItem from '@/pagesB/cart/productitem.vue'
  105. import sklineHeader from '../../components/skline/sklineHeader.vue'
  106. import { getCartList, updateCart, deleteCart } from '@/api/cart.js'
  107. import { purchaseSave, purchaseCheck } from '@/api/purchase.js'
  108. export default {
  109. components:{
  110. productItem,
  111. sklineHeader
  112. },
  113. onLoad() {
  114. // 计算区域高度
  115. this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
  116. this.screenWidth = uni.getSystemInfoSync().windowWidth
  117. this.screenHeight = uni.getSystemInfoSync().windowHeight
  118. this.safeAreaBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
  119. // 获取列表数据
  120. this.pageInit()
  121. },
  122. data() {
  123. return {
  124. loading: false,
  125. status: 'loading',
  126. noDataText: '暂无产品',
  127. empty: {
  128. tip: '购物车空空的,去挑选商品吧',
  129. imgUrl: '/static/kongCart.png'
  130. },
  131. // 查询条件
  132. pageNo: 1, // 页数
  133. pageSize: 10000, // 每页数
  134. list: [], // 列表数据
  135. total: 0, // 总款数
  136. totalAmount: 0, // 总金额
  137. totalDiscount:0, // 总优惠
  138. totalCoupon: 0, // 总代金券
  139. totalNum: 0, // 总数量
  140. totalSel: 0, // 已选数量
  141. editFlag: false, // 是否编辑状态
  142. allChecked: false, // 是否全选
  143. screenWidth: 325, // 屏幕宽度
  144. screenHeight: 0, // 屏幕高度
  145. statusBarHeight: 44, // 状态栏高度
  146. safeAreaBottom: 0, // 底部安全区域高度
  147. curEditRow: null
  148. }
  149. },
  150. computed: {
  151. ...mapState(['hasLogin']),
  152. userInfo(){
  153. return this.$store.state.vuex_userInfo
  154. },
  155. allDisabled(){
  156. let ret = false
  157. if(!this.editFlag){
  158. this.list.forEach(key => {
  159. ret = key.every(item => !item.status || item.status==0 || item.dealerScopeFlag==0)
  160. })
  161. }
  162. return ret
  163. }
  164. },
  165. methods: {
  166. goBack(){
  167. uni.navigateBack()
  168. },
  169. pageInit(){
  170. this.allChecked = false
  171. this.pageNo = 1
  172. this.list = []
  173. this.getRow()
  174. },
  175. // 关闭弹框
  176. closePopu(){
  177. this.$refs.showPopu.close()
  178. this.curEditRow = null
  179. },
  180. // 打开编辑数量弹框
  181. editQty(item){
  182. this.curEditRow = JSON.parse(JSON.stringify(item))
  183. this.$refs.showPopu.open()
  184. },
  185. // 确定修改
  186. changeSingQty(){
  187. this.changeQty(this.curEditRow.qty,this.curEditRow.cartSn)
  188. },
  189. // 查询列表
  190. getRow (pageNo) {
  191. let _this = this
  192. if (pageNo) {
  193. this.pageNo = pageNo
  194. }
  195. let params = {
  196. pageNo: this.pageNo,
  197. pageSize: this.pageSize,
  198. queryWord: this.queryWord
  199. }
  200. this.status = "loading"
  201. getCartList(params).then(res => {
  202. if (res.status == 200) {
  203. _this.total = res.data.count || 0
  204. const list = res.data.list
  205. for(let i=0;i<list.length;i=i+10){
  206. _this.list.push(list.slice(i,(i+10)>list.length?list.length:(i+10)).map(key=>{
  207. const a = key.shopPromoProduct
  208. key.orginPrice = key.price
  209. if(a){
  210. key.promoType = a.promoType
  211. key.resultValue = a.resultValue
  212. key.conditionValue = a.conditionValue
  213. key.discountType = a.discountType
  214. key.promoProductSn = a.promoProductSn
  215. key.promoSn = a.promoSn
  216. // 特价
  217. if(key.promoType=='PROMO_PROD'){
  218. key.price = key.conditionValue
  219. }
  220. }
  221. key.priceStr = Number(key.price).toFixed(2).toString().split('.')
  222. delete key.shopPromoProduct
  223. return {
  224. id: key.id,
  225. edit: false,
  226. checked: _this.allChecked,
  227. cartSn: key.cartSn,
  228. price: key.price,
  229. orginPrice: key.orginPrice,
  230. priceStr: key.priceStr,
  231. qty: key.qty,
  232. productSn: key.productSn,
  233. productName: key.productEntity.productName,
  234. productImage: key.productEntity.images,
  235. productCode: key.productEntity.code,
  236. productOrigCode: key.productEntity.origCode,
  237. unit: key.productEntity.unit,
  238. status: key.status,
  239. dealerScopeFlag: key.dealerScopeFlag,
  240. resultValue: key.resultValue,
  241. conditionValue: key.conditionValue,
  242. discountType: key.discountType,
  243. promoType: key.promoType,
  244. promoProductSn: key.promoProductSn,
  245. promoSn: key.promoSn,
  246. giftQty: 0
  247. }
  248. }))
  249. }
  250. // 默认全选
  251. if(_this.pageNo == 1){
  252. _this.chooseAll()
  253. }
  254. // 判断是否最后一页
  255. const maxPages = Math.ceil(_this.total / _this.pageSize)
  256. if(this.pageNo >= maxPages){
  257. _this.status = 'nomore'
  258. _this.noDataText = '没有更多了'
  259. }else{
  260. _this.status = 'loadmore'
  261. _this.noDataText = '加载更多'
  262. }
  263. } else {
  264. _this.list = []
  265. _this.total = 0
  266. _this.status = 'loadmore'
  267. _this.noDataText = res.message
  268. }
  269. })
  270. },
  271. // scroll-view到底部加载更多
  272. onreachBottom() {
  273. // 判断是否最后一页
  274. const maxPages = Math.ceil(this.total / this.pageSize)
  275. if(this.pageNo >= maxPages){
  276. this.status = "nomore"
  277. this.noDataText = '没有更多了'
  278. }else{
  279. this.pageNo += 1
  280. this.getRow()
  281. }
  282. },
  283. // 根据cartSn查找
  284. getItemById(cartSn){
  285. const a = this.list.findIndex(k => k.find(s=> s.cartSn == cartSn))
  286. const b = a>=0 ? this.list[a].findIndex(s=> s.cartSn == cartSn) : -1
  287. return {p:a,s:b}
  288. },
  289. // 已选产品变更数量
  290. changeQty(val,cartSn){
  291. uni.showLoading({
  292. title: '加载中'
  293. })
  294. updateCart({
  295. cartSn: cartSn,
  296. qty: val
  297. }).then(res => {
  298. if(res.status == 200){
  299. const crow = this.getItemById(cartSn)
  300. if(crow.p>=0&&crow.s>=0){
  301. this.list[crow.p][crow.s].qty = val
  302. this.list[crow.p].splice()
  303. // 合计
  304. this.getChooseHeji()
  305. uni.$emit('refashCart')
  306. }
  307. this.closePopu()
  308. }else{
  309. uni.showToast({
  310. title: res.message,
  311. icon: 'none'
  312. })
  313. }
  314. uni.hideLoading()
  315. })
  316. },
  317. // 单选择
  318. chooseItem(cartSn){
  319. const crow = this.getItemById(cartSn)
  320. if(crow.p>=0&&crow.s>=0){
  321. this.list[crow.p][crow.s].checked = !this.list[crow.p][crow.s].checked
  322. // 合计
  323. this.getChooseHeji()
  324. // 判断是否全选
  325. this.isAllChecked()
  326. }
  327. },
  328. // 判断是否全选
  329. isAllChecked(){
  330. if(this.editFlag){
  331. this.allChecked = this.list.every(key => key.every(item => item.checked))
  332. }else{
  333. this.allChecked = this.list.every(key => key.filter(item => item.status==1&&item.dealerScopeFlag==1 ).every(item => item.checked))
  334. }
  335. },
  336. // 编辑
  337. editAll(){
  338. this.editFlag = !this.editFlag
  339. this.list.forEach(key => {
  340. key.forEach(item => {
  341. item.edit = this.editFlag
  342. if(!item.status||item.status==0||item.dealerScopeFlag==0){
  343. item.checked = false
  344. }
  345. })
  346. })
  347. // 合计
  348. this.getChooseHeji()
  349. // 判断是否全选
  350. this.isAllChecked()
  351. },
  352. // 全选
  353. chooseAll(){
  354. if(this.allDisabled){
  355. return
  356. }
  357. this.allChecked = !this.allChecked
  358. this.list.forEach(key => {
  359. // 非编辑模式
  360. if(!this.editFlag){
  361. key.filter(item=>item.status == 1 && item.dealerScopeFlag == 1).forEach(item => {
  362. item.checked = this.allChecked
  363. })
  364. }else{
  365. // 编辑模式
  366. key.forEach(item => {
  367. item.checked = this.allChecked
  368. })
  369. }
  370. })
  371. // 合计
  372. this.getChooseHeji()
  373. },
  374. //单个删除
  375. removeChoose(cartSn,isBatch){
  376. // 删除项
  377. const crow = this.getItemById(cartSn)
  378. if(crow.p>=0&&crow.s>=0){
  379. this.list[crow.p].splice(crow.s, 1);
  380. this.total = this.total - 1
  381. // 合计
  382. if(!isBatch){
  383. this.getChooseHeji()
  384. uni.$emit('refashCart')
  385. // 判断是否全选
  386. this.isAllChecked()
  387. }
  388. }
  389. },
  390. // 批量删除
  391. batchRemove(){
  392. if(this.totalNum==0){
  393. uni.showToast({
  394. title: '请选择产品',
  395. icon: 'none'
  396. })
  397. return false
  398. }
  399. const _this = this
  400. uni.showModal({
  401. title: '提示',
  402. content: '确定删除商品吗?',
  403. confirmText: '确定',
  404. success(res) {
  405. if(res.confirm){
  406. const snList = []
  407. _this.list.forEach(item => {
  408. item.filter(k=>k.checked).forEach(s=>{
  409. snList.push(s.cartSn)
  410. })
  411. })
  412. // 删除购物车
  413. _this.removeCart(snList,true,true)
  414. }
  415. }
  416. })
  417. },
  418. // 删除商品
  419. removeCart(snList,isBatch,isTip){
  420. const _this = this
  421. if(isTip){
  422. uni.showLoading({
  423. title: '删除中'
  424. })
  425. }
  426. deleteCart({cartSns:snList}).then(ret => {
  427. if(ret.status == 200){
  428. snList.forEach(sn => {
  429. _this.removeChoose(sn,isBatch)
  430. })
  431. // 合计,批量操作
  432. if(isBatch){
  433. _this.getChooseHeji()
  434. uni.$emit('refashCart')
  435. // 判断是否全选
  436. _this.isAllChecked()
  437. }
  438. if(isTip){
  439. uni.showToast({
  440. title: '删除成功',
  441. icon: 'none'
  442. })
  443. }
  444. }
  445. uni.hideLoading()
  446. })
  447. },
  448. // 去结算
  449. settlement(){
  450. if(this.totalAmount>0){
  451. // this.submitOrder()
  452. const list = []
  453. this.list.forEach(key => {
  454. const c = key.filter(item => item.checked)
  455. list.push(c)
  456. })
  457. this.$store.state.vuex_tempData = list
  458. uni.navigateTo({
  459. url: '/pagesB/procureOrder/creatOrder'
  460. })
  461. }else{
  462. uni.showToast({
  463. title: '请选择产品',
  464. icon: 'none'
  465. })
  466. }
  467. },
  468. // 去结算
  469. submitOrder(){
  470. const _this = this
  471. // 获取已选商品
  472. const detailList = []
  473. const cartSn = []
  474. _this.list.forEach(key => {
  475. key.filter(item=>item.checked).forEach(item => {
  476. detailList.push({
  477. productSn:item.productSn,
  478. productCode:item.productCode,
  479. qty: item.qty,
  480. price:item.orginPrice,
  481. promoSn: item.promoSn
  482. })
  483. cartSn.push({
  484. cartSn: item.cartSn,
  485. productSn:item.productSn
  486. })
  487. })
  488. })
  489. // 校验并提示信息
  490. purchaseCheck({detailList:detailList}).then(res => {
  491. if(res.status == 200){
  492. const promoChangeFlag = res.data.promoChangeFlag
  493. // 活动变更
  494. if(promoChangeFlag){
  495. uni.showModal({
  496. title: '提示',
  497. content: '促销活动已变更,请刷新?',
  498. confirmText:'确定刷新',
  499. success(ret) {
  500. if(ret.confirm){
  501. _this.pageInit()
  502. }
  503. }
  504. })
  505. return
  506. }
  507. const successList = res.data.successList.map(item => {
  508. return {
  509. productSn:item.productSn,
  510. productCode: item.productCode,
  511. qty: item.qty,
  512. price:item.price,
  513. promoSn: item.promoSn
  514. }
  515. })
  516. const delSn = cartSn.filter(item => successList.find(k => k.productSn == item.productSn)).map(item => item.cartSn)
  517. const removeList = res.data.removeList.map(item => item.productCode)
  518. const selloutList = res.data.selloutList.map(item => item.productCode)
  519. console.log(successList,delSn)
  520. console.log(removeList,selloutList)
  521. // 有已下架或已售罄产品提示
  522. if(removeList.length || selloutList.length){
  523. uni.showModal({
  524. title: '提示',
  525. content: (removeList.length ? `产品${removeList.join(',')}已下架,`:'')+(selloutList.length?`产品${selloutList.join(',')}已售罄,`:'')+`不可采购。`+(successList.length?'是否继续采购其他产品?':''),
  526. showCancel: successList.length,
  527. confirmText: successList.length?'确定':'知道了',
  528. success(ret) {
  529. if(ret.confirm && successList.length){
  530. _this.submitForm(successList,delSn)
  531. }
  532. }
  533. })
  534. }else{
  535. // 提交
  536. _this.submitForm(successList,delSn)
  537. }
  538. }else{
  539. uni.showToast({
  540. title: res.message,
  541. icon: 'none'
  542. })
  543. }
  544. })
  545. },
  546. // 确认提交
  547. submitForm(detailList,cartSn){
  548. uni.showLoading({
  549. title: '提交中...',
  550. mask: true
  551. })
  552. this.loading = true
  553. purchaseSave({
  554. detailList: detailList
  555. }).then(res => {
  556. this.loading = false
  557. uni.hideLoading()
  558. if(res.status == 200){
  559. // 删除已提交产品
  560. this.removeCart(cartSn,true,false)
  561. res.data.detailList = []
  562. this.$store.state.vuex_tempData = res.data
  563. uni.navigateTo({
  564. url: "/pagesB/procureOrder/orderDetail"
  565. })
  566. }else{
  567. uni.showToast({
  568. title: res.message,
  569. icon: 'none'
  570. })
  571. }
  572. })
  573. },
  574. // 计算总款数、合计、数量
  575. getChooseHeji(){
  576. this.totalAmount = 0
  577. this.totalDiscount = 0
  578. this.totalCoupon = 0
  579. this.totalNum = 0
  580. this.totalSel = 0
  581. this.list.forEach(key => {
  582. key.filter(item=>item.checked).forEach(item => {
  583. this.totalAmount += item.price * item.qty // 总金额
  584. this.totalNum += item.qty // 总数量
  585. this.totalSel += 1 // 已选数量
  586. // 如果是返券类型
  587. if(item.promoType=='BUY_PROD_GIVE_VALID'){
  588. this.totalCoupon += item.resultValue * item.qty
  589. }
  590. // 特价
  591. if(item.promoType=='PROMO_PROD'){
  592. this.totalDiscount += (item.orginPrice - item.conditionValue) * item.qty
  593. }
  594. // 满赠
  595. item.giftQty = item.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(item.qty / item.conditionValue)*item.resultValue : 0
  596. })
  597. })
  598. },
  599. }
  600. }
  601. </script>
  602. <style lang="less">
  603. .pages{
  604. height: 100vh;
  605. display: flex;
  606. flex-direction: column;
  607. .popu-content{
  608. background-color: #FFFFFF;
  609. border-radius: 10px;
  610. width: 300px;
  611. display: flex;
  612. flex-direction: column;
  613. align-items: center;
  614. padding: 10px 15px;
  615. .popu-close{
  616. padding: 10px;
  617. position: absolute;
  618. right: 0;
  619. top: 0;
  620. }
  621. .popu-content-title{
  622. padding: 10px;
  623. font-size: 16px;
  624. }
  625. .popu-content-num{
  626. font-size: 14px;
  627. color: #999999;
  628. padding: 10px 0;
  629. > text{
  630. margin-right: 10px;
  631. font-size: 10px;
  632. }
  633. }
  634. .popu-content-btn{
  635. width: 100%;
  636. display: flex;
  637. align-items: center;
  638. justify-content: space-around;
  639. margin: 20px 0 10px;
  640. .popu-content-btn-item{
  641. width: 40%;
  642. height: 32px;
  643. font-size: 14px;
  644. display: flex;
  645. align-items: center;
  646. justify-content: center;
  647. border-radius: 100px;
  648. }
  649. .cancelBtn{
  650. background-color: #f8f8f8;
  651. color: #666;
  652. }
  653. .okbtn{
  654. background-color: #f70000;
  655. color: #FFFFFF;
  656. }
  657. }
  658. }
  659. .cart-body{
  660. position: relative;
  661. flex-grow: 1;
  662. display: flex;
  663. flex-direction: column;
  664. .cart-head{
  665. display: flex;
  666. justify-content: space-between;
  667. align-items: center;
  668. padding: 0 20rpx;
  669. background-color: #FFFFFF;
  670. height: 40px;
  671. .cart-head-left{
  672. display: flex;
  673. align-items: center;
  674. font-size: 28rpx;
  675. color: #333333;
  676. height: 100%;
  677. text{
  678. color: #d81e06;
  679. margin: 0 10rpx;
  680. }
  681. }
  682. .cart-head-right{
  683. display: flex;
  684. align-items: center;
  685. }
  686. .red{
  687. color: #d81e06;
  688. }
  689. .blue{
  690. color: #2196F3;
  691. }
  692. .cart-head-btton{
  693. height: 100%;
  694. font-size: 28rpx;
  695. margin-right: 10px;
  696. }
  697. }
  698. .cart-list{
  699. flex-grow: 1;
  700. background-color: #F5F5F5;
  701. width: 100%;
  702. .loading-bar{
  703. text-align: center;
  704. padding: 10px 0;
  705. color: #999999;
  706. }
  707. .empty-bar{
  708. display: flex;
  709. flex-direction: column;
  710. align-items: center;
  711. justify-content: center;
  712. padding: 20px 0;
  713. margin-top: 20vh;
  714. image{
  715. width: 100px;
  716. height: 100px;
  717. }
  718. view{
  719. font-size: 14px;
  720. color: #999999;
  721. margin-top: 10px;
  722. }
  723. }
  724. }
  725. .cart-footer{
  726. width: 100%;
  727. background-color: #FFFFFF;
  728. .cart-footer-box{
  729. width: 100%;
  730. height: 100rpx;
  731. display: flex;
  732. justify-content: space-between;
  733. align-items: center;
  734. }
  735. .cart-footer-left{
  736. display: flex;
  737. align-items: center;
  738. padding: 0 20rpx 0 36rpx;
  739. .cart-footer-left-all{
  740. display: flex;
  741. align-items: center;
  742. .cart-footer-left-all-text{
  743. margin-left: 10rpx;
  744. font-size: 28rpx;
  745. color: #333333;
  746. }
  747. }
  748. }
  749. .cart-footer-right{
  750. padding: 0 20rpx;
  751. display: flex;
  752. align-items: center;
  753. justify-content: space-between;
  754. flex-grow:1;
  755. .cart-footer-left-price{
  756. flex-grow:1;
  757. > view{
  758. display: flex;
  759. align-items: baseline;
  760. justify-content: flex-end;
  761. }
  762. .cart-footer-left-price-text{
  763. font-size: 24rpx;
  764. color: #333333;
  765. }
  766. .cart-footer-left-price-text1{
  767. font-size: 20rpx;
  768. color: #666;
  769. display: flex;
  770. align-items: center;
  771. flex-wrap: wrap;
  772. justify-content: flex-end;
  773. text{
  774. margin-right: 5px;
  775. }
  776. }
  777. .cart-footer-left-price-num{
  778. display: flex;
  779. align-items: baseline;
  780. font-size: 24rpx;
  781. color: #d81e06;
  782. text{
  783. font-size: 32rpx;
  784. }
  785. }
  786. }
  787. .red{
  788. color: #d81e06;
  789. }
  790. .cart-head-btton{
  791. height: 100%;
  792. font-size: 28rpx;
  793. color: #333333;
  794. }
  795. .cart-footer-right-button{
  796. display: flex;
  797. align-items: center;
  798. margin-left: 20rpx;
  799. text-align: right;
  800. .btns{
  801. border-radius: 100rpx;
  802. height: 36px;
  803. padding: 0 10px;
  804. min-width: 80px;
  805. }
  806. }
  807. }
  808. }
  809. }
  810. }
  811. </style>