suggest.vue
4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<template>
<div>
<nav-bar>
<div slot="left" class="back" @click="goBack">
<img src="../../assets/img/back.png" alt="">
</div>
<div slot="center" class="userinfotitle">
投诉与建议
</div>
<div slot="right" class="result"></div>
</nav-bar>
<div class="suggest">
<div class="suggest_title">投诉类型</div>
<div class="suggest_one">
<select name="" id="" v-model="type" >
<option value="" disabled selected style="color: lightgrey !important;">选择投诉类型</option>
<option value="1">功能异常</option>
<option value="2">体验问题</option>
<option value="3">功能建议</option>
<option value="4">服务投诉</option>
<option value="5">其他问题</option>
</select>
</div>
</div>
<div class="suggest">
<div class="suggest_title">具体问题</div>
<div class="suggest_one">
<textarea type="text" v-model="question" maxlength="400" style="resize:none;" placeholder="请填写具体意见"></textarea>
</div>
</div>
<div class="suggest">
<div class="suggest_title">手机号</div>
<div class="suggest_one">
<input type="number" v-model="phone" placeholder="请填写手机号" class="inputphone">
</div>
</div>
<div class="display-flex radio">
<div class="radioinput">
<input type="radio" id="one" value="1" v-model="picked" >
<label for="one">平台建议</label>
</div>
<div class="radioinput">
<input type="radio" id="two" value="2" v-model="picked">
<label for="two">企业建议</label>
</div>
</div>
<div class="suggest">
<div class="suggest_one display-flex-between">
<div>是否匿名提交</div>
<van-switch v-model="checked" />
</div>
</div>
<div class="footer" @click="submit">
<div class="footer_button">提交信息</div>
</div>
</div>
</template>
<script>
export default {
data () {
return {
checked: true,
picked: '',
type: '',
question: '',
phone: ''
}
},
methods: {
goBack () {
this.$router.go(-1)
},
async submit () {
const that = this
if (that.type === '') {
that.$toast('请选择投诉类型')
} else if (that.question === '') {
that.$toast('请填写具体问题')
} else if (that.picked === '') {
that.$toast('请选择是平台建议还是企业建议')
} else {
const params = {
platform: 2,
mobile: that.phone,
type: that.type,
sub_type: that.picked,
des: that.question,
is_hide: that.checked ? 1 : 0
}
const reslist = await that.api.suggest(params)
if (reslist.code === 1) {
that.$toast('投诉成功')
that.$router.go(-1)
} else {
that.$toast(reslist.msg)
}
}
}
}
}
</script>
<style>
.suggest_title{
color: rgba(50,50,51,1);
font-size: 0.36rem;
font-weight: 600;
font-family: "PingFang SC";
text-align: left
}
.suggest{
width: 100%;
height: auto;
padding: 0.32rem;
box-sizing: border-box;
}
.suggest_one{
width: 100%;
height: auto;
border-radius: 0.16rem;
opacity: 1;
background: rgba(239,242,246,1);
margin-top: 0.24rem;
color: rgba(50,50,51,1);
font-size: 0.28rem;
font-weight: 400;
font-family: "PingFang SC";
text-align: left;
line-height: 0.44rem;
padding: 0.26rem 0.32rem;
box-sizing: border-box;
}
.suggest_one .inputphone{
width: 100%;
height: 100%;
text-align: left;
}
.suggest_one textarea{
width: 100%;
height: 2rem;
border: none;
background: none;
}
.radio{
font-size: 0.28rem;
width: 100%;
padding: 0 0.32rem;
box-sizing: border-box;
}
.radioinput{
margin-right: 0.48rem;
display: flex;
align-items: center;
}
.radioinput input{
margin-right: 0.2rem;
}
</style>