index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818
  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">
  65. <view class="cart-footer-left-price-text1">
  66. <text>优惠:¥{{totalDiscount}}</text>
  67. <text>代金券:¥{{totalCoupon}}</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.pageNo = 1
  171. this.list = []
  172. this.getRow()
  173. },
  174. // 关闭弹框
  175. closePopu(){
  176. this.$refs.showPopu.close()
  177. this.curEditRow = null
  178. },
  179. // 打开编辑数量弹框
  180. editQty(item){
  181. this.curEditRow = JSON.parse(JSON.stringify(item))
  182. this.$refs.showPopu.open()
  183. },
  184. // 确定修改
  185. changeSingQty(){
  186. this.changeQty(this.curEditRow.qty,this.curEditRow.cartSn)
  187. },
  188. // 查询列表
  189. getRow (pageNo) {
  190. let _this = this
  191. if (pageNo) {
  192. this.pageNo = pageNo
  193. }
  194. let params = {
  195. pageNo: this.pageNo,
  196. pageSize: this.pageSize,
  197. queryWord: this.queryWord
  198. }
  199. this.status = "loading"
  200. getCartList(params).then(res => {
  201. if (res.status == 200) {
  202. _this.total = res.data.count || 0
  203. const list = res.data.list
  204. for(let i=0;i<list.length;i=i+10){
  205. _this.list.push(list.slice(i,(i+10)>list.length?list.length:(i+10)).map(key=>{
  206. const a = key.shopPromoProduct
  207. key.orginPrice = key.price
  208. if(a){
  209. key.promoType = a.promoType
  210. key.resultValue = a.resultValue
  211. key.conditionValue = a.conditionValue
  212. key.discountType = a.discountType
  213. key.promoProductSn = a.promoProductSn
  214. key.promoSn = a.promoSn
  215. // 特价
  216. if(key.promoType=='PROMO_PROD'){
  217. // 直降
  218. if(key.discountType == 'STRAIGHT_DOWN'){
  219. key.price = key.price - key.resultValue
  220. }
  221. // 折扣
  222. if(key.discountType == 'DISCOUNT'){
  223. key.price = Number(key.price * key.resultValue).toFixed(2)
  224. }
  225. }
  226. }
  227. delete key.shopPromoProduct
  228. return {
  229. id: key.id,
  230. edit: false,
  231. checked: _this.allChecked,
  232. cartSn: key.cartSn,
  233. price: key.price,
  234. orginPrice: key.orginPrice,
  235. qty: key.qty,
  236. productSn: key.productSn,
  237. productName: key.productEntity.productName,
  238. productImage: key.productEntity.images,
  239. productCode: key.productEntity.code,
  240. productOrigCode: key.productEntity.origCode,
  241. unit: key.productEntity.unit,
  242. status: key.status,
  243. dealerScopeFlag: key.dealerScopeFlag,
  244. resultValue: key.resultValue,
  245. conditionValue: key.conditionValue,
  246. discountType: key.discountType,
  247. promoType: key.promoType,
  248. promoProductSn: key.promoProductSn,
  249. promoSn: key.promoSn,
  250. giftQty: 0
  251. }
  252. }))
  253. }
  254. // 默认全选
  255. if(_this.pageNo == 1){
  256. _this.$nextTick(()=>{
  257. _this.chooseAll()
  258. })
  259. }
  260. // 判断是否最后一页
  261. const maxPages = Math.ceil(_this.total / _this.pageSize)
  262. if(this.pageNo >= maxPages){
  263. _this.status = 'nomore'
  264. _this.noDataText = '没有更多了'
  265. }else{
  266. _this.status = 'loadmore'
  267. _this.noDataText = '加载更多'
  268. }
  269. } else {
  270. _this.list = []
  271. _this.total = 0
  272. _this.status = 'loadmore'
  273. _this.noDataText = res.message
  274. }
  275. })
  276. },
  277. // scroll-view到底部加载更多
  278. onreachBottom() {
  279. // 判断是否最后一页
  280. const maxPages = Math.ceil(this.total / this.pageSize)
  281. if(this.pageNo >= maxPages){
  282. this.status = "nomore"
  283. this.noDataText = '没有更多了'
  284. }else{
  285. this.pageNo += 1
  286. this.getRow()
  287. }
  288. },
  289. // 根据cartSn查找
  290. getItemById(cartSn){
  291. const a = this.list.findIndex(k => k.find(s=> s.cartSn == cartSn))
  292. const b = a>=0 ? this.list[a].findIndex(s=> s.cartSn == cartSn) : -1
  293. return {p:a,s:b}
  294. },
  295. // 已选产品变更数量
  296. changeQty(val,cartSn){
  297. uni.showLoading({
  298. title: '加载中'
  299. })
  300. updateCart({
  301. cartSn: cartSn,
  302. qty: val
  303. }).then(res => {
  304. if(res.status == 200){
  305. const crow = this.getItemById(cartSn)
  306. if(crow.p>=0&&crow.s>=0){
  307. this.list[crow.p][crow.s].qty = val
  308. this.list[crow.p].splice()
  309. // 合计
  310. this.getChooseHeji()
  311. uni.$emit('refashCart')
  312. }
  313. this.closePopu()
  314. }else{
  315. uni.showToast({
  316. title: res.message,
  317. icon: 'none'
  318. })
  319. }
  320. uni.hideLoading()
  321. })
  322. },
  323. // 单选择
  324. chooseItem(cartSn){
  325. const crow = this.getItemById(cartSn)
  326. if(crow.p>=0&&crow.s>=0){
  327. this.list[crow.p][crow.s].checked = !this.list[crow.p][crow.s].checked
  328. // 合计
  329. this.getChooseHeji()
  330. // 判断是否全选
  331. this.isAllChecked()
  332. }
  333. },
  334. // 判断是否全选
  335. isAllChecked(){
  336. if(this.editFlag){
  337. this.allChecked = this.list.every(key => key.every(item => item.checked))
  338. }else{
  339. this.allChecked = this.list.every(key => key.filter(item => item.status==1&&item.dealerScopeFlag==1 ).every(item => item.checked))
  340. }
  341. },
  342. // 编辑
  343. editAll(){
  344. this.editFlag = !this.editFlag
  345. this.list.forEach(key => {
  346. key.forEach(item => {
  347. item.edit = this.editFlag
  348. if(!item.status||item.status==0||item.dealerScopeFlag==0){
  349. item.checked = false
  350. }
  351. })
  352. })
  353. // 合计
  354. this.getChooseHeji()
  355. // 判断是否全选
  356. this.isAllChecked()
  357. },
  358. // 清空购物车
  359. clearAll(){
  360. const _this = this
  361. uni.showModal({
  362. title: '提示',
  363. content: '确定清空购物车?',
  364. confirmText: '确定',
  365. success(res) {
  366. if(res.confirm){
  367. uni.showLoading({
  368. title: '正在清空...',
  369. mask: true
  370. })
  371. }
  372. }
  373. })
  374. },
  375. // 全选
  376. chooseAll(){
  377. if(this.allDisabled){
  378. return
  379. }
  380. this.allChecked = !this.allChecked
  381. this.list.forEach(key => {
  382. // 非编辑模式
  383. if(!this.editFlag){
  384. key.filter(item=>item.status == 1 && item.dealerScopeFlag == 1).forEach(item => {
  385. item.checked = this.allChecked
  386. })
  387. }else{
  388. // 编辑模式
  389. key.forEach(item => {
  390. item.checked = this.allChecked
  391. })
  392. }
  393. })
  394. // 合计
  395. this.getChooseHeji()
  396. },
  397. //单个删除
  398. removeChoose(cartSn,isBatch){
  399. // 删除项
  400. const crow = this.getItemById(cartSn)
  401. if(crow.p>=0&&crow.s>=0){
  402. this.list[crow.p].splice(crow.s, 1);
  403. this.total = this.total - 1
  404. // 合计
  405. if(!isBatch){
  406. this.getChooseHeji()
  407. uni.$emit('refashCart')
  408. // 判断是否全选
  409. this.isAllChecked()
  410. }
  411. }
  412. },
  413. // 批量删除
  414. batchRemove(){
  415. if(this.totalNum==0){
  416. uni.showToast({
  417. title: '请选择产品',
  418. icon: 'none'
  419. })
  420. return false
  421. }
  422. const _this = this
  423. uni.showModal({
  424. title: '提示',
  425. content: '确定删除商品吗?',
  426. confirmText: '确定',
  427. success(res) {
  428. if(res.confirm){
  429. const snList = []
  430. _this.list.forEach(item => {
  431. item.filter(k=>k.checked).forEach(s=>{
  432. snList.push(s.cartSn)
  433. })
  434. })
  435. // 删除购物车
  436. _this.removeCart(snList,true,true)
  437. }
  438. }
  439. })
  440. },
  441. // 删除商品
  442. removeCart(snList,isBatch,isTip){
  443. const _this = this
  444. if(isTip){
  445. uni.showLoading({
  446. title: '删除中'
  447. })
  448. }
  449. deleteCart({cartSns:snList}).then(ret => {
  450. if(ret.status == 200){
  451. snList.forEach(sn => {
  452. _this.removeChoose(sn,isBatch)
  453. })
  454. // 合计,批量操作
  455. if(isBatch){
  456. _this.getChooseHeji()
  457. uni.$emit('refashCart')
  458. // 判断是否全选
  459. _this.isAllChecked()
  460. }
  461. if(isTip){
  462. uni.showToast({
  463. title: '删除成功',
  464. icon: 'none'
  465. })
  466. }
  467. }
  468. uni.hideLoading()
  469. })
  470. },
  471. // 去结算
  472. settlement(){
  473. if(this.totalAmount>0){
  474. this.submitOrder()
  475. }else{
  476. uni.showToast({
  477. title: '请选择产品',
  478. icon: 'none'
  479. })
  480. }
  481. },
  482. // 去结算
  483. submitOrder(){
  484. const _this = this
  485. // 获取已选商品
  486. const detailList = []
  487. const cartSn = []
  488. _this.list.forEach(key => {
  489. key.filter(item=>item.checked).forEach(item => {
  490. detailList.push({
  491. productSn:item.productSn,
  492. productCode:item.productCode,
  493. qty: item.qty,
  494. price:item.orginPrice,
  495. })
  496. cartSn.push({
  497. cartSn: item.cartSn,
  498. productSn:item.productSn
  499. })
  500. })
  501. })
  502. // 校验并提示信息
  503. purchaseCheck({detailList:detailList}).then(res => {
  504. if(res.status == 200){
  505. const successList = res.data.successList.map(item => {
  506. return {
  507. productSn:item.productSn,
  508. productCode: item.productCode,
  509. qty: item.qty,
  510. price:item.price
  511. }
  512. })
  513. const delSn = cartSn.filter(item => successList.find(k => k.productSn == item.productSn)).map(item => item.cartSn)
  514. const removeList = res.data.removeList.map(item => item.productCode)
  515. const selloutList = res.data.selloutList.map(item => item.productCode)
  516. console.log(successList,delSn)
  517. console.log(removeList,selloutList)
  518. // 有已下架或已售罄产品提示
  519. if(removeList.length || selloutList.length){
  520. uni.showModal({
  521. title: '提示',
  522. content: (removeList.length ? `产品${removeList.join(',')}已下架,`:'')+(selloutList.length?`产品${selloutList.join(',')}已售罄,`:'')+`不可采购。`+(successList.length?'是否继续采购其他产品?':''),
  523. showCancel: successList.length,
  524. confirmText: successList.length?'确定':'知道了',
  525. success(ret) {
  526. if(ret.confirm && successList.length){
  527. _this.submitForm(successList,delSn)
  528. }
  529. }
  530. })
  531. }else{
  532. // 提交
  533. _this.submitForm(successList,delSn)
  534. }
  535. }else{
  536. uni.showToast({
  537. title: res.message,
  538. icon: 'none'
  539. })
  540. }
  541. })
  542. },
  543. // 确认提交
  544. submitForm(detailList,cartSn){
  545. uni.showLoading({
  546. title: '提交中...',
  547. mask: true
  548. })
  549. this.loading = true
  550. purchaseSave({
  551. detailList: detailList
  552. }).then(res => {
  553. this.loading = false
  554. uni.hideLoading()
  555. if(res.status == 200){
  556. // 删除已提交产品
  557. this.removeCart(cartSn,true,false)
  558. res.data.detailList = []
  559. this.$store.state.vuex_tempData = res.data
  560. uni.navigateTo({
  561. url: "/pagesB/procureOrder"
  562. })
  563. }else{
  564. uni.showToast({
  565. title: res.message,
  566. icon: 'none'
  567. })
  568. }
  569. })
  570. },
  571. // 计算总款数、合计、数量
  572. getChooseHeji(){
  573. this.totalAmount = 0
  574. this.totalDiscount = 0
  575. this.totalCoupon = 0
  576. this.totalNum = 0
  577. this.totalSel = 0
  578. this.list.forEach(key => {
  579. key.filter(item=>item.checked).forEach(item => {
  580. this.totalAmount += item.price * item.qty // 总金额
  581. this.totalNum += item.qty // 总数量
  582. this.totalSel += 1 // 已选数量
  583. // 如果是返券类型
  584. if(item.promoType=='BUY_PROD_GIVE_VALID'){
  585. this.totalCoupon += item.resultValue * item.qty
  586. }
  587. // 特价
  588. if(item.promoType=='PROMO_PROD'){
  589. // 直降
  590. if(item.discountType == 'STRAIGHT_DOWN'){
  591. this.totalDiscount += item.resultValue * item.qty
  592. }
  593. // 折扣
  594. if(item.discountType == 'DISCOUNT'){
  595. this.totalDiscount += Number(item.price * (1-item.resultValue)) * item.qty
  596. }
  597. }
  598. // 满赠
  599. item.giftQty = item.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(item.qty / item.conditionValue)*item.resultValue : 0
  600. })
  601. })
  602. },
  603. }
  604. }
  605. </script>
  606. <style lang="less">
  607. .pages{
  608. height: 100vh;
  609. display: flex;
  610. flex-direction: column;
  611. .popu-content{
  612. background-color: #FFFFFF;
  613. border-radius: 10px;
  614. width: 300px;
  615. display: flex;
  616. flex-direction: column;
  617. align-items: center;
  618. padding: 10px 15px;
  619. .popu-close{
  620. padding: 10px;
  621. position: absolute;
  622. right: 0;
  623. top: 0;
  624. }
  625. .popu-content-title{
  626. padding: 10px;
  627. font-size: 16px;
  628. }
  629. .popu-content-num{
  630. font-size: 14px;
  631. color: #999999;
  632. padding: 10px 0;
  633. > text{
  634. margin-right: 10px;
  635. font-size: 10px;
  636. }
  637. }
  638. .popu-content-btn{
  639. width: 100%;
  640. display: flex;
  641. align-items: center;
  642. justify-content: space-around;
  643. margin: 20px 0 10px;
  644. .popu-content-btn-item{
  645. width: 40%;
  646. height: 36px;
  647. font-size: 14px;
  648. display: flex;
  649. align-items: center;
  650. justify-content: center;
  651. border-radius: 100px;
  652. }
  653. .cancelBtn{
  654. background-color: #f8f8f8;
  655. color: #666;
  656. }
  657. .okbtn{
  658. background-color: #f70000;
  659. color: #FFFFFF;
  660. }
  661. }
  662. }
  663. .cart-body{
  664. position: relative;
  665. flex-grow: 1;
  666. display: flex;
  667. flex-direction: column;
  668. .cart-head{
  669. display: flex;
  670. justify-content: space-between;
  671. align-items: center;
  672. padding: 0 20rpx;
  673. background-color: #FFFFFF;
  674. height: 40px;
  675. .cart-head-left{
  676. display: flex;
  677. align-items: center;
  678. font-size: 28rpx;
  679. color: #333333;
  680. height: 100%;
  681. text{
  682. color: #d81e06;
  683. margin: 0 10rpx;
  684. }
  685. }
  686. .cart-head-right{
  687. display: flex;
  688. align-items: center;
  689. }
  690. .red{
  691. color: #d81e06;
  692. }
  693. .blue{
  694. color: #2196F3;
  695. }
  696. .cart-head-btton{
  697. height: 100%;
  698. font-size: 28rpx;
  699. margin-right: 10px;
  700. }
  701. }
  702. .cart-list{
  703. flex-grow: 1;
  704. background-color: #F5F5F5;
  705. width: 100%;
  706. .loading-bar{
  707. text-align: center;
  708. padding: 10px 0;
  709. color: #999999;
  710. }
  711. .empty-bar{
  712. display: flex;
  713. flex-direction: column;
  714. align-items: center;
  715. justify-content: center;
  716. padding: 20px 0;
  717. margin-top: 20vh;
  718. image{
  719. width: 100px;
  720. height: 100px;
  721. }
  722. view{
  723. font-size: 14px;
  724. color: #999999;
  725. margin-top: 10px;
  726. }
  727. }
  728. }
  729. .cart-footer{
  730. width: 100%;
  731. background-color: #FFFFFF;
  732. .cart-footer-box{
  733. width: 100%;
  734. height: 100rpx;
  735. display: flex;
  736. justify-content: space-between;
  737. align-items: center;
  738. }
  739. .cart-footer-left{
  740. display: flex;
  741. align-items: center;
  742. padding: 0 20rpx 0 36rpx;
  743. .cart-footer-left-all{
  744. display: flex;
  745. align-items: center;
  746. .cart-footer-left-all-text{
  747. margin-left: 10rpx;
  748. font-size: 28rpx;
  749. color: #333333;
  750. }
  751. }
  752. }
  753. .cart-footer-right{
  754. padding: 0 20rpx;
  755. display: flex;
  756. align-items: center;
  757. justify-content: space-between;
  758. flex-grow:1;
  759. .cart-footer-left-price{
  760. flex-grow:1;
  761. > view{
  762. display: flex;
  763. align-items: baseline;
  764. justify-content: flex-end;
  765. }
  766. .cart-footer-left-price-text{
  767. font-size: 24rpx;
  768. color: #333333;
  769. }
  770. .cart-footer-left-price-text1{
  771. font-size: 20rpx;
  772. color: #666;
  773. display: flex;
  774. align-items: center;
  775. margin-top: 2px;
  776. text{
  777. margin-right: 5px;
  778. }
  779. }
  780. .cart-footer-left-price-num{
  781. display: flex;
  782. align-items: baseline;
  783. font-size: 24rpx;
  784. color: #d81e06;
  785. text{
  786. font-size: 32rpx;
  787. }
  788. }
  789. }
  790. .red{
  791. color: #d81e06;
  792. }
  793. .cart-head-btton{
  794. height: 100%;
  795. font-size: 28rpx;
  796. color: #333333;
  797. }
  798. .cart-footer-right-button{
  799. display: flex;
  800. align-items: center;
  801. margin-left: 20rpx;
  802. text-align: right;
  803. .btns{
  804. border-radius: 100rpx;
  805. height: 36px;
  806. }
  807. }
  808. }
  809. }
  810. }
  811. }
  812. </style>