2024-01-25 13:47:25 +08:00

99 lines
1.7 KiB
JavaScript

import { imageBasUrl } from '../../utils/config';
import { myToPathList, myToHistroy } from "../../utils/constData";
const { httpRequest } = getApp();
Page({
data: {
imageBasUrl,
userInfo: {},
myToPathList: myToPathList,
myToHistroy: myToHistroy,
popupShow: false
},
onLoad(query) {
console.log('page onLoad', query)
},
onShow() {
this.setData({
userInfo: getApp().globalData.userInfo,
systemInfo: getApp().globalData.systemInfo,
})
},
async isGetUserInfo() {
my.showLoading({
content: '刷新中...',
});
const paramenter = {
path: '/user',
method: 'GET',
}
const res = await httpRequest(paramenter);
my.hideLoading({
page: this,
});
if (res.status == 1) {
my.showToast({
type: 'none',
content: '刷新成功',
duration: 2000,
});
this.setData({
userInfo: res.data.info,
})
getApp().globalData.userInfo = res.data.info;
my.setStorageSync({
key: 'userInfo',
data: {
userInfo: res.data.info
}
})
}
},
toPathOtherPage(event) {
console.log(event, "==========")
const item = event.target.dataset.item;
if (item.id == 4) {
my.tb.openMessage({
sellerNick: "湖南秦九",
success: (res) => {
console.log(res);
},
fail: (res) => {
console.log(res);
},
})
} else {
my.navigateTo({
url: item.toPath
});
}
},
goIndex() {
my.switchTab({
url: '/pages/index/index',
})
},
// getPayG() {
// my.hideTabBar({
// animation: true
// })
// this.setData({
// popupShow: true
// })
// },
// onClosePopup() {
// this.setData({
// popupShow: false
// })
// my.showTabBar({
// animation: true
// })
// }
})