flat: 合并
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import {
|
||||
request
|
||||
} from '@/untils/AxiosUtils.js';
|
||||
|
||||
export const addConsultMailboxInfo = (data) => request({
|
||||
url: 'api/jobslink-api/content/consultMailboxInfo/add',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
|
||||
export const addSuperviseComplaintInfo = (data) => request({
|
||||
url: 'api/jobslink-api/content/superviseComplaintInfo/add',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
import {
|
||||
request
|
||||
} from '@/untils/AxiosUtils.js';
|
||||
|
||||
export const addConsultMailboxInfo = (data) => request({
|
||||
url: 'api/jobslink-api/content/consultMailboxInfo/add',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
|
||||
export const addSuperviseComplaintInfo = (data) => request({
|
||||
url: 'api/jobslink-api/content/superviseComplaintInfo/add',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
23
api/help.js
Normal file
23
api/help.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import {
|
||||
request
|
||||
} from '@/untils/AxiosUtils.js';
|
||||
import {
|
||||
getStore
|
||||
} from '@/untils/store.js'
|
||||
|
||||
//轮播图
|
||||
export const getEmploymentSurveyManage = (params) => request({
|
||||
url: '/api/jobslink-api/content/questionnaireSurveyInfo/list',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
export const queryByIdQuestionnaireSurveyInfo = (params) => request({
|
||||
url: '/api/jobslink-api/content/questionnaireSurveyInfo/queryById',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
export const replyQuestionnaireSurveyInfo = (params) => request({
|
||||
url: '/api/jobslink-api/content/questionnaireSurveyInfo/reply',
|
||||
method: 'post',
|
||||
data: params
|
||||
});
|
||||
189
pageMy/help/mailbox.vue
Normal file
189
pageMy/help/mailbox.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<view class="content">
|
||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="formOne">
|
||||
<view class="card">
|
||||
<view class="card_title">认证信息</view>
|
||||
<u-form-item label="用工单位" labelWidth="100" prop="comname" borderBottom ref="item1">
|
||||
<u--input v-model="formData.comname" placeholder="请输入用工单位名称"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="企业介绍" labelWidth="100" labelPosition="top" prop="companyDesc" borderBottom
|
||||
ref="item1">
|
||||
<u--textarea v-model="formData.companyDesc" placeholder="请输入企业介绍" count
|
||||
maxlength="200"></u--textarea>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="card">
|
||||
<view class="card_title">联系人信息</view>
|
||||
<u-form-item label="联系人" labelWidth="100" prop="manager" borderBottom ref="item1">
|
||||
<u--input v-model="formData.manager" placeholder="请输入联系人"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="手机号码" labelWidth="100" prop="telphone" borderBottom ref="item1">
|
||||
<u--input v-model="formData.telphone" placeholder="请输入手机号码"></u--input>
|
||||
</u-form-item>
|
||||
</view>
|
||||
|
||||
<view class="card">
|
||||
<u-button type="primary" text="提交" customStyle="margin-top: 50px" @click="submit"></u-button>
|
||||
<u-button type="error" text="重置" customStyle="margin-top: 10px" @click="reset"></u-button>
|
||||
</view>
|
||||
</u--form>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dic from '@/common/dic.js'
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex'
|
||||
import {
|
||||
getEmploymentSurveyManage
|
||||
} from '@/api/help.js'
|
||||
const rules = {
|
||||
comname: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请输入用工单位',
|
||||
trigger: ['change']
|
||||
},
|
||||
companyTid: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
max: 18,
|
||||
min: 18,
|
||||
message: '请输入18位统一信用代码',
|
||||
trigger: ['change']
|
||||
},
|
||||
masterName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请输入法人姓名',
|
||||
trigger: ['change']
|
||||
},
|
||||
masterIdentity: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
pattern: /^[1-9]\d{5}(19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[Xx\d]$/,
|
||||
message: '请输入法人身份证号',
|
||||
trigger: ['change']
|
||||
},
|
||||
cityId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请选择所在地区',
|
||||
trigger: ['change']
|
||||
},
|
||||
companyAddress: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请输入详细地址',
|
||||
trigger: ['change']
|
||||
},
|
||||
nature: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请选择企业性质',
|
||||
trigger: ['change']
|
||||
},
|
||||
tradeId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请选择行业',
|
||||
trigger: ['change']
|
||||
},
|
||||
companyDesc: {
|
||||
type: 'string',
|
||||
min: 20,
|
||||
required: true,
|
||||
message: '请输入企业介绍(最少20个字符)',
|
||||
trigger: ['change']
|
||||
},
|
||||
manager: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请输入联系人',
|
||||
trigger: ['change']
|
||||
},
|
||||
telphone: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
pattern: /^1[3-9]{1}[0-9]{9}$/,
|
||||
message: '请输入手机号码',
|
||||
trigger: ['change']
|
||||
},
|
||||
identityUrl4Id: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请上传法人身份证(人像)',
|
||||
trigger: ['change']
|
||||
},
|
||||
identityUrl5Id: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请上传法人身份证(国徽)',
|
||||
trigger: ['change']
|
||||
},
|
||||
authUrlId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请上传企业营业执照',
|
||||
trigger: ['change']
|
||||
},
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dic,
|
||||
formData: {},
|
||||
rules
|
||||
};
|
||||
},
|
||||
onLoad(options) {},
|
||||
computed: {
|
||||
...mapState({
|
||||
authInfo: (state) => state.auth.authInfo,
|
||||
userInfo: (state) => state.user.userInfo
|
||||
}),
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
hideKeyboard() {
|
||||
uni.hideKeyboard()
|
||||
},
|
||||
async submit() {
|
||||
|
||||
},
|
||||
reset() {
|
||||
const _this = this
|
||||
uni.showModal({
|
||||
content: '重置将清空表单,确定重置吗?',
|
||||
success() {
|
||||
_this.formData = {}
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
padding: 24rpx;
|
||||
|
||||
.card {
|
||||
.card_title {
|
||||
font-weight: bold;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.card_content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
104
pageMy/setUserBase/applicationsRecord.vue
Normal file
104
pageMy/setUserBase/applicationsRecord.vue
Normal file
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="dataSource.length">
|
||||
<block v-for="(item, index) in dataSource" :key="item.id">
|
||||
<view class="search-item" @click="toDetail(item)">
|
||||
{{item.surveyTitle}}
|
||||
<view style="flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{ item.workname }}
|
||||
</view>
|
||||
<image src="../../static/img/eyeopen.svg" style="width: 32rpx;height: 32rpx;margin-right: 10rpx;"
|
||||
mode="">
|
||||
</image>
|
||||
<view class="baddd"></view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<empty v-else content="暂无问卷" mrTop="300"></empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getEmploymentSurveyManage
|
||||
} from '@/api/help.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataSource: [],
|
||||
pageNumber: 1,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList("refresh");
|
||||
},
|
||||
onReachBottom() {
|
||||
this.getList();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getList("refresh");
|
||||
},
|
||||
methods: {
|
||||
toDetail(row) {
|
||||
this.navTo(`/pageMy/setUserBase/sub/appliRecordsDeatil?id=${row.id}`)
|
||||
},
|
||||
async getList(type = 'add') {
|
||||
if (type === "refresh") {
|
||||
this.pageNumber = 1;
|
||||
}
|
||||
let params = {
|
||||
size: 10,
|
||||
page: this.pageNumber
|
||||
}
|
||||
let resData = await getEmploymentSurveyManage(params)
|
||||
uni.stopPullDownRefresh()
|
||||
if (resData.data.code === 200) {
|
||||
const {
|
||||
current,
|
||||
records,
|
||||
total,
|
||||
size
|
||||
} = resData.data.data
|
||||
if (!records.length) {
|
||||
return this.$api.msg("没有更多");
|
||||
}
|
||||
switch (type) {
|
||||
case "add":
|
||||
this.dataSource = [...this.dataSource, ...records];
|
||||
break;
|
||||
case "refresh":
|
||||
this.dataSource = records;
|
||||
break;
|
||||
}
|
||||
this.pageNumber += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.baddd {
|
||||
background: #f6f6f6;
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
.search-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 26rpx;
|
||||
border-bottom: 1rpx solid #ddd;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
padding: 10rpx 30rpx;
|
||||
}
|
||||
|
||||
.search-item .type {
|
||||
font-size: 20rpx;
|
||||
color: #707070;
|
||||
background-color: #dddddd;
|
||||
border-radius: 15rpx;
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -1,185 +1,170 @@
|
||||
<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><u-form-item
|
||||
label="投诉内容:"
|
||||
prop="complaintContent"
|
||||
labelWidth="80"
|
||||
borderBottom
|
||||
>
|
||||
<u--textarea v-model="fromData.consultContent" placeholder="请输入投诉内容" ></u--textarea>
|
||||
</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= [
|
||||
[ '一般投诉', '较难投诉', '困难投诉', '特殊投诉']
|
||||
]
|
||||
const classEnum = {
|
||||
'一般投诉': 1,
|
||||
'较难投诉': 2,
|
||||
'困难投诉': 3,
|
||||
'特殊投诉': 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>
|
||||
<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><u-form-item label="投诉内容:" prop="complaintContent" labelWidth="80" borderBottom>
|
||||
<u--textarea v-model="fromData.consultContent" placeholder="请输入投诉内容"></u--textarea>
|
||||
</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 = [
|
||||
['一般投诉', '较难投诉', '困难投诉', '特殊投诉']
|
||||
]
|
||||
const classEnum = {
|
||||
'一般投诉': 1,
|
||||
'较难投诉': 2,
|
||||
'困难投诉': 3,
|
||||
'特殊投诉': 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,
|
||||
isNext: true,
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
computed: {},
|
||||
methods: {
|
||||
confirm(item) {
|
||||
const {
|
||||
value
|
||||
} = item
|
||||
this.fromData.complaintType = value[0]
|
||||
this.showclassEnum = false
|
||||
},
|
||||
addComplaint() {
|
||||
if (this.isNext) {
|
||||
this.isNext = false
|
||||
} else {
|
||||
return
|
||||
}
|
||||
this.$refs.uForm.validate().then(async (res) => {
|
||||
let params = {
|
||||
...this.fromData,
|
||||
complaintType: classEnum[this.fromData.complaintType]
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '请求中'
|
||||
})
|
||||
let resData = await addSuperviseComplaintInfo(params)
|
||||
uni.hideLoading()
|
||||
if (resData.data?.code === 200) {
|
||||
uni.$u.toast(resData.data.msg)
|
||||
this.$api.sleep(1000).then(() => {
|
||||
uni.navigateBack(1)
|
||||
})
|
||||
}
|
||||
}).catch((errors) => {
|
||||
this.isNext = true
|
||||
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>
|
||||
@@ -1,144 +1,136 @@
|
||||
<template>
|
||||
<view class="app_cotainer">
|
||||
<u--form
|
||||
labelPosition="left"
|
||||
:fromData="fromData"
|
||||
:model="fromData"
|
||||
:rules="rules"
|
||||
ref="uForm"
|
||||
>
|
||||
<u-form-item
|
||||
label="咨询部门:"
|
||||
prop="consultDeptName"
|
||||
labelWidth="80"
|
||||
borderBottom
|
||||
>
|
||||
<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="consultContent"
|
||||
labelWidth="80"
|
||||
borderBottom
|
||||
>
|
||||
<u--textarea v-model="fromData.consultContent" placeholder="请输入咨询内容" ></u--textarea>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
label="咨询人姓名:"
|
||||
prop="consultPhone"
|
||||
labelWidth="80"
|
||||
borderBottom
|
||||
>
|
||||
<u--textarea v-model="fromData.consultContent" placeholder="请输入您的姓名" ></u--textarea>
|
||||
</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>
|
||||
<view class="btn_add">
|
||||
<u-button type="primary" size="large" text="发送信件" @click="addConsult" ></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
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 {
|
||||
fromData: Object.assign({}, formData),
|
||||
rules: Object.assign({}, rules),
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
methods: {
|
||||
addConsult() {
|
||||
this.$refs.uForm.validate().then(async(res) => {
|
||||
let resData = await addConsultMailboxInfo(this.fromData)
|
||||
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>
|
||||
<template>
|
||||
<view class="app_cotainer">
|
||||
<u--form labelPosition="left" :fromData="fromData" :model="fromData" :rules="rules" ref="uForm">
|
||||
<u-form-item label="咨询部门:" prop="consultDeptName" labelWidth="80" borderBottom>
|
||||
<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="consultContent" labelWidth="80" borderBottom>
|
||||
<u--textarea v-model="fromData.consultContent" placeholder="请输入咨询内容"></u--textarea>
|
||||
</u-form-item>
|
||||
<u-form-item label="咨询人姓名:" prop="consultName" labelWidth="80" borderBottom>
|
||||
<u--textarea v-model="fromData.consultName" placeholder="请输入您的姓名"></u--textarea>
|
||||
</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>
|
||||
<view class="btn_add">
|
||||
<u-button type="primary" size="large" text="发送信件" @click="addConsult"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
dateFormat
|
||||
} from '@/untils/format.js'
|
||||
import {
|
||||
addConsultMailboxInfo
|
||||
} from '@/api/content'
|
||||
const formData = {
|
||||
consultContent: '',
|
||||
consultPhone: '',
|
||||
consultTopic: '',
|
||||
consultDeptName: '',
|
||||
}
|
||||
const rules = {
|
||||
'consultName': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请填写联系人姓名',
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
'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 {
|
||||
fromData: Object.assign({}, formData),
|
||||
rules: Object.assign({}, rules),
|
||||
isNext: true,
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
computed: {},
|
||||
methods: {
|
||||
addConsult() {
|
||||
if (this.isNext) {
|
||||
this.isNext = false
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
||||
this.$refs.uForm.validate().then(async (res) => {
|
||||
uni.showLoading({
|
||||
title: '请求中'
|
||||
})
|
||||
let resData = await addConsultMailboxInfo(this.fromData)
|
||||
uni.hideLoading()
|
||||
if (resData.data?.code === 200) {
|
||||
uni.$u.toast(resData.data.msg)
|
||||
this.$api.sleep(1000).then(() => {
|
||||
uni.navigateBack(1)
|
||||
})
|
||||
}
|
||||
}).catch((errors) => {
|
||||
this.isNext = true
|
||||
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>
|
||||
101
pageMy/setUserBase/sub/appliRecordsDeatil.vue
Normal file
101
pageMy/setUserBase/sub/appliRecordsDeatil.vue
Normal file
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<view class="app_cotainer">
|
||||
<view class="content">
|
||||
<p>描述:{{infoMation.surveyContent}}</p>
|
||||
</view>
|
||||
<u--form labelPosition="left" :fromData="fromData" :model="fromData" :rules="rules" ref="uForm1">
|
||||
<u-form-item label="" prop="replyContent" labelWidth="80" borderBottom>
|
||||
<u--textarea v-model="fromData.replyContent" placeholder="回复内容"></u--textarea>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<view class="btn_add">
|
||||
<u-button type="primary" size="large" text="发送信件" @click="submit"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const rules = {
|
||||
'replyContent': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请填写投诉标题',
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
}
|
||||
import {
|
||||
queryByIdQuestionnaireSurveyInfo,
|
||||
replyQuestionnaireSurveyInfo
|
||||
} from '@/api/help.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
infoMation: {},
|
||||
fromData: {},
|
||||
rules: Object.assign({}, rules),
|
||||
isNext: true,
|
||||
}
|
||||
},
|
||||
onLoad({
|
||||
id
|
||||
}) {
|
||||
this.getDetail(id)
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
async submit() {
|
||||
if (this.isNext) {
|
||||
this.isNext = false
|
||||
} else {
|
||||
return
|
||||
}
|
||||
if (!this.fromData.replyContent) {
|
||||
this.isNext = true
|
||||
return this.$api.mag('请输入回复内容')
|
||||
}
|
||||
console.log('submit', this.fromData)
|
||||
let params = {
|
||||
surveyId: this.infoMation.id,
|
||||
...this.fromData,
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '请求中'
|
||||
})
|
||||
let resData = await replyQuestionnaireSurveyInfo(params)
|
||||
uni.hideLoading()
|
||||
this.isNext = true
|
||||
if (resData.data?.code === 200) {
|
||||
uni.$u.toast(resData.data.msg)
|
||||
this.$api.sleep(1000).then(() => {
|
||||
uni.navigateBack(1)
|
||||
})
|
||||
}
|
||||
},
|
||||
getDetail(id) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let resData = await queryByIdQuestionnaireSurveyInfo({
|
||||
id
|
||||
})
|
||||
if (resData.data.code === 200) {
|
||||
this.infoMation = resData.data.data
|
||||
resolve(resData.data.data)
|
||||
} else {
|
||||
reject()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app_cotainer {
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-bottom: 100rpx;
|
||||
}
|
||||
</style>
|
||||
16
pages.json
16
pages.json
@@ -706,6 +706,22 @@
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "setUserBase/applicationsRecord",
|
||||
"style": {
|
||||
"navigationBarTitleText": "问卷调查列表",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "setUserBase/sub/appliRecordsDeatil",
|
||||
"style": {
|
||||
"navigationBarTitleText": "问卷调查",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "help/questions/questionDetail",
|
||||
"style": {
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
咨询信箱
|
||||
<image src="../../static/img/right.svg" mode=""></image>
|
||||
</view>
|
||||
<view class="btnList" @click="go('')">
|
||||
<view class="btnList" @click="navTo('/pageMy/setUserBase/applicationsRecord')">
|
||||
<image src="../../static/img/phone.svg" mode=""></image>
|
||||
问卷调查
|
||||
<image src="../../static/img/right.svg" mode=""></image>
|
||||
|
||||
@@ -1,183 +1,183 @@
|
||||
<template>
|
||||
<view class="body">
|
||||
<view v-for="(value,key) in data" class="newsList" @click="goList(value)" :key="key">
|
||||
<view class="newsIcon">
|
||||
<image :src="value.icon" mode=""></image>
|
||||
<view v-if="news.unread[value.id] > 0" class="point"></view>
|
||||
</view>
|
||||
<view class="newsListRight">
|
||||
<view class="head">
|
||||
<view class="head_left">
|
||||
{{value.title}}
|
||||
</view>
|
||||
<view class="head_right" v-if="value.data.length > 0">
|
||||
{{value.data[0][0][value.prop.time]}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="content" v-if="value.data.length > 0">
|
||||
{{value.prop.desc(value)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<cs-button></cs-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapGetters
|
||||
} from 'vuex'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
if (!this.$store.state.user.token) {
|
||||
uni.redirectTo({
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
} else {
|
||||
uni.$emit('newsReadChange')
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.loading = true
|
||||
this.$store.dispatch("newsInit").then(() => {
|
||||
this.loading = false
|
||||
uni.stopPullDownRefresh();
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
goList(item) {
|
||||
// if (item.data.length === 0) {
|
||||
// uni.showToast({
|
||||
// title: '暂无消息',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// return
|
||||
// }
|
||||
console.log(item.data)
|
||||
// 任务推送、岗位推送、政策推送
|
||||
if(item.title == '零工岗位推送') {
|
||||
console.log('零工岗位推送')
|
||||
uni.navigateTo({
|
||||
url: './taskProjectList'
|
||||
})
|
||||
} else if(item.title == '全职岗位推送') {
|
||||
console.log('全职岗位推送')
|
||||
uni.navigateTo({
|
||||
url: './jobProjectList'
|
||||
})
|
||||
} else if(item.title == '政策推送') {
|
||||
console.log('政策推送')
|
||||
uni.navigateTo({
|
||||
url: './policyList'
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: './newsList?type=' + item.id
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['news']),
|
||||
data() {
|
||||
console.log(this.news.data,'-----------------------------');
|
||||
return this.news.data
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.content {
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
width: 560rpx;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
/*不换行*/
|
||||
text-overflow: ellipsis;
|
||||
/*超出部分文字以...显示*/
|
||||
}
|
||||
|
||||
.head_right {
|
||||
float: right;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 24rpx;
|
||||
color: #CCCCCC;
|
||||
}
|
||||
|
||||
.head_left {
|
||||
float: left;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.head {
|
||||
overflow: hidden;
|
||||
width: 560rpx;
|
||||
}
|
||||
|
||||
.newsListRight {
|
||||
float: left;
|
||||
width: 560rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
padding-left: 30rpx;
|
||||
}
|
||||
|
||||
.newsList .newsIcon {
|
||||
position: relative;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.newsList image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
.newsList .point {
|
||||
position: absolute;
|
||||
top: 5rpx;
|
||||
right: 10rpx;
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
background: red;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.newsList {
|
||||
border-bottom: 1rpx solid #dddddd;
|
||||
padding-bottom: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
padding-top: 30rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.body {
|
||||
background-color: #fefefe;
|
||||
padding-left: 30rpx;
|
||||
|
||||
width: 720rpx;
|
||||
}
|
||||
|
||||
page {
|
||||
background: #f6f6f6;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="body">
|
||||
<view v-for="(value,key) in data" class="newsList" @click="goList(value)" :key="key">
|
||||
<view class="newsIcon">
|
||||
<image :src="value.icon" mode=""></image>
|
||||
<view v-if="news.unread[value.id] > 0" class="point"></view>
|
||||
</view>
|
||||
<view class="newsListRight">
|
||||
<view class="head">
|
||||
<view class="head_left">
|
||||
{{value.title}}
|
||||
</view>
|
||||
<view class="head_right" v-if="value.data.length > 0">
|
||||
{{value.data[0][0][value.prop.time]}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="content" v-if="value.data.length > 0">
|
||||
{{value.prop.desc(value)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<cs-button></cs-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapGetters
|
||||
} from 'vuex'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
if (!this.$store.state.user.token) {
|
||||
uni.redirectTo({
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
} else {
|
||||
uni.$emit('newsReadChange')
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.loading = true
|
||||
this.$store.dispatch("newsInit").then(() => {
|
||||
this.loading = false
|
||||
uni.stopPullDownRefresh();
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
goList(item) {
|
||||
// if (item.data.length === 0) {
|
||||
// uni.showToast({
|
||||
// title: '暂无消息',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// return
|
||||
// }
|
||||
console.log(item.data)
|
||||
// 任务推送、岗位推送、政策推送
|
||||
if (item.title == '零工岗位推送') {
|
||||
console.log('零工岗位推送')
|
||||
uni.navigateTo({
|
||||
url: './taskProjectList'
|
||||
})
|
||||
} else if (item.title == '全职岗位推送') {
|
||||
console.log('全职岗位推送')
|
||||
uni.navigateTo({
|
||||
url: './jobProjectList'
|
||||
})
|
||||
} else if (item.title == '政策推送') {
|
||||
console.log('政策推送')
|
||||
uni.navigateTo({
|
||||
url: './policyList'
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: './newsList?type=' + item.id
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['news']),
|
||||
data() {
|
||||
console.log(this.news.data, '-----------------------------');
|
||||
return this.news.data
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.content {
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
width: 560rpx;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
/*不换行*/
|
||||
text-overflow: ellipsis;
|
||||
/*超出部分文字以...显示*/
|
||||
}
|
||||
|
||||
.head_right {
|
||||
float: right;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 24rpx;
|
||||
color: #CCCCCC;
|
||||
}
|
||||
|
||||
.head_left {
|
||||
float: left;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.head {
|
||||
overflow: hidden;
|
||||
width: 560rpx;
|
||||
}
|
||||
|
||||
.newsListRight {
|
||||
float: left;
|
||||
width: 560rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
padding-left: 30rpx;
|
||||
}
|
||||
|
||||
.newsList .newsIcon {
|
||||
position: relative;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.newsList image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
.newsList .point {
|
||||
position: absolute;
|
||||
top: 5rpx;
|
||||
right: 10rpx;
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
background: red;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.newsList {
|
||||
border-bottom: 1rpx solid #dddddd;
|
||||
padding-bottom: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
padding-top: 30rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.body {
|
||||
background-color: #fefefe;
|
||||
padding-left: 30rpx;
|
||||
|
||||
width: 720rpx;
|
||||
}
|
||||
|
||||
page {
|
||||
background: #f6f6f6;
|
||||
}
|
||||
</style>
|
||||
@@ -342,3 +342,378 @@ const news = {
|
||||
}
|
||||
};
|
||||
export default news;
|
||||
=======
|
||||
import {
|
||||
inviteCount,
|
||||
inviteList,
|
||||
inviteRead,
|
||||
inviteRemove,
|
||||
noticeCount,
|
||||
noticeList,
|
||||
noticeRead,
|
||||
noticeRemove
|
||||
} from '@/api/news.js'
|
||||
import website from '@/config/website.js'
|
||||
const size = 20
|
||||
const handler = {
|
||||
'0': {
|
||||
count: noticeCount,
|
||||
getList: noticeList,
|
||||
read: noticeRead,
|
||||
remove: noticeRemove
|
||||
},
|
||||
'1': {
|
||||
count: inviteCount,
|
||||
getList: inviteList,
|
||||
read: inviteRead,
|
||||
remove: inviteRemove
|
||||
}
|
||||
}
|
||||
|
||||
function getCount(data) {
|
||||
let sum = 0
|
||||
for (let key in data) {
|
||||
sum += data[key]
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
let refreshTimer = null;
|
||||
|
||||
function startRefreshToken(dispatch) {
|
||||
refreshTimer = setInterval(() => {
|
||||
dispatch("newsInit");
|
||||
}, website.newsRefreshTime);
|
||||
}
|
||||
|
||||
function stopRefreshToken() {
|
||||
clearInterval(refreshTimer)
|
||||
}
|
||||
|
||||
const news = {
|
||||
state: {
|
||||
count: 0,
|
||||
data: {
|
||||
"0": {
|
||||
id: "0",
|
||||
title: "消息通知",
|
||||
icon: "../../static/img/notice.svg",
|
||||
page: {
|
||||
current: 0,
|
||||
size,
|
||||
total: size
|
||||
},
|
||||
data: [],
|
||||
prop: {
|
||||
title: 'title',
|
||||
desc: (value) => {
|
||||
if (value.data[0])
|
||||
return value.data[0][0]['desc']
|
||||
},
|
||||
time: 'createTime',
|
||||
isRead: 'isRead',
|
||||
listDesc: 'desc',
|
||||
},
|
||||
navigateTo(item) {
|
||||
uni.$once('getNewsDetail', (cb) => {
|
||||
cb(item)
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: "/pages/news/newsDetail?type=0"
|
||||
})
|
||||
}
|
||||
},
|
||||
"1": {
|
||||
id: "1",
|
||||
title: "岗位推送",
|
||||
icon: "../../static/img/renwu.png",
|
||||
page: {
|
||||
current: 0,
|
||||
size,
|
||||
total: size
|
||||
},
|
||||
data: [],
|
||||
prop: {
|
||||
title: 'missionTitle',
|
||||
desc: (value) => {
|
||||
if (value.data[0])
|
||||
return `您收到${value.data[0][0]['companyName']}岗位`
|
||||
},
|
||||
time: 'createTime',
|
||||
isRead: 'status',
|
||||
listDesc: 'companyName',
|
||||
},
|
||||
navigateTo(item, dispatch) {
|
||||
dispatch('readNew', {
|
||||
key: '1',
|
||||
id: item.id
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: `/pages/projectInfo/projectInfo?type=1&missionNo=${encodeURIComponent(item.missionNo)}&id=${encodeURIComponent(item.id)}`
|
||||
})
|
||||
}
|
||||
},
|
||||
"2": {
|
||||
id: "1",
|
||||
title: "岗位推送",
|
||||
icon: "../../static/img/gangwei.svg",
|
||||
page: {
|
||||
current: 0,
|
||||
size,
|
||||
total: size
|
||||
},
|
||||
data: [],
|
||||
prop: {
|
||||
title: 'missionTitle',
|
||||
desc: (value) => {
|
||||
if (value.data[0])
|
||||
return `您收到${value.data[0][0]['companyName']}的岗位`
|
||||
},
|
||||
time: 'createTime',
|
||||
isRead: 'status',
|
||||
listDesc: 'companyName',
|
||||
},
|
||||
navigateTo(item, dispatch) {
|
||||
dispatch('readNew', {
|
||||
key: '1',
|
||||
id: item.id
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: `/pages/projectInfo/projectInfo?type=1&missionNo=${encodeURIComponent(item.missionNo)}&id=${encodeURIComponent(item.id)}`
|
||||
})
|
||||
}
|
||||
},
|
||||
// "3": {
|
||||
// id: "1",
|
||||
// title: "技能推送",
|
||||
// icon: "../../static/img/jineng.svg",
|
||||
// page: {
|
||||
// current: 0,
|
||||
// size,
|
||||
// total: size
|
||||
// },
|
||||
// data: [],
|
||||
// prop: {
|
||||
// title: 'missionTitle',
|
||||
// desc: (value) => {
|
||||
// if (value.data[0])
|
||||
// return `您收到${value.data[0][0]['companyName']}的任务`
|
||||
// },
|
||||
// time: 'createTime',
|
||||
// isRead: 'status',
|
||||
// listDesc: 'companyName',
|
||||
// },
|
||||
// navigateTo(item, dispatch) {
|
||||
// dispatch('readNew', {
|
||||
// key: '1',
|
||||
// id: item.id
|
||||
// })
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/projectInfo/projectInfo?type=1&missionNo=${encodeURIComponent(item.missionNo)}&id=${encodeURIComponent(item.id)}`
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
"4": {
|
||||
id: "1",
|
||||
title: "政策推送",
|
||||
icon: "../../static/img/zhengce.svg",
|
||||
page: {
|
||||
current: 0,
|
||||
size,
|
||||
total: size
|
||||
},
|
||||
data: [],
|
||||
prop: {
|
||||
title: 'missionTitle',
|
||||
desc: (value) => {
|
||||
if (value.data[0])
|
||||
return `您收到${value.data[0][0]['companyName']}的岗位`
|
||||
},
|
||||
time: 'createTime',
|
||||
isRead: 'status',
|
||||
listDesc: 'companyName',
|
||||
},
|
||||
navigateTo(item, dispatch) {
|
||||
dispatch('readNew', {
|
||||
key: '1',
|
||||
id: item.id
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: `/pages/projectInfo/projectInfo?type=1&missionNo=${encodeURIComponent(item.missionNo)}&id=${encodeURIComponent(item.id)}`
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
unread: {
|
||||
"0": 0,
|
||||
"1": 0
|
||||
},
|
||||
allUnread: 0,
|
||||
dic: {}
|
||||
},
|
||||
actions: {
|
||||
newsInit({
|
||||
dispatch
|
||||
}) {
|
||||
const ps = []
|
||||
ps.push(dispatch('getUnreadNum'))
|
||||
|
||||
for (let key in handler) {
|
||||
ps.push(dispatch('newsReload', key))
|
||||
}
|
||||
return Promise.all(ps)
|
||||
},
|
||||
newsReload({
|
||||
dispatch,
|
||||
commit
|
||||
}, id) {
|
||||
commit('CLEAR_NEWS_DATA', id)
|
||||
return dispatch('newsGetNextPage', id)
|
||||
},
|
||||
getUnreadNum({
|
||||
commit
|
||||
}) {
|
||||
for (let key in handler) {
|
||||
handler[key].count().then((result) => {
|
||||
commit('SET_UNREADNUM', {
|
||||
id: key,
|
||||
count: result
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
newsGetNextPage({
|
||||
state,
|
||||
commit
|
||||
}, id) {
|
||||
const item = state.data[id]
|
||||
const page = item.page
|
||||
const current = page.current + 1
|
||||
return new Promise((resolve, reject) => {
|
||||
if (parseInt(page.total / page.size) + 1 < current) {
|
||||
resolve()
|
||||
return
|
||||
}
|
||||
handler[id].getList(current, page.size).then(res => {
|
||||
const data = res.data.data;
|
||||
commit('ADD_NEWS_DATA', {
|
||||
id,
|
||||
data: data.records,
|
||||
current,
|
||||
total: data.total
|
||||
})
|
||||
resolve(res)
|
||||
}).catch(reject)
|
||||
})
|
||||
},
|
||||
removeNew({
|
||||
commit
|
||||
}, {
|
||||
id,
|
||||
key,
|
||||
group,
|
||||
index
|
||||
}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
commit('REMOVE_NEWS', {
|
||||
id,
|
||||
key,
|
||||
group,
|
||||
index
|
||||
})
|
||||
handler[key].remove(id).then(resolve, reject)
|
||||
})
|
||||
},
|
||||
readNew({
|
||||
commit
|
||||
}, {
|
||||
key,
|
||||
id
|
||||
}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
commit('READ_NEWS', {
|
||||
key,
|
||||
id
|
||||
})
|
||||
handler[key].read(id).then(resolve, reject)
|
||||
})
|
||||
},
|
||||
endRefreshNewsTimer() {
|
||||
stopRefreshToken()
|
||||
},
|
||||
startRefreshNewsTimer({
|
||||
state,
|
||||
commit,
|
||||
dispatch
|
||||
}) {
|
||||
console.log('触发2')
|
||||
dispatch('newsInit').then(() => {
|
||||
startRefreshToken(dispatch);
|
||||
})
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
SET_UNREADNUM: (state, {
|
||||
id,
|
||||
count
|
||||
}) => {
|
||||
state.unread[id] = count
|
||||
state.allUnread = getCount(state.unread)
|
||||
},
|
||||
CLEAR_NEWS_DATA: (state, id) => {
|
||||
state.data[id].page = {
|
||||
current: 0,
|
||||
size
|
||||
}
|
||||
state.data[id].data = []
|
||||
},
|
||||
ADD_NEWS_DATA: (state, {
|
||||
id,
|
||||
data,
|
||||
current,
|
||||
total
|
||||
}) => {
|
||||
data.forEach(item => {
|
||||
state.dic[item.id] = item
|
||||
})
|
||||
state.data[id].page.total = total
|
||||
state.data[id].page.current = current
|
||||
if (data.length > 0) {
|
||||
state.data[id].data.push(data)
|
||||
}
|
||||
},
|
||||
REMOVE_NEWS: (state, {
|
||||
id,
|
||||
key,
|
||||
group,
|
||||
index
|
||||
}) => {
|
||||
const readProp = state.data[key].prop['isRead']
|
||||
if (state.dic[id][readProp] === 0) {
|
||||
state.unread[key]--
|
||||
state.allUnread--
|
||||
}
|
||||
state.dic[id] = undefined
|
||||
const data = state.data[key].data
|
||||
data[group].splice(index, 1)
|
||||
if (data[group].length === 0) {
|
||||
data.splice(group, 1)
|
||||
}
|
||||
},
|
||||
READ_NEWS: (state, {
|
||||
key,
|
||||
id
|
||||
}) => {
|
||||
const readProp = state.data[key].prop['isRead']
|
||||
if (state.dic[id][readProp] === 0) {
|
||||
state.dic[id][readProp] = 1
|
||||
state.unread[key]--
|
||||
state.allUnread--
|
||||
}
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
|
||||
}
|
||||
};
|
||||
export default news;
|
||||
|
||||
Reference in New Issue
Block a user