Moss 1 anno fa
parent
commit
d38bab047d
1 ha cambiato i file con 6 aggiunte e 4 eliminazioni
  1. 6 4
      src/pages/goods/search.vue

+ 6 - 4
src/pages/goods/search.vue

@@ -29,7 +29,8 @@
           <view class="left">猜你想搜</view>
         </view>
         <view class="list">
-          <view class="item" v-for="(item, index) in keyword1List" :key="index" @tap="clickKeyword(item)">{{item}}</view>
+          <view class="item" v-for="(item, index) in keyword1List.slice(0, isOpen1 ? keyword1List.length : 10)" :key="index" @tap="clickKeyword(item)">{{item}}</view>
+          <view class="item" @tap="isOpen1 = !isOpen1" v-if="keyword1List.length > 10">{{isOpen1 ? '收起' : '展开'}}<u-icon size="14" :name="isOpen1 ? 'arrow-up' : 'arrow-down'"></u-icon></view>
         </view>
       </view>
       <view class="group">
@@ -40,8 +41,8 @@
           </view>
         </view>
         <view class="list">
-          <view class="item" v-for="(item, index) in keyword2List.slice(0, isOpen ? keyword2List.length : 10)" :key="index" @tap="clickKeyword(item)">{{item}}</view>
-          <view class="item" @tap="isOpen = !isOpen" v-if="keyword2List.length > 10">{{isOpen ? '收起' : '展开'}}<u-icon size="14" :name="isOpen ? 'arrow-up' : 'arrow-down'"></u-icon></view>
+          <view class="item" v-for="(item, index) in keyword2List.slice(0, isOpen2 ? keyword2List.length : 10)" :key="index" @tap="clickKeyword(item)">{{item}}</view>
+          <view class="item" @tap="isOpen2 = !isOpen2" v-if="keyword2List.length > 10">{{isOpen2 ? '收起' : '展开'}}<u-icon size="14" :name="isOpen2 ? 'arrow-up' : 'arrow-down'"></u-icon></view>
         </view>
       </view>
     </view>
@@ -112,7 +113,8 @@
         pageNum: 1,
         loadStatus: 0,
 
-        isOpen: false,
+        isOpen1: false,
+        isOpen2: false,
       }
     },