接着做首页的充值,,调试接口

This commit is contained in:
2024-03-28 16:49:49 +08:00
parent 4713116996
commit c9abd2cfa0
15 changed files with 125 additions and 35 deletions

View File

@@ -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
});
},
/**
* 生命周期函数--监听页面隐藏
*/

View File

@@ -1,7 +1,9 @@
{
"usingComponents": {
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index"
"van-cell-group": "@vant/weapp/cell-group/index",
"cell": "/components/cell/index",
"van-dialog": "@vant/weapp/dialog/index"
},
"navigationBarTitleText": "我的"
}

View File

@@ -4,9 +4,13 @@
<cell title="常见问题" bind:click="jumpToQuestions" /> -->
<!-- <van-cell-group title=" "> -->
<van-cell title="二维码" value="" is-link bind:click="jumpToQrCode" />
<van-cell title="联系客服" value="" is-link bind:tap="connect" />
<van-cell wx:if="{{!!user.isAdmin}}" title="二维码" value="" is-link bind:click="jumpToQrCode" />
<van-cell wx:if="{{!!user.isAdmin}}" title="成员管理" value="" is-link bind:click="jumpToMember" />
<!-- </van-cell-group> -->
<!-- <van-cell-group title=" ">
<van-cell title="单元格" value="内容" is-link />
</van-cell-group> -->
</van-cell-group> -->
<van-dialog id="van-dialog" />

View File

@@ -1 +1 @@
/* pages/my/index.wxss */
/* pages/my/index.wxss */