hengmei-two/pagesA/suggestions/suggestions.vue

188 lines
6.0 KiB
Vue
Raw Normal View History

2021-08-19 06:40:59 +00:00
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'投诉与建议'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy20">
2021-08-19 06:40:59 +00:00
<view class="bacf mar-s25 pad-zy20 radius20 fon28 col3 pad-x40">
<!-- 问题类型 -->
<view class="disac pad-s32">
<view class="flexs mar-y20 titlel">问题类型</view>
2021-12-20 08:02:27 +00:00
<radio-group @change="changeCate" class="width100 disac">
<label class="radio disac">
<radio style="transform: scale(.7);" :value="2" checked color="#3875f6"/><text>改进意见/建议</text>
</label>
<label class="radio disac">
<radio style="transform: scale(.7);" :value="1" color="#3875f6"/><text>投诉</text>
</label>
</radio-group>
<!-- <radio-group @change="changeCate" class="width100 disac">
<label class="radio disac" v-for="(iteml,indexl) in xialone" :key="indexl">
<radio style="transform: scale(.7);" :value="iteml.id" :checked="indexl==0" color="#3875f6"/><text>{{iteml.title}}</text>
</label>
</radio-group> -->
<!-- 下拉列表 -->
<!-- <view @tap="openXial" class="disjbac width100 radius10 pad-zy20 xiala posir">
2021-08-19 06:40:59 +00:00
<view>{{category}}</view>
<image :class="isZhuan?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
<view v-if="isZhuan" class="posia bacf radius10 xial-box">
<view class="pad-zy20 xial-item-box">
<view @tap="chooseXia(indexl)" :class="xialCurrent==indexl?'pcol':''" v-for="(iteml,indexl) in xialone" :key="indexl">{{iteml.title}}</view>
</view>
</view>
2021-12-20 08:02:27 +00:00
</view> -->
2021-08-19 06:40:59 +00:00
</view>
<!-- 建议意见 -->
<view class="dis mar-s20">
2021-12-02 09:31:26 +00:00
<view class="mar-y20 flexs mar-s20 titlel">意见建议</view>
2021-08-19 06:40:59 +00:00
<view class="width100 radius10 pad20 borbot-cc" style="height: 300rpx;">
2021-12-02 09:31:26 +00:00
<textarea v-model="tmsg" class="fon28" maxlength="500" style="height: 300rpx;width: auto;" placeholder="请把您的意见及建议填写在这里" placeholder-style="color:#999999;"/>
2021-08-19 06:40:59 +00:00
</view>
</view>
2021-12-20 08:02:27 +00:00
<!-- 姓名 -->
2021-08-19 06:40:59 +00:00
<view class="disac mar-s30">
<view class="mar-y20 flexs titlel disjb">
2021-12-02 09:31:26 +00:00
<view></view>
<view class="mar-y10"></view>
2021-08-19 06:40:59 +00:00
</view>
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
2021-12-02 09:31:26 +00:00
<input v-model="tname" class="fon28 height-68" type="text" value="" placeholder="我们怎么称呼您" placeholder-style="color:#999999;"/>
2021-08-19 06:40:59 +00:00
</view>
</view>
<!-- 联系电话 -->
<view class="disac mar-s20">
<view class="mar-y20 flexs titlel">联系电话</view>
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
<input v-model="tphone" maxlength="11" class="fon28 height-68" type="text" value="" placeholder="请输入联系电话" placeholder-style="color:#999999;"/>
</view>
</view>
<!-- 底部按钮 -->
<view @tap="submit" class="fon30 radius20 tc colf bold0 btnl" :style="{background:publicColor}">{{btnCon}}</view>
</view>
<!-- 弹框 -->
<pu-po :isShowT="isShowT" :isCenter="true" :contentVal="'提交成功!等待审核'" :comfrimVal="'好的'" @comfirmev="comfirmev"></pu-po>
</view>
2021-08-26 09:57:04 +00:00
<!-- 底部客服 -->
2022-02-15 08:02:16 +00:00
<!-- <public-customer :nright="20" :nbottom="100"></public-customer> -->
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='-1'></foot-tab>
2022-03-04 08:48:40 +00:00
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
2021-08-19 06:40:59 +00:00
</view>
</template>
<script>
export default {
data() {
return {
isShowT:false,
category:'',
tname:'',//联系人姓名
tphone:'',//联系方式
tmsg:'',//留言信息
touId:'',
isZhuan:false,
xialCurrent:0,
xialone:[],
2021-12-20 08:02:27 +00:00
btnCon:'立即提交',
}
},
computed: {
// 底部标题
titleList() {
return this.$store.state.titleList
},
// 底部图标
imgList() {
return this.$store.state.imgList
},
// 主题颜色
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
2021-08-19 06:40:59 +00:00
}
},
onLoad() {
2022-03-21 01:44:07 +00:00
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
2022-03-04 08:48:40 +00:00
this.checkCate();
this.tphone = uni.getStorageSync('phone');
}
2021-08-19 06:40:59 +00:00
},
methods: {
2021-12-20 08:02:27 +00:00
changeCate(e){
console.log(e.detail.value);
this.touId = e.detail.value;
},
2021-08-19 06:40:59 +00:00
checkCate(){
this.$requst.post('user/feedback-types').then(res=>{
// console.log('问题类型列表:',res);
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let obj = {
id:item.id,
title:item.title
}
this.xialone.push(obj)
})
this.category = this.xialone[0].title
this.touId = this.xialone[0].id
}
}
},error=>{})
},
submit(){
if(!this.tmsg){
this.$toolAll.tools.showToast('请输入意见及建议')
2021-12-20 08:02:27 +00:00
} else if(this.$toolAll.tools.isPhone(this.tphone)){
this.$toolAll.tools.showToast('请输入正确的手机号')
2021-08-19 06:40:59 +00:00
} else {
2021-12-20 08:02:27 +00:00
this.eventEv();
2021-08-19 06:40:59 +00:00
}
},
eventEv(){
let parmas = {
type_id:this.touId,
content:this.tmsg,
user_name:this.tname,
user_phone:this.tphone
}
if(this.btnCon == '立即提交'){
// this.$toolAll.tools.showToast('正在提交...')
this.btnCon = '正在提交...'
this.$requst.post('user/add-feedback',parmas).then(res=>{
// uni.hideToast()
if(res.code==0){
this.isShowT = true
} else {
this.btnCon = '返回'
this.$toolAll.tools.showToast(res.msg)
}
},error=>{})
} else {
uni.navigateBack({delta:1})
}
},
comfirmev(){
uni.navigateBack({delta:1})
},
openXial(){
this.isZhuan = !this.isZhuan
// console.log('开启下拉');
},
chooseXia(index){
this.xialCurrent = index
this.btnCon = '立即提交'
this.category = this.xialone[index].title
this.touId = this.xialone[index].id
},
}
}
</script>
<style>
</style>