连云港陪玩陪聊
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.
 
 
 
 
 
 

438 lines
9.8 KiB

<template>
<view class="add">
<view class="add-hd" @click="getConfigData()">如需尽快解决问题可直接联系在线客服<image src="@/static/jiantou1.png"></image></view>
<view class="add-content">
<!-- <view class="content">
<view class="title"><text class="red">*</text>反馈类型</view>
<view class="tab">
<view class="li" :class="tabIndex == 1?'li-on':''" @click="tabItem(1)">界面</view>
<view class="li" :class="tabIndex == 2?'li-on':''" @click="tabItem(2)">服务问题</view>
</view>
<view class="info">
<picker mode="selector">
<view class="picker picker-on">请选择</view>
</picker>
</view>
</view> -->
<view class="content">
<view class="title"><text class="red">*</text>反馈内容</view>
<view class="box">
<textarea v-model="content" maxlength="200" placeholder="如有必要,请详细描述(200字以内)~"></textarea>
<view class="tips">{{content.length}}/200字</view>
</view>
</view>
<view class="content">
<view class="title"><text class="red">*</text>图片上传<text class="hs">(上传聊天截图或与问题描述相关的图片)</text></view>
<view class="list">
<view class="item" v-for="(a,i) in imgurl" :key="i">
<image class="pic" :src="a"></image>
<image class="del" @click="toDel(i)" src="@/static/fabu-cha.png"></image>
</view>
<view class="upload" @click="uploadImg()">
<image class="pic" src="@/static/fankui-tianjia.png"></image>
<view class="txt">上传图片</view>
</view>
</view>
</view>
<view class="content">
<view class="title"><text class="red">*</text>联系方式</view>
<view class="list">
<view class="dd">
<input v-model="name" type="text" placeholder="请填写您的姓名"/>
</view>
<view class="dd">
<input v-model="phone" type="text" placeholder="请填写您的电话"/>
</view>
</view>
</view>
</view>
<view class="add-fd">
<view class="btn" @click="toReg()">提交反馈</view>
<view class="history" @click="toPage()">反馈记录 ></view>
</view>
<u-popup v-model="show" mode="center" border-radius="20" :mask-close-able="true">
<view class="feed">
<image src="@/static/feed-01.png"></image>
<view class="title">反馈提交成功</view>
<view class="btn" @click="show = false">我知道了</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
imgurl: [],
content: "",
tabIndex: 1,
name: "",
phone: ""
};
},
methods: {
toPage() {
uni.navigateTo({
url: "/pages/users/feedback/list"
})
},
//字典查询
async getConfigData() {
const that = this;
let res1 = await that.$api.getConfigData({dictType: 'CONFIG_CUSTOMER_SERVICE_USERID'});
if(res1.data.content){
that.toChat(res1.data.content)
}
},
//去聊天
async toChat(sellerId) {
const { code, data, msg } = await this.$api.findZegoToken({
userId: uni.getStorageSync("userInfo").id,
sellerId
})
if(code == 200){
uni.setStorageSync("chatToken",data.token);
uni.navigateTo({
url: "/pages/users/chat/index?id="+sellerId+"&roomId="+data.roomId
})
}else{
uni.showToast({
icon: "none",
position: "bottom",
title: msg
})
}
},
//上传图片
uploadImg() {
const that = this
uni.chooseImage({
count: 9-that.imgurl.length,
sizeType: ["original"], //可以指定是原图还是压缩图,默认二者都有
sourceType: ["album", "camera"],
success: (res1) => {
console.log(res1)
for(var i = 0; i<res1.tempFilePaths.length;i++){
uni.uploadFile({
name: 'file',
url: that.$baseUrl+'/prod-api/common/upload',
filePath: res1.tempFilePaths[i],
success: (res) => {
const {code, fileName, url, msg} = JSON.parse(res.data);
if(code == 200){
uni.showToast({
title: "上传成功"
})
that.imgurl.push(url)
}else{
uni.showToast({
icon: "error",
title: "上传失败"
})
}
},
fail: (err) => {
console.log(err)
}
});
}
},
fail(err){
console.log("fail",err)
}
});
},
async toReg() {
const that = this;
if(!that.content){
uni.showToast({
icon: "none",
position: "bottom",
title: "反馈内容不能为空!"
})
return ;
}
if(that.imgurl.length == 0){
uni.showToast({
icon: "none",
position: "bottom",
title: "请上传图片"
})
return ;
}
if(!that.name){
uni.showToast({
icon: "none",
position: "bottom",
title: "姓名不能为空!"
})
return ;
}
if(!that.phone){
uni.showToast({
icon: "none",
position: "bottom",
title: "电话不能为空!"
})
return ;
}
const { code, data, msg } = await that.$api.feedback({
userId: uni.getStorageSync("userInfo").id,
content: that.content,
imgurl: that.imgurl.join(","),
name: that.name,
phone: that.phone
})
if(code == 200){
that.imgurl = [];
that.content = "";
that.name = "";
that.phone = "";
that.show = true;
}else{
uni.showToast({
icon: "none",
position: "bottom",
title: msg
})
}
},
tabItem(index) {
this.tabIndex = index;
},
toDel(i) {
this.imgurl.splice(i,1)
},
}
}
</script>
<style scoped lang="scss">
.add{
overflow: hidden;
padding-bottom: 200rpx;
&-hd{
padding: 0 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
line-height: 80rpx;
background: #FBEBEB;
font-weight: 400;
font-size: 26rpx;
color: #E53623;
image{
width: 45rpx;
height: 45rpx;
}
}
.feed{
width: 670rpx;
height: 688rpx;
background: #FFFFFF;
border-radius: 20rpx;
text-align: center;
padding-top: 70rpx;
box-sizing: border-box;
image{
width: 408rpx;
height: 315rpx;
}
.title{
font-weight: 500;
font-size: 36rpx;
color: #222222;
margin-top: 50rpx;
}
.btn{
width: 400rpx;
line-height: 90rpx;
background: linear-gradient(0deg, #000000, #3D3B38);
box-shadow: 0px 4rpx 18rpx 0px rgba(42,41,39,0.34);
border-radius: 90rpx;
font-weight: 500;
font-size: 30rpx;
color: #FFFFFF;
margin: 0 auto;
margin-top: 50rpx;
}
}
&-content{
padding: 30rpx;
overflow: hidden;
background: #FFFFFF;
border-radius: 20rpx;
width: 700rpx;
margin: 0 auto;
margin-top: 20rpx;
box-sizing: border-box;
.content{
box-sizing: border-box;
overflow: hidden;
.box{
width: 100%;
background: #F6F6F6;
border-radius: 10rpx;
padding: 30rpx;
box-sizing: border-box;
margin: 30rpx auto;
textarea{
width: 100%;
height: 300rpx;
font-weight: 400;
font-size: 28rpx;
color: #212121;
}
.tips{
font-weight: 400;
font-size: 28rpx;
color: #999999;
margin-top: 20rpx;
text-align: right;
}
}
.picker{
height: 90rpx;
line-height: 90rpx;
background: #F6F6F6;
border-radius: 10rpx;
padding: 0 30rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #333333;
margin: 30rpx auto;
}
.tab{
display: flex;
align-items: center;
justify-content: flex-start;
margin-top: 20rpx;
.li{
padding: 0 40rpx;
font-weight: 500;
font-size: 30rpx;
color: #333333;
line-height: 61rpx;
background: #FFFFFF;
border-radius: 61rpx;
border: 1px solid #CCCCCC;
text-align: center;
margin-right: 20rpx;
&-on{
background: linear-gradient(0deg, #000000, #3D3B38);
border: 1px solid #2261CD;
color: #FFFFFF;
}
}
}
}
.title{
.red{
color: #E53623;
}
.hs{
font-size: 24rpx;
color: #999999;
}
font-weight: 400;
font-size: 30rpx;
color: #212121;
}
.list{
width: 110%;
margin-bottom: 30rpx;
overflow: hidden;
.dd{
width: 100%;
padding: 0 20rpx;
box-sizing: border-box;
background: #F6F6F6;
border-radius: 10rpx;
margin-top: 20rpx;
input{
width: 100%;
height: 90rpx;
line-height: 90rpx;
font-weight: 400;
font-size: 28rpx;
color: #212121;
}
}
.upload{
width: 150rpx;
height: 150rpx;
background: #FFFFFF;
border-radius: 10rpx;
border: 1px solid #DDDDDD;
float: left;
font-weight: 400;
text-align: center;
font-size: 24rpx;
color: #999999;
margin-top: 30rpx;
image{
width: 50rpx;
height: 50rpx;
display: block;
margin: 0 auto;
margin-top: 25rpx;
margin-bottom: 10rpx;
}
}
.item{
width: 150rpx;
height: 150rpx;
border-radius: 10rpx;
float: left;
margin-top: 30rpx;
overflow: hidden;
position: relative;
margin-right: 12rpx;
.pic{
width: 100%;
height: 100%;
}
.del{
width: 35rpx;
height: 35rpx;
position: absolute;
right: 0;
top: 0;
z-index: 2;
}
}
}
}
&-fd{
width: 100%;
padding: 20rpx 25rpx;
box-sizing: border-box;
position: fixed;
left: 0;
bottom: 0;
z-index: 22;
background-color: #FFFFFF;
.btn{
width: 100%;
line-height: 90rpx;
background: linear-gradient(0deg, #000000, #3D3B38);
box-shadow: 0px 4rpx 18rpx 0px rgba(42,41,39,0.34);
border-radius: 90rpx;
text-align: center;
font-weight: 400;
font-size: 30rpx;
color: #FFFFFF;
letter-spacing: 2rpx;
}
.history{
text-align: center;
font-weight: 400;
font-size: 26rpx;
color: #666666;
margin-top: 20rpx;
}
}
}
</style>