gx
queenwuli
2021-01-25 c4246ca910f28014efaace64ebf92f47a673a9cf
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){