Browse Source

feat(member): 添加用户反馈功能并优化登录接口

- 在 member.js 中添加 setFeedback 方法,用于提交用户反馈
- 更新 feedback.vue 页面,增加反馈内容和邮箱输入框的双向绑定
- 添加表单提交功能,验证反馈内容不能为空- 优化 login 方法,统一登录接口
master
liutong 1 year ago
parent
commit
87d94a510a
  1. 22
      api/member.js
  2. 76
      pages/common/feedback.vue

22
api/member.js

@ -1,23 +1,17 @@
import http from '../common/axios.js'
// 账号密码登录
function medication_login(data) {
let url = '/dnseyeapi/Login/login'
return http.post(url, data).then(res => {
export default {
// 业务员端配置项(关于我们)
setFeedback(data) {
let url = '/member/set_feedback'
return http.post(url,data).then(res => {
return res;
})
}
//登录
function login(data) {
},
login(data) {
let url = '/login'
return http.get(url,data).then(res => {
return res;
})
}
export default {
login,
medication_login,
},
}

76
pages/common/feedback.vue

@ -5,7 +5,7 @@
<view class="main_section">
<view class="section">
<view class="text_input">
<fui-textarea placeholder="请输入反馈内容"></fui-textarea>
<fui-textarea placeholder="请输入反馈内容" v-model="formData.content"></fui-textarea>
</view>
</view>
@ -17,9 +17,10 @@
</view>
</view>
<view class="section">
<view class="input_box">
<fui-input label="邮箱方式" borderTop placeholder="请输入邮箱"></fui-input>
<fui-input label="邮箱方式" borderTop placeholder="请输入邮箱" v-model="formData.mailbox"></fui-input>
</view>
</view>
@ -27,13 +28,13 @@
反馈的相关问题会第一时间通过邮箱解答
</view>
<view class="btn">提交</view>
<view class="btn" @click="submitForm()">提交</view>
</view>
</view>
</template>
<script>
// import user from '@/api/user.js';
import memberApi from '@/api/member.js';
import AQUplodeImgMulti from '@/components/AQ/AQUplodeImgMulti';
import AQTabber from "@/components/AQ/AQTabber"
@ -46,40 +47,11 @@
data() {
return {
formData: {
images_arr: []
images_arr: [],
images:'',
content:'',
mailbox:'',
},
//
show_course: false, //
//
course_name: '课程', //
options_course: [{
text: '请选择课程',
value: '',
checked: true
}, {
text: '羽毛球课程1',
value: '1'
}, {
text: '篮球课程2',
value: '2'
}],
//
show_classroom: false, //
//
classroom_name: '课室', //
options_classroom: [{
text: '请选择课室',
value: '',
checked: true
}, {
text: '羽毛球201',
value: '1'
}, {
text: '篮球室101',
value: '2'
}],
}
},
onLoad() {},
@ -97,6 +69,32 @@
// console.log('AQxxx1',res)
// console.log('AQxxx2',this.formData.member_store_certification_arr)
},
async submitForm() {
let data = {...this.formData}
data.images = data.images_arr.join(',')
if(!data.content){
//
uni.showToast({
title:'反馈内容为必填项',
icon:'none'
})
return
}
let res = await memberApi.setFeedback(data)
if(res.code != 1){
uni.showToast({
title:res.msg,
icon:'none'
})
}else{
uni.showToast({
title:'提交成功',
icon:'none'
})
}
},
}
}
</script>
@ -145,6 +143,10 @@
background-color: #434544 !important;
}
::v-deep textarea {
color: #fff !important;
}
::v-deep .fui-textarea__background {
border: 0;
background-color: #434544 !important;

Loading…
Cancel
Save