Files
learning-system-mobile/pages/plus/feedback.vue
zhaofang 59758b1c91 提交
2022-11-17 17:17:56 +08:00

257 lines
6.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<!--提意见反馈意见-->
<view>
<u-toast ref="messager"></u-toast>
<!-- <page-title :showBack="true">提意见</page-title> -->
<view class="feed-box" v-if="isShow">
<!-- <page-title :showBack="true">提意见</page-title> -->
<!-- <page-add-title :showBack="true">提意见</page-add-title> -->
<view class="feed-title">
<text class="title-left" @click="toBack()">取消</text>
<!-- <text class="title-con">提意见</text> -->
<text class="title-right" @click="goSubmit()">发布</text>
</view>
<view class="content">
<view style="display: flex;margin-bottom: 10upx;">
<view class="content-text" @click="isClick('课程问题')" :class="{'active':info.type=='课程问题'}" style="margin-right: 10upx;">内容相关</view>
<view class="content-text" @click="isClick('系统问题')" :class="{'active':info.type=='系统问题'}" style="margin-left: 10upx;">平台使用</view>
<view class="content-text" @click="isClick('其他')" :class="{'active':info.type=='其他'}" style="margin-left: 10upx;">其他</view>
</view>
<u--textarea :height="300" v-model="info.content" placeholder="请尽量详细描述您的问题,管理员将会及时对您的问题进行反馈,您可以在消息中查看管理员的反馈。"></u--textarea>
</view>
</view>
<view class="sub-box" v-else>
<page-title :showBack="true">意见详情</page-title>
<view class="sub-success" style="margin-top: 20px;">
<view class="sub-text">{{result.content}}</view>
<view class="sub-bar">
<view class="bar-time">{{result.sysCreateTime}}</view>
<!-- <view class="bar-right" style="display: flex;">
<u-avatar class="u-img" v-if="authorInfo.avatar==''" :size="20" shape="square" icon="account"></u-avatar>
<u-avatar class="u-img" v-else :size="20" shape="square" :src="authorInfo.avatar"></u-avatar>
<text style="font-size: 20rpx;color: #666666;">{{result.sysCreateBy}}</text>
</view> -->
<author-info :name="result.sysCreateBy" :avatar="authorInfo.avatar"></author-info>
</view>
<view class="bar-cor">
</view>
<view class="bar-bon">
<u-icon name="checkmark-circle" color="#489f6e" size="18" class="bon-icon"></u-icon>
<text class="bon-text">感谢您宝贵的意见</text>
</view>
</view>
</view>
</view>
</template>
<script>
import apiFeedback from '@/api/modules/feedback.js'
import apiUser from '@/api/system/user.js'
import apiStat from '@/api/phase2/stat.js'
import { mapGetters } from 'vuex';
export default {
data() {
return {
isShow:true,
info: {
type: '课程问题',
content: ''
},
authorInfo:{aid:'',name:'',code:'',orgInfo:''},
result:{},
typesShow: false,
index: 0
}
},
computed:{
...mapGetters(['userInfo']),
},
methods: {
isClick(type) {
this.info.type = type;
},
toBack(){
uni.navigateBack();
},
goSubmit() {
if(this.info.type == '') {
this.$refs.messager.show({message:'请选择意见类型!',type:'warning'});
return;
}
if(this.info.content == '') {
this.$refs.messager.show({message:'请输入问题描述!',type:'warning'});
return;
}
uni.showLoading({title:'提交中...'})
apiFeedback.save(this.info).then(rs=>{
if(rs.status==200){
this.result = rs.result;
this.loadUserInfo(rs.result.sysCreateAid)
uni.hideLoading()
this.isShow = false;
// uni.redirectTo({
// url:'/pages/resource/qaDetail?id='+rs.result.id
// })
let event = {
key: "Feedback",//后台的事件key
title: "意见反馈",//事件的标题
parameters:"",//用户自定义参数 name:value,name:value
content: '意见反馈',//事件的内容
objId: rs.result.id,//关联的id
objType:'99',//关联的类型
objInfo: "意见反馈",
aid: this.userInfo.aid, //当前登录人的id
aname: this.userInfo.name,//当前人的姓名
status: 1 ,//状态直接写1
source:"h5",
}
apiStat.sendEvent(event);
}else{
this.$refs.messager.show({message:rs.message,type:'error'});
}
})
},
loadUserInfo(uid){
apiUser.getByIds([uid]).then(res=>{
if(res.status==200){
this.authorInfo=res.result[0];
}
})
},
hideKeyboard() {
},
chooseType(e) {
this.info.qtype = e.name
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .u-button__text{
font-size: 36upx !important;
}
.u-textarea{
margin: 50upx 10upx;
height: 748upx;
border-radius: 12upx;
border: 1px solid rgba(151,151,151,0.18);
}
.u-img{
vertical-align: middle;
margin-right: 10upx;
}
.content-text{
border: none;
font-size: 36upx;
flex: 1;
text-align: center;
color: #666;
font-weight: 400;
}
.active{
color: #333;
font-weight: bold;
font-size: 36upx;
}
.sub-box{
// padding: 20rpx;
background-color: #fff;
.sub-success{
.sub-title{
font-size: 40rpx;
font-weight: 500;
line-height: 45rpx;
margin-bottom: 10rpx;
padding: 20rpx;
}
.sub-text{
font-size: 34rpx;
line-height: 50rpx;
margin-bottom: 20rpx;
padding: 20rpx;
font-weight: 500;
font-family: Source Han Sans CN;
}
.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;
height: 600rpx;
margin-top: 80rpx;
.bon-icon{
display: inline-block;
}
.bon-text{
display: inline-block;
margin-right: 10rpx;
font-family: Source Han Sans CN;
}
}
}
}
.feed-box{
height: 100vh;
background-color: #fff;
.feed-title{
display: flex;
justify-content: space-between;
padding: 20rpx;
// background-color: #fff;
.title-left{
color: #7F7F7F;
font-size: 32upx;
font-family: Source Han Sans CN;
// font-weight: bold;
color: #7F7F7F;
line-height: 36rpx;
}
.title-con{
font-size: 32upx;
font-family: Source Han Sans CN;
font-weight: 600;
color: #0D0D0D;
}
.title-right{
color: #387DF7;
font-size: 32upx;
font-family: Source Han Sans CN;
font-weight: 400;
line-height: 36rpx;
}
}
}
.row {
margin-bottom: 50upx;
}
.btn {
padding: 0px;
}
</style>