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.

219 lines
5.2 KiB

<template>
3 years ago
<view>
<view class="feedback-title">
3 years ago
<view class="content">
<view class="title">请选择问题反馈类型</view>
<view class="choicebox">
3 years ago
<view class="choices">
<view v-for="(item,index) in choicelist" class="choices-item" :key="index" :class="{changeStyle:changeSelectStyle == index}" @click="changeStyle(index)"> {{item.name}} </view>
3 years ago
</view>
</view>
<view>
3 years ago
<textarea placeholder="请填写15字以上的内容描述,我们将尽快给您回复" style="height:200rpx;" v-model="text" placeholder-style="font-size: 24rpx;color: #999999;" />
3 years ago
</view>
</view>
<!-- <text @tap="chooseMsg">快速键入</text> -->
</view>
3 years ago
<!-- <view class="feedback-body"><textarea placeholder="请详细描述你的问题和意见..." v-model="sendDate.content" class="feedback-textare" /></view>
<view class="feedback-title"><text>QQ/邮箱</text></view>
3 years ago
<view class="feedback-body"><input class="feedback-input" v-model="sendDate.contact" placeholder="方便我们联系你 " /></view> -->
<!-- <view class="feedback-title feedback-star-view">
<text>应用评分</text>
<view class="feedback-star-view">
<text class="feedback-star" v-for="(value, key) in stars" :key="key" :class="key < sendDate.score ? 'active' : ''" @tap="chooseStar(value)"></text>
</view>
</view> -->
3 years ago
<view type="primary" class="button" @tap="send">提交</view>
</view>
</template>
<script>
3 years ago
export default {
data() {
return {
msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
stars: [1, 2, 3, 4, 5],
imageList: [],
sendDate: {
score: 5,
content: '',
contact: ''
},
text: '',
choicelist: [{
"name": "其他反馈"
},
{
"name": "优化建议"
},
3 years ago
],
changeSelectStyle: '',
isshow: true
};
},
// onLoad() {
// let deviceInfo = {
// appid: plus.runtime.appid,
// imei: plus.device.imei, //设备标识
// p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型,i表示iOS平台,a表示Android平台。
// md: plus.device.model, //设备型号
// app_version: plus.runtime.version,
// plus_version: plus.runtime.innerVersion, //基座版本号
// os: plus.os.version,
// net: '' + plus.networkinfo.getCurrentType()
// };
// this.sendDate = Object.assign(deviceInfo, this.sendDate);
// },
methods: {
close(e) {
this.imageList.splice(e, 1);
},
changeStyle(index) {
this.changeSelectStyle = index;
},
chooseMsg() {
//快速输入
uni.showActionSheet({
itemList: this.msgContents,
success: res => {
this.sendDate.content = this.msgContents[res.tapIndex];
}
});
3 years ago
},
chooseImg() {
//选择图片
uni.chooseImage({
sourceType: ['camera', 'album'],
sizeType: 'compressed',
count: 8 - this.imageList.length,
success: res => {
this.imageList = this.imageList.concat(res.tempFilePaths);
}
});
3 years ago
},
chooseStar(e) {
//点击评星
this.sendDate.score = e;
},
previewImage() {
//预览图片
uni.previewImage({
urls: this.imageList
});
},
send() {
//发送反馈
console.log(JSON.stringify(this.sendDate));
if (!this.sendDate.content) {
uni.showToast({
icon: 'none',
title: '请输入反馈内容'
});
return;
}
if (!this.sendDate.contact) {
uni.showToast({
icon: 'none',
title: '请填写QQ或邮箱'
});
return;
}
// uni.report('意见反馈', this.sendDate);
this.$queue.showLoading('加载中...');
this.$Request
.postJson('/message/add', {
state: 2,
title: this.sendDate.contact,
content: JSON.stringify(this.sendDate)
})
.then(res => {
if (res.code === 0) {
uni.showToast({
title: '反馈成功'
});
setTimeout(function() {
uni.navigateBack();
}, 1000);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '反馈失败',
content: res.msg
});
}
});
}
}
3 years ago
};
</script>
<style>
3 years ago
page {
background-color: #F6F6F6;
}
.feedback-title {
3 years ago
height: 400rpx;
3 years ago
background: #FFFFFF;
3 years ago
border-radius: 12rpx;
margin: 0 32rpx;
margin-top: 32rpx;
3 years ago
}
3 years ago
.feedback-title .content {
3 years ago
margin: 0 32rpx;
3 years ago
}
.feedback-title .title {
3 years ago
padding-top: 24rpx;
3 years ago
margin-bottom: 8rpx;
3 years ago
font-size: 28rpx;
3 years ago
color: #000000;
}
.feedback-submit {
background: #007aff;
color: #ffffff;
3 years ago
margin: 20rpx;
3 years ago
}
.choices {
3 years ago
padding-top: 20rpx;
margin-bottom: 16rpx;
display: flex;
3 years ago
}
3 years ago
.choices-item {
padding: 0 20rpx;
font-size: 24rpx;
3 years ago
background: #F5F5F5;
3 years ago
border: 2rpx solid #999999;
border-radius: 4rpx;
3 years ago
color: #999999;
3 years ago
margin-right: 20rpx;
3 years ago
}
.button {
3 years ago
width: 240rpx;
height: 52rpx;
3 years ago
background: linear-gradient(141deg, #FF4848 0%, #FF2929 100%);
3 years ago
border-radius: 24rpx;
font-size: 24rpx;
3 years ago
color: #FFFFFF;
3 years ago
padding-top: 8rpx;
padding-left: 100rpx;
3 years ago
margin: 0 auto;
3 years ago
margin-top: 20rpx;
3 years ago
}
.changeStyle {
background: #F8E3DF;
border: 1px solid #FF6A6A;
3 years ago
border-radius: 4rpx;
3 years ago
color: #FF7171;
}
</style>