From c4246ca910f28014efaace64ebf92f47a673a9cf Mon Sep 17 00:00:00 2001
From: queenwuli <942534046@qq.com>
Date: Mon, 25 Jan 2021 11:47:46 +0800
Subject: [PATCH] gx

---
 hive-app/pages/workbench/selectProduct/index.vue |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/hive-app/pages/workbench/selectProduct/index.vue b/hive-app/pages/workbench/selectProduct/index.vue
index b0906f1..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
@@ -132,6 +134,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