接着做首页的充值,,调试接口
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { alertInfo } from "../../utils/index";
|
||||
import Dialog from '@vant/weapp/dialog/dialog';
|
||||
// pages/my/index.js
|
||||
Page({
|
||||
|
||||
@@ -5,17 +7,16 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
user: {}
|
||||
user: {},
|
||||
visible: false,
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const user = wx.getStorageSync('user');
|
||||
this.setData({ user })
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
@@ -41,9 +42,27 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
const user = wx.getStorageSync('user');
|
||||
if (!user || !user.id) {
|
||||
wx.switchTab({
|
||||
url: '/pages/home/index',
|
||||
})
|
||||
alertInfo("请先登录");
|
||||
return false;
|
||||
}
|
||||
this.setData({ user })
|
||||
},
|
||||
connect() {
|
||||
Dialog.alert({
|
||||
title: '提示',
|
||||
message: '将进入咨询客服页面',
|
||||
confirmButtonOpenType: "contact",
|
||||
showCancelButton: true,
|
||||
}).then(() => {
|
||||
// on close
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
|
Reference in New Issue
Block a user