|
|
|
@ -1,8 +1,8 @@ |
|
|
|
|
<template> |
|
|
|
|
<view class="add"> |
|
|
|
|
<view class="add-hd">如需尽快解决问题,可直接联系在线客服<image src="@/static/jiantou1.png"></image></view> |
|
|
|
|
<view class="add-hd" @click="getConfigData()">如需尽快解决问题,可直接联系在线客服<image src="@/static/jiantou1.png"></image></view> |
|
|
|
|
<view class="add-content"> |
|
|
|
|
<view class="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> |
|
|
|
@ -13,24 +13,24 @@ |
|
|
|
|
<view class="picker picker-on">请选择</view> |
|
|
|
|
</picker> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
<view class="content"> |
|
|
|
|
<view class="title"><text class="red">*</text>反馈内容</view> |
|
|
|
|
<view class="box"> |
|
|
|
|
<textarea maxlength="200" placeholder="如有必要,请详细描述(200字以内)~"></textarea> |
|
|
|
|
<view class="tips">0/200字</view> |
|
|
|
|
<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"> |
|
|
|
|
<image class="pic" src="@/static/1.png"></image> |
|
|
|
|
<image class="del" src="@/static/fabu-cha.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="upload"> |
|
|
|
|
<image class="pic" src="@/static/fankui-tianjia.png"></image> |
|
|
|
|
<view class="txt">上传图片</view> |
|
|
|
|
<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> |
|
|
|
@ -38,23 +38,23 @@ |
|
|
|
|
<view class="title"><text class="red">*</text>联系方式</view> |
|
|
|
|
<view class="list"> |
|
|
|
|
<view class="dd"> |
|
|
|
|
<input type="text" placeholder="请填写您的姓名"/> |
|
|
|
|
<input v-model="name" type="text" placeholder="请填写您的姓名"/> |
|
|
|
|
</view> |
|
|
|
|
<view class="dd"> |
|
|
|
|
<input type="text" placeholder="请填写您的电话或邮箱"/> |
|
|
|
|
<input v-model="phone" type="text" placeholder="请填写您的电话"/> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="add-fd"> |
|
|
|
|
<view class="btn">提交反馈</view> |
|
|
|
|
<view class="history">反馈记录 ></view> |
|
|
|
|
<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">我知道了</view> |
|
|
|
|
<view class="btn" @click="show = false">我知道了</view> |
|
|
|
|
</view> |
|
|
|
|
</u-popup> |
|
|
|
|
</view> |
|
|
|
@ -64,14 +64,141 @@ |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
show: false, |
|
|
|
|
tabIndex: 1 |
|
|
|
|
show: false, |
|
|
|
|
imgurl: [], |
|
|
|
|
content: "", |
|
|
|
|
tabIndex: 1, |
|
|
|
|
name: "", |
|
|
|
|
phone: "" |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
tabItem(index) { |
|
|
|
|
this.tabIndex = index; |
|
|
|
|
} |
|
|
|
|
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 } = await this.$api.findZegoToken({ |
|
|
|
|
userId: uni.getStorageSync("userInfo").id, |
|
|
|
|
sellerId |
|
|
|
|
}) |
|
|
|
|
if(code == 200){ |
|
|
|
|
uni.setStorageSync("chatToken",data.token); |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: "/pages/users/chat?id="+sellerId+"&roomId="+data.roomId |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//上传图片 |
|
|
|
|
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> |
|
|
|
|