|
@@ -45,6 +45,45 @@
|
|
</uni-col>
|
|
</uni-col>
|
|
</uni-row>
|
|
</uni-row>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
|
|
+ <!-- ------------------------------------------------------------------------------------------------------------------------------------------ -->
|
|
|
|
+
|
|
|
|
+ <view>
|
|
|
|
+ <!-- 使用分段器来切换推荐和收藏列表 -->
|
|
|
|
+ <view class="segmented-control">
|
|
|
|
+ <view class="segmented-control-item" :class="{ active: activeTab === 'recommend' }" @click="changeTab('recommend')">推荐</view>
|
|
|
|
+ <view class="segmented-control-item" :class="{ active: activeTab === 'favorite' }" @click="changeTab('favorite')">收藏</view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <!-- 根据选中的标签显示对应的列表 -->
|
|
|
|
+ <view v-if="activeTab === 'recommend'">
|
|
|
|
+ <view class="rnwdList">
|
|
|
|
+ <ul>
|
|
|
|
+ <!-- <li v-for="(item,index) in recommendList" :key="index">
|
|
|
|
+ <p @click="getmatter(item)">{{ item.title }}</p>
|
|
|
|
+ </li> -->
|
|
|
|
+ <uni-list>
|
|
|
|
+ <uni-list-item :title="item.title" v-for="(item,index) in recommendList" @click="getmatter(item)" clickable="true" ></uni-list-item>
|
|
|
|
+ </uni-list>
|
|
|
|
+ </ul>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="activeTab === 'favorite'">
|
|
|
|
+ <view class="rnwdList">
|
|
|
|
+ <ul>
|
|
|
|
+ <!-- <li v-for="(item,index) in favoriteList" :key="index">
|
|
|
|
+ <p @click="getmatter(item)">{{ item.title }}</p>
|
|
|
|
+ </li> -->
|
|
|
|
+ <uni-list>
|
|
|
|
+ <uni-list-item :title="item.title" v-for="(item,index) in favoriteList" @click="getmatter(item)" clickable="true" ></uni-list-item>
|
|
|
|
+ </uni-list>
|
|
|
|
+ </ul>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -52,16 +91,23 @@
|
|
import {
|
|
import {
|
|
listGridType
|
|
listGridType
|
|
} from '@/api/handleAffairs/gridType.js';
|
|
} from '@/api/handleAffairs/gridType.js';
|
|
-
|
|
|
|
|
|
+import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
title:"",
|
|
title:"",
|
|
- gridtType: [], //是一个list<map>数据 [{0,[1,2,3]}]
|
|
|
|
|
|
+ gridtType: [], //是一个list<map>数据 [[1,2,3]]
|
|
|
|
+
|
|
|
|
+ activeTab: 'recommend', // 默认选中推荐列表
|
|
|
|
+ recommendList: [], // 推荐列表数据
|
|
|
|
+ favoriteList: [], // 收藏列表数据
|
|
|
|
+ userList: [], // 收藏列表数据
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.getList();
|
|
|
|
|
|
+ this.getListListGrid();
|
|
|
|
+ this.getListDept();
|
|
|
|
+ this.getListscolle();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
confirm(){
|
|
confirm(){
|
|
@@ -80,10 +126,7 @@
|
|
url: '/pages/topic/topic',
|
|
url: '/pages/topic/topic',
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- //部门导航跳转
|
|
|
|
- dept(){
|
|
|
|
|
|
|
|
- },
|
|
|
|
querygrid(item) {
|
|
querygrid(item) {
|
|
console.log(item)
|
|
console.log(item)
|
|
uni.setStorageSync('id', item.id)
|
|
uni.setStorageSync('id', item.id)
|
|
@@ -92,7 +135,7 @@
|
|
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- getList() {
|
|
|
|
|
|
+ getListListGrid() {
|
|
const _that = this
|
|
const _that = this
|
|
let query = {
|
|
let query = {
|
|
yesOrNoShow: "0"
|
|
yesOrNoShow: "0"
|
|
@@ -111,6 +154,49 @@
|
|
});
|
|
});
|
|
|
|
|
|
},
|
|
},
|
|
|
|
+ getListDept() {
|
|
|
|
+ const _that = this;
|
|
|
|
+ let query = { yesOrNoShow: "0" };
|
|
|
|
+ // 获取推荐列表数据
|
|
|
|
+ listDept(query).then(res => {
|
|
|
|
+ _that.recommendList = res.rows;
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ getListscolle(){
|
|
|
|
+
|
|
|
|
+ const userId = getApp().globalData.userId;
|
|
|
|
+ collectlist(userId).then(res =>{
|
|
|
|
+ this.favoriteList = res.rows
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getmatter(item) {
|
|
|
|
+ uni.setStorageSync('id', item.id);
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/gridQuery/mattercontent',
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ addNewItem(item) {
|
|
|
|
+
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/mattersAdd/mattersAdd',
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ changeTab(tab) {
|
|
|
|
+ this.activeTab = tab;
|
|
|
|
+
|
|
|
|
+ this.getListDept()
|
|
|
|
+
|
|
|
|
+ this.getListscolle()
|
|
|
|
+ },
|
|
|
|
+ dept(){
|
|
|
|
+
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/topic/dept',
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -145,4 +231,18 @@
|
|
margin: 7px 0;
|
|
margin: 7px 0;
|
|
line-height: $nav-height;
|
|
line-height: $nav-height;
|
|
}
|
|
}
|
|
|
|
+ .segmented-control {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
+ background-color: #f0f0f0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .segmented-control-item {
|
|
|
|
+ padding: 10px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .segmented-control-item.active {
|
|
|
|
+ color: #007aff;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|