From a2ec8f55c37bda2a99effa489de253ca21bb4eb8 Mon Sep 17 00:00:00 2001 From: xuminyui <576362016@qq.com> Date: Thu, 17 Oct 2024 10:59:23 +0800 Subject: [PATCH] fix --- src/App.vue | 2 + src/components/navBar/index.vue | 9 +- src/pages/detail/index.vue | 262 +++++++++++++++----------------- src/pages/painting/index.vue | 54 ++++--- utils/service/index.js | 12 +- 5 files changed, 173 insertions(+), 166 deletions(-) diff --git a/src/App.vue b/src/App.vue index f9768a5..61d4597 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,6 +5,8 @@ export default { }, onShow: function () { console.log("App Show"); + console.log(window.location.href); + }, onHide: function () { console.log("App Hide"); diff --git a/src/components/navBar/index.vue b/src/components/navBar/index.vue index c8573a6..ef05cd6 100644 --- a/src/components/navBar/index.vue +++ b/src/components/navBar/index.vue @@ -39,10 +39,9 @@ const currentWebView = plus.webview.getWebviewById("wv"); const root = document.documentElement; root.style.setProperty( "--statusBarHeight", - `${ - currentWebView.RunTime === "app" - ? plus.navigator.getStatusbarHeight() - : 0 ?? 0 + `${currentWebView.RunTime === "app" + ? plus.navigator.getStatusbarHeight() + : 0 ?? 0 }px` ); @@ -51,9 +50,11 @@ root.style.setProperty( .status_bar { height: var(--status-bar-height); } + :deep(.u-status-bar) { margin-top: var(--statusBarHeight); } + @mixin flex($direction: row) { /* #ifndef APP-NVUE */ display: flex; diff --git a/src/pages/detail/index.vue b/src/pages/detail/index.vue index be2efd0..5bb342f 100644 --- a/src/pages/detail/index.vue +++ b/src/pages/detail/index.vue @@ -1,84 +1,69 @@ - - - - - - \ No newline at end of file + + + .painting-box { + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + margin-top: 60rpx; + padding: 20rpx; + box-sizing: border-box; + background-color: #fff; + box-shadow: 0 0 6px rgba(219, 218, 218, 0.5); + } + + .image-container { + display: flex; + justify-content: center; + align-items: center; + margin-top: 20rpx; + height: auto; + } +} + +.button-container { + display: flex; + justify-content: space-between; + width: 100%; + position: fixed; + bottom: 1rpx; + left: 0; + padding: 0 20rpx; + box-sizing: border-box; + background-color: #fff; + height: 8%; +} + \ No newline at end of file diff --git a/src/pages/painting/index.vue b/src/pages/painting/index.vue index 0432925..fe40840 100644 --- a/src/pages/painting/index.vue +++ b/src/pages/painting/index.vue @@ -5,25 +5,45 @@ 已扫画筒号:{{ state.pid }} 请放入: - {{ state.containerName }}货架 + {{ state.containerName }}货架 - + " + > {{ state.boxName }} - {{ state.column }}列{{ state.row }}行 + + {{ state.column }}列{{ state.row }}行 + - 取消 - {{ buttonText }} + 取消 + {{ buttonText }} @@ -32,7 +52,7 @@ import { ref, reactive, onBeforeMount } from "vue"; import useToast from "@/hooks/toast/useToast.js"; import { onLoad } from "@dcloudio/uni-app"; import { freebox, bind, check_freebox, cancel } from "@/api/login.js"; -import { closeWebview, runTimeEnv } from "@/utils/index.js" +import { closeWebview, runTimeEnv } from "@/utils/index.js"; const { showMessage } = useToast(); const loading = ref(false); const isButtonDisabled = ref(false); @@ -44,10 +64,9 @@ const state = reactive({ containerName: "", boxName: "", boxUid: "", - containerUid: '', + containerUid: "", }); onLoad((options) => { - state.id = options.id; state.pid = options.pid; bindShelfHole(); @@ -61,13 +80,12 @@ const bindShelfHole = async () => { state.boxName = res.data.boxName; state.containerUid = res.data.containerUid; state.boxUid = res.data.boxUid; - check() + check(); if (state.boxName) { const parts = state.boxName.split(/(\d+)/); state.column = parts[0]; // 字母部分 state.row = parts[1]; // 数字部分 } - } loading.value = false; }; @@ -86,6 +104,7 @@ const doneSet = async () => { showMessage({ type: "sucess", message: "入库成功" }); isButtonDisabled.value = true; buttonText.value = "已入库"; + closeWebview(); } else { showMessage({ type: "error", message: res.msg }); } @@ -95,7 +114,7 @@ const doneSet = async () => { const closeFn = async () => { loading.value = true; const res = await cancel({ - boxUid: state.boxUid + boxUid: state.boxUid, }); if (res.status === 0) { showMessage({ type: "error", message: "取消入库" }); @@ -105,18 +124,17 @@ const closeFn = async () => { showMessage({ type: "error", message: res.msg }); } loading.value = false; -} +}; //查孔洞是否能用 const check = async () => { const res = await check_freebox({ - boxUid: state.boxUid + boxUid: state.boxUid, }); if (res.status === 0) { } else { showMessage({ type: "error", message: res.msg }); } -} - +};