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,
"es6" : true
},
"usingComponents" : true
"usingComponents" : true,
"optimization" : {
"subpackages" : true
}
},
"mp-alipay" : {
"usingComponents" : true

View File

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

View File

@ -93,7 +93,7 @@
<script>
import VNavigationBar from '@/components/VNavigationBar.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";
export default {
components: {

View File

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

View File

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

View File

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