This commit is contained in:
zhaofang
2022-11-15 18:05:38 +08:00
parent 2bf36d1283
commit 2f0a4e42f6
4 changed files with 40 additions and 20 deletions

View File

@@ -189,15 +189,18 @@
url: '/pages/study/studydetail?id='+citem.id+'&type='+citem.type url: '/pages/study/studydetail?id='+citem.id+'&type='+citem.type
}); });
} else { } else {
if (citem.type == 10) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/resource/microDetail?id=' + citem.id url: '/pages/study/courseStudy?id=' + citem.id
}); });
} else if (citem.type == 20) { // if (citem.type == 10) {
uni.navigateTo({ // uni.navigateTo({
url: '/pages/resource/courseDetail?id=' +citem.id // url: '/pages/resource/microDetail?id=' + citem.id
}); // });
} // } else if (citem.type == 20) {
// uni.navigateTo({
// url: '/pages/resource/courseDetail?id=' +citem.id
// });
// }
} }
}, },
...mapActions({ ...mapActions({

View File

@@ -9,7 +9,7 @@
<view class="news-page-list"> <view class="news-page-list">
<view class="list-index" v-for="item in items" :key="item.id" @click="returnRouter(item)"> <view class="list-index" v-for="item in items" :key="item.id" @click="returnRouter(item)">
<view style="margin-top: 16upx;margin-right: 20upx;"> <view style="margin-top: 16upx;margin-right: 20upx;">
<radio v-show="flag" @click="changeChecked(item)" :checked="item.checked"/> <radio v-show="flag" @click.stop="changeChecked(item)" :checked="item.checked"/>
</view> </view>
<view class="list-index-img"> <view class="list-index-img">
<u-badge :isDot="!item.isRead" type="error" :absolute="true" :offset="[0,-2]"></u-badge> <u-badge :isDot="!item.isRead" type="error" :absolute="true" :offset="[0,-2]"></u-badge>

View File

@@ -62,7 +62,7 @@
<view v-if="detailData.isResolve"> <view v-if="detailData.isResolve">
<text v-if="an.isBest" style="color:#FFB30F;">最佳答案</text> <text v-if="an.isBest" style="color:#FFB30F;">最佳答案</text>
</view> </view>
<view class="set-good-an" v-if="userInfo.aid==detailData.sysCreateAid && !detailData.isResolve && an.id && an.clevel==1" @click="setBest()">设置为最佳答案</view> <view class="set-good-an" v-if="userInfo.aid==detailData.sysCreateAid && !detailData.isResolve && an.id && an.clevel==1" @click="setBest(an)">设置为最佳答案</view>
</view> </view>
</view> </view>
@@ -362,6 +362,8 @@ export default {
uni.showLoading({title:'加载中...'}) uni.showLoading({title:'加载中...'})
let $this=this; let $this=this;
apiQa.detail(id).then(res => { apiQa.detail(id).then(res => {
console.log(res,'res')
setTimeout(function(){ uni.hideLoading() },100);
if (res.status == 200) { if (res.status == 200) {
//处理图片 //处理图片
let imgArray=[]; let imgArray=[];
@@ -377,6 +379,7 @@ export default {
this.getAnswerList(id); this.getAnswerList(id);
this.autoCheck(res.result.sysCreateAid); this.autoCheck(res.result.sysCreateAid);
apiUser.getByIds([res.result.sysCreateAid]).then(rs=>{ apiUser.getByIds([res.result.sysCreateAid]).then(rs=>{
setTimeout(function(){ uni.hideLoading() },100); setTimeout(function(){ uni.hideLoading() },100);
if(rs.status==200){ if(rs.status==200){
if(rs.result!='' && rs.result.length>0){ if(rs.result!='' && rs.result.length>0){
@@ -396,7 +399,6 @@ export default {
$this.detailData = res.result; $this.detailData = res.result;
} }
}) })
setTimeout(function(){ uni.hideLoading() },100);
let event = { let event = {
key: "ReadQuestion",//后台的事件key 发布文章且审核通过 key: "ReadQuestion",//后台的事件key 发布文章且审核通过
title: "阅读问题",//事件的标题 title: "阅读问题",//事件的标题
@@ -411,9 +413,15 @@ export default {
source:2, source:2,
} }
apiStat.sendEvent(event); apiStat.sendEvent(event);
} else {
uni.showToast({
icon: 'error',
title:res.message
})
} }
}) })
.catch(err => { .catch(err => {
setTimeout(function(){ uni.hideLoading() },100);
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title:"获取数据失败" title:"获取数据失败"
@@ -533,9 +541,9 @@ export default {
}) })
}, },
//设置最佳答案接口 //设置最佳答案接口
setBest() { setBest(an) {
//userInfo.aid == an.sysCreateAid因为身份信息为空所以为了接接口没有加这个判断但是实际上要加的 //userInfo.aid == an.sysCreateAid因为身份信息为空所以为了接接口没有加这个判断但是实际上要加的
apiQa.isBest(this.curItem.id).then(res => { apiQa.isBest(an.id).then(res => {
if (res.status == 200) { if (res.status == 200) {
this.$set(this.detailData, 'isResolve', true); this.$set(this.detailData, 'isResolve', true);
uni.showToast({title:"设置成功" ,duration: 2000}) uni.showToast({title:"设置成功" ,duration: 2000})
@@ -546,9 +554,9 @@ export default {
let event = { let event = {
key: "AnswerBest",//设置为最佳答案 key: "AnswerBest",//设置为最佳答案
title: "回答被选为最佳答案",// title: "回答被选为最佳答案",//
parameters:"author:"+this.curItem.sysCreateAid,//内容的作者 parameters:"author:"+an.sysCreateAid,//内容的作者
content: '回答被选为最佳答案',//事件的内容 content: '回答被选为最佳答案',//事件的内容
objId: this.curItem.id,//关联的id objId: an.id,//关联的id
objType: '5',//关联的类型 objType: '5',//关联的类型
objInfo: '设置最佳答案', objInfo: '设置最佳答案',
aid: this.userInfo.aid, //当前登录人的id aid: this.userInfo.aid, //当前登录人的id

View File

@@ -13,6 +13,7 @@
shape="round" shape="round"
@clear="clearSearch" @clear="clearSearch"
@search="searchList" @search="searchList"
@custom="searchList"
search-icon="search" search-icon="search"
:showAction="true" :showAction="true"
actionText="搜索" actionText="搜索"
@@ -182,7 +183,11 @@
</div> </div>
</view> </view>
<view v-if="article.list.length==0 && article.loadStatus=='noMore'" class="empty"> <view v-if="article.list.length==0 && article.loadStatus=='noMore'" class="empty">
<u-empty icon="search" text=""></u-empty> <!-- <u-empty icon="search" text=""></u-empty>
<view class="agreeTip">抱歉暂时没有找到相关内容,</view>
<view class="agreeTip">
是否要去<text class="productAgree" @click="toProductAgree">提个意见</text>
</view> -->
<u-empty <u-empty
text="没有查找到相关内容" text="没有查找到相关内容"
icon="../../static/images/seach-empt.png"> icon="../../static/images/seach-empt.png">
@@ -233,11 +238,15 @@
<view style="margin-top: 10px;"> <view style="margin-top: 10px;">
<interact-bar :comments="false" :answers="true" :data="item"></interact-bar> <interact-bar :comments="false" :answers="true" :data="item"></interact-bar>
</view> </view>
</view> </view>
</view> </view>
<view v-if="qa.list.length==0 && qa.loadStatus=='noMore'" class="empty"> <view v-if="qa.list.length==0 && qa.loadStatus=='noMore'" class="empty">
<u-empty icon="search" text=""></u-empty> <!-- <u-empty icon="search" text=""></u-empty>
<view class="agreeTip">抱歉暂时没有找到相关内容,</view>
<view class="agreeTip">
是否要去<text class="productAgree" @click="toProductAgree">提个意见</text>
</view> -->
<u-empty <u-empty
text="没有查找到相关内容" text="没有查找到相关内容"
icon="../../static/images/seach-empt.png"> icon="../../static/images/seach-empt.png">