diff --git a/.env b/.env index 24d61b6..2c79874 100644 --- a/.env +++ b/.env @@ -22,8 +22,8 @@ VITE_IMAGE_BASE_PATH = http://localhost:9999 # ******************** start 开发环境 start ******************** # VITE_APP_DEV_SERVICE =http://123.156.228.134:48080/app-api # VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/app-api -VITE_APP_DEV_SERVICE = http://192.168.101.24:7001/app-api # 邓本地 -# VITE_APP_DEV_SERVICE = http://localhost:9999 +# VITE_APP_DEV_SERVICE = http://192.168.101.24:48080/app-api +VITE_APP_DEV_SERVICE = http://localhost:9999 # ******************** end 开发环境 end ******************** diff --git a/src/pages.json b/src/pages.json index 0b9d6f6..e0a2293 100644 --- a/src/pages.json +++ b/src/pages.json @@ -239,7 +239,7 @@ ] }, { - "root": "pages/humanFace", + "root": "pages/human-face", "pages": [ { "path": "list", @@ -293,4 +293,4 @@ } ] } -} +} \ No newline at end of file diff --git a/src/pages/apply/foreign-apply.vue b/src/pages/apply/foreign-apply.vue index 48d9cc0..739742b 100644 --- a/src/pages/apply/foreign-apply.vue +++ b/src/pages/apply/foreign-apply.vue @@ -47,7 +47,6 @@ const getDetail = async () => { const { data } = await applyApi.foreignDetail(_pa) if (!isEmpty(data)) { state.detail = data - const startTime = hooks.useTime(data.applyStartTime, "{y}-{m}-{d}") const endTime = hooks.useTime(data.applyEndTime, "{y}-{m}-{d}") applyForm.displayTimeRangeStr = startTime + "~" + endTime @@ -66,11 +65,12 @@ const doSubmit = async () => { const { isPass } = applyFormRef.value.validate() if (!isPass) return const range = applyForm.displayTimeRange + console.log(range); try { uni.showLoading({ title: '申请中...', mask: false }); const _pa = { - applyStartTime: dayjs(range[0]).valueOf(), - applyEndTime: dayjs(range[1]).valueOf(), + applyStartTime: hooks.useTime(range[0], "{y}-{m}-{d}"), + applyEndTime: hooks.useTime(range[1], "{y}-{m}-{d}"), count: applyForm.count, remark: applyForm.remark, } diff --git a/src/pages/apply/foreign-items.vue b/src/pages/apply/foreign-items.vue index 17c6731..b290b83 100644 --- a/src/pages/apply/foreign-items.vue +++ b/src/pages/apply/foreign-items.vue @@ -6,16 +6,17 @@ import { isEmpty } from 'radash' import { hooks, router } from "@@/index" import { applyApi } from "@@/api" +import { filePath } from "@@/utils/file" const state = reactive({ pa: { id: null, - pagesize: 99, + pagesize: 15, }, }) const pageRef = ref(null) -const pageHook = hooks.usePage(pageRef, applyApi.foreignItems, null, 'data') +const pageHook = hooks.usePage(pageRef, applyApi.codeList, null, 'data.records') const query = (page: number, pagesize: number) => { pageHook.startPage(page, pagesize, false, state.pa); } @@ -46,12 +47,12 @@ onShow(() => { v-for="(v, i) in pageHook.list" :key="i" @tap="hooks.usePreviewImage(v.code)"> - 未使用 - 已使用 + 未使用 + 已使用 - {{ v.userNameStr }} - {{ v.userMobile }} + {{ v.username }} + {{ v.userMobile }} diff --git a/src/pages/apply/foreign-list.vue b/src/pages/apply/foreign-list.vue index a512936..2b8b995 100644 --- a/src/pages/apply/foreign-list.vue +++ b/src/pages/apply/foreign-list.vue @@ -17,12 +17,12 @@ const data = { } const state = reactive({ pa: { - status: data.tabs[0].id, + processStatus: data.tabs[0].id, }, }) const pageRef = ref(null) -const pageHook = hooks.usePage(pageRef, applyApi.foreignList, null, 'data.list') +const pageHook = hooks.usePage(pageRef, applyApi.foreignList, null, 'data.records') const query = (page: number, pagesize: number) => { pageHook.startPage(page, pagesize, false, state.pa); } @@ -38,7 +38,7 @@ onShow(() => { const doTab = (e: any) => { const target = data.tabs[e]; - state.pa.status = target.id + state.pa.processStatus = target.id pageRef.value.reload(true) } @@ -47,7 +47,7 @@ const doApply = async () => { } const doCard = (v: any) => { - if (v.status == 2) { + if (v.processStatus == 2) { router.jump("/pages/apply/foreign-items", { id: v.id }) } else { router.jump("/pages/apply/foreign-apply", { type: 'view', id: v.id }) @@ -76,9 +76,9 @@ const doCard = (v: any) => { {{ hooks.useTime(v.createTime, "") }} - 待审核 - 已通过 - 已拒绝 + 待审核 + 已通过 + 已拒绝 @@ -97,7 +97,7 @@ const doCard = (v: any) => { - + @@ -111,7 +111,7 @@ const doCard = (v: any) => { - 使用 + 使用 查看 diff --git a/src/pages/apply/stride-items.vue b/src/pages/apply/stride-items.vue index 0ff2934..652ce6c 100644 --- a/src/pages/apply/stride-items.vue +++ b/src/pages/apply/stride-items.vue @@ -14,7 +14,7 @@ const state = reactive({ }) const pageRef = ref(null) -const pageHook = hooks.usePage(pageRef, applyApi.strideItems, null, 'data') +const pageHook = hooks.usePage(pageRef, applyApi.codeList, null, 'data') const query = (page: number, pagesize: number) => { pageHook.startPage(page, pagesize, false, state.pa); } diff --git a/src/pages/apply/stride-list.vue b/src/pages/apply/stride-list.vue index a3444ad..1502690 100644 --- a/src/pages/apply/stride-list.vue +++ b/src/pages/apply/stride-list.vue @@ -17,12 +17,12 @@ const data = { } const state = reactive({ pa: { - status: data.tabs[0].id, + processStatus: data.tabs[0].id, }, }) const pageRef = ref(null) -const pageHook = hooks.usePage(pageRef, applyApi.strideList, null, 'data.list') +const pageHook = hooks.usePage(pageRef, applyApi.strideList, null, 'data.records') const query = (page: number, pagesize: number) => { pageHook.startPage(page, pagesize, false, state.pa); } @@ -38,7 +38,7 @@ onShow(() => { const doTab = (e: any) => { const target = data.tabs[e]; - state.pa.status = target.id + state.pa.processStatus = target.id pageRef.value.reload(true) } @@ -47,7 +47,7 @@ const doApply = async () => { } const doCard = (v: any) => { - if (v.status == 2) { + if (v.processStatus == 2) { router.jump("/pages/apply/stride-items", { id: v.id }) } else { router.jump("/pages/apply/stride-apply", { type: 'view', id: v.id }) @@ -76,9 +76,9 @@ const doCard = (v: any) => { {{ hooks.useTime(v.createTime, "") }} - 待审核 - 已通过 - 已拒绝 + 待审核 + 已通过 + 已拒绝 @@ -89,7 +89,7 @@ const doCard = (v: any) => { {{ v.count }} - + @@ -103,7 +103,7 @@ const doCard = (v: any) => { - 使用 + 使用 查看 diff --git a/src/pages/humanFace/apply.vue b/src/pages/human-face/apply.vue similarity index 81% rename from src/pages/humanFace/apply.vue rename to src/pages/human-face/apply.vue index 421bf7b..86c4c92 100644 --- a/src/pages/humanFace/apply.vue +++ b/src/pages/human-face/apply.vue @@ -3,14 +3,16 @@ import { ref, reactive, nextTick } from "vue"; import { onLoad, onShow } from "@dcloudio/uni-app"; import { isEmpty } from "radash"; -import { hooks, router } from "@@/index"; +import { hooks, router, constant } from "@@/index"; import { faceApi } from "@@/api"; -const uploadPhotoBaseUrl = import.meta.env.VITE_APP_DEV_SERVICE; + +import { filePath } from "@@/utils/file" const state = reactive({ detailType: "add", detailId: null, detail: null, + header: {} }); const applyForm = reactive({ faceImg: [], @@ -23,26 +25,28 @@ onLoad(async (options: any) => { const { type, id } = options; if (!isEmpty(type)) state.detailType = type; if (!isEmpty(id)) state.detailId = id; + state.header = hooks.useDefaultHeader() if (type === "edit") { applyForm.faceImg = []; uploadFileUrl.value = ""; await getDetail(); } }); -onShow(() => {}); +onShow(() => { }); const getDetail = async () => { if (isEmpty(state.detailId)) return; const { data } = await faceApi.get({ id: state.detailId }); if (!isEmpty(data)) { - applyForm.faceImg = [data.faceImg]; - uploadFileUrl.value = data.faceImg; + const img = filePath(data.faceImg) + applyForm.faceImg = [img] + uploadFileUrl.value = img } }; const beforeComplete = (uploadFile: any) => { if (JSON.parse(uploadFile.data).code == 0) { - uploadFileUrl.value = JSON.parse(uploadFile.data).data; + uploadFileUrl.value = JSON.parse(uploadFile.data).data.url; return true; } else { uploadFileUrl.value = ""; @@ -55,7 +59,6 @@ const doSubmit = async () => { applyFormRef.value.submit(); const { isPass } = applyFormRef.value.validate(); if (!isPass || !uploadFileUrl.value) return; - try { uni.showLoading({ title: "提交中...", mask: false }); const { data, code }: any = @@ -80,21 +83,14 @@ const doSubmit = async () => { - + - + @tap="doSubmit"> {{ state.detailId ? "修改" : "提交" }} diff --git a/src/pages/humanFace/list.vue b/src/pages/human-face/list.vue similarity index 53% rename from src/pages/humanFace/list.vue rename to src/pages/human-face/list.vue index e9250da..3ea8aef 100644 --- a/src/pages/humanFace/list.vue +++ b/src/pages/human-face/list.vue @@ -1,39 +1,3 @@ - - + + \ No newline at end of file diff --git a/src/pages/tabbar/my.vue b/src/pages/tabbar/my.vue index 18de3d4..774930b 100644 --- a/src/pages/tabbar/my.vue +++ b/src/pages/tabbar/my.vue @@ -10,10 +10,9 @@ const data = { serviceList: [ { text: "钱包管理", icon: "/static/icon/service_3.png", router: "/pages/wallet/list" }, { text: "包厢预定", icon: "/static/icon/service_4.png", router: "/pages/boxes/apply-list" }, - // { text: '车牌管理', icon: '/static/icon/service_2.png', router: '/pages/user/diff-price' }, { text: "外来人员就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/foreign-list" }, { text: "跨单位就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/stride-list" }, - { text: "人脸管理", icon: "/static/icon/service_5.png", router: "/pages/humanFace/list" }, + { text: "人脸管理", icon: "/static/icon/service_5.png", router: "/pages/human-face/list" }, { text: "测试登录", icon: "/static/icon/login.png", router: "/pages/test/login" }, ], }; @@ -116,7 +115,8 @@ const doLogout = async () => {