index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <view class="requestList">
  3. <!-- header -->
  4. <cu-custom custom bgColor="bg-gradual-blue"><view slot="content">购物车</view></cu-custom>
  5. <view class="setting">
  6. <view class="setting-content flex align-center justify-center padding-sm bg-white">
  7. <view class="left text-cut text-grey">配送至河南省郑州市高新区大学科技园配送至河南省郑州市高新区大学科技园</view>
  8. <view @click="status = !status" class="right margin-left">{{ status ? '完成' : '管理' }}</view>
  9. </view>
  10. </view>
  11. <!-- section -->
  12. <view class="section">
  13. <checkbox-group @change="chooseShop" >
  14. <view v-for="(item, index) in 20" :key="index" class="item flex align-center bg-white radius padding">
  15. <checkbox :value="item" style="transform: scale(0.6);" />
  16. <view class="right flex margin-left">
  17. <view :style="{backgroundImage:'url('+'https://gd-hbimg.huaban.com/d478a9c4bd0167adae79806c6ccaa2d7f59ded5dd101-WmmTdI_fw658/format/webp'+')'}" class="image radius margin-right-sm"></view>
  18. <view class="right-right">
  19. <view class="text-xl">{{item}}</view>
  20. <view style="float: right;"><cu-stepper :value.sync="item" /></view>
  21. </view>
  22. </view>
  23. </view>
  24. </checkbox-group>
  25. </view>
  26. <!-- footer -->
  27. <view class="tool">
  28. <!-- 结算 -->
  29. <view v-if="!status" class="bg-white tool-contentA flex align-center justify-center padding-lr padding-tb-sm">
  30. <view class="left flex ">
  31. <checkbox-group @change="e => (total_lockA = !total_lockA)" class="margin-right flex align-center">
  32. <checkbox style="transform: scale(0.6);" />
  33. <text class="text-lg margin-left-sm">全选</text>
  34. </checkbox-group>
  35. <view class="text-red margin-left">
  36. 合计:
  37. <cu-price :value="price" size="52" />
  38. </view>
  39. </view>
  40. <view class="right"><button class="cu-btn bg-red round shadow-blur">结算</button></view>
  41. </view>
  42. <!-- 管理 -->
  43. <view v-else class="bg-white tool-contentA flex align-center justify-center padding-lr padding-tb-sm">
  44. <view class="left flex ">
  45. <checkbox-group @change="e => (total_lockB = !total_lockB)" class="margin-right flex align-center">
  46. <checkbox style="transform: scale(0.6);" />
  47. <text class="text-lg margin-left-sm">全选</text>
  48. </checkbox-group>
  49. </view>
  50. <view class="right">
  51. <button class="cu-btn bg-red round shadow-blur margin-right">删除</button>
  52. <button class="cu-btn bg-green round shadow-blur">移入收藏</button>
  53. </view>
  54. </view>
  55. </view>
  56. <cu-bar active="2" />
  57. </view>
  58. </template>
  59. <script>
  60. import { mapState, mapMutations, mapActions } from 'vuex';
  61. export default {
  62. data() {
  63. return {
  64. status: false, // false 管理 true 完成
  65. total_lockA: false, //全选
  66. total_lcokB: false, //全选
  67. price: 0 //合计
  68. };
  69. },
  70. computed: {
  71. ...mapState('requestList', ['value'])
  72. },
  73. onLoad() {
  74. // this.requestFunc({
  75. // axios:{},
  76. // reset:true
  77. // });
  78. },
  79. methods: {
  80. ...mapActions('requestList', ['requestFunc']),
  81. chooseShop(e){
  82. console.log(e)
  83. }
  84. },
  85. onShareAppMessage() {
  86. return {};
  87. },
  88. onShareTimeline() {
  89. return {};
  90. },
  91. // 下拉刷新
  92. async onPullDownRefresh() {
  93. // await this.$store.requestList.dispatch('requestFunc',true);
  94. uni.stopPullDownRefresh({});
  95. }
  96. };
  97. </script>
  98. <style lang="scss" scoped>
  99. .requestList {
  100. .section{
  101. .item{
  102. position: relative;
  103. .image{
  104. width: 160upx;
  105. min-width: 160upx;
  106. height: 160upx;
  107. background-size: cover;
  108. background-position: center;
  109. }
  110. .right{
  111. flex: auto;
  112. .right-right{
  113. flex: auto;
  114. }
  115. }
  116. &::after {
  117. content: '';
  118. border-bottom: 1upx solid #eee;
  119. position: absolute;
  120. left: 0;
  121. bottom: 0;
  122. transform: scale(1, 0.5);
  123. width: 100%;
  124. }
  125. }
  126. }
  127. .setting {
  128. height: 80upx;
  129. .setting-content {
  130. position: fixed;
  131. left: 0;
  132. z-index: 9998;
  133. width: 100%;
  134. .left {
  135. flex: auto;
  136. }
  137. .right {
  138. min-width: 60upx;
  139. }
  140. }
  141. }
  142. .tool {
  143. height: 130upx;
  144. .tool-contentA {
  145. position: fixed;
  146. bottom: calc(100rpx + env(safe-area-inset-bottom));
  147. left: 0;
  148. z-index: 9998;
  149. width: 100%;
  150. .left {
  151. flex: auto;
  152. }
  153. &::before {
  154. content: '';
  155. border-top: 1upx solid #aaa;
  156. position: absolute;
  157. left: 0;
  158. top: 0;
  159. transform: scale(1, 0.5);
  160. width: 100%;
  161. }
  162. }
  163. }
  164. }
  165. </style>