You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.5 KiB

3 years ago
<template>
<view class="index">
<view class="inp-box">
3 years ago
<textarea
@input="sumfontnum"
maxlength="100"
@blur="bindTextAreaBlur"
placeholder-style="color:#999999;"
placeholder="请填写您宝贵的反馈意见"
v-model="content"/>
3 years ago
<view class="fontnum">{{fontnum}}/100</view>
</view>
3 years ago
<view class="submit-btn" @click="submitClick()">提交</view>
3 years ago
</view>
</template>
<script>
3 years ago
import { feedBack } from '@/api/knowledge'
3 years ago
export default{
data(){
return {
3 years ago
content:'',
3 years ago
fontnum:0
}
},
methods:{
bindTextAreaBlur: function (e) {
console.log(e.detail.value)
},
sumfontnum(e){
this.fontnum = e.detail.value.length
3 years ago
},
submitClick(){
feedBack({content:this.content}).then((res)=>{
if(res.success){
uni.showToast({
title: '反馈成功!',
duration:2000
})
setTimeout(()=>{
uni.navigateBack({
delta:1
})
},2000)
} else{
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
},
3 years ago
}
}
</script>
<style lang="less" scoped>
.inp-box{
width: 100%;
background: #fff;
padding: 24rpx;
font-size: 28rpx;
position: relative;
.fontnum{
font-size: 24rpx;
color: #999;
position: absolute;
right: 28rpx;
bottom: 16rpx;
}
}
.submit-btn{
width: 208rpx;
height: 80rpx;
background: #6E85EB;
color: #fff;
text-align: center;
line-height: 80rpx;
border-radius: 4rpx;
margin: 30rpx auto;
}
</style>