This commit is contained in:
daihh
2022-11-17 15:58:49 +08:00
11 changed files with 316 additions and 38 deletions

22
App.vue
View File

@@ -71,6 +71,28 @@
border-right: 1px solid #bdbdbd;
transform: rotate(45deg);
}
uni-modal {
.uni-modal {
width: 288px !important;
max-width: 288px !important;
border-radius: 26upx;
.uni-modal__bd{
font-size: 36upx;
font-weight: 600;
color: #333333;
padding: 33px 25px 33px 25px;
}
.uni-modal__ft{
font-size: 32upx;
.uni-modal__btn_default{
color: #333333;
}
.uni-modal__btn_primary{
color: #387DF7;
}
}
}
}
/**统一样式*/
.fixed-field{

View File

@@ -66,7 +66,8 @@
}
},
{"path" : "pages/plus/addQuestion","style" : {"navigationBarTitleText": "提问题"}},
{"path" : "pages/plus/editQuestion","style" : {"navigationBarTitleText": "编辑问题"}},
{"path" : "pages/plus/editQuestion","style" : {"navigationBarTitleText": "编辑问题"}},
{"path" : "pages/plus/editAnser","style" : {"navigationBarTitleText": "编辑回答"}},
{"path" : "pages/plus/feedback","style" : {"navigationBarTitleText": "提意见"}},
{"path" : "pages/login/next","style" : {"navigationBarTitleText": "修改密码"}},
{"path" : "pages/login/headPortrait","style" : {"navigationBarTitleText": "修改头像"}},

View File

