332 lines
8.7 KiB
Vue
332 lines
8.7 KiB
Vue
<template>
|
||
<view class="page">
|
||
<view class="bg">
|
||
<view class="feedback-title">投诉类型</view>
|
||
<view class="feedback-body" @tap="showType = true">
|
||
<view class="feedback-input">{{typeName ? typeName : '请选择投诉类型'}}</view>
|
||
</view>
|
||
<view class="feedback-title">投诉标题</view>
|
||
<view class="feedback-body">
|
||
<input class="feedback-input" v-model="sendDate.title" placeholder="请输入投诉标题 " />
|
||
</view>
|
||
<view class="feedback-title">投诉内容</view>
|
||
<view class="" style="color: #999999;">
|
||
<u-input v-model="sendDate.content" type="textarea" placeholder="请详细描述你的问题... " style="height: 300rpx;padding: 10rpx;background-color: #f5f5f5;border-radius: 10rpx;margin: 10rpx 0 20rpx 0;color: #999999;"/>
|
||
</view>
|
||
<!-- <view class="feedback-title">投诉图</view> -->
|
||
<view class="margin-tb-sm">
|
||
<view class="flex" style="flex-direction: initial;flex-wrap: wrap;">
|
||
<view v-if="Imgo.length" style="width: 100%;">
|
||
<view class=" flex flex-wrap" style="justify-content: space-between;">
|
||
<view class="flex"
|
||
style="margin-right: 5rpx;position: relative;width: 200rpx;height: 200rpx;"
|
||
v-for="(image,index) in Imgo" :key="index">
|
||
<image :src="image" style="width: 100%;height: 100%;"></image>
|
||
<view style="z-index: 999;position: absolute;top: -15rpx;right: -15rpx;"
|
||
@click="removeImg(index)">
|
||
<u-icon name="close-circle-fill" color="#333333" size="50rpx"></u-icon>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="" @click="addImages(2)" v-if="Imgo.length<=2">
|
||
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;border-radius: 10rpx;"
|
||
class="flex justify-center align-center">
|
||
<view>
|
||
<view class="text-center">
|
||
<image style="width: 43.06rpx;height: 38.19rpx;" src="../../static/orderDetail/img-shang.png" mode=""></image>
|
||
<!-- <u-icon name="plus" color="#666666" size="28"></u-icon> -->
|
||
</view>
|
||
<view class="text-center">选择图片</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="" style="font-size: 20.83rpx;color: #ED782E;margin-top: 40rpx;">温馨提示:最多上传3张图片</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="push-button">
|
||
<button type="primary" style="" class="feedback-submit" @tap="send">提交</button>
|
||
</view>
|
||
|
||
<u-action-sheet :list="typeList" v-model="showType" @click="typeCallback"></u-action-sheet>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import * as websocketUtils from 'utils/websocketUtils.js';
|
||
export default {
|
||
data() {
|
||
return {
|
||
newTypeList: [],
|
||
typeId: '',
|
||
typeName: '',
|
||
typeList: [],
|
||
showType: false,
|
||
msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
|
||
stars: [1, 2, 3, 4, 5],
|
||
imageList: [],
|
||
sendDate: {
|
||
content: '',
|
||
// contact: '',
|
||
title: '',
|
||
image: "",
|
||
},
|
||
ordersId: '',
|
||
Imgo: [],
|
||
byUserId: '',
|
||
byuserName: '',
|
||
userName: '',
|
||
title: '',
|
||
ordersNo: ''
|
||
};
|
||
},
|
||
onLoad(e) {
|
||
this.getTypeList();
|
||
this.getUserInfo();
|
||
this.ordersId = e.id
|
||
this.byuserName = e.byuserName
|
||
this.byUserId = e.byUserId
|
||
// #ifdef APP-PLUS
|
||
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);
|
||
// #endif
|
||
},
|
||
methods: {
|
||
typeCallback(index) {
|
||
console.log(index)
|
||
this.typeName = this.newTypeList[index].title;
|
||
this.typeId = this.newTypeList[index].id;
|
||
},
|
||
getTypeList() {
|
||
this.$Request.getT('/app/message/selectMessageList?page=1&limit=50&state=6').then(res => {
|
||
if (res.code == 0) {
|
||
if (res.data.list && res.data.list.length > 0) {
|
||
this.newTypeList = res.data.list;
|
||
res.data.list.forEach((d, index) => {
|
||
let data = {
|
||
text: d.title,
|
||
label: index
|
||
}
|
||
this.typeList.push(data);
|
||
});
|
||
}
|
||
}
|
||
});
|
||
},
|
||
// 详情图删除
|
||
removeImg(index) {
|
||
console.log(index)
|
||
this.Imgo.splice(index, 1)
|
||
},
|
||
close(e) {
|
||
this.imageList.splice(e, 1);
|
||
},
|
||
getUserInfo() {
|
||
this.$Request.get("/app/user/selectUserById").then(res => {
|
||
if (res.code == 0) {
|
||
this.userName = res.data.userName
|
||
uni.setStorageSync('avatar', res.data.avatar)
|
||
uni.setStorageSync('invitationCode', res.data.invitationCode)
|
||
uni.setStorageSync('zhiFuBao', res.data.zhiFuBao)
|
||
uni.setStorageSync('zhiFuBaoName', res.data.zhiFuBaoName)
|
||
}
|
||
});
|
||
},
|
||
send() {
|
||
//发送反馈
|
||
this.sendDate.image = this.Imgo
|
||
this.sendDate.image = this.sendDate.image.toString()
|
||
|
||
// console.log(JSON.stringify(this.sendDate));
|
||
if (!this.typeId) {
|
||
uni.showToast({
|
||
icon: 'none',
|
||
title: '请选择投诉类型'
|
||
});
|
||
return;
|
||
}
|
||
if (!this.sendDate.content) {
|
||
uni.showToast({
|
||
icon: 'none',
|
||
title: '请输入投诉内容'
|
||
});
|
||
return;
|
||
}
|
||
if (!this.Imgo) {
|
||
uni.showToast({
|
||
icon: 'none',
|
||
title: '请上传投诉图片'
|
||
});
|
||
return;
|
||
}
|
||
this.$queue.showLoading('加载中...');
|
||
let userId = this.$queue.getData("userId");
|
||
console.log("this.byUserId",this.byUserId,this.byuserName)
|
||
this.$Request.postJson('/app/message/insertMessage', {
|
||
// ordersId: this.ordersId,
|
||
byUserId: this.byUserId,
|
||
title: this.sendDate.title,
|
||
image: this.sendDate.image,
|
||
userId: userId,
|
||
content: this.sendDate.content,
|
||
state: 7,
|
||
type: 0,
|
||
typeId: this.typeId,
|
||
typeName: this.typeName,
|
||
userName: this.userName,
|
||
byUserName: this.byuserName,
|
||
}).then(res => {
|
||
if (res.code === 0) {
|
||
uni.showToast({
|
||
title: '投诉成功'
|
||
});
|
||
setTimeout(function() {
|
||
// uni.navigateBack();
|
||
uni.redirectTo({
|
||
url: '/my/order/tousuList'
|
||
})
|
||
}, 1000);
|
||
} else {
|
||
uni.hideLoading();
|
||
uni.showModal({
|
||
showCancel: false,
|
||
title: '投诉失败',
|
||
content: res.msg
|
||
});
|
||
}
|
||
});
|
||
}, // 图片上传
|
||
addImages(e) {
|
||
let that = this
|
||
uni.chooseImage({
|
||
count: 6,
|
||
sourceType: ['album', 'camera'],
|
||
success: res => {
|
||
for (let i = 0; i < res.tempFilePaths.length; i++) {
|
||
that.$queue.showLoading("上传中...");
|
||
uni.uploadFile({ // 上传接口
|
||
url: websocketUtils.uploadFileUrl(), //真实的接口地址
|
||
// url: 'https://xichewap.xianmxkj.com/sqx_fast/alioss/upload',
|
||
filePath: res.tempFilePaths[i],
|
||
name: 'file',
|
||
success: (uploadFileRes) => {
|
||
if (e == 2) {
|
||
console.log(JSON.parse(uploadFileRes.data).data)
|
||
that.Imgo.push(JSON.parse(uploadFileRes.data).data)
|
||
}
|
||
|
||
uni.hideLoading();
|
||
}
|
||
});
|
||
}
|
||
}
|
||
})
|
||
},
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style>
|
||
.feedback-submit {
|
||
display: inline-block;
|
||
width: 92%;
|
||
text-align: center;
|
||
background: linear-gradient(90deg, #019C88, #28BA92, #35C495);
|
||
height: 40px;
|
||
border-radius: 28px;
|
||
color: #ffffff;
|
||
line-height: 40px;
|
||
margin-top: 4px;
|
||
font-size: 34rpx;
|
||
}
|
||
.push-button{
|
||
width: 100%;
|
||
height: 48px;
|
||
position: fixed;
|
||
bottom: 0px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
margin: 0 auto;
|
||
}
|
||
.sbu-btn{
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
background: #f7f7f7;
|
||
}
|
||
@font-face {
|
||
font-family: uniicons;
|
||
font-weight: normal;
|
||
font-style: normal;
|
||
src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
|
||
}
|
||
|
||
.page {
|
||
width: 100%;
|
||
height: 100vh;
|
||
background-color: #f7f7f7 !important;
|
||
padding-top: 20px;
|
||
}
|
||
.bg{
|
||
background-color: #ffffff;
|
||
padding: 30rpx;
|
||
width: 95%;
|
||
margin: 0px auto;
|
||
border-radius: 24rpx;
|
||
}
|
||
/*问题反馈*/
|
||
.feedback-title {
|
||
display: flex;
|
||
flex-direction: row;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding: 10rpx 0;
|
||
font-weight: bold;
|
||
color: #333333;
|
||
font-size: 30rpx;
|
||
}
|
||
|
||
.feedback-star-view.feedback-title {
|
||
justify-content: flex-start;
|
||
margin: 0;
|
||
}
|
||
|
||
.feedback-body {
|
||
font-size: 28rpx;
|
||
padding: 12rpx 30rpx;
|
||
margin: 10rpx 0 24rpx 0;
|
||
border-radius: 10rpx;
|
||
background: #F5F5F5;
|
||
/* color: #FFF; */
|
||
}
|
||
|
||
.feedback-textare {
|
||
font-size: 34upx;
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
padding: 12rpx 30rpx;
|
||
}
|
||
|
||
.feedback-input {
|
||
font-size: 28rpx;
|
||
height: 60upx;
|
||
/* padding: 15upx 20upx; */
|
||
line-height: 60upx;
|
||
}
|
||
|
||
|
||
|
||
</style>
|