fix
This commit is contained in:
parent
97be883204
commit
a2a27e334f
@ -7,6 +7,7 @@ export const userLogin = (data) => {
|
|||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
//验证码
|
||||||
export const userSend = (data) => {
|
export const userSend = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: "/user/send",
|
url: "/user/send",
|
||||||
@ -14,5 +15,21 @@ export const userSend = (data) => {
|
|||||||
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>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<navBar v-if="!isDetail"> 出库 </navBar>
|
<navBar v-if="state.boxRelBucketStatus == 1"> 出库 </navBar>
|
||||||
<navBar v-if="isDetail"> 画作详情 </navBar>
|
<navBar v-if="state.boxRelBucketStatus == 2"> 画作详情 </navBar>
|
||||||
<view class="container-box" >
|
<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的
|
保存要出库A000-B3的
|
||||||
</span>
|
</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;margin-top: 20rpx;" v-if="state.boxRelBucketStatus == 1"> PT00000004画筒吗?</span>
|
||||||
<span style="font-weight: bold;text-align: center;" v-if="isDetail">画筒号:</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="isDetail">所在位置:</span>
|
<span style="font-weight: bold;text-align: center;margin-top: 20rpx;" v-if="state.boxRelBucketStatus == 2">所在位置:</span>
|
||||||
<view class="painting-box" >
|
<view class="painting-box" >
|
||||||
<span>画作名称:</span>
|
<span>画作名称:</span>
|
||||||
<span style="margin-top: 20rpx;">画家:</span>
|
<span style="margin-top: 20rpx;">画家:</span>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
color="#BCBCBC"
|
color="#BCBCBC"
|
||||||
throttleTime="5"
|
throttleTime="5"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
v-if="!isDetail"
|
v-if="state.boxRelBucketStatus == 1"
|
||||||
>取消</up-button
|
>取消</up-button
|
||||||
>
|
>
|
||||||
<up-button
|
<up-button
|
||||||
@ -40,7 +40,7 @@
|
|||||||
color="#EFC54E"
|
color="#EFC54E"
|
||||||
throttleTime="5"
|
throttleTime="5"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
v-if="!isDetail"
|
v-if="state.boxRelBucketStatus == 1"
|
||||||
>确认</up-button
|
>确认</up-button
|
||||||
>
|
>
|
||||||
<up-button
|
<up-button
|
||||||
@ -49,7 +49,7 @@
|
|||||||
throttleTime="5"
|
throttleTime="5"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@click="login"
|
@click="login"
|
||||||
v-if="isDetail"
|
v-if="state.boxRelBucketStatus == 2"
|
||||||
>返回继续扫码</up-button
|
>返回继续扫码</up-button
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
@ -57,8 +57,22 @@
|
|||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import { ref,reactive,onBeforeMount } from "vue";
|
||||||
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
const isDetail = ref(false);
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<span style="color: #efc54e">仓库管理</span>
|
<span style="color: #efc54e">仓库管理</span>
|
||||||
</view>
|
</view>
|
||||||
<view>使用你的手机号登录</view>
|
<view>使用你的手机号登录</view>
|
||||||
<view class="login" >
|
<view class="login">
|
||||||
<view class="login-input" v-if="!haveCode">
|
<view class="login-input" v-if="!haveCode">
|
||||||
<up-input placeholder="请输入手机号" v-model="state.TelNum" clearable>
|
<up-input placeholder="请输入手机号" v-model="state.TelNum" clearable>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
@ -21,11 +21,17 @@
|
|||||||
</up-input>
|
</up-input>
|
||||||
</view>
|
</view>
|
||||||
<span
|
<span
|
||||||
style="text-align: right; color: #e3af1c;"
|
style="text-align: right; color: #e3af1c"
|
||||||
@click="goToPassword" v-if="isCode&&!haveCode"
|
@click="goToPassword"
|
||||||
>密码登录</span>
|
v-if="isCode && !haveCode"
|
||||||
|
>密码登录</span
|
||||||
|
>
|
||||||
<view class="login-input" v-if="!isCode">
|
<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>
|
<template #prefix>
|
||||||
<up-text
|
<up-text
|
||||||
text="密码"
|
text="密码"
|
||||||
@ -40,42 +46,50 @@
|
|||||||
<view v-if="haveCode">
|
<view v-if="haveCode">
|
||||||
<view class="code-box">
|
<view class="code-box">
|
||||||
<span style="color: #888888">已发送验证码至 </span>
|
<span style="color: #888888">已发送验证码至 </span>
|
||||||
<span>123123123</span>
|
<span style="font-weight: bold">{{ state.TelNum }}</span>
|
||||||
</view>
|
</view>
|
||||||
<up-code-input v-model="code" :maxlength="6"></up-code-input>
|
<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
|
<span
|
||||||
style="text-align: left; color: #e3af1c;"
|
style="text-align: right; color: #e3af1c"
|
||||||
@click=""
|
@click.stop="goToPassword"
|
||||||
>重新发送</span>
|
>密码登录</span
|
||||||
<span
|
>
|
||||||
style="text-align: right; color: #e3af1c;"
|
|
||||||
@click="goToPassword"
|
|
||||||
>密码登录</span>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view> </view>
|
<view> </view>
|
||||||
<view
|
<text
|
||||||
style="text-align: right; color: #e3af1c; margin-top: 20rpx"
|
style="text-align: right; color: #e3af1c; margin-top: 20rpx"
|
||||||
@click="toCode" v-if="!isCode"
|
@click="toCode"
|
||||||
>验证码登录</view
|
v-if="!isCode"
|
||||||
|
>验证码登录</text
|
||||||
>
|
>
|
||||||
<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"
|
color="#EFC54E"
|
||||||
throttleTime="5"
|
throttleTime="5"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@click="logining"
|
@click="logining"
|
||||||
v-if="!isCode"
|
v-if="!isCode || haveCode"
|
||||||
>登录</up-button
|
>登录</up-button
|
||||||
>
|
>
|
||||||
<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"
|
color="#EFC54E"
|
||||||
throttleTime="5"
|
throttleTime="5"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@click="obtainCode"
|
@click="obtainCode"
|
||||||
v-if="isCode&&!haveCode"
|
v-if="isCode && !haveCode"
|
||||||
>获取验证码</up-button
|
>获取验证码</up-button
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
@ -83,20 +97,92 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref,reactive } from "vue";
|
import { ref, reactive } from "vue";
|
||||||
import useToast from "@/hooks/toast/useToast.js";
|
import useToast from "@/hooks/toast/useToast.js";
|
||||||
import {
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
userLogin,userSend
|
import { userLogin, userSend, pbDetail } from "@/api/login.js";
|
||||||
} from "@/api/login.js";
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
TelNum:'15190039212',
|
TelNum: "15190039212",
|
||||||
Password:'',
|
Password: "Jia011225",
|
||||||
|
id: "",
|
||||||
})
|
pid: "",
|
||||||
|
});
|
||||||
const { showMessage } = useToast();
|
const { showMessage } = useToast();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const isCode = ref(false);
|
const isCode = ref(false);
|
||||||
const haveCode = 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 = () => {
|
// const show = () => {
|
||||||
// showMessage({ type: "default", message: "验证码已发送" });
|
// showMessage({ type: "default", message: "验证码已发送" });
|
||||||
// };
|
// };
|
||||||
@ -104,44 +190,38 @@ const toCode = () => {
|
|||||||
isCode.value = true;
|
isCode.value = true;
|
||||||
};
|
};
|
||||||
const obtainCode = async () => {
|
const obtainCode = async () => {
|
||||||
console.log('获取验证码')
|
console.log("获取验证码");
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await userSend({
|
const res = await userSend({
|
||||||
TelNum: state.TelNum ?? '',
|
TelNum: state.TelNum ?? "",
|
||||||
});
|
});
|
||||||
if (res.status === 0) {
|
if (res.status === 0) {
|
||||||
haveCode.value = true;
|
haveCode.value = true;
|
||||||
showMessage({ type: "default", message: "验证码已发送" });
|
showMessage({ type: "default", message: "验证码已发送" });
|
||||||
} else {
|
} else {
|
||||||
showMessage({ type: "error", message: res.msg });
|
showMessage({ type: "error", message: res.msg });
|
||||||
}
|
}
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
const goToPassword = () =>{
|
const goToPassword = () => {
|
||||||
isCode.value=false;
|
isCode.value = false;
|
||||||
haveCode.value = false;
|
haveCode.value = false;
|
||||||
}
|
};
|
||||||
|
|
||||||
// 登录方法
|
// 登录方法
|
||||||
const logining = async () => {
|
const logining = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await userLogin({
|
const res = await userLogin({
|
||||||
TelNum:state.TelNum ?? '' ,
|
TelNum: state.TelNum ?? "",
|
||||||
Password:state.Password ?? '',
|
Password: state.Password ?? "",
|
||||||
});
|
});
|
||||||
if(res.status === 0){
|
if (res.status === 0) {
|
||||||
uni.navigateTo({
|
uni.setStorageSync("token", res.data.Token);
|
||||||
url: '/pages/index/index',
|
uni.setStorageSync("userInfo", res.data.AccountInfo);
|
||||||
success: () => {
|
await paintingDetail();
|
||||||
loading.value = false;
|
|
||||||
},
|
loading.value = false;
|
||||||
fail: () => {
|
}
|
||||||
loading.value = false;
|
|
||||||
showMessage({ type: "default", message: "跳转失败" });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
<navBar> 入库 </navBar>
|
<navBar> 入库 </navBar>
|
||||||
<view class="container-box">
|
<view class="container-box">
|
||||||
<span style="font-weight: bold">
|
<span style="font-weight: bold">
|
||||||
已扫画筒号:{{ }}
|
已扫画筒号:{{state.pid }}
|
||||||
</span>
|
</span>
|
||||||
<span style="margin-top: 40rpx;">
|
<span style="margin-top: 40rpx;">
|
||||||
请放入:
|
请放入:
|
||||||
</span>
|
</span>
|
||||||
<view class="painting-box" >
|
<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>
|
<up-line style="margin-top: 20rpx;"></up-line>
|
||||||
<span style="color: #CF3050;font-size: 24px;text-align: center;margin-top: 20rpx;">
|
<span style="color: #CF3050;font-size: 24px;text-align: center;margin-top: 20rpx;">
|
||||||
A1
|
A1
|
||||||
@ -41,7 +41,38 @@
|
|||||||
|
|
||||||
|
|
||||||
<script setup>
|
<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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -8,7 +8,6 @@ const request = new Request({
|
|||||||
interceptors: {
|
interceptors: {
|
||||||
//实例的请求拦截器
|
//实例的请求拦截器
|
||||||
requestInterceptors: (config) => {
|
requestInterceptors: (config) => {
|
||||||
console.log('config',config)
|
|
||||||
config.headers["Content-Type"] =
|
config.headers["Content-Type"] =
|
||||||
config.method === "get"
|
config.method === "get"
|
||||||
? "application/x-www-form-urlencoded"
|
? "application/x-www-form-urlencoded"
|
||||||
@ -28,11 +27,10 @@ const request = new Request({
|
|||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
showMessage({ type: "error", message: response.data.msg });
|
showMessage({ type: "error", message: response.data.msg });
|
||||||
}
|
}
|
||||||
if(response.data.code === 200){
|
if(response.data.status === 0){
|
||||||
uni.setStorageSync("token", response.data.Token);
|
uni.setStorageSync("token", response.data.data.Token);
|
||||||
uni.setStorageSync("userInfo", response.data.AccountInfo);
|
uni.setStorageSync("userInfo", response.data.data.AccountInfo);
|
||||||
response.config.headers["Authorization"] = response.data.Token;
|
response.config.headers["Authorization"] = response.data.data.Token;
|
||||||
return request.request(response.config);
|
|
||||||
}
|
}
|
||||||
if (response.data.code === 401) {
|
if (response.data.code === 401) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user