cart.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <v-header title="购物车" mode="">
  3. <view class="screen_all flex" v-if="isLogin">
  4. <view class="flex-all-1 overflow flex">
  5. <view class="car-header row aCenter">
  6. <view class="flex-all-1 row">
  7. <view class="row aCenter" @click="routerHome">
  8. <image src="/static/images/shop.png" class="car-header-icon"></image>
  9. <view class="car-shop-label">{{config.name}}</view>
  10. <text class="iconfont iconfont-more car-header-more"></text>
  11. </view>
  12. </view>
  13. <view @click="triggerEdit" class="car-header-edit">{{edit?'完成':'编辑'}}</view>
  14. </view>
  15. <view class="flex-all-1 overflow">
  16. <flat-list
  17. background="transparent"
  18. @changeData="flatChangeData"
  19. @fetch="fetch"
  20. :ref="base_flat_id"
  21. emptyText="购物车空空如也"
  22. >
  23. <view class="car-padding">
  24. <view class="car-shop row aCenter"
  25. v-for="(item,index) in base_flat_data.data"
  26. :key="index"
  27. @click.stop="triggerSelect(item)"
  28. v-if="!base_flat_remove[item.id]"
  29. >
  30. <v-radio disabled :value="!!selectObject[item.id]" borderColor="#999999" class="car-shop-radio" activeBorderColor="#41AE3C" activeColor="#41AE3C"></v-radio>
  31. <view class="flex-all-1 overflow">
  32. <layout-shop-item
  33. :item="item"
  34. numberEdit
  35. type="car"
  36. @input="triggerInput"
  37. @change="triggerChange"
  38. ></layout-shop-item>
  39. </view>
  40. </view>
  41. </view>
  42. </flat-list>
  43. </view>
  44. </view>
  45. <view v-show="!empty" class="car-footer row aCenter">
  46. <view @click="triggerAllSelect" class="row aCenter">
  47. <v-radio :value="allSelect" disabled size="small" class="car-footer-radio" borderColor="#999999" activeBorderColor="#41AE3C" activeColor="#41AE3C"></v-radio>
  48. <text>全选</text>
  49. </view>
  50. <view class="flex-all-1"></view>
  51. <view v-if="!edit" class="car-footer-right row aCenter">
  52. <view>合计:</view>
  53. <view class="car-footer-price">¥{{total}}</view>
  54. </view>
  55. <view v-if="edit" class="car-footer-button center" @click="deleteCheckShop">删除</view>
  56. <view v-else class="car-footer-button center" @click="triggerOrder">结算</view>
  57. </view>
  58. </view>
  59. <view class="screen_all center" v-else>
  60. <view @click="routerLogin" class="cart-button center">授权登录</view>
  61. </view>
  62. </v-header>
  63. </template>
  64. <script>
  65. import vHeader from '@/components/v-header/main';
  66. import vRadio from '@/components/v-radio/main';
  67. import flatList from '@/components/flat-list/src/main';
  68. import mixins from './mixins';
  69. import layoutShopItem from '../../layout/layout-shop-item/main';
  70. import { mapState } from 'vuex';
  71. export default {
  72. components:{
  73. vHeader,
  74. vRadio,
  75. flatList,
  76. layoutShopItem
  77. },
  78. mixins,
  79. computed:mapState(['config'])
  80. }
  81. </script>
  82. <style lang='scss' scoped src="./style.scss">
  83. </style>