From b83ba3cc4687f21d744e9866e10e30e91229e8a4 Mon Sep 17 00:00:00 2001 From: queenwuli <942534046@qq.com> Date: Thu, 28 Jan 2021 16:23:30 +0800 Subject: [PATCH] gx --- hive-app/pages/workbench/selectProduct/index.vue | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/hive-app/pages/workbench/selectProduct/index.vue b/hive-app/pages/workbench/selectProduct/index.vue index 856ad7a..ed1bbba 100644 --- a/hive-app/pages/workbench/selectProduct/index.vue +++ b/hive-app/pages/workbench/selectProduct/index.vue @@ -5,8 +5,8 @@ <view class="list"> <scroll-view class="list-left" scroll-y="true"> <uni-collapse accordion="true" @change="toggleCollapse"> - <uni-collapse-item :showAnimation="true" :title="item.name" class="list-left-row" - v-if="item.parentId===0" v-for="item in goodsTypeList"> + <uni-collapse-item :showAnimation="true" :open="item.id==cateId" :title="item.name" :isShowIcon="isShowIcon(item)" class="list-left-row" + v-if="item.parentId===0" v-for="(item, index) in goodsTypeList"> <view class="list-row-wrap"> <view class="list-row" :class="op.id==cateId?'blue':''" v-for="op in goodsTypeList" @@ -42,6 +42,7 @@ <view v-if="goodsList.length"> <uni-load-more :status="loadStatus" color="#a5abaf"></uni-load-more> </view> + <no-record :isShow="!goodsList.length" txt="暂无产品/项目"></no-record> </scroll-view> </view> <view class="footer"> @@ -75,6 +76,7 @@ data(){ return{ id: '', + tabIndex: '0', goodsTypeList: [], goodsList: [], cateId: null,//当前产品类别id @@ -117,7 +119,7 @@ onPullDownRefresh(){ this.reloadData(); let timer = setTimeout(function () { - uni.startPullDownRefresh(); + uni.stopPullDownRefresh(); clearTimeout(timer); timer = null; }, 800); @@ -131,6 +133,15 @@ }, scrolltolower(){ this.loadGoodsList() + }, + isShowIcon(item){ + let count = 0; + this.goodsTypeList.forEach((op) => { + if(op.parentId==item.id){ + count ++ + } + }); + return count?true:false; }, openShoppingCart(){ this.$refs.shopCart.toggle() @@ -189,6 +200,9 @@ }) return arr.length?arr[0].parentId:''; }, + toggleAll(arr){ + this.changeGoodsType(''); + }, // 打开关闭面板 toggleCollapse(arr){ if(!arr.length){ -- Gitblit v1.9.1