This commit is contained in:
Aiden 2024-10-21 10:05:57 +08:00
commit c6e741b207
5 changed files with 59 additions and 12 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
/unpackage /unpackage
/node_modules
/.gitignore /.gitignore

View File

@ -4,7 +4,7 @@
*/ */
export default { export default {
config: { config: {
baseUrl: "https://warehouse.szjixun.cn", //"http://172.16.100.93:8017", //"http://192.168.88.175:9021",//测试 'https://warehouse.szjixun.cn' 正式 https://stock.szjixun.cn baseUrl: "https://stock.szjixun.cn", //"http://172.16.100.93:8017", //"http://192.168.88.175:9021",//测试 'https://warehouse.szjixun.cn' 正式 https://stock.szjixun.cn
header: { header: {
"Content-Type": "application/json;charset=UTF-8", "Content-Type": "application/json;charset=UTF-8",
// 'Content-Type':'application/x-www-form-urlencoded' // 'Content-Type':'application/x-www-form-urlencoded'
@ -61,6 +61,10 @@ export default {
} }
} }
if (response.data?.status === 401) { if (response.data?.status === 401) {
uni.showModal({
title:'登录后使用完整功能',
success:(res)=>{
if (res.confirm){
let curPage = getCurrentPages(); let curPage = getCurrentPages();
let route = curPage[curPage.length - 1].route; //获取当前页面的路由 let route = curPage[curPage.length - 1].route; //获取当前页面的路由
if (route !== "pages/login/login") { if (route !== "pages/login/login") {
@ -68,6 +72,11 @@ export default {
url: "/pages/login/login", url: "/pages/login/login",
}); });
} }
}
}
})
} }
// 统一的响应日志记录 // 统一的响应日志记录
_reslog(response); _reslog(response);

View File

@ -552,8 +552,15 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: `/pages/signwebview/index`, url: `/pages/signwebview/index`,
}); });
this.loading=false
}else {
uni.showToast({
title: res.msg,
duration: 2000,
icon: "none",
});
} }
this.loading=false
}, },
async obtainAmount(index,list=false){ async obtainAmount(index,list=false){
let data={ let data={

View File

@ -1,5 +1,6 @@
<template> <template>
<view class="main"> <view class="main">
<view class="ykfw" @click="goRouter">游客访问</view>
<image src="@/static/image/logo.png" mode="scaleToFill" class="logo" /> <image src="@/static/image/logo.png" mode="scaleToFill" class="logo" />
<view class="btn"> <view class="btn">
<u-button v-if="isShow" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" color="transparent" <u-button v-if="isShow" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" color="transparent"
@ -22,6 +23,11 @@ export default {
}; };
}, },
methods: { methods: {
goRouter(){
uni.switchTab({
url: '/pages/home/index'
});
},
async getPhoneNumber(e) { async getPhoneNumber(e) {
if (e.detail.errMsg == "getPhoneNumber:ok") { if (e.detail.errMsg == "getPhoneNumber:ok") {
// //
@ -111,7 +117,14 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
position: relative;
.ykfw{
height: 50rpx;
position:absolute;
top: 20rpx;
right: 40rpx;
color: #fff;
}
.logo { .logo {
margin-top: 250rpx; margin-top: 250rpx;
width: 398rpx; width: 398rpx;

View File

@ -85,6 +85,24 @@ export default {
if (res1.code === 200) { if (res1.code === 200) {
this.info = res1.data this.info = res1.data
} }
},
async getData1() {
const data1 = {
ID: Number(this.$mp.query.ID)
}
const res1 = await postDataByParams('/api/v2/warehouse/detail', data1)
if (res1.code === 200) {
this.info = res1.data
}
},
async getData2() {
const data1 = {
ID: Number(this.$mp.query.ID)
}
const res1 = await postDataByParams('/api/v2/warehouse/detail', data1)
if (res1.code === 200) {
this.info = res1.data
}
} }
} }
}; };