bug修改

This commit is contained in:
Vinjor 2024-09-28 11:22:55 +08:00
parent 65e5c884fa
commit 17c53afdb4
7 changed files with 47 additions and 16 deletions

View File

@ -55,7 +55,10 @@
"urlCheck" : false, "urlCheck" : false,
"es6" : true "es6" : true
}, },
"usingComponents" : true "usingComponents" : true,
"optimization" : {
"subpackages" : true
}
}, },
"mp-alipay" : { "mp-alipay" : {
"usingComponents" : true "usingComponents" : true

View File

@ -35,7 +35,7 @@
import VNavigationBar from '@/components/VNavigationBar.vue' import VNavigationBar from '@/components/VNavigationBar.vue'
import request from "@/utils/request"; import request from "@/utils/request";
import {getUserInfoRequest} from "@/utils/common.js"; import {getUserInfoRequest} from "@/utils/common.js";
import {getToken,setUserInfo} from '@/utils/auth.js' import {getToken,setUserInfo,getUserInfo} from '@/utils/auth.js'
export default { export default {
components: { components: {
VNavigationBar, VNavigationBar,
@ -76,13 +76,25 @@ export default {
}) })
}else{ }else{
console.log("已登录") console.log("已登录")
this.getUserInfos() if(!getUserInfo()){
console.log("没有用户信息")
this.getUserInfos()
}else{
this.customInfo = JSON.parse(getUserInfo())
this.getActive()
}
} }
}, },
onLoad(data) { onLoad(data) {
this.getActive()
}, },
methods: { methods: {
preventKeyboard(e) {
//
e.preventDefault();
//
e.target.blur();
},
isNumber(value) { isNumber(value) {
return /^\d+(\.\d+)?$/.test(value); return /^\d+(\.\d+)?$/.test(value);
}, },
@ -108,12 +120,27 @@ export default {
}, },
// //
async getUserInfos() { async getUserInfos() {
await getUserInfoRequest() request({
await this.getActive() url: "/userClient/customer/getUserCustomer",
method: 'get',
params:{}
}).then(res=>{
if(!res.data){
uni.reLaunch({
url: '/pages/my/register'
})
}else{
setUserInfo(JSON.stringify(res.data))
this.customInfo = res.data
this.getActive()
}
})
}, },
// //
async getActive() { async getActive() {
this.customInfo = JSON.parse(uni.getStorageSync('customerInfo')) this.activeList=[]
this.couponList=[]
this.array=[]
const data = { const data = {
cusId: this.customInfo.id cusId: this.customInfo.id
} }
@ -265,9 +292,7 @@ export default {
flex: 1; flex: 1;
height: 0; height: 0;
box-sizing: border-box; box-sizing: border-box;
padding: 30rpx 0; padding: 30rpx 32rpx;
margin: 0 32rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
row-gap: 20rpx; row-gap: 20rpx;

View File

@ -93,7 +93,7 @@
<script> <script>
import VNavigationBar from '@/components/VNavigationBar.vue' import VNavigationBar from '@/components/VNavigationBar.vue'
import reservationOrder from '@/components/reservationOrder/reservationOrder.vue' import reservationOrder from '@/components/reservationOrder/reservationOrder.vue'
import TicketsItem from "@/components/ticketsItem/ticketsItem.vue"; import TicketsItem from "@/pages-order/ticketsItem/ticketsItem.vue";
import request from "../../utils/request"; import request from "../../utils/request";
export default { export default {
components: { components: {

View File

@ -66,8 +66,7 @@
import tabBarVue from '@/components/tabBar/tabBar.vue' import tabBarVue from '@/components/tabBar/tabBar.vue'
import request from "@/utils/request"; import request from "@/utils/request";
import {getUserInfoRequest} from "@/utils/common.js"; import {getUserInfoRequest} from "@/utils/common.js";
import {getToken,setUserInfo} from '@/utils/auth.js' import {getToken,setUserInfo,getUserInfo} from '@/utils/auth.js'
import {getUserInfo} from "../../utils/auth";
export default { export default {
components: { components: {
tabBarVue, tabBarVue,
@ -80,7 +79,11 @@
}) })
}else{ }else{
console.log("已登录") console.log("已登录")
this.getServer() if(!getUserInfo()){
this.getServer()
}else{
this.customInfo = JSON.parse(getUserInfo())
}
} }
}, },
data() { data() {

View File

@ -103,7 +103,7 @@
import VNavigationBar from '@/components/VNavigationBar.vue' import VNavigationBar from '@/components/VNavigationBar.vue'
import config from "@/config"; import config from "@/config";
import {getUserInfoRequest} from "@/utils/common.js"; import {getUserInfoRequest} from "@/utils/common.js";
import {getToken,setUserInfo} from '@/utils/auth.js' import {getToken,getUserInfo} from '@/utils/auth.js'
export default { export default {
components: { components: {

View File

@ -123,7 +123,7 @@
}, },
focus: { focus: {
type: Boolean, type: Boolean,
default: true, default: false,
} }
}, },
data() { data() {