fix
This commit is contained in:
parent
97be883204
commit
a2a27e334f
@ -7,6 +7,7 @@ export const userLogin = (data) => {
|
||||
data,
|
||||
});
|
||||
};
|
||||
//验证码
|
||||
export const userSend = (data) => {
|
||||
return request({
|
||||
url: "/user/send",
|
||||
@ -14,5 +15,21 @@ export const userSend = (data) => {
|
||||
data,
|
||||
});
|
||||
};
|
||||
//扫码查看画桶详情
|
||||
export const pbDetail = (data) => {
|
||||
return request({
|
||||
url: "/containeradm/v1/painting_bucket/get_by_id",
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
};
|
||||
//查询可放画桶的空闲货架孔
|
||||
export const freebox = (data) => {
|
||||
return request({
|
||||
url: "/containeradm/v1/box_rel_bucket/freebox",
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<navBar v-if="!isDetail"> 出库 </navBar>
|
||||
<navBar v-if="isDetail"> 画作详情 </navBar>
|
||||
<navBar v-if="state.boxRelBucketStatus == 1"> 出库 </navBar>
|
||||
<navBar v-if="state.boxRelBucketStatus == 2"> 画作详情 </navBar>
|
||||
<view class="container-box" >
|
||||
<span style="font-weight: bold;text-align: center;" v-if="!isDetail">
|
||||
<span style="font-weight: bold;text-align: center;" v-if="state.boxRelBucketStatus == 1">
|
||||
保存要出库A000-B3的
|
||||
</span>
|
||||
<span style="font-weight: bold;text-align: center;margin-top: 20rpx;" v-if="!isDetail"> PT00000004画筒吗?</span>
|
||||
<span style="font-weight: bold;text-align: center;" v-if="isDetail">画筒号:</span>
|
||||
<span style="font-weight: bold;text-align: center;margin-top: 20rpx;" v-if="isDetail">所在位置:</span>
|
||||
<span style="font-weight: bold;text-align: center;margin-top: 20rpx;" v-if="state.boxRelBucketStatus == 1"> PT00000004画筒吗?</span>
|
||||
<span style="font-weight: bold;text-align: center;" v-if="state.boxRelBucketStatus == 2">画筒号:</span>
|
||||
<span style="font-weight: bold;text-align: center;margin-top: 20rpx;" v-if="state.boxRelBucketStatus == 2">所在位置:</span>
|
||||
<view class="painting-box" >
|
||||
<span>画作名称:</span>
|
||||
<span style="margin-top: 20rpx;">画家:</span>
|
||||
@ -32,7 +32,7 @@
|
||||
color="#BCBCBC"
|
||||
throttleTime="5"
|
||||
:loading="loading"
|
||||
v-if="!isDetail"
|
||||
v-if="state.boxRelBucketStatus == 1"
|
||||
>取消</up-button
|
||||
>
|
||||
<up-button
|
||||
@ -40,7 +40,7 @@
|
||||
color="#EFC54E"
|
||||
throttleTime="5"
|
||||
:loading="loading"
|
||||
v-if="!isDetail"
|
||||
v-if="state.boxRelBucketStatus == 1"
|
||||
>确认</up-button
|
||||
>
|
||||
<up-button
|
||||
@ -49,7 +49,7 @@
|
||||
throttleTime="5"
|
||||
:loading="loading"
|
||||
@click="login"
|
||||
v-if="isDetail"
|
||||
v-if="state.boxRelBucketStatus == 2"
|
||||
>返回继续扫码</up-button
|
||||
>
|
||||
</view>
|
||||
@ -57,8 +57,22 @@
|
||||
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { ref,reactive,onBeforeMount } from "vue";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
const isDetail = ref(false);
|
||||
const state = reactive({
|
||||
id: "",
|
||||
pid: "",
|
||||
containerName:"",
|
||||
boxRelBucketStatus:"",
|
||||
});
|
||||
onLoad((options) =>{
|
||||
state.id = options.id;
|
||||
state.pid = options.pid;
|
||||
state.boxRelBucketStatus = options.boxRelBucketStatus;
|
||||
console.log("qqq",state.boxRelBucketStatus)
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -21,11 +21,17 @@
|
||||
</up-input>
|
||||
</view>
|
||||
<span
|
||||
style="text-align: right; color: #e3af1c;"
|
||||
@click="goToPassword" v-if="isCode&&!haveCode"
|
||||
>密码登录</span>
|
||||
style="text-align: right; color: #e3af1c"
|
||||
@click="goToPassword"
|
||||
v-if="isCode && !haveCode"
|
||||
>密码登录</span
|
||||
>
|
||||
<view class="login-input" v-if="!isCode">
|
||||
<up-input placeholder="请输入密码" :password="true" v-model="state.Password">
|
||||
<up-input
|
||||
placeholder="请输入密码"
|
||||
:password="true"
|
||||
v-model="state.Password"
|
||||
>
|
||||
<template #prefix>
|
||||
<up-text
|
||||
text="密码"
|
||||
@ -40,37 +46,45 @@
|
||||
<view v-if="haveCode">
|
||||
<view class="code-box">
|
||||
<span style="color: #888888">已发送验证码至 </span>
|
||||
<span>123123123</span>
|
||||
<span style="font-weight: bold">{{ state.TelNum }}</span>
|
||||
</view>
|
||||
<up-code-input v-model="code" :maxlength="6"></up-code-input>
|
||||
<view style="display: flex; justify-content: space-between; align-items: center; margin-top: 20rpx;">
|
||||
<view
|
||||
style="
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 20rpx;
|
||||
"
|
||||
>
|
||||
<span style="text-align: left; color: #e3af1c" @click=""
|
||||
>重新发送</span
|
||||
>
|
||||
<span
|
||||
style="text-align: left; color: #e3af1c;"
|
||||
@click=""
|
||||
>重新发送</span>
|
||||
<span
|
||||
style="text-align: right; color: #e3af1c;"
|
||||
@click="goToPassword"
|
||||
>密码登录</span>
|
||||
style="text-align: right; color: #e3af1c"
|
||||
@click.stop="goToPassword"
|
||||
>密码登录</span
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view> </view>
|
||||
<view
|
||||
<text
|
||||
style="text-align: right; color: #e3af1c; margin-top: 20rpx"
|
||||
@click="toCode" v-if="!isCode"
|
||||
>验证码登录</view
|
||||
@click="toCode"
|
||||
v-if="!isCode"
|
||||
>验证码登录</text
|
||||
>
|
||||
<up-button
|
||||
style="width: 626rpx; margin: auto; height: 96rpx;margin-top: 90rpx;"
|
||||
style="width: 626rpx; margin: auto; height: 96rpx; margin-top: 90rpx"
|
||||
color="#EFC54E"
|
||||
throttleTime="5"
|
||||
:loading="loading"
|
||||
@click="logining"
|
||||
v-if="!isCode"
|
||||
v-if="!isCode || haveCode"
|
||||
>登录</up-button
|
||||
>
|
||||
<up-button
|
||||
style="width: 626rpx; margin: auto; height: 96rpx;margin-top: 90rpx;"
|
||||
style="width: 626rpx; margin: auto; height: 96rpx; margin-top: 90rpx"
|
||||
color="#EFC54E"
|
||||
throttleTime="5"
|
||||
:loading="loading"
|
||||
@ -85,18 +99,90 @@
|
||||
<script setup>
|
||||
import { ref, reactive } from "vue";
|
||||
import useToast from "@/hooks/toast/useToast.js";
|
||||
import {
|
||||
userLogin,userSend
|
||||
} from "@/api/login.js";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { userLogin, userSend, pbDetail } from "@/api/login.js";
|
||||
const state = reactive({
|
||||
TelNum:'15190039212',
|
||||
Password:'',
|
||||
|
||||
})
|
||||
TelNum: "15190039212",
|
||||
Password: "Jia011225",
|
||||
id: "",
|
||||
pid: "",
|
||||
});
|
||||
const { showMessage } = useToast();
|
||||
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();
|
||||
}
|
||||
|
||||
/*
|
||||
1.先调用options的对应接口
|
||||
2.判断是是否有没有登录
|
||||
3如果登录了判断状态去相应页面
|
||||
4.没有登录让他登录,然后根据状态判断去相应页面
|
||||
|
||||
**/
|
||||
});
|
||||
const paintingDetail = async () => {
|
||||
loading.value = true;
|
||||
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) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/index?id="+state.id+'&pid='+state.pid,
|
||||
success: () => {
|
||||
loading.value = false;
|
||||
},
|
||||
fail: () => {
|
||||
loading.value = false;
|
||||
showMessage({ type: "default", message: "跳转失败" });
|
||||
},
|
||||
});
|
||||
} else {
|
||||
if (res.data.boxRelBucketStatus == 3) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/painting/index?id="+state.id+'&pid='+state.pid,
|
||||
success: () => {
|
||||
loading.value = false;
|
||||
},
|
||||
fail: () => {
|
||||
loading.value = false;
|
||||
showMessage({ type: "default", message: "跳转失败" });
|
||||
},
|
||||
});
|
||||
}else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/detail/index?id="+state.id+'&pid='+state.pid+'&boxRelBucketStatus='+state.boxRelBucketStatus,
|
||||
success: () => {
|
||||
loading.value = false;
|
||||
},
|
||||
fail: () => {
|
||||
loading.value = false;
|
||||
showMessage({ type: "default", message: "跳转失败" });
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// const show = () => {
|
||||
// showMessage({ type: "default", message: "验证码已发送" });
|
||||
// };
|
||||
@ -104,10 +190,10 @@ const toCode = () => {
|
||||
isCode.value = true;
|
||||
};
|
||||
const obtainCode = async () => {
|
||||
console.log('获取验证码')
|
||||
console.log("获取验证码");
|
||||
loading.value = true;
|
||||
const res = await userSend({
|
||||
TelNum: state.TelNum ?? '',
|
||||
TelNum: state.TelNum ?? "",
|
||||
});
|
||||
if (res.status === 0) {
|
||||
haveCode.value = true;
|
||||
@ -120,26 +206,20 @@ const obtainCode = async () => {
|
||||
const goToPassword = () => {
|
||||
isCode.value = false;
|
||||
haveCode.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 登录方法
|
||||
const logining = async () => {
|
||||
loading.value = true;
|
||||
const res = await userLogin({
|
||||
TelNum:state.TelNum ?? '' ,
|
||||
Password:state.Password ?? '',
|
||||
TelNum: state.TelNum ?? "",
|
||||
Password: state.Password ?? "",
|
||||
});
|
||||
if (res.status === 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/index',
|
||||
success: () => {
|
||||
loading.value = false;
|
||||
},
|
||||
fail: () => {
|
||||
loading.value = false;
|
||||
showMessage({ type: "default", message: "跳转失败" });
|
||||
}
|
||||
});
|
||||
uni.setStorageSync("token", res.data.Token);
|
||||
uni.setStorageSync("userInfo", res.data.AccountInfo);
|
||||
await paintingDetail();
|
||||
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
@ -3,13 +3,13 @@
|
||||
<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;">{{ }}货架</span>
|
||||
<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
|
||||
@ -41,7 +41,38 @@
|
||||
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
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:"",
|
||||
});
|
||||
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 () => {
|
||||
loading.value = true;
|
||||
const res = await freebox( );
|
||||
if (res.status === 0) {
|
||||
state.containerName = res.data.containerName;
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
onBeforeMount(() => {
|
||||
bindShelfHole();
|
||||
// getPositionList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -8,7 +8,6 @@ const request = new Request({
|
||||
interceptors: {
|
||||
//实例的请求拦截器
|
||||
requestInterceptors: (config) => {
|
||||
console.log('config',config)
|
||||
config.headers["Content-Type"] =
|
||||
config.method === "get"
|
||||
? "application/x-www-form-urlencoded"
|
||||
@ -28,11 +27,10 @@ const request = new Request({
|
||||
if (response.data.status === 1) {
|
||||
showMessage({ type: "error", message: response.data.msg });
|
||||
}
|
||||
if(response.data.code === 200){
|
||||
uni.setStorageSync("token", response.data.Token);
|
||||
uni.setStorageSync("userInfo", response.data.AccountInfo);
|
||||
response.config.headers["Authorization"] = response.data.Token;
|
||||
return request.request(response.config);
|
||||
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) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user