征信小程序
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.
zhengxinApplets/pages/user/feedback.vue

488 lines
11 KiB

3 months ago
<template>
<view class="feedback">
3 months ago
<view class="hd" @click="getlianxi()">如需尽快解决问题可直接联系在线客服<image src="https://zhengxin.njrenzhou.cn/static/jiantou2.png"></image>
3 months ago
</view>
3 months ago
<view class="bd">
<view class="title"><text>*</text>反馈类型</view>
<view class="tab">
3 months ago
<view class="item" v-for="(a,i) in articleList" :key="i" :class="tabIndex == i?'item-on':''" @click="tabItem(i)">{{a.title}}</view>
3 months ago
</view>
3 months ago
<picker mode="selector" :range="childlist" :value="chilIndex" range-key="title" @change="bindPickerChange">
3 months ago
<view class="picker">
3 months ago
{{childlist[chilIndex].title}}<image src="https://zhengxin.njrenzhou.cn/static/jiantouxia.png"></image>
3 months ago
</view>
</picker>
<view class="title"><text>*</text>反馈内容</view>
<view class="textarea">
3 months ago
<textarea class="box" maxlength="200" v-model="content" placeholder="请输入文字"></textarea>
<view class="num">{{content.length}}/200</view>
3 months ago
</view>
<view class="title"><text>*</text>图片上传<view class="sub">(上传聊天截图或与问题描述相关的图片)</view></view>
<view class="pic">
3 months ago
<view class="li" v-for="(a,i) in imgs" :key="i">
<image class="img" mode="heightFix" :src="baseUrl+a"></image>
<image class="del" mode="heightFix" @click="deletePic(i)" src="https://zhengxin.njrenzhou.cn/static/icon-del.png"></image>
3 months ago
</view>
3 months ago
<view class="upload" @click="uploadImg">
3 months ago
<image src="https://zhengxin.njrenzhou.cn/static/paizhao.png"></image>
3 months ago
<view class="txt">上传图片</view>
</view>
</view>
<view class="title"><text>*</text>联系方式</view>
<view class="content">
<view class="item">
3 months ago
<input type="text" v-model="email" placeholder="请填写您的姓名" />
3 months ago
</view>
<view class="item">
3 months ago
<input type="phone" v-model="phone" placeholder="请填写您的电话" />
3 months ago
</view>
</view>
</view>
<view class="fd">
3 months ago
<view class="btn" @click="toSubmit">提交反馈</view>
3 months ago
<view class="jilu" @click="openPage()">反馈记录<image src="https://zhengxin.njrenzhou.cn/static/icon-arrow.png"></image></view>
3 months ago
</view>
3 months ago
<u-popup :show="show" :round="10" mode="center">
<view class="wechat">
<view class="title">联系客服</view>
<view class="info">
3 months ago
<view class="item" v-for="(a,i) in lianxiInfo" :key="i" v-if="i<=2">{{a.title}}<text>{{a.number}}</text></view>
3 months ago
</view>
<view class="btn" @click="show = false">我知道了</view>
</view>
</u-popup>
3 months ago
</view>
</template>
<script>
export default {
data() {
return {
3 months ago
lianxiInfo: [],
3 months ago
show: false,
articleList: [],
childlist: [],
3 months ago
tabIndex: 0,
3 months ago
chilIndex: 0,
3 months ago
content: "",
imgs: [],
3 months ago
email: "",
phone: "",
baseUrl: "",
3 months ago
statusBarHeight: 0,
bgColor: '#EBEDEC'
}
},
mounted() {
3 months ago
this.baseUrl = this.$baseUrl;
this.systemfankuiGettype();
3 months ago
},
methods: {
3 months ago
//联系客服
async getlianxi() {
const { code, data } = await this.$api.getlianxi({})
if(code == 1){
this.lianxiInfo = data
this.show = true
}
},
3 months ago
bindPickerChange(e){
this.chilIndex = e.detail.value
},
//获取反馈类型
async systemfankuiGettype() {
const { code, data } = await this.$api.systemfankuiGettype({})
if(code == 1){
if(data.length > 0){
this.childlist = data[this.tabIndex].childlist
}
this.articleList = data
}
},
3 months ago
async toSubmit() {
const that = this;
if (!this.content) {
uni.showToast({
title: '请输入反馈内容',
icon: 'none',
})
return
}
if (this.imgs.length == 0) {
uni.showToast({
title: '请上传图片',
icon: 'none',
})
return
}
3 months ago
if (!this.email) {
uni.showToast({
title: '请输入你的姓名',
icon: 'none',
})
return
}
if (!this.phone) {
uni.showToast({
title: '请输入你的手机号',
icon: 'none',
})
return
}
3 months ago
if(!/^1[3456789]\d{9}$/.test(this.phone)){
uni.showToast({
title: '手机号格式不正确',
icon: "none",
})
return ;
}
const { code, data, msg } = await this.$api.systemfankuiSetfankui({
3 months ago
image: this.imgs.join(","),
type: this.articleList[this.tabIndex].title,
type_item: this.childlist[this.chilIndex].title,
phone: this.phone,
email: this.email,
token: uni.getStorageSync("token"),
3 months ago
content: this.content,
});
3 months ago
if(code == 1){
3 months ago
uni.showToast({
title: "提交成功"
})
setTimeout(()=>{
that.content = "";
that.imgs = [];
3 months ago
that.phone = "";
that.email = "";
that.tabIndex = 0;
that.chilIndex = 0;
},2000)
3 months ago
}else{
uni.showToast({
title: msg,
icon: "none"
})
3 months ago
}
},
3 months ago
//上传图片
uploadImg() {
const that = this
uni.chooseImage({
count: 9-that.imgs.length,
sizeType: ["original"], //可以指定是原图还是压缩图,默认二者都有
sourceType: ["album", "camera"],
success: (res) => {
console.log(res)
for(var i = 0; i<res.tempFilePaths.length;i++){
uni.uploadFile({
name: 'file',
url: this.$baseUrl+'/api/Common/upload',
filePath: res.tempFilePaths[i],
formData: {
"token": uni.getStorageSync('token')
},
success: (upRes) => {
const {code, data, msg } = JSON.parse(upRes.data);
if(code == 1){
uni.showToast({
icon: "success",
title: "上传成功"
})
that.imgs.push(data.url)
}else{
uni.showToast({
icon: "error",
title: "上传失败"
})
}
},
fail: (err) => {
console.log("toUpload err",err)
console.log(err)
}
});
}
},
fail(err){
console.log("fail",err)
}
});
},
3 months ago
openPage(){
uni.navigateTo({
url: "/pages/user/feedList"
})
},
3 months ago
tabItem(index){
this.tabIndex = index;
this.childlist = this.articleList[index].childlist
3 months ago
},
3 months ago
deletePic(index) {
this.imgs.splice(index, 1)
3 months ago
},
},
}
</script>
<style lang="scss" scoped>
.feedback {
padding-bottom: 200rpx;
overflow: hidden;
3 months ago
.wechat{
width: 620rpx;
height: 510rpx;
background: #FFFFFF;
border-radius: 20rpx;
text-align: center;
.title{
font-weight: 500;
font-size: 36rpx;
color: #333333;
padding: 30rpx 0;
border-bottom: 1px solid #EAEAEA;
}
.info{
padding: 30rpx 50rpx;
overflow: hidden;
.item{
text-align: left;
line-height: 60rpx;
font-weight: 500;
font-size: 30rpx;
color: #999999;
text{
color: #333333;
}
}
}
.btn{
width: 300rpx;
height: 90rpx;
background: #FFFFFF;
border-radius: 90rpx;
border: 1px solid #00C6A9;
text-align: center;
font-weight: 500;
font-size: 30rpx;
color: #00C6A9;
line-height: 90rpx;
margin: 0 auto;
margin-top: 20rpx;
}
}
3 months ago
.fd{
width: 100%;
position: fixed;
left: 0;
bottom: 0;
z-index: 22;
background-color: #FFFFFF;
padding: 25rpx;
box-sizing: border-box;
.btn{
width: 100%;
height: 90rpx;
line-height: 90rpx;
background: #00C6A9;
border-radius: 90rpx;
text-align: center;
font-weight: 400;
font-size: 30rpx;
color: #FFFFFF;
}
.jilu{
display: flex;
align-items: center;
justify-content: center;
font-weight: 400;
font-size: 26rpx;
color: #666666;
margin-top: 10rpx;
image{
width: 30rpx;
height: 30rpx;
}
}
}
.hd{
width: 100%;
line-height: 80rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 25rpx;
box-sizing: border-box;
background: #FBEBEB;
font-weight: 400;
font-size: 26rpx;
color: #E53623;
3 months ago
position: relative;
overflow: hidden;
.btns{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 2;
opacity: 0;
}
3 months ago
image{
width: 14rpx;
height: 24rpx;
}
}
.bd{
padding: 0 25rpx 15rpx;
box-sizing: border-box;
width: 100%;
background: #FFFFFF;
box-shadow: 0px 3rpx 10rpx 0px rgba(9,44,39,0.05);
border-radius: 20rpx;
margin-top: 20rpx;
.title{
padding: 30rpx 0;
font-weight: 400;
font-size: 30rpx;
color: #333;
display: flex;
align-items: center;
text{
color: #E53623;
}
.sub{
margin-left: 10rpx;
font-size: 24rpx;
color: #999999;
}
}
.tab{
display: flex;
align-items: center;
.item{
padding: 0 40rpx;
line-height: 61rpx;
height: 61rpx;
border-radius: 61rpx;
border: 1px solid #CCCCCC;
text-align: center;
font-weight: 400;
font-size: 28rpx;
color: #333333;
&-on{
color: #FFFFFF;
border: 1px solid #00C6A9;
background: #00C6A9;
}
margin-right: 20rpx;
}
}
.picker{
width: 100%;
height: 90rpx;
background: #F6F6F6;
border-radius: 10rpx;
padding: 0 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 400;
font-size: 28rpx;
color: #333333;
margin-top: 40rpx;
box-sizing: border-box;
image{
width: 24rpx;
height: 14rpx;
}
}
.textarea{
width: 100%;
height: 360rpx;
background: #F6F6F6;
border-radius: 10rpx;
padding: 25rpx;
box-sizing: border-box;
textarea{
width: 100%;
height: 250rpx;
font-weight: 400;
font-size: 28rpx;
color: #333;
}
.num{
text-align: right;
font-weight: 400;
font-size: 28rpx;
color: #999999;
line-height: 60rpx;
}
}
.pic{
overflow: hidden;
padding-bottom: 30rpx;
.li{
width: 152rpx;
height: 152rpx;
border-radius: 10rpx;
position: relative;
overflow: hidden;
margin-top: 20rpx;
margin-right: 20rpx;
float: left;
.img{
width: 100%;
height: 100%;
}
.del{
width: 45rpx;
height: 45rpx;
position: absolute;
right: 0;
top: 0;
z-index: 2;
}
}
.upload{
width: 152rpx;
height: 152rpx;
border-radius: 10rpx;
position: relative;
overflow: hidden;
border: 1px solid #DDDDDD;
text-align: center;
font-weight: 500;
margin-top: 20rpx;
font-size: 24rpx;
color: #333333;
float: left;
image{
width: 46rpx;
height: 42rpx;
margin-top: 35rpx;
margin-bottom: 20rpx;
}
}
}
.content{
.item{
width: 100%;
margin-bottom: 20rpx;
overflow: hidden;
input{
height: 90rpx;
line-height: 90rpx;
background: #F6F6F6;
border-radius: 10rpx;
text-align: left;
font-weight: 400;
font-size: 28rpx;
color: #333333;
padding: 0 30rpx;
}
}
}
}
}
</style>