@@ -238,6 +238,7 @@
color: #0A89FC;
margin-left: 74upx;
margin-top: 26upx;
margin-bottom: 30upx;
}
// margin-top: 510upx;
.medal-list-index{

View File

@@ -117,6 +117,7 @@
</view>
</view>
</u-popup>
<!-- <u-modal :show="modalShow" @confirm="confirm" @cancel="cancel" :showCancelButton="true" confirmText="删除" ref="uModal" :content='content'></u-modal> -->
<uni-load-more :status="loadStatus"></uni-load-more>
</view>
</template>
@@ -132,6 +133,7 @@
},
data() {
return {
modalShow:false,
inputShow:false,
loadStatus:'more',
active:1,
@@ -232,8 +234,9 @@
delItem(item) {
const $this=this
uni.showModal({
title: '提示',
// title: '提示',
content: '您确定要删除此回答吗?',
confirmText:"删除",
success: function (res) {
if (res.confirm) {
apiQa
@@ -254,9 +257,13 @@
});
},
editItem(item){
this.reply = item;
this.inputValue = item.answercontent;
this.inputShow=true
// this.reply = item;
// this.inputValue = item.answercontent;
// this.inputShow=true
uni.navigateTo({
url:'/pages/plus/editAnser?value='+JSON.stringify(item)
})
},
toanDetail(item) {
uni.navigateTo({
@@ -265,7 +272,6 @@
});
},
toDetail(item) {
console.log(item,'item')
uni.navigateTo({
url: '/pages/resource/qaDetail?id=' + item.id
});
@@ -278,8 +284,9 @@
del(item,index){
const $this=this
uni.showModal({
title: '提示',
// title: '提示',
content: '确认删除这条提问吗?',
confirmText:"删除",
success: function (res) {
if (res.confirm) {
apiQa.del(item.id).then(res=>{
@@ -441,9 +448,7 @@
}
</script>
<style scoped lang="scss">
.qa-solve{
color: #333333;
margin-left:-7px;

View File

@@ -15,13 +15,13 @@
<text style="height: 100upx;margin-top: 6upx;" v-html="$keywordActiveShow(item.title,query.keyword)"></text>
<view class="coures-bottom">
<view class="course-author" style="margin-right: 50upx;">分享给{{ item.toAname }}</view>
<view class="withdraw" v-if="!item.isRead" @click="withdraw(item)">
<view class="withdraw" v-if="!item.isRead" @click.stop="withdraw(item)">
<image src="../../static/images/icon/withdrawnew.png" mode=""></image>撤回
</view>
<view v-if="item.isRead" class="Viewed">
<view v-if="item.isRead" style="margin-left:auto ;" class="Viewed">
已查看
</view>
<view v-else class="notViewed">
<view v-else style="margin-left:auto ;" class="notViewed">
未查看
</view>
</view>
@@ -42,7 +42,7 @@
<text style="font-size: 24upx;color: #999;margin-right: 35upx;">分享给{{item.toAname}}</text>
</view>
<view class="rowbtn-right">
<view class="withdraw" v-if="item.isRead" @click="withdraw(item)">
<view class="withdraw" v-if="item.isRead" @click.stop="withdraw(item)">
<image src="../../static/images/icon/withdrawnew.png" mode=""></image>撤回
</view>
<view v-if="item.isRead" class="Viewed">
@@ -67,7 +67,7 @@
<text style="font-size: 24upx;color: #999;margin-top: 10upx;" @click="toQaDetail(item.question)">分享给{{item.toAname}}</text>
</view>
<view class="rowbtn-right" style="margin-left: auto;">
<view class="withdraw" v-if="!item.isRead" @click="withdraw(item)">
<view class="withdraw" v-if="!item.isRead" @click.stop="withdraw(item)">
<image src="../../static/images/icon/withdrawnew.png" mode=""></image>撤回
</view>
<view v-if="item.isRead" class="Viewed">

View File

@@ -13,7 +13,7 @@
<!-- <text class="title-con">写文章</text> -->
<view class="title-right" >
<text style="padding-right: 20rpx;" @click="saveDraft()">保存草稿</text>
<text style="padding-right: 20rpx;" @click="submit()">提交</text>
<text style="padding-right: 20rpx;" @click="submit()">发布</text>
</view>
</view>
<view class="content">
@@ -324,7 +324,7 @@
color: #0D0D0D;
}
.title-right{
color: #588AFC;
color: #387DF7;
font-size: 28rpx;
font-family: Source Han Sans CN;
line-height: 36rpx;
@@ -363,12 +363,11 @@
font-family: Source Han Sans CN;
font-weight: bold;
line-height: 36rpx;
}
.title-right{
// position: absolute;
right: 18rpx;
color: #588AFC;
color: #387DF7;
font-size: 30rpx;
font-family: Source Han Sans CN;
line-height: 36rpx;

View File

@@ -7,7 +7,7 @@
<view class="bar-box">
<view class="bar-cancel" @click="toBack()">取消</view>
<!-- <view class="bar-center">提问题</view> -->
<view @click="goSubmit()" class="bar-go">提交</view>
<view @click="goSubmit()" class="bar-go">发布</view>
</view>
<view class="content" >
<view class="big-box-content">
@@ -319,10 +319,10 @@
color: #0D0D0D;
}
.bar-go{
color: #588AFC;
color: #387DF7;
font-size: 30rpx;
font-family: Source Han Sans CN;
font-weight: bold;
font-weight: 400;
line-height: 36rpx;
}
}

250
pages/plus/editAnser.vue Normal file
View File

@@ -0,0 +1,250 @@
<template>
<!--添加文章-->
<view style="background-color: #fff;">
<u-toast ref="messager"></u-toast>
<!-- <page-title :showBack="true">编辑问题</page-title> -->
<view style="background-color: #fff;padding-top: 18rpx;">
<view class="bar-box">
<view class="bar-cancel" @click="toBack()"><u-icon style="color: #333333;font-weight: 600;" name="arrow-left"></u-icon></view>
<view class="bar-center">编辑回答</view>
<view @click="goSubmit()" class="bar-go">发布</view>
</view>
<view class="content">
<view class="big-box-content">
<view class="row row-lin">
<u--input placeholder="请输入标题" placeholder-style="font-size:42upx;color:#c1c1c1;display:inline-block;white-space: pre-wrap; word-wrap: break-word;height: auto;
" maxlength="30" class="row-input" border="surround" v-model="qa.title" @change="change"></u--input>
</view>
<view class="row ">
<u--textarea class="row-input row-text" placeholder-style="font-size:42upx;color:#666;font-weight: normal;" :height="300" count maxlength="140" v-model="inputValue" placeholder="请输入正文"></u--textarea>
</view>
<!-- <view class="row">
<u-upload uploadIcon="plus" :fileList="fileList" multiple @afterRead="afterRead" @delete="deletePic" name="coverImg" :maxCount="5">
</u-upload>
</view> -->
</view>
</view>
</view>
</view>
</template>
<script>
import apiQa from '@/api/modules/qa.js'
import uploadUtil from '@/utils/upload.js'
import { mapGetters } from 'vuex';
import apiStat from '@/api/phase2/stat.js'
export default {
data() {
return {
fileUrl:this.$config.fileUrl,
inputValue:'',
qa:{
id:'',
title:'',
answercontent:'',
},
fileList: [],
}
},
computed:{
...mapGetters(['userInfo']),
},
methods: {
toBack(){
uni.navigateBack();
},
goSubmit() {
let $this = this;
// let images=[];
// this.fileList.forEach(file=>{
// images.push(file.path);
// })
// this.qa.images=images.join();
// uni.showLoading({title:'提交中...'})
// apiQa.update(this.qa).then(rs=>{
// if(rs.status==200){
// this.$refs.messager.show({message:'提交成功',type:'success'});
// uni.redirectTo({
// url:'/pages/resource/qaDetail?id='+rs.result.id
// })
// }else{
// this.$refs.messager.show({message:rs.message,type:'error'});
// setTimeout(function(){uni.hideLoading()},1000);
// }
// })
let {answerid,content,sysCreateAid,favorites,praises,shares}=this.qa;
apiQa
.updateAnswer({id:answerid,sysCreateAid,content:$this.inputValue})
.then(res => {
if (res.status == 200) {
uni.showToast({
title:'修改成功'
})
// $this.$refs.articleToast.show({message:'修改成功',type:'success'});
// $this.closeInput();
// $this.findAnData(true);
uni.redirectTo({
url:'/pages/resource/qaDetail?id='+this.qa.qid
})
// this.toBack();
} else {
// $this.$refs.articleToast.show({message:'修改失败',type:'error'});
}
})
},
change(e) {
//没有任何处理打印console.log无意义
//console.log('change', e);
},
//删除图片
// deletePic(event) {
// this.fileList.splice(event.index, 1);
// },
//新增图片
// async afterRead(event) {
// //当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
// //console.log(event.file);
// let $this=this;
// event.file.forEach(img=>{
// uploadUtil.uploadFile(img.url).then(rs=>{
// //console.log(rs);
// let item={
// status: 'success',
// message: '已上传',
// path:rs.result.filePath,
// url:rs.result.httpPath
// }
// this.fileList.push(item)
// uni.hideLoading();
// });
// })
// },
reverse() {
uni.navigateBack({
url: '/pages/plus/index'
})
}
},
onLoad(option){
if(option.value){
this.qa=JSON.parse(option.value)
this.inputValue = this.qa.answercontent;
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .uni-textarea-textarea{
color: #666 !important;
}
::v-deep .uni-input-input{
font-size: 36upx !important;
font-weight: 500 !important;
color: #333333 !important;
}
.sub-box{
padding: 20rpx;
.sub-success{
.sub-title{
font-size: 40rpx;
font-weight: 500;
line-height: 45rpx;
margin-bottom: 10rpx;
padding: 20rpx;
}
.sub-text{
font-size: 30rpx;
line-height: 30rpx;
margin-bottom: 20rpx;
padding: 20rpx;
}
.sub-bar{
display: flex;
justify-content: space-between;
padding: 20rpx;
border-bottom: 2rpx solid #ccc;
.bar-time{
font-size: 26rpx;
color: #ccc;
}
}
.bar-reply{
text-align: center;
padding: 30rpx;
.field-icon{
display: block;
width: 40rpx;
margin: 0 auto;
}
}
.bar-cor{
height: 20rpx;
background-color: #ebebeb;
}
.bar-bon{
text-align: center;
min-height: 600rpx;
margin-top: 35rpx;
.bon-icon{
display: inline-block;
}
.bon-text{
display: inline-block;
margin-right: 10rpx;
}
}
}
}
.bar-box{
display: flex;
margin: 18rpx;
justify-content: space-between;
// position: relative;
.bar-cancel{
font-size: 32upx;
color: #7F7F7F;
font-family: Source Han Sans CN;
line-height: 36rpx;
}
.bar-center{
font-size: 36upx;
font-weight: 600;
color: #0D0D0D;
}
.bar-go{
// position: absolute;
// right: 18rpx;
color: #387DF7;
font-size: 32rpx;
font-family: Source Han Sans CN;
font-weight: bold;
line-height: 36rpx;
}
}
.row {
margin-bottom: 10rpx;
.row-input{
border: none;
}
}
.row-lin{
// border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
}
.btn {
padding: 0px;
}
</style>

View File

@@ -9,7 +9,7 @@
<view class="feed-title">
<text class="title-left" @click="toBack()">取消</text>
<!-- <text class="title-con">提意见</text> -->
<text class="title-right" @click="goSubmit()">提交</text>
<text class="title-right" @click="goSubmit()">发布</text>
</view>
<view class="content">
<view style="display: flex;margin-bottom: 10upx;">
@@ -154,7 +154,7 @@
}
.active{
color: #333;
font-weight: 500;
font-weight: bold;
font-size: 36upx;
}
.sub-box{
@@ -238,12 +238,10 @@
color: #0D0D0D;
}
.title-right{
// position: absolute;
// right: 18rpx;
color: #588AFC;
color: #387DF7;
font-size: 32upx;
font-family: Source Han Sans CN;
font-weight: bold;
font-weight: 400;
line-height: 36rpx;
}
}

View File

@@ -15,7 +15,7 @@
{{ detailData.title }}
</view>
</view>
<view class="interval"></view>
<!-- <view class="interval"></view> -->
<view class="adetail content">
<!--文章内容-->
<view class="adetail-info">
@@ -938,7 +938,7 @@ export default {
padding: 15upx 30upx;
.adetail-title {
background-color: #fff;
padding-bottom: 40upx;
// padding-bottom: 40upx;
font-weight: 500;
font-size: 36upx;
letter-spacing: 0.5px;
@@ -954,6 +954,7 @@ export default {
color: #7e7e7e;
}
.adetail-body {
padding-top: 20upx;
line-height: 55upx;
white-space: normal;
word-break: break-all;

View File

@@ -15,7 +15,7 @@
</u-search>
</view>
</view>
<view class="tabbar" style="position: relative;">
<view class="tabbar" style="position: relative;padding-bottom: 20upx;">
<view class="tabbar-item" style="text-align: right;margin-right: 26upx;" @click="clicktab(0)" :class="{'active':tabIndex===0}">
<u-badge :type="type" max="99" :value="value" class="tabber-co"></u-badge>学习任务
<view class="border-bottom-one"></view>
@@ -77,7 +77,7 @@
</view>
</view>
</view>
<view>
<view style="margin-top: 60upx;">
<uni-load-more :status="loadStatus"></uni-load-more>
</view>
</view>
@@ -160,7 +160,7 @@
</view>
</view>
</view>
<view>
<view style="margin-top: 60upx;">
<uni-load-more :status="loadStatus"></uni-load-more>
</view>
</view>
@@ -415,7 +415,6 @@
},
methods: {
removecour(item){
console.log(item);
item.delcour = !item.delcour
},
rowbtn(row) {
@@ -520,8 +519,8 @@
})
},
autonomyStatus(num) {
console.log(num)
this.Applistatus = num;
// console.log(this.Applistatus)
this.getLearning();
},
taskStatus(num) {
@@ -576,6 +575,7 @@
loadBoeData(flag) {
if (flag) {
this.taskPageIndex = 1; //回到首页
this.couresList = [];
}
let params = {
page: this.taskPageIndex,
@@ -587,12 +587,12 @@
params.cmtask_name = this.keyWord;
}
apiBoeCourse.cmtaskList(params).then(res => {
this.taskCount = res.result.count;
this.taskCount = res.result.count;
res.result.list.forEach(item => {
let time = this.formatDate(item.created_at * 1000);
item.created_at = time.split(' ')[0];
});
this.couresList = res.result.list;
this.couresList.push(...res.result.list);
if (this.taskCount > this.taskPageIndex * this.taskPageSize) {
this.taskHasMore = true;
} else {
@@ -648,12 +648,12 @@
},
clicktab(idx) {
this.tabIndex = idx;
if (this.tabIndex == 1) {
if (this.tabIndex == 1 && this.studyList.length == 0) {
this.getLearning()
// this.searchData();
} else if (this.tabIndex == 2) {
this.history()
} else if (this.tabIndex == 0) {
} else if (this.tabIndex == 0 && this.couresList.length == 0) {
this.loadBoeData()
}
},
@@ -701,6 +701,7 @@
})
},
async getLearning() {
console.log(this.Applistatus)
uni.showLoading({
title: '加载中...'
});