mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-09 02:46:46 +08:00
我的问答提问
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<view class="my-qa-page">
|
||||
<u-toast ref="articleToast"></u-toast>
|
||||
<page-title :showBack="true">我的问答</page-title>
|
||||
<view class="top-content">
|
||||
<view>
|
||||
@@ -18,44 +19,44 @@
|
||||
<view class="tabs-text" @click="tabsClick(1)" :class="{'active':active ==1}"><text style="z-index: 999;">提问</text><text v-show="active ==1" class="active-line"></text></view>
|
||||
<view class="tabs-text" @click="tabsClick(2)" :class="{'active':active ==2}">回答<text v-show="active ==2" class="active-line"></text></view>
|
||||
</view>
|
||||
<view class="my-qa-list">
|
||||
<view class="">
|
||||
<view class="my-qa-list" v-show="active ==1">
|
||||
<view class="my-qa-index" v-for="put in putList.list" :key="put.id" @click="toDetail(put)">
|
||||
<view class="artical-box-top">
|
||||
<view style="" class="artical-tit">
|
||||
<!-- <text class="qa-basic qa-solve" v-if="item.isResolve">[已解决]</text> -->
|
||||
<!-- <text class="qa-basic qa-unSolve" v-else >[待解决]</text> -->
|
||||
<text class="qa-basic qa-unSolve">【待解决】</text>
|
||||
<!-- {{item.title}} -->
|
||||
你能想到哪些柔性显示的应用场备份你能想到哪些柔性显示的应用场备份你能想到哪些柔性显示的应用场备份
|
||||
<text class="qa-basic qa-solve" v-if="put.isResolve">[已解决]</text>
|
||||
<text class="qa-basic" v-else >[待解决]</text>
|
||||
<!-- <text class="qa-basic qa-unSolve">【待解决】</text> -->
|
||||
{{put.title}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
<!-- <author-info :avatar="item.avatar" :name="item.name" :info="item.orgInfo" :sex="item.sex"></author-info> -->
|
||||
<view class="qa-author-time">
|
||||
<view class="author-info">
|
||||
<author-info :avatar="put.avatar" :name="put.name" :sex="put.sex"></author-info>
|
||||
</view>
|
||||
<view class="">
|
||||
2022/9/26 14:25
|
||||
<view class="qa-time">
|
||||
{{put.sysCreateTime}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="qa-text">
|
||||
穿戴产品一般需要贴合人体不同部位,是需要柔性显示器件,如腕带显示,指显,臂显等,还可以贴合在曲···
|
||||
<view v-html="highlightedFilter(put.content)"></view>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: space-between;">
|
||||
<view style="display: flex;justify-content: space-between;margin-top: 20upx;">
|
||||
<view style="display: flex;">
|
||||
<view class="rowbtn" @click="toEdit()">
|
||||
<view class="rowbtn" @click.stop="toEdit(put)">
|
||||
<image class="btn-img" src="../../static/images/icon/edit.png" size="24"></image><text class="btn-text">编辑</text>
|
||||
</view>
|
||||
<view class="rowbtn" style="margin-left: 12upx;" @click="del()">
|
||||
<view class="rowbtn" style="margin-left: 12upx;" @click.stop="del(put)">
|
||||
<image class="btn-img" src="../../static/images/icon/del.png" size="24"></image><text class="btn-text">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<!-- <interact-bar :views="false" :data="item"></interact-bar> -->
|
||||
<interact-bar :comments="false" :answers="true" :views="false" :data="put"></interact-bar>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -71,6 +72,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loadStatus:'more',
|
||||
active:1,
|
||||
keyword:'',
|
||||
uCoinRecord:[],
|
||||
@@ -82,18 +84,58 @@
|
||||
pageIndex:1,
|
||||
pageSize:10,
|
||||
list:[],
|
||||
count:0,
|
||||
}
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.onReachBottom();
|
||||
},
|
||||
async onReachBottom() {
|
||||
if (this.putList.list.length < this.putList.count) {
|
||||
this.loadStatus = 'loading'; //more,loading,noMore
|
||||
this.putList.pageIndex++;
|
||||
await this.findData(false);
|
||||
this.loadStatus = 'more';
|
||||
} else {
|
||||
this.loadStatus = 'noMore';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.findData(true)
|
||||
},
|
||||
methods:{
|
||||
toEdit(item) {
|
||||
|
||||
toDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/resource/qaDetail?id=' + item.id
|
||||
});
|
||||
},
|
||||
del(item) {
|
||||
|
||||
toEdit(item){
|
||||
uni.navigateTo({
|
||||
url:'/pages/plus/editQuestion?value='+JSON.stringify(item)
|
||||
})
|
||||
},
|
||||
del(item){
|
||||
const $this=this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认删除这条提问吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
apiQa.del(item.id).then(res=>{
|
||||
if(res.status=200){
|
||||
$this.$refs.articleToast.show({message:'删除成功',type:'success'});
|
||||
setTimeout(()=>{
|
||||
$this.findData(true)
|
||||
},1000)
|
||||
}else{
|
||||
$this.$refs.articleToast.show({message:'删除失败,请稍后再试',type:'error'});
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
findData(flag) {
|
||||
//是否重置列表
|
||||
@@ -119,11 +161,13 @@
|
||||
this.putList.list.push(item);
|
||||
userIds.push(item.sysCreateAid);
|
||||
});
|
||||
//await this.loadUserInfos(rs.result.list, userIds);
|
||||
await this.loadUserInfos(rs.result.list, userIds);
|
||||
}
|
||||
}
|
||||
uni.hideLoading();
|
||||
});
|
||||
}).catch((err)=>{
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
loadUserInfos(list, userIds) {
|
||||
const noReapetIds = [...new Set(userIds)];
|
||||
@@ -165,7 +209,14 @@
|
||||
},
|
||||
tabsClick(tab) {
|
||||
this.active=tab
|
||||
}
|
||||
},
|
||||
highlightedFilter(value) {
|
||||
if (value.indexOf(this.copyKeyWord) !== -1 && this.copyKeyWord !== '') {
|
||||
return value.replace(this.copyKeyWord,`<span class='highlighted'>${this.copyKeyWord}</span>`);
|
||||
}else{
|
||||
return value
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -219,6 +270,10 @@
|
||||
}
|
||||
.my-qa-list{
|
||||
margin-top: 12upx;
|
||||
.my-qa-index{
|
||||
padding-bottom: 36upx;
|
||||
border-bottom: 20upx solid #F9F9F9;
|
||||
}
|
||||
.artical-box-top {
|
||||
padding: 36upx 0;
|
||||
font-weight: 600;
|
||||
@@ -234,6 +289,14 @@
|
||||
}
|
||||
|
||||
}
|
||||
.qa-author-time{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 34upx;
|
||||
.qa-time{
|
||||
margin-top: 14upx;
|
||||
}
|
||||
}
|
||||
.qa-text{
|
||||
font-size: 28upx;
|
||||
color: #666666;
|
||||
@@ -243,6 +306,10 @@
|
||||
-webkit-box-orient: vertical;
|
||||
display: -webkit-box;-webkit-line-clamp: 2;
|
||||
}
|
||||
.qa-time{
|
||||
font-size: 24upx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user