拉取代码

This commit is contained in:
2024-08-02 16:44:18 +08:00
3 changed files with 40 additions and 12 deletions

View File

@@ -159,6 +159,11 @@ Page({
this.setData({ rechargeVisible: true })
},
jumpToInvoice() {
const { user, } = this.data;
if (!user || !user.id) {
alertInfo("请先登录")
return
}
wx.navigateTo({
url: '/pages/invoiceList/index',
})
@@ -172,7 +177,6 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.getAllList();
this.watchTenement();
this.watchPark();
@@ -251,6 +255,11 @@ Page({
// }
},
jumpToElectric() {
const { user, } = this.data;
if (!user || !user.id) {
alertInfo("请先登录")
return
}
wx.navigateTo({
url: '/childPackage/pages/electricQuery/index',
})
@@ -308,11 +317,21 @@ Page({
})
},
jumpToRecord() {
const { user, } = this.data;
if (!user || !user.id) {
alertInfo("请先登录")
return
}
wx.navigateTo({
url: '/pages/rechargeRecord/index',
})
},
jumpToOrder() {
const { user, } = this.data;
if (!user || !user.id) {
alertInfo("请先登录")
return
}
// alertInfo("尚未完成")
wx.navigateTo({
url: '/pages/billList/index',

View File

@@ -1,6 +1,7 @@
import { getPrivaciList, login } from "../../service/user";
import { alertError, alertInfo, alertSuccess, loadingFunc, wxLogin } from "../../utils/index";
import request from "../../utils/request";
import { getUserInfo } from "../../service/user"
import Dialog from '@vant/weapp/dialog/dialog';
const { OK } = request;
@@ -20,12 +21,20 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
this.getPrivacy();
const user = wx.getStorageSync('user')
if (!user || !user.id) {
async setUser() {
const result = await getUserInfo();
if (result.code !== OK) {
return;
}
this.setData({ user: result.data })
wx.setStorageSync('user', result.data)
// const user = wx.getStorageSync('user')
// this.setData({ user: user })
},
onLoad() {
this.getPrivacy();
this.setUser();
// if (user.status === 0 || user.status === 2) {
// wx.redirectTo({
// url: '/pages/waitApprove/index',