From 6743895a4e087b9a03782ee83aef5851ed1c0269 Mon Sep 17 00:00:00 2001
From: lmj <3407000732@qq.com>
Date: Wed, 9 Nov 2022 16:30:28 +0800
Subject: [PATCH] =?UTF-8?q?=E6=88=91=E5=88=86=E4=BA=AB=E7=9A=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/modules/shares.js | 11 ++
pages/my/myShares.vue | 282 ++++++++++++++++--------------------------
2 files changed, 115 insertions(+), 178 deletions(-)
diff --git a/api/modules/shares.js b/api/modules/shares.js
index 55d723c..5d416e6 100644
--- a/api/modules/shares.js
+++ b/api/modules/shares.js
@@ -13,6 +13,16 @@ import ajax from '@/utils/xajax.js'
const save=function(data){
return ajax.post('/xboe/m/share/add',data);
}
+/**
+ * 我分享的全部
+ * @param pageIndex 第几页
+ * @param pageSize 每页多少行
+ * @param keyword 关键字搜索
+ * @param isRead 是否已读
+ * */
+const findMeShare=function (query){
+ return ajax.post('/xboe/m/share/findMeShare',query);
+}
// 删除分享
// 参数 id
const del=function(id){
@@ -134,5 +144,6 @@ const updateIsRead=function(id){
mymecourselist,
mymearticlelist,
deleteshares,
+ findMeShare,
updateIsRead
}
\ No newline at end of file
diff --git a/pages/my/myShares.vue b/pages/my/myShares.vue
index 3f2af25..aedc0cc 100644
--- a/pages/my/myShares.vue
+++ b/pages/my/myShares.vue
@@ -1,60 +1,84 @@
我的分享
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ contentTypeFilter(item.contentType).text }}
+
+
+
+
+
+
+
+ {{ contentTypeFilter(item.contentType).text }}
+
+
+
+
+
+
+ 分享给{{ item.toAname }}
+
+ 撤回
+
+
+ 已查看
+
+
+ 未查看
+
+
-
-
-
-
-
-
-
- 分享给{{ item.toAname }}
+
+
+
+
+
+
+
+
+
+
+
+
+ 分享给{{item.toAname}}
+
+
+
+ 撤回
+
+
+ 已查看
+
+
+ 未查看
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 分享给{{item.toAname}}
+
+
撤回
-
+
已查看
@@ -64,59 +88,9 @@
+
-
-
-
-
-
-
-
-
-
-
- 分享给{{item.toAname}}
-
-
-
- 撤回
-
-
- 已查看
-
-
- 未查看
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 分享给{{item.toAname}}
-
-
-
- 撤回
-
-
- 已查看
-
-
- 未查看
-
-
-
-
-
-
+
@@ -128,6 +102,13 @@ export default {
computed: mapState(['resourceTab']),
data() {
return {
+ dataList: {
+ pageIndex: 1,
+ pageSize: 10,
+ keyword: '',
+ count: 0,
+ list: []
+ },
isRead:null,
statusBtn: '全部',
selectData: [
@@ -142,7 +123,7 @@ export default {
conType: 1,
query:{
pageIndex: 1,
- pageSize: 4,
+ pageSize: 10,
keyword:'',
isRead:null
},
@@ -160,8 +141,7 @@ export default {
this.onReachBottom();
},
async onReachBottom() {
- if(this.conType==1){
- if(this.courseList.length {
+ apiShares.findMeShare(this.query).then(rs => {
if (rs.status == 200) {
this.count=rs.result.count
+ console.log(rs);
+ rs.result.list.forEach(item => {
+ if(item.type == 4) {
+ item.question = {isResolve:false,title:'',content:'',bestAnswer:''};
+ item.question.isResolve=item.isResolve;
+ item.question.title=item.title;
+ item.question.content=item.content;
+ item.question.bestAnswer=item.bestAnswer;
+ item.question.id=item.id;
+ }
+ if(item.type == 3){
+ item.cases = {title:'',summary:''};
+ item.cases.title=item.title;
+ item.cases.summary=item.content;
+ item.cases.id=item.id;
+ }
+
+ });
+ if(flag){
+ this.dataList.list = rs.result.list;
+ }else{
+ this.dataList.list.push(...rs.result.list);
+ }
+
+
- if(this.conType==1){
- rs.result.list.forEach(item=>{
- $this.courseList.push(item)
- })
- }
- if(this.conType==2){
- let userIds = [];
- rs.result.list.forEach(item=>{
- item.avatar=''
- item.orgInfo='';
- item.sex=null;
- userIds.push(item.sysCreateAid);
- $this.articleList.push(item)
-
- })
- $this.loadUserInfos(rs.result.list,userIds);
- }
- if(this.conType==4){
- let userIds = [];
- rs.result.list.forEach(item=>{
- item.avatar=''
- item.orgInfo='';
- item.sex=null;
- userIds.push(item.question.sysCreateAid);
- $this.qaList.push(item)
- })
- $this.loadUserInfos(rs.result.list,userIds);
- }
}else{
uni.showToast({
title: "获取数据失败",
@@ -276,8 +207,6 @@ export default {
uni.hideLoading();
}, 100);
},
-
-
withdraw(item){
apiShares.deleteshares(item.id).then(res=>{
if(res.status == 200){
@@ -765,15 +694,12 @@ export default {
}
.qa {
- // margin-top: 19rpx;
- // padding: 10px;
padding: 36upx 36upx;
box-shadow: #f7f7f7 0px 6px 5px;
border-radius: 4px;
background: #ffffff;
margin-top: 20upx;
padding-bottom: 15rpx;
- padding-top: 0;
.qa-header {
height: 26px;