flat: 信箱、投诉建议

This commit is contained in:
Apcallover
2024-03-05 18:03:31 +08:00
parent a81a27f08e
commit 01c906beb6
6 changed files with 305 additions and 274 deletions

View File

@@ -2,15 +2,14 @@ import {
request
} from '@/untils/AxiosUtils.js';
//轮播图
export const getConsultMailboxInfo = (type) => request({
url: '/api/jobslink-api/content/consultMailboxInfo/list',
method: 'get',
export const addConsultMailboxInfo = (data) => request({
url: 'api/jobslink-api/content/consultMailboxInfo/add',
method: 'post',
data
});
export const consultMailboxInfoQueryById = (params) => request({
url: 'api/jobslink-api/content/consultMailboxInfo/queryById',
method: 'get',
params: params
export const addSuperviseComplaintInfo = (data) => request({
url: 'api/jobslink-api/content/superviseComplaintInfo/add',
method: 'post',
data
});

View File

@@ -0,0 +1,177 @@
<template>
<view class="app_cotainer">
<u--form
labelPosition="left"
:fromData="fromData"
:model="fromData"
:rules="rules"
ref="uForm"
>
<u-form-item
label="投诉标题:"
prop="complaintTitle"
labelWidth="90"
borderBottom
>
<u--input v-model="fromData.complaintTitle" border="surround" placeholder="请输入投诉标题" ></u--input>
</u-form-item>
<u-form-item
label="投诉对象:"
prop="complaintObject"
labelWidth="90"
borderBottom
>
<u--input v-model="fromData.complaintObject" border="surround" placeholder="请输入投诉对象" ></u--input>
</u-form-item>
<u-form-item
label="投诉分类:"
prop="complaintType"
labelWidth="90"
borderBottom
>
<u-picker @confirm="confirm" :show="showclassEnum" @cancel="showclassEnum = false" :columns="classColumns"></u-picker>
<u-button class="picker_flag" @click="showclassEnum = true" :style="[{color: fromData.complaintType ? '' : '#c0c4cc'}, {paddingLeft: `10px`}]">
{{fromData.complaintType || '请选择分类'}}
</u-button>
</u-form-item>
<u-form-item
label="投诉联系人:"
prop="complaintName"
labelWidth="90"
borderBottom
>
<u--input v-model="fromData.complaintName" border="surround" placeholder="请输入投诉人" ></u--input>
</u-form-item>
<u-form-item
label="联系电话:"
prop="complaintPhone"
labelWidth="90"
borderBottom
>
<u--input v-model="fromData.complaintPhone" border="surround" placeholder="请输入11位电话号码" ></u--input>
</u-form-item>
</u--form>
<view class="btn_add">
<u-button type="primary" size="large" text="发送信件" @click="addComplaint" ></u-button>
</view>
</view>
</template>
<script>
import { dateFormat } from '@/untils/format.js'
import { addSuperviseComplaintInfo } from '@/api/content'
const formData = {
complaintTitle: '',
complaintObject: '',
complaintType: '',
complaintName: '',
complaintPhone: '',
}
const classColumns= [
[ '分类1', '分类2', '分类3', '分类4']
]
const classEnum = {
'分类1': 1,
'分类2': 2,
'分类3': 3,
'分类4': 4,
}
const rules = {
'complaintTitle': {
type: 'string',
required: true,
message: '请填写投诉标题',
trigger: ['blur', 'change']
},
'complaintObject': {
type: 'string',
required: true,
message: '请填写咨询对象',
trigger: ['blur', 'change']
},
'complaintType': {
type: 'string',
required: true,
message: '请填投诉类型',
trigger: ['blur', 'change']
},
'complaintName': {
type: 'string',
required: true,
message: '请填写投诉人',
trigger: ['blur', 'change']
},
'complaintPhone': {
type: 'string',
required: true,
pattern: /^1[3-9]{1}\d{9}/,
message: '请填写联系方式',
trigger: ['blur', 'change']
},
}
export default {
data() {
return {
fromData: Object.assign({}, formData),
rules: Object.assign({}, rules),
classColumns,
showclassEnum: false,
};
},
onLoad() {
},
computed: {
},
methods: {
confirm(item) {
const {value} = item
this.fromData.complaintType = value[0]
this.showclassEnum = false
},
addComplaint() {
this.$refs.uForm.validate().then(async(res) => {
let params = {
...this.fromData,
complaintType: classEnum[this.fromData.complaintType]
}
console.log(params)
let resData = await addSuperviseComplaintInfo(params)
if(resData.data?.code === 200) {
uni.$u.toast(resData.data.msg)
}
}).catch((errors) => {
this.$api.msg('请输入完整信件信息')
})
}
}
}
</script>
<style lang="scss" scoped>
.app_cotainer{
padding: 24rpx;
.picker_flag{
// border: 0;
// height: auto;
display: flex;
justify-content: flex-start;
padding: 0;
}
.reply_info{
}
.btn_add{
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 110rpx;
background-color: $uni-bg-color-grey;
padding: 24rpx 24rpx calc(10px + env(safe-area-inset-bottom) / 2) 24rpx;
text-align: center;
line-height: 110rpx;
}
}
</style>

View File

@@ -1,91 +1,125 @@
<template>
<view>
<!-- 注意如果需要兼容微信小程序最好通过setRules方法设置rules规则 -->
<view class="u-page">
<u-list
@scrolltolower="getList('add')"
<view class="app_cotainer">
<u--form
labelPosition="left"
:fromData="fromData"
:model="fromData"
:rules="rules"
ref="uForm"
>
<u-list-item
v-for="(item, index) in recordList"
:key="index"
<u-form-item
label="咨询部门:"
prop="consultDeptName"
labelWidth="80"
borderBottom
>
<u-cell @click="navTo(`/pageMy/setUserBase/subPage/mailboxDetail?id=${item.id}`)" isLink center>
<view slot="title" class="title_style pro_warp2"> {{item.consultTopic}} </view>
<view slot="label" class="label_style pro_warp2"> {{item.consultContent}} </view>
</u-cell>
</u-list-item>
</u-list>
</view>
<view class="btn_add" >
<u-button type="primary" size="large" text="添加信件" @click="addConsult"></u-button>
<u--input v-model="fromData.consultDeptName" border="surround" placeholder="请输入咨询部门" ></u--input>
</u-form-item>
<u-form-item
label="咨询题目:"
prop="consultTopic"
labelWidth="80"
borderBottom
>
<u--input v-model="fromData.consultTopic" border="surround" placeholder="请输入咨询题目" ></u--input>
</u-form-item>
<u-form-item
label="联系电话:"
prop="consultPhone"
labelWidth="80"
borderBottom
>
<u--input v-model="fromData.consultPhone" border="surround" placeholder="请输入11位电话号码" ></u--input>
</u-form-item>
<u-form-item
label="咨询内容:"
prop="consultContent"
labelWidth="80"
borderBottom
>
<u--textarea v-model="fromData.consultContent" placeholder="请输入咨询内容" ></u--textarea>
</u-form-item>
</u--form>
<view class="btn_add">
<u-button type="primary" size="large" text="发送信件" @click="addConsult" ></u-button>
</view>
</view>
</template>
<script>
import { getConsultMailboxInfo } from '@/api/content.js'
export default {
import { dateFormat } from '@/untils/format.js'
import { addConsultMailboxInfo } from '@/api/content'
const formData = {
consultContent: '',
consultPhone: '',
consultTopic: '',
consultDeptName: '',
}
const rules = {
'consultPhone': {
type: 'string',
required: true,
pattern: /^1[3-9]{1}\d{9}/,
message: '请填写联系电话',
trigger: ['blur', 'change']
},
'consultContent': {
type: 'string',
required: true,
message: '请填写咨询内容',
trigger: ['blur', 'change']
},
'consultTopic': {
type: 'string',
required: true,
message: '请填写咨询题目',
trigger: ['blur', 'change']
},
'consultDeptName': {
type: 'string',
required: true,
message: '请填写咨询部门',
trigger: ['blur', 'change']
},
}
export default {
data() {
return {
recordList: [],
pageNumber: 1,
pageSize: 10,
fromData: Object.assign({}, formData),
rules: Object.assign({}, rules),
};
},
onReady() {
this.getList("refresh")
onLoad() {
},
created() {
},
onReachBottom() {
console.log('触底了')
computed: {
},
methods: {
addConsult() {
this.navTo(`/pageMy/setUserBase/subPage/mailboxDetail`)
},
async getList(type) {
if (type === "refresh") {
this.pageNumber = 1;
this.$refs.uForm.validate().then(async(res) => {
let resData = await addConsultMailboxInfo(this.fromData)
if(resData.data?.code === 200) {
uni.$u.toast(resData.data.msg)
}
let params = {
page: this.pageNumber,
size: 10,
};
if (this.status) {
}).catch((errors) => {
this.$api.msg('请输入完整信件信息')
})
}
uni.showLoading({ title: '加载中' })
let resData = await getConsultMailboxInfo({})
uni.hideLoading()
if (resData.data?.code === 200) {
const { records, total, current, size } = resData.data.data;
if (!records.length) {
return this.$Api.msg("没有更多");
}
switch (type) {
case "add":
this.recordList = [...this.recordList, ...records];
break;
case "refresh":
this.recordList = records;
break;
}
console.log(this.recordList)
this.pageNumber += 1;
}
},
},
};
</script>
<style lang="scss" scoped>
.label_style{
width: 440rpx;
.app_cotainer{
padding: 24rpx;
.picker_flag{
border: 0;
height: auto;
display: flex;
justify-content: flex-start;
padding: 0;
}
.title_style{
width: 400rpx;
font-weight: bold;
font-size: 36rpx;
.reply_info{
}
.btn_add{
position: fixed;
@@ -98,4 +132,5 @@ export default {
text-align: center;
line-height: 110rpx;
}
}
</style>

View File

@@ -1,178 +0,0 @@
<template>
<view class="app_cotainer">
<u--form
labelPosition="left"
:model="model"
ref="uForm"
>
<u-form-item
label="咨询题目:"
prop="consultTopic"
labelWidth="80"
borderBottom
ref="item1"
>
<u--input v-model="model.consultTopic" :border="isShowBorder" ></u--input>
</u-form-item>
<u-form-item
label="咨询部门:"
prop="consultDeptName"
labelWidth="80"
borderBottom
ref="item1"
>
<u--input v-model="model.consultDeptName" :border="isShowBorder" ></u--input>
</u-form-item>
<u-form-item
label="咨询日期:"
prop="consultTime"
labelWidth="80"
borderBottom
ref="item1"
v-if="isSeeDetail"
>
<u-datetime-picker
:show="show"
v-model="model.consultTime"
mode="date"
@cancel="show = false"
@confirm="show = false"
></u-datetime-picker>
<u-button class="picker_flag" @click="show = true">{{model.consultTime && dateFormat(model.consultTime )}}</u-button>
</u-form-item>
<u-form-item
label="咨询内容:"
prop="consultContent"
labelWidth="80"
borderBottom
ref="item1"
>
<u--input v-model="model.consultContent" :border="isShowBorder" ></u--input>
</u-form-item>
<view class="reply_info" v-if="isSeeDetail">
<hr></hr>
<u-form-item
label="答复部门:"
prop="replyDeptName"
labelWidth="80"
borderBottom
ref="item1"
>
<u--input v-model="model.replyDeptName" :border="isShowBorder" ></u--input>
</u-form-item>
<u-form-item
label="答复人员:"
prop="replySubmitName"
labelWidth="80"
borderBottom
ref="item1"
>
<u--input v-model="model.replySubmitName" :border="isShowBorder" ></u--input>
</u-form-item>
<u-form-item
label="答复时间:"
prop="DreplyTime"
labelWidth="80"
borderBottom
ref="item1"
>
<u--input v-model="model.DreplyTime" :border="isShowBorder" ></u--input>
</u-form-item>
<u-form-item
label="答复内容:"
prop="replyContent"
labelWidth="80"
borderBottom
ref="item1"
>
<u--input v-model="model.replyContent" :border="isShowBorder"></u--input>
</u-form-item>
</view>
<hr></hr>
<u-form-item
label="应答人:"
prop="replyName"
labelWidth="80"
borderBottom
ref="item1"
>
<u--input v-model="model.replyName" :border="isShowBorder" ></u--input>
</u-form-item>
<u-form-item
label="应答电话:"
prop="replyPhone"
labelWidth="80"
borderBottom
ref="item1"
>
<u--input v-model="model.replyPhone" :border="isShowBorder" ></u--input>
</u-form-item>
</u--form>
<view class="btn_add" >
<u-button type="primary" size="large" text="发送信件" @click="addConsult"></u-button>
</view>
</view>
</template>
<script>
import { consultMailboxInfoQueryById } from '@/api/content.js'
import { dateFormat } from '@/untils/format.js'
export default {
data() {
return {
isSeeDetail: null,
model: {},
show: false,
dateFormat
};
},
onLoad({ id }) {
if(id) {
this.isSeeDetail = id
this.getDetail({id})
}
},
computed: {
isShowBorder() {
return this.isSeeDetail ? 'none': 'surround'
}
},
methods: {
async getDetail(params) {
let resData = await consultMailboxInfoQueryById(params)
if(resData.data?.code === 200){
const { data, msg } = resData.data
data.consultTime = new Date('2022-10-22').getTime()
console.log(data)
this.model = data
}
},
}
}
</script>
<style lang="scss" scoped>
.app_cotainer{
padding: 24rpx;
.picker_flag{
border: 0;
height: auto;
display: flex;
justify-content: flex-start;
padding: 0;
}
.reply_info{
}
.btn_add{
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 110rpx;
background-color: $uni-bg-color-grey;
padding: 24rpx 24rpx calc(10px + env(safe-area-inset-bottom) / 2) 24rpx;
text-align: center;
line-height: 110rpx;
}
}
</style>

View File

@@ -472,18 +472,16 @@
{
"path": "setUserBase/mailbox",
"style": {
"navigationBarTitleText": "信箱列表",
"navigationBarTitleText": "添加信件",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": true
}
},
{
"path" : "setUserBase/subPage/mailboxDetail",
"style" :
{
"navigationBarTitleText" : "信件详情",
}, {
"path": "setUserBase/complain",
"style": {
"navigationBarTitleText": "投诉建议",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh" : true
"enablePullDownRefresh": true
}
},
{

View File

@@ -57,7 +57,7 @@
问卷调查
<image src="../../static/img/right.svg" mode=""></image>
</view>
<view class="btnList" @click="go('')">
<view class="btnList" @click="navTo('/pageMy/setUserBase/complain')">
<image src="../../static/img/vip.svg" mode=""></image>
投诉建议
<image src="../../static/img/right.svg" mode=""></image>