tijiao
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
fontColor="#fff"
|
||||
:backState="2000"
|
||||
>
|
||||
<template v-slot:right v-if="activeTab === 1">
|
||||
<template v-slot:right v-if="activeTab === 1&&showArticleButton">
|
||||
<view class="top_right" @tap="createFolder" style="margin-right: 20rpx">
|
||||
<uni-icons type="folder-add" size="17" color="#fff"></uni-icons>
|
||||
<text>发布文章</text>
|
||||
@@ -202,6 +202,7 @@
|
||||
:name="item.taihuTalent&&item.taihuTalent.name?item.taihuTalent.name:''"
|
||||
:createTime="item.createTime"
|
||||
:title="item.title"
|
||||
:id="item.id"
|
||||
:content="item.content"
|
||||
:isLike="item.likeFlag"
|
||||
:isGiveReward="item.isGiveReward"
|
||||
@@ -211,6 +212,7 @@
|
||||
:giveRewardNumber="item.giveRewardNumber"
|
||||
:commentCount="item.commentCount"
|
||||
@clickDynamic="clickDynamic(index)"
|
||||
@addRead="addRead"
|
||||
@clickUser="clickUser(item)"
|
||||
@clickFocus="clickFocus(index)"
|
||||
@clickThumbsup="(type) => clickThumbsup(item.id, type)"
|
||||
@@ -265,6 +267,7 @@ export default {
|
||||
return {
|
||||
sysNotices_list:[],
|
||||
shareId: null,
|
||||
showArticleButton: false,
|
||||
activeTab: 0,
|
||||
tabsList: [],
|
||||
currentCateIndex: 0,
|
||||
@@ -326,8 +329,34 @@ export default {
|
||||
uni.hideTabBar();
|
||||
this.getTabData();
|
||||
},
|
||||
onShow() {},
|
||||
onShow() {
|
||||
this.isShowArticleButton()
|
||||
if (this.activeTab == 0&&this.taihumedId!=null) {
|
||||
this.getListData(this.taihumedId);
|
||||
} else if (this.activeTab == 1) {
|
||||
this.getArticleListData(true);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async addRead(articleId){
|
||||
// common/taihuTalentArticle/addReadCount
|
||||
await $http
|
||||
.request({
|
||||
url: "common/taihuTalentArticle/addReadCount",
|
||||
method: "POST",
|
||||
data: {"articleId":articleId},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
if(res.code == 0){
|
||||
console.log(res)
|
||||
this.getArticleDetail(articleId);
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
confirm2(){
|
||||
this.$refs.customModal2.close();
|
||||
this.sysNotices_list.forEach(e=>{
|
||||
@@ -358,6 +387,26 @@ readArticle(item){
|
||||
})
|
||||
.then(async (res) => {
|
||||
|
||||
});
|
||||
},
|
||||
//已读记录
|
||||
async isShowArticleButton() {
|
||||
await $http
|
||||
.request({
|
||||
url: "common/taihuTalentArticle/getArticleRoleByUser",
|
||||
method: "POST",
|
||||
data: { },
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
if(res.code == 0 && res.roleFlag == 1){
|
||||
this.showArticleButton=true
|
||||
}else{
|
||||
this.showArticleButton=false
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
async getSysNotices() {
|
||||
@@ -378,8 +427,8 @@ readArticle(item){
|
||||
}
|
||||
});
|
||||
},
|
||||
refreshData(reset) {
|
||||
if (reset) {
|
||||
refreshData() {
|
||||
this.activeTab=1;
|
||||
this.currentCateIndex = 0;
|
||||
|
||||
//重置
|
||||
@@ -389,21 +438,21 @@ readArticle(item){
|
||||
this.count = 0;
|
||||
this.current = 1;
|
||||
this.getArticleListData();
|
||||
}
|
||||
|
||||
},
|
||||
createFolder() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/articleList/article?navTitle=文章&title=文章&type=add`,
|
||||
url: `/pages/articleList/articleAdd?navTitle=文章&title=文章&type=add`,
|
||||
});
|
||||
},
|
||||
newOnShare() {
|
||||
this.$refs.share.open();
|
||||
},
|
||||
haveSelected() {
|
||||
var data = this.list.find((item) => item.id == this.shareId);
|
||||
haveSelected(data) {
|
||||
var data1 = this.list.find((item) => item.id == this.shareId);
|
||||
let image = "";
|
||||
data.img && data.img != ""
|
||||
? (image = data.img.split(",")[0])
|
||||
data1.img && data1.img != ""
|
||||
? (image = data1.img.split(",")[0])
|
||||
: (image = "static/logo_zi.png");
|
||||
console.log(data, " 选择的是");
|
||||
if (data.index == 0) {
|
||||
@@ -413,8 +462,8 @@ readArticle(item){
|
||||
scene: "WXSceneSession",
|
||||
type: 0,
|
||||
href: this.$apkUrl,
|
||||
title: `我在【太湖云医】发布了文章 “ ${data.title} ”`,
|
||||
// summary: `${this.productInfo.content}`,
|
||||
title: `我在【太湖云医】发布了文章 “ ${data1.title} ”`,
|
||||
summary: `${data1.content.substring(0, 50).replace(/<[^>]*>/g, '').trim()}`,
|
||||
imageUrl: image,
|
||||
success: function (res) {
|
||||
console.log("success:" + JSON.stringify(res));
|
||||
@@ -430,8 +479,8 @@ readArticle(item){
|
||||
scene: "WXSceneTimeline",
|
||||
type: 0,
|
||||
href: this.$apkUrl,
|
||||
title: `我在【太湖云医】发布了文章 “ ${data.title} ”`,
|
||||
// summary: `${this.taskInfo.content}`,
|
||||
title: `我在【太湖云医】发布了文章 “ ${data1.title} ”`,
|
||||
summary: `${data1.content.substring(0, 50).replace(/<[^>]*>/g, '').trim()}`,
|
||||
imageUrl: image,
|
||||
success: function (res) {
|
||||
console.log("success:" + JSON.stringify(res));
|
||||
@@ -597,6 +646,7 @@ readArticle(item){
|
||||
},
|
||||
//获取列表数据
|
||||
getArticleListData(type) {
|
||||
|
||||
if (type) {
|
||||
this.current = 1;
|
||||
this.list = [];
|
||||
|
||||
Reference in New Issue
Block a user