编辑我的页面跳转,完成积分和优惠券页面的创建(内容还没写多少)

This commit is contained in:
2024-12-04 17:30:02 +08:00
parent f6d44a6d33
commit 34c2cb76e7
30 changed files with 566 additions and 12 deletions

View File

@@ -4,8 +4,10 @@ import Dialog from '@vant/weapp/dialog/dialog';
import { getUserInfo, logout } from "../../service/user";
import { getDot } from "../../utils/system";
import request from "../../utils/request"
import { getCurrentIntegral } from "../../service/system";
const { OK } = request;
Page({
/**
@@ -15,6 +17,7 @@ Page({
user: {},
tenement: {},
visible: false,
integral: 0,
},
/**
@@ -63,9 +66,20 @@ Page({
}
this.init()
this.getUnReadNumber()
// this.getIntegral()
const tenement = wx.getStorageSync('tenement')
this.setData({ tenement })
},
async getIntegral() {
const { code, message, data } = await getCurrentIntegral();
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({
integral: data?.balance || 0
})
},
async init() {
const tenement = wx.getStorageSync('tenement')
const result = await getUserInfo(tenement?.id);
@@ -86,6 +100,16 @@ Page({
url: '/pages/workBench/index',
})
},
jumpToIntegral() {
wx.navigateTo({
url: '/pages/integral/index',
})
},
jumpToDiscountCoupon() {
wx.navigateTo({
url: '/pages/discountCoupon/index',
})
},
async getUnReadNumber() {
const dot = await getDot();
this.setData({