|
|
@ -8,14 +8,14 @@ |
|
|
|
<view class="label">投诉类别</view> |
|
|
|
<view class="rightSelect"> |
|
|
|
<u-radio-group |
|
|
|
v-model="form.radiovalue1" |
|
|
|
v-model="form.userType" |
|
|
|
> |
|
|
|
<u-radio |
|
|
|
:customStyle="{marginRight: '24rpx'}" |
|
|
|
v-for="(item, index) in radiolist1" |
|
|
|
:key="index" |
|
|
|
:label="item.name" |
|
|
|
:name="item.name" |
|
|
|
:name="item.id" |
|
|
|
> |
|
|
|
</u-radio> |
|
|
|
</u-radio-group> |
|
|
@ -26,15 +26,15 @@ |
|
|
|
<view class="card"> |
|
|
|
<view class="row"> |
|
|
|
<view class="label">驾校名称</view> |
|
|
|
<view @click="showShoolName=true" class="select_row my" > |
|
|
|
<input v-model="form.classModel" placeholder="请选择" @click="showShoolName=true" disabled/></input> |
|
|
|
<view @click="showSchool=true" class="select_row my" > |
|
|
|
<input v-model="form.schoolName" placeholder="请选择" @click="showSchool=true" disabled style="pointer-events: none;"/></input> |
|
|
|
<u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="row"> |
|
|
|
<view class="label">教练名称</view> |
|
|
|
<view @click="showShoolName=true" class="select_row" > |
|
|
|
<input v-model="form.classModel" placeholder="请选择" @click="showShoolName=true" disabled/></input> |
|
|
|
<view @click="goCoach" class="select_row" > |
|
|
|
<input v-model="form.coachName" placeholder="请选择" @click="goCoach" style="pointer-events: none;" disabled/></input> |
|
|
|
<u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -43,8 +43,8 @@ |
|
|
|
<view class="card"> |
|
|
|
<view class="row"> |
|
|
|
<view class="label">投诉类型</view> |
|
|
|
<view @click="showShoolName=true" class="select_row" > |
|
|
|
<input v-model="form.classModel" placeholder="请选择" @click="showShoolName=true" disabled/></input> |
|
|
|
<view @click="showComplainType=true" class="select_row" > |
|
|
|
<input v-model="form.complainTypeName" placeholder="请选择" @click="showComplainType=true" style="pointer-events: none;" disabled/></input> |
|
|
|
<u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -58,19 +58,19 @@ |
|
|
|
<image src="@/static/images/index/edit.png" mode=""></image> |
|
|
|
</view> |
|
|
|
<view class="inputBox"> |
|
|
|
<u-textarea v-model="value" ref="textarea" placeholder="详细说明问题,以便获得更好的回答~"></u-textarea> |
|
|
|
<u-textarea v-model.trim="form.content" ref="textarea" placeholder="详细说明问题,以便获得更好的回答~"></u-textarea> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="phoneBox"> |
|
|
|
<view class="imgBox"> |
|
|
|
<view class="img"> |
|
|
|
<view class="minusCircle"> |
|
|
|
<u-icon name="close-circle-fill" size="20" color="#b9061d"></u-icon> |
|
|
|
<view class="img" v-for="(item,index) in imgArr" :key="item"> |
|
|
|
<view class="minusCircle" @click="deleteImg(item)"> |
|
|
|
<u-icon name="close-circle-fill" size="20" color="#b9061d"></u-icon> |
|
|
|
</view> |
|
|
|
<image src="../../../../static/logo.png" mode=""></image> |
|
|
|
<image :src="item" mode=""></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="phone" @click="chooseImages"> |
|
|
|
<view class="phone" @click="chooseImages" v-if="imgArr.length<3"> |
|
|
|
<view class="phoneIcon"> |
|
|
|
<image src="@/static/images/index/btn_tupian.png" mode=""></image> |
|
|
|
</view> |
|
|
@ -83,52 +83,107 @@ |
|
|
|
<view class="card"> |
|
|
|
<view class="phone_row"> |
|
|
|
<view class="label">联系电话</view> |
|
|
|
<view class="uInput my"> |
|
|
|
<u--input placeholder="输入手机号码,以便我们回复您!" v-model="value" border="none" type="number" fontSize="14"></u--input> |
|
|
|
</view> |
|
|
|
<view class="uInput my">{{ this.vuex_userInfo.mobile }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="btn active">提交</view> |
|
|
|
<view class="btn" :class="{active: btnActive}" @click="submintFn">提交</view> |
|
|
|
</view> |
|
|
|
<u-picker :show="showShoolName" :columns="shoolArr" keyName="lab" @confirm="confirmSex" @cancel="showShoolName=false"></u-picker> |
|
|
|
<u-picker :show="showComplainType" :columns="complainTypeArr" keyName="label" @confirm="confirmComplainType" @cancel="showComplainType=false"></u-picker> |
|
|
|
|
|
|
|
<u-popup :show="showSchool" mode="bottom" :round="8" @close="showSchool=false"> |
|
|
|
<searchSchool @chooseSchool="chooseSchool"/> |
|
|
|
</u-popup> |
|
|
|
<!-- <u-picker :show="show" :columns="shoolArr" keyName="lab"></u-picker> --> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { APP_API, APP_HOST } from '@/site.config.js'; |
|
|
|
const _url = APP_HOST + APP_API + '/util/manage/uploadFile.do'; |
|
|
|
import { createcomplain, consultationType } from '@/config/api.js' |
|
|
|
import { WX_API, H5_API, prefix } from '@/config/site.config.js'; |
|
|
|
import searchSchool from '@/pages/indexEntry/enroll/registInfo/comp/searchSchool.vue' |
|
|
|
var _url = H5_API+ WX_API |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { searchSchool }, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
showSchool: false, |
|
|
|
value: '', |
|
|
|
imgArr: [], |
|
|
|
showShoolName: false, |
|
|
|
shoolArr: [ |
|
|
|
[ |
|
|
|
{lab: '翔力驾校',id: 1} |
|
|
|
] |
|
|
|
], |
|
|
|
showComplainType: false, |
|
|
|
// 1、服务态度,2、教学质量、3、退费问题,4、学时问题,5、考试预约,6、转校问题,示例值(1) |
|
|
|
complainTypeArr: [], |
|
|
|
form: { |
|
|
|
value: '投诉驾校' |
|
|
|
value: '投诉驾校', |
|
|
|
complainType: '', |
|
|
|
complainTypeName: '', |
|
|
|
userType: 1, |
|
|
|
coachName: '', |
|
|
|
schoolName: '', |
|
|
|
schoolId: '', |
|
|
|
content: '', |
|
|
|
type: 2 |
|
|
|
}, |
|
|
|
radiolist1: [{ |
|
|
|
name: '投诉驾校', |
|
|
|
id: 1, |
|
|
|
disabled: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '投诉教练', |
|
|
|
id: 2, |
|
|
|
disabled: false |
|
|
|
}, |
|
|
|
], |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
btnActive() { |
|
|
|
if(this.form.schoolId&&this.form.complainType&&this.form.content) { |
|
|
|
return true |
|
|
|
}else { |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
uni.$on('upDateCoachItem',(item)=>{ |
|
|
|
console.log(item) |
|
|
|
this.form.coachId = item.id |
|
|
|
this.form.coachName = item.name |
|
|
|
}) |
|
|
|
this.consultationTypeFn() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 选择驾校 |
|
|
|
confirmSex(val) { |
|
|
|
// 投诉类型 |
|
|
|
async consultationTypeFn() { |
|
|
|
const {data: res} = await consultationType() |
|
|
|
this.complainTypeArr = [res] |
|
|
|
}, |
|
|
|
// 选择投诉类型 |
|
|
|
confirmComplainType(val) { |
|
|
|
console.log(val) |
|
|
|
this.showShoolName = false |
|
|
|
let item = val.value[0] |
|
|
|
this.form.complainType = item.value |
|
|
|
this.form.complainTypeName = item.label |
|
|
|
this.showComplainType = false |
|
|
|
}, |
|
|
|
// 选择驾校 |
|
|
|
chooseSchool(item) { |
|
|
|
this.form.schoolName = item.name |
|
|
|
this.form.schoolId = item.id |
|
|
|
console.log(this.columnsCar) |
|
|
|
this.showSchool = false |
|
|
|
}, |
|
|
|
// 跳转到选择教练 |
|
|
|
goCoach() { |
|
|
|
if(!this.form.schoolId) return this.$u.toast('请先选择驾校') |
|
|
|
this.$goPage('/pages/indexEntry/enroll/registInfo/chooseCoach/chooseCoach?schoolId=' + this.form.schoolId) |
|
|
|
}, |
|
|
|
deleteImg(item) { |
|
|
|
let index = this.imgArr.findIndex(val=>val==item) |
|
|
|
this.imgArr.splice(index, 1) |
|
|
|
}, |
|
|
|
//选择图片 |
|
|
|
chooseImages(type) { |
|
|
@ -141,27 +196,32 @@ |
|
|
|
uni.showLoading({ |
|
|
|
title: '图片上传中...' |
|
|
|
}); |
|
|
|
res.tempFilePaths.forEach( (item,index)=>{ |
|
|
|
this.uploadImgApi(item) |
|
|
|
console.log(res) |
|
|
|
res.tempFiles.forEach( (item,index)=>{ |
|
|
|
this.uploadImgApi(item.path, item.name) |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
uploadImgApi(filePath) { |
|
|
|
uploadImgApi(filePath, imgName) { |
|
|
|
console.log(filePath) |
|
|
|
let token = 'Bearer '+ this.$store.state.user.vuex_loginInfo.accessToken |
|
|
|
let _this = this |
|
|
|
let timer = new Date() * 1 |
|
|
|
// 上传图片到服务器 |
|
|
|
uni.uploadFile({ |
|
|
|
url: _url,//接口 |
|
|
|
url: _url + 'app-api/infra/file/upload',//接口 |
|
|
|
filePath: filePath,//要上传的图片的本地路径 |
|
|
|
name: 'file', |
|
|
|
|
|
|
|
formData: { |
|
|
|
fileType: 1, |
|
|
|
path: 'complain/'+ uni.$u.date(name, 'yyyy-mm-dd')+'/'+timer + '-'+ imgName, |
|
|
|
type: 1, |
|
|
|
fileSuffix: "png" |
|
|
|
}, |
|
|
|
header: { |
|
|
|
token: uni.getStorageSync("Authorization") || '', |
|
|
|
Authorization: token, |
|
|
|
'tenant-id': 1 |
|
|
|
}, |
|
|
|
success(res) { |
|
|
|
console.log('上传成功') |
|
|
@ -170,9 +230,24 @@ |
|
|
|
console.log(res2) |
|
|
|
uni.hideLoading(); |
|
|
|
}, |
|
|
|
complete: ()=> {} |
|
|
|
complete: (err)=> { |
|
|
|
console.log(err) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
async submintFn() { |
|
|
|
if(!this.btnActive) return |
|
|
|
if(!this.form.content) return this.$u.toast('请输入内容') |
|
|
|
this.form.images = this.imgArr.join(',') |
|
|
|
let obj = Object.assign({}, this.form) |
|
|
|
delete obj.value |
|
|
|
delete obj.complainTypeName |
|
|
|
const {data: res} = await createcomplain(this.form) |
|
|
|
this.$u.toast('发布成功') |
|
|
|
setTimeout(()=>{ |
|
|
|
this.$goPage('/pages/indexEntry/consult/record/record?tab=2') |
|
|
|
},1500) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|