flat: 3.4
This commit is contained in:
101
pageMy/setUserBase/mailbox.vue
Normal file
101
pageMy/setUserBase/mailbox.vue
Normal file
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
|
||||
<view class="u-page">
|
||||
<u-list
|
||||
@scrolltolower="getList('add')"
|
||||
>
|
||||
<u-list-item
|
||||
v-for="(item, index) in recordList"
|
||||
:key="index"
|
||||
>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getConsultMailboxInfo } from '@/api/content.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
recordList: [],
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
},
|
||||
onReady() {
|
||||
this.getList("refresh")
|
||||
},
|
||||
created() {
|
||||
},
|
||||
onReachBottom() {
|
||||
console.log('触底了')
|
||||
},
|
||||
methods: {
|
||||
addConsult() {
|
||||
this.navTo(`/pageMy/setUserBase/subPage/mailboxDetail`)
|
||||
},
|
||||
async getList(type) {
|
||||
if (type === "refresh") {
|
||||
this.pageNumber = 1;
|
||||
}
|
||||
let params = {
|
||||
page: this.pageNumber,
|
||||
size: 10,
|
||||
};
|
||||
if (this.status) {
|
||||
}
|
||||
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;
|
||||
}
|
||||
.title_style{
|
||||
width: 400rpx;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.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>
|
||||
178
pageMy/setUserBase/subPage/mailboxDetail.vue
Normal file
178
pageMy/setUserBase/subPage/mailboxDetail.vue
Normal file
@@ -0,0 +1,178 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user