diff --git a/src/router/index.js b/src/router/index.js index e39a110..a5410fa 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -19,6 +19,14 @@ const routes = [ meta: { keepAlive: true }, + }, + { + path: '/verify', + name: 'Verify', + component: () => import(/* webpackChunkName: "verify" */ '../views/Verify/Verify.vue'), + meta: { + keepAlive: true + }, }, { path: '*', // 页面不存在的情况下会跳到home diff --git a/src/views/Comment/Comment.vue b/src/views/Comment/Comment.vue index 128ce5e..16953c0 100644 --- a/src/views/Comment/Comment.vue +++ b/src/views/Comment/Comment.vue @@ -39,7 +39,7 @@ 删除 - + {{ snakebar_msg }}
diff --git a/src/views/Verify/verify.vue b/src/views/Verify/verify.vue index ff405cb..ac29f22 100644 --- a/src/views/Verify/verify.vue +++ b/src/views/Verify/verify.vue @@ -13,20 +13,72 @@ -
- +
+ - + + + + + showImg + + + +
{{verify_content.title}}
+
{{formatDateTime(verify_content.create_time)}}
+
+ + {{verify_content.content}} + {{verify_content.total_addr}} - {{verify_content.detail_addr}} + 联系方式 - {{verify_content.contact}} + 用户名 - {{verify_content.user_info.nick}} + + + 否决 + 通过 + +
+ + + + {{ snakebar_msg }} -
+
@@ -37,6 +89,8 @@ import { mapState, mapActions } from "vuex"; import { setHtmlFontSize } from "@/utils/px2rem.js"; import { api } from "@/axios/fetch.js"; +import { formatDateTime } from "@/utils/formatTime.js"; + export default { name: "clear", data() { @@ -49,7 +103,13 @@ export default { show_snackbar: false, snakebar_msg: "", // 加载控制 - loading_switch: false + loading_switch: false, + // 通过弹窗控制 + pass_confirm_switch: false, + // 否决弹窗控制 + veto_prompt_switch: false, + // 否决原因 + veto_reason: "" }; }, computed: { @@ -57,7 +117,8 @@ export default { }, methods: { ...mapActions(["setUserInfo", "setSettings"]), - + // 格式化时间 + formatDateTime, // 修改md-app的最小高度 changeFixed(clientHeight) { //动态修改样式 @@ -83,7 +144,7 @@ export default { ); this.initUserInfo(); // 获取失物招领信息 - this.getVerify() + this.getVerify(); }, // 初始化用户信息 @@ -99,7 +160,7 @@ export default { } console.log("用户信息初始化完成"); }, - + // 获取待审核信息 getVerify() { if (Object.keys(this.user_info).length == 0) { @@ -110,13 +171,14 @@ export default { this.loading_switch = true; let data = { openid: this.user_info.openid - } + }; console.log(`上传信息准备完成`); - console.log(data) + console.log(data); api .post("/verify/get", data) .then(res => { this.verify_content = res.data.verify; + console.log(this.verify_content); console.log("请求成功,待审核覆写成功"); this.loading_switch = false; this.message("刷新成功"); @@ -131,6 +193,50 @@ export default { } }); }, + + // 审核结果上传 + confirmRes(verify_type) { + if (Object.keys(this.user_info).length == 0) { + console.log("管理员信息校验失败"); + this.message("请先登录"); + return; + } + if(!verify_type) { + if(! (this.veto_reason = this.veto_reason.trim())){ + console.log("否决原因校验失败"); + this.message("请填写否决原因"); + return; + } + } + this.loading_switch = true; + let data = { + openid: this.user_info.openid, + id: this.verify_content.id, + pass: verify_type, + reason: this.veto_reason + }; + console.log(`上传信息准备完成`); + console.log(data); + api + .put("/verify/res", data) + .then(res => { + this.verify_content = null; + this.veto_reason = ''; + console.log("请求成功,审核成功"); + this.loading_switch = false; + this.message("审核完成"); + this.getVerify() + }) + .catch(err => { + console.log(err); + this.loading_switch = false; + if (err.response && err.response.status != 500) { + this.message(`${err.response.status}: ${err.response.data}`); + } else { + this.message("网络错误,请稍候重试"); + } + }); + }, // 调用snackBar message(msg) { this.snakebar_msg = msg; @@ -229,4 +335,8 @@ export default { .md-bottom-bar.md-type-fixed .md-bottom-bar-item { max-width: 1000px !important; } +.md-app-content .md-card { + margin: 0; + margin-bottom: 16px; +}