footmark.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view>
  3. <!--标题栏-->
  4. <bar-title bgColor="bg-white" isBack @rightTap="rightTap">
  5. <block slot="content">我的足迹</block>
  6. <block slot="right" v-if="goods_checked">完成</block>
  7. <block slot="right" v-else>编辑</block>
  8. </bar-title>
  9. <!--足迹的tab-->
  10. <view class="bg-white zaiui-nav-view">
  11. <scroll-view scroll-x class="nav z" scroll-with-animation :scroll-left="headTab.scrollLeft">
  12. <block v-for="(item,index) in headTab.list" :key="index">
  13. <view class="cu-item" :class="index==headTab.TabCur?'select':''" @tap="tabSelect" :data-id="index">
  14. <view :class="index==headTab.TabCur?'text-black':''">{{item}}</view>
  15. <view class="tab-dot bg-red"/>
  16. </view>
  17. </block>
  18. </scroll-view>
  19. </view>
  20. <checkbox-group class="block" @change="checkboxChange">
  21. <!--商品列表-->
  22. <view class="bg-white zaiui-goods-list-view" :class="goods_checked?'checked':''">
  23. <view class="zaiui-checkbox-view">
  24. <checkbox class='round red zaiui-checked' :class="checkbox_list[0].checked?'checked':''"
  25. :checked="checkbox_list[0].checked?true:false" :value="checkbox_list[0].id + ''"/>
  26. <view class="text-black">今天</view>
  27. </view>
  28. <view class="zaiui-goods-list-box">
  29. <checkbox class='round red zaiui-checked' :class="checkbox_list[1].checked?'checked':''"
  30. :checked="checkbox_list[1].checked?true:false" :value="checkbox_list[1].id + ''"/>
  31. <view class="cu-avatar radius" :style="[{backgroundImage:'url('+ goods_img +')'}]"/>
  32. <view class="goods-info-view">
  33. <view class="text-cut-2 text-black">商品名称 99新 苹果 iPhoneX</view>
  34. <view class="goods-info-tools">
  35. <text class="text-price text-red text-lg">2999.00</text>
  36. <text class="cu-tag radius line-red sm">找相似</text>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="zaiui-goods-list-box">
  41. <checkbox class='round red zaiui-checked' :class="checkbox_list[2].checked?'checked':''"
  42. :checked="checkbox_list[2].checked?true:false" :value="checkbox_list[2].id + ''"/>
  43. <view class="cu-avatar radius" :style="[{backgroundImage:'url('+ goods_img +')'}]"/>
  44. <view class="goods-info-view">
  45. <view class="text-cut-2 text-black">商品名称 99新 苹果 iPhoneX 256G 银色 测试换行内容的 测试一下效果的</view>
  46. <view class="goods-info-tools">
  47. <text class="text-price text-red text-lg">2999.00</text>
  48. <text class="cu-tag radius line-red sm">找相似</text>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <!--商品列表-->
  54. <view class="bg-white zaiui-goods-list-view" :class="goods_checked?'checked':''">
  55. <view class="zaiui-checkbox-view">
  56. <checkbox class='round red zaiui-checked' :class="checkbox_list[3].checked?'checked':''"
  57. :checked="checkbox_list[3].checked?true:false" :value="checkbox_list[3].id + ''"/>
  58. <view class="text-black">2020-04-01</view>
  59. </view>
  60. <view class="zaiui-goods-list-box zaiui-lower-shelf">
  61. <checkbox class='round red zaiui-checked' :class="checkbox_list[4].checked?'checked':''"
  62. :checked="checkbox_list[4].checked?true:false" :value="checkbox_list[4].id + ''"/>
  63. <view class="cu-avatar radius" :style="[{backgroundImage:'url('+ goods_img_a +')'}]"/>
  64. <view class="img-lower-box">已下架</view>
  65. <view class="goods-info-view">
  66. <view class="text-cut-2 text-black">商品名称 99新 苹果 iPhoneX</view>
  67. <view class="goods-info-tools">
  68. <text class="text-price text-red text-lg">2999.00</text>
  69. <text class="cu-tag radius line-red sm">找相似</text>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="zaiui-goods-list-box zaiui-lower-shelf">
  74. <checkbox class='round red zaiui-checked' :class="checkbox_list[5].checked?'checked':''"
  75. :checked="checkbox_list[5].checked?true:false" :value="checkbox_list[5].id + ''"/>
  76. <view class="cu-avatar radius" :style="[{backgroundImage:'url('+ goods_img_a +')'}]"/>
  77. <view class="img-lower-box">已下架</view>
  78. <view class="goods-info-view">
  79. <view class="text-cut-2 text-black">商品名称 99新 苹果 iPhoneX 256G 银色 测试换行内容的 测试一下效果的</view>
  80. <view class="goods-info-tools">
  81. <text class="text-price text-red text-lg">2999.00</text>
  82. <text class="cu-tag radius line-red sm">找相似</text>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </checkbox-group>
  88. <!--占位底部距离-->
  89. <view class="cu-tabbar-height" v-if="goods_checked"/>
  90. <!--底部操作-->
  91. <view class="bg-white zaiui-footer-fixed zaiui-foot-padding-bottom" v-if="goods_checked">
  92. <view class="cu-bar padding-lr">
  93. <view class="checked-view" @tap="tapChecked">
  94. <checkbox class='round red sm zaiui-checked' :class="checkbox_all?'checked':''" :checked="checkbox_all"/>
  95. <text class="text-black text-lg">全选</text>
  96. </view>
  97. <view class="btn-view">
  98. <button class="cu-btn radius bg-red">删除(3)</button>
  99. </view>
  100. </view>
  101. </view>
  102. <!--小程序端显示-->
  103. <!-- #ifdef MP -->
  104. <!--编辑-->
  105. <view class="zaiui-add-btn-view-box" @tap="rightTap">
  106. <button class="cu-btn cuIcon-check bg-red" v-if="goods_checked"/>
  107. <button class="cu-btn cuIcon-write bg-red" v-else/>
  108. </view>
  109. <!-- #endif -->
  110. </view>
  111. </template>
  112. <script>
  113. import barTitle from '@/components/zaiui-common/basics/bar-title';
  114. import _tool from '@/static/zaiui/util/tools.js'; //工具函数
  115. export default {
  116. components: {
  117. barTitle
  118. },
  119. data() {
  120. return {
  121. headTab: {TabCur: 0, scrollLeft: 0, list: []},
  122. goods_img: '/static/images/home/goods/1.png',
  123. goods_img_a: '/static/images/home/goods/2.png',
  124. checkbox_list: [], checkbox_all: false, goods_checked: false,
  125. }
  126. },
  127. onLoad() {
  128. this.checkbox_list = [
  129. {id: 1,checked: true}, {id: 2,checked: false}, {id: 3,checked: false},
  130. {id: 4,checked: false}, {id: 5,checked: false}, {id: 6,checked: false}
  131. ];
  132. this.headTab.list = ['全部', '手机', '图书', '电脑办公', '游戏交易', '办公用品', '家电', '数码', '教育', '测试', '测试1'];
  133. },
  134. onReady() {
  135. _tool.setBarColor(true);
  136. uni.pageScrollTo({
  137. scrollTop: 0,
  138. duration: 0
  139. });
  140. },
  141. methods: {
  142. //tab菜单被点击
  143. tabSelect(e) {
  144. let index = e.currentTarget.dataset.id;
  145. this.headTab.TabCur = index;
  146. this.headTab.scrollLeft = (index - 1) * 60;
  147. //滚动到顶部
  148. uni.pageScrollTo({
  149. scrollTop: 0,
  150. duration: 100
  151. });
  152. },
  153. //编辑
  154. rightTap() {
  155. if (this.goods_checked) {
  156. this.goods_checked = false;
  157. } else {
  158. this.goods_checked = true;
  159. }
  160. },
  161. //选择
  162. checkboxChange(e) {
  163. let items = this.checkbox_list, values = e.detail.value;
  164. for (let i = 0; i < items.length; i++) {
  165. //店铺处理
  166. let result = values.includes(items[i].id + '');
  167. if (result) {
  168. items[i].checked = true;
  169. } else {
  170. items[i].checked = false;
  171. }
  172. }
  173. },
  174. tapChecked() {
  175. if (this.checkbox_all) {
  176. this.checkbox_all = false;
  177. } else {
  178. this.checkbox_all = true;
  179. }
  180. }
  181. }
  182. }
  183. </script>
  184. <style lang="scss">
  185. /* #ifdef APP-PLUS */
  186. @import "../../static/colorui/main.css";
  187. @import "../../static/colorui/icon.css";
  188. @import "../../static/zaiui/style/app.scss";
  189. /* #endif */
  190. @import "../../static/zaiui/style/footmark.scss";
  191. </style>