diff --git a/api/content.js b/api/content.js index 4731f0a..cf5b010 100644 --- a/api/content.js +++ b/api/content.js @@ -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 +}); \ No newline at end of file diff --git a/api/help.js b/api/help.js new file mode 100644 index 0000000..3131fae --- /dev/null +++ b/api/help.js @@ -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 +}); \ No newline at end of file diff --git a/pageMy/help/mailbox.vue b/pageMy/help/mailbox.vue new file mode 100644 index 0000000..d1e44e3 --- /dev/null +++ b/pageMy/help/mailbox.vue @@ -0,0 +1,189 @@ + + + + + \ No newline at end of file diff --git a/pageMy/setUserBase/applicationsRecord.vue b/pageMy/setUserBase/applicationsRecord.vue new file mode 100644 index 0000000..8f06c86 --- /dev/null +++ b/pageMy/setUserBase/applicationsRecord.vue @@ -0,0 +1,104 @@ + + + + + \ No newline at end of file diff --git a/pageMy/setUserBase/complain.vue b/pageMy/setUserBase/complain.vue index 7358db8..19bdf21 100644 --- a/pageMy/setUserBase/complain.vue +++ b/pageMy/setUserBase/complain.vue @@ -1,185 +1,170 @@ - - - - - + + + + + \ No newline at end of file diff --git a/pageMy/setUserBase/mailbox.vue b/pageMy/setUserBase/mailbox.vue index e98d835..5a1f2fd 100644 --- a/pageMy/setUserBase/mailbox.vue +++ b/pageMy/setUserBase/mailbox.vue @@ -1,144 +1,136 @@ - - - - - + + + + + \ No newline at end of file diff --git a/pageMy/setUserBase/sub/appliRecordsDeatil.vue b/pageMy/setUserBase/sub/appliRecordsDeatil.vue new file mode 100644 index 0000000..d4f3c74 --- /dev/null +++ b/pageMy/setUserBase/sub/appliRecordsDeatil.vue @@ -0,0 +1,101 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index 95e07f3..9c29e0d 100644 --- a/pages.json +++ b/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": { diff --git a/pages/my/my.vue b/pages/my/my.vue index d3260ea..a0a9199 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -62,7 +62,7 @@ 咨询信箱 - + 问卷调查 diff --git a/pages/news/news.vue b/pages/news/news.vue index 3f61746..d801a0d 100644 --- a/pages/news/news.vue +++ b/pages/news/news.vue @@ -1,183 +1,183 @@ - - - - - + + + + + \ No newline at end of file diff --git a/store/models/news.js b/store/models/news.js index 9d80f8e..e68a935 100644 --- a/store/models/news.js +++ b/store/models/news.js @@ -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;