fix
This commit is contained in:
parent
a2a27e334f
commit
7102055fe1
@ -112,16 +112,16 @@ const loading = ref(false);
|
||||
const isCode = ref(false);
|
||||
const haveCode = ref(false);
|
||||
onLoad((options) => {
|
||||
console.log('options',options)
|
||||
state.id = options.id;
|
||||
state.pid = options.pid;
|
||||
console.log("222", state.id);
|
||||
const token = uni.getStorageSync("token");
|
||||
const userInfo = uni.getStorageSync("userInfo");
|
||||
console.log('userInfo',token,userInfo)
|
||||
// 已经登录了
|
||||
if (token && userInfo) {
|
||||
paintingDetail();
|
||||
if (options.id && options.pid) {
|
||||
console.log("options", options);
|
||||
state.id = options.id;
|
||||
state.pid = options.pid;
|
||||
const token = uni.getStorageSync("token");
|
||||
const userInfo = uni.getStorageSync("userInfo");
|
||||
// 已经登录了
|
||||
if (token && userInfo) {
|
||||
paintingDetail();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -134,18 +134,17 @@ onLoad((options) => {
|
||||
});
|
||||
const paintingDetail = async () => {
|
||||
loading.value = true;
|
||||
console.log('state',state)
|
||||
console.log("state", state);
|
||||
const res = await pbDetail({
|
||||
id: state.id,
|
||||
pid: state.pid,
|
||||
});
|
||||
console.log(1111111111111,res)
|
||||
if (res.status === 0) {
|
||||
state.boxRelBucketStatus=res.data.boxRelBucketStatus;
|
||||
console.log("boxRelBucketStatus",state.boxRelBucketStatus)
|
||||
if (res.data.pbStatus == 1) {
|
||||
state.boxRelBucketStatus = res.data.boxRelBucketStatus;
|
||||
console.log("boxRelBucketStatus", state.boxRelBucketStatus);
|
||||
if (res.data.pbStatus == 1) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/index?id="+state.id+'&pid='+state.pid,
|
||||
url: "/pages/index/index?id=" + state.id + "&pid=" + state.pid,
|
||||
success: () => {
|
||||
loading.value = false;
|
||||
},
|
||||
@ -157,7 +156,7 @@ const paintingDetail = async () => {
|
||||
} else {
|
||||
if (res.data.boxRelBucketStatus == 3) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/painting/index?id="+state.id+'&pid='+state.pid,
|
||||
url: "/pages/painting/index?id=" + state.id + "&pid=" + state.pid,
|
||||
success: () => {
|
||||
loading.value = false;
|
||||
},
|
||||
@ -166,9 +165,15 @@ const paintingDetail = async () => {
|
||||
showMessage({ type: "default", message: "跳转失败" });
|
||||
},
|
||||
});
|
||||
}else {
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/detail/index?id="+state.id+'&pid='+state.pid+'&boxRelBucketStatus='+state.boxRelBucketStatus,
|
||||
url:
|
||||
"/pages/detail/index?id=" +
|
||||
state.id +
|
||||
"&pid=" +
|
||||
state.pid +
|
||||
"&boxRelBucketStatus=" +
|
||||
state.boxRelBucketStatus,
|
||||
success: () => {
|
||||
loading.value = false;
|
||||
},
|
||||
@ -177,7 +182,6 @@ const paintingDetail = async () => {
|
||||
showMessage({ type: "default", message: "跳转失败" });
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -218,7 +222,7 @@ const logining = async () => {
|
||||
if (res.status === 0) {
|
||||
uni.setStorageSync("token", res.data.Token);
|
||||
uni.setStorageSync("userInfo", res.data.AccountInfo);
|
||||
await paintingDetail();
|
||||
await paintingDetail();
|
||||
|
||||
loading.value = false;
|
||||
}
|
||||
|
@ -1,130 +1,120 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<navBar> 入库 </navBar>
|
||||
<view class="container-box">
|
||||
<span style="font-weight: bold">
|
||||
已扫画筒号:{{state.pid }}
|
||||
<view class="content">
|
||||
<navBar> 入库 </navBar>
|
||||
<view class="container-box">
|
||||
<span style="font-weight: bold"> 已扫画筒号:{{ state.pid }} </span>
|
||||
<span style="margin-top: 40rpx"> 请放入: </span>
|
||||
<view class="painting-box">
|
||||
<span style="font-weight: bold; text-align: center"
|
||||
>{{ state.containerName }}货架</span
|
||||
>
|
||||
<up-line style="margin-top: 20rpx"></up-line>
|
||||
<span
|
||||
style="
|
||||
color: #cf3050;
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
"
|
||||
>
|
||||
A1
|
||||
</span>
|
||||
<span style="margin-top: 40rpx;">
|
||||
请放入:
|
||||
</span>
|
||||
<view class="painting-box" >
|
||||
<span style="font-weight: bold;text-align: center;">{{ state.containerName }}货架</span>
|
||||
<up-line style="margin-top: 20rpx;"></up-line>
|
||||
<span style="color: #CF3050;font-size: 24px;text-align: center;margin-top: 20rpx;">
|
||||
A1
|
||||
</span>
|
||||
<span style="text-align: center;margin-top: 20rpx;">
|
||||
A列1行
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<span style="text-align: center; margin-top: 20rpx"> A列1行 </span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="button-container">
|
||||
<up-button
|
||||
style="width: 326rpx; margin: auto; height: 80rpx;"
|
||||
color="#BCBCBC"
|
||||
throttleTime="5"
|
||||
:loading="loading"
|
||||
>取消</up-button
|
||||
>
|
||||
<up-button
|
||||
style="width: 326rpx; margin: auto; height: 80rpx;"
|
||||
color="#EFC54E"
|
||||
throttleTime="5"
|
||||
:loading="loading"
|
||||
>确认</up-button
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import { ref,reactive,onBeforeMount } from "vue";
|
||||
import useToast from "@/hooks/toast/useToast.js";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { freebox } from "@/api/login.js";
|
||||
const { showMessage } = useToast();
|
||||
const loading = ref(false);
|
||||
const state = reactive({
|
||||
</view>
|
||||
<view class="button-container">
|
||||
<up-button
|
||||
style="width: 326rpx; margin: auto; height: 80rpx"
|
||||
color="#BCBCBC"
|
||||
throttleTime="5"
|
||||
:loading="loading"
|
||||
>取消</up-button
|
||||
>
|
||||
<up-button
|
||||
style="width: 326rpx; margin: auto; height: 80rpx"
|
||||
color="#EFC54E"
|
||||
throttleTime="5"
|
||||
:loading="loading"
|
||||
>确认</up-button
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onBeforeMount } from "vue";
|
||||
import useToast from "@/hooks/toast/useToast.js";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { freebox } from "@/api/login.js";
|
||||
const { showMessage } = useToast();
|
||||
const loading = ref(false);
|
||||
const state = reactive({
|
||||
id: "",
|
||||
pid: "",
|
||||
containerName:"",
|
||||
containerName: "",
|
||||
});
|
||||
onLoad((options) =>{
|
||||
state.id = options.id;
|
||||
state.pid = options.pid;
|
||||
const token = uni.getStorageSync("token");
|
||||
const userInfo = uni.getStorageSync("userInfo");
|
||||
if(token && userInfo){
|
||||
bindShelfHole();
|
||||
}
|
||||
});
|
||||
const bindShelfHole = async () => {
|
||||
onLoad((options) => {
|
||||
state.id = options.id;
|
||||
state.pid = options.id;
|
||||
bindShelfHole();
|
||||
});
|
||||
const bindShelfHole = async () => {
|
||||
loading.value = true;
|
||||
const res = await freebox( );
|
||||
const res = await freebox();
|
||||
if (res.status === 0) {
|
||||
state.containerName = res.data.containerName;
|
||||
}
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
onBeforeMount(() => {
|
||||
bindShelfHole();
|
||||
// getPositionList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: url("@/static/bgp.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
background-attachment: fixed;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.content {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: url("@/static/bgp.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
background-attachment: fixed;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.container-box {
|
||||
height: 100%;
|
||||
width: 98%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.container-box {
|
||||
height: 100%;
|
||||
width: 98%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 60rpx;
|
||||
padding: 40rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.painting-box {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 6px rgba(219, 218, 218, 0.5);
|
||||
}
|
||||
margin-top: 60rpx;
|
||||
padding: 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.button-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
left: 0;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
height: 8%;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
.painting-box {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 6px rgba(219, 218, 218, 0.5);
|
||||
}
|
||||
}
|
||||
.button-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
left: 0;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
height: 8%;
|
||||
}
|
||||
</style>
|
||||
|
@ -27,13 +27,12 @@ const request = new Request({
|
||||
if (response.data.status === 1) {
|
||||
showMessage({ type: "error", message: response.data.msg });
|
||||
}
|
||||
if(response.data.status === 0){
|
||||
uni.setStorageSync("token", response.data.data.Token);
|
||||
uni.setStorageSync("userInfo", response.data.data.AccountInfo);
|
||||
response.config.headers["Authorization"] = response.data.data.Token;
|
||||
}
|
||||
// if(response.data.status === 0){
|
||||
// uni.setStorageSync("token", response.data.data.Token);
|
||||
// uni.setStorageSync("userInfo", response.data.data.AccountInfo);
|
||||
// response.config.headers["Authorization"] = response.data.data.Token;
|
||||
// }
|
||||
if (response.data.code === 401) {
|
||||
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/index",
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user