diff --git a/api/message.js b/api/message.js index 007f48c..653520d 100644 --- a/api/message.js +++ b/api/message.js @@ -27,7 +27,7 @@ export function solveStatus(status, userId) { useNetWork(); const params = { - id: userId, + ids: userId, status: status } return fetch.post(SOLVE_STATUS, params).then(res => res); diff --git a/api/message.js b/api/message.js index 007f48c..653520d 100644 --- a/api/message.js +++ b/api/message.js @@ -27,7 +27,7 @@ export function solveStatus(status, userId) { useNetWork(); const params = { - id: userId, + ids: userId, status: status } return fetch.post(SOLVE_STATUS, params).then(res => res); diff --git a/common/utils.js b/common/utils.js index 873094e..0b50694 100644 --- a/common/utils.js +++ b/common/utils.js @@ -261,23 +261,27 @@ export function getDateTime(value) { let time = new Date(value); - let year = time.getFullYear()+'/'; + let yearNowStamp = new Date(Date.now()); + let yearNow = yearNowStamp.getFullYear()+'年'; + let year = time.getFullYear()+'年'; let month = (time.getMonth()+1); let date = time.getDate(); let hour = time.getHours(); let minute = time.getMinutes(); let second = time.getSeconds(); - month = month < 10 ? '0'+ month +'/' : month +'/'; - date = date < 10 ? '0'+ date : date; + month = month < 10 ? '0'+ month +'月' : month +'月'; + date = date < 10 ? '0'+ date +'日': date +'日'; hour = hour < 10 ? '0'+ hour + ":" : hour + ":"; - minute = minute < 10 ? '0'+ minute : minute + ":"; - second = second < 10 ? '0'+ second : second; + minute = minute < 10 ? '0'+ minute : minute; let a = '上午'; if(hour < 12) { a = '上午'; } else { a = '下午'; } + if(String(year) === String(yearNow)) { + return String(month)+String(date)+ ' ' + a + String(hour) + String(minute); + } let str = String(year)+String(month)+String(date)+ ' ' + a + String(hour) + String(minute); return str; } diff --git a/api/message.js b/api/message.js index 007f48c..653520d 100644 --- a/api/message.js +++ b/api/message.js @@ -27,7 +27,7 @@ export function solveStatus(status, userId) { useNetWork(); const params = { - id: userId, + ids: userId, status: status } return fetch.post(SOLVE_STATUS, params).then(res => res); diff --git a/common/utils.js b/common/utils.js index 873094e..0b50694 100644 --- a/common/utils.js +++ b/common/utils.js @@ -261,23 +261,27 @@ export function getDateTime(value) { let time = new Date(value); - let year = time.getFullYear()+'/'; + let yearNowStamp = new Date(Date.now()); + let yearNow = yearNowStamp.getFullYear()+'年'; + let year = time.getFullYear()+'年'; let month = (time.getMonth()+1); let date = time.getDate(); let hour = time.getHours(); let minute = time.getMinutes(); let second = time.getSeconds(); - month = month < 10 ? '0'+ month +'/' : month +'/'; - date = date < 10 ? '0'+ date : date; + month = month < 10 ? '0'+ month +'月' : month +'月'; + date = date < 10 ? '0'+ date +'日': date +'日'; hour = hour < 10 ? '0'+ hour + ":" : hour + ":"; - minute = minute < 10 ? '0'+ minute : minute + ":"; - second = second < 10 ? '0'+ second : second; + minute = minute < 10 ? '0'+ minute : minute; let a = '上午'; if(hour < 12) { a = '上午'; } else { a = '下午'; } + if(String(year) === String(yearNow)) { + return String(month)+String(date)+ ' ' + a + String(hour) + String(minute); + } let str = String(year)+String(month)+String(date)+ ' ' + a + String(hour) + String(minute); return str; } diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 5680a18..09356c3 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -121,10 +121,12 @@ }, ], status: '已提交', - name: '张三', - time: '2012', - place: '一期主楼', + name: '', + time: '', + place: '', willchange: '', + // messageId: '', //消息id + solveId: '', //管理员处理id } }, mounted() { @@ -177,6 +179,7 @@ this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; + this.solveId = res.id; this.list.forEach(item => { for(let key in res) { if(item.id === key) { @@ -189,7 +192,7 @@ }, //管理员处理是否通过申请 async solveStatusData() { - await solveStatus(this.willchange, this.userId); + await solveStatus(this.willchange, this.solveId); } } } diff --git a/api/message.js b/api/message.js index 007f48c..653520d 100644 --- a/api/message.js +++ b/api/message.js @@ -27,7 +27,7 @@ export function solveStatus(status, userId) { useNetWork(); const params = { - id: userId, + ids: userId, status: status } return fetch.post(SOLVE_STATUS, params).then(res => res); diff --git a/common/utils.js b/common/utils.js index 873094e..0b50694 100644 --- a/common/utils.js +++ b/common/utils.js @@ -261,23 +261,27 @@ export function getDateTime(value) { let time = new Date(value); - let year = time.getFullYear()+'/'; + let yearNowStamp = new Date(Date.now()); + let yearNow = yearNowStamp.getFullYear()+'年'; + let year = time.getFullYear()+'年'; let month = (time.getMonth()+1); let date = time.getDate(); let hour = time.getHours(); let minute = time.getMinutes(); let second = time.getSeconds(); - month = month < 10 ? '0'+ month +'/' : month +'/'; - date = date < 10 ? '0'+ date : date; + month = month < 10 ? '0'+ month +'月' : month +'月'; + date = date < 10 ? '0'+ date +'日': date +'日'; hour = hour < 10 ? '0'+ hour + ":" : hour + ":"; - minute = minute < 10 ? '0'+ minute : minute + ":"; - second = second < 10 ? '0'+ second : second; + minute = minute < 10 ? '0'+ minute : minute; let a = '上午'; if(hour < 12) { a = '上午'; } else { a = '下午'; } + if(String(year) === String(yearNow)) { + return String(month)+String(date)+ ' ' + a + String(hour) + String(minute); + } let str = String(year)+String(month)+String(date)+ ' ' + a + String(hour) + String(minute); return str; } diff --git a/pages/checkMessageDetail/checkMessageDetail.vue b/pages/checkMessageDetail/checkMessageDetail.vue index 5680a18..09356c3 100644 --- a/pages/checkMessageDetail/checkMessageDetail.vue +++ b/pages/checkMessageDetail/checkMessageDetail.vue @@ -121,10 +121,12 @@ }, ], status: '已提交', - name: '张三', - time: '2012', - place: '一期主楼', + name: '', + time: '', + place: '', willchange: '', + // messageId: '', //消息id + solveId: '', //管理员处理id } }, mounted() { @@ -177,6 +179,7 @@ this.name = res.visitorName; this.time = res.inTime + ' ~ ' + res.outTime; this.place = res.visitPosition; + this.solveId = res.id; this.list.forEach(item => { for(let key in res) { if(item.id === key) { @@ -189,7 +192,7 @@ }, //管理员处理是否通过申请 async solveStatusData() { - await solveStatus(this.willchange, this.userId); + await solveStatus(this.willchange, this.solveId); } } } diff --git a/pages/message/message.vue b/pages/message/message.vue index 74abd42..91c953a 100644 --- a/pages/message/message.vue +++ b/pages/message/message.vue @@ -94,7 +94,7 @@ startTime: dateToString(new Date (item.apply_time.slice(0, item.apply_time.indexOf('-'))), 'yyyy-MM-dd'), endTime: dateToString(new Date (item.apply_time.slice(item.apply_time.indexOf('-') + 1)), 'yyyy-MM-dd'), status: item.visitor_apply_status === '1' ? '已提交' : item.visitor_apply_status === '2' ? '已通过' : '未通过', - messageTime: getDateTime(item.send_time), + messageTime: getDateTime(new Date(Number(item.send_time)).getTime()), } }) }