2025-11-28 16:49:36 +08:00
|
|
|
// pages/index/index.ts
|
|
|
|
|
|
2026-01-14 16:54:47 +08:00
|
|
|
import { menuConfig } from "@/utils/menuConfig";
|
2025-11-28 16:49:36 +08:00
|
|
|
import { Subscribe } from "@/utils/subscribe";
|
2026-01-14 16:54:47 +08:00
|
|
|
import { getDataSet, toObject } from "@/utils/util";
|
2025-11-28 16:49:36 +08:00
|
|
|
|
|
|
|
|
// const app = getApp();
|
|
|
|
|
// const Storage = app.Storage;
|
|
|
|
|
Page({
|
|
|
|
|
/**
|
|
|
|
|
* 页面的初始数据
|
|
|
|
|
*/
|
2026-01-14 16:54:47 +08:00
|
|
|
data: {
|
|
|
|
|
BGColors: [
|
|
|
|
|
"linear-gradient( 135deg, #FDEB71 10%, #F8D800 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #ABDCFF 10%, #0396FF 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #FEB692 10%, #EA5455 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #CE9FFC 10%, #7367F0 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #90F7EC 10%, #32CCBC 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #FFF6B7 10%, #F6416C 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #81FBB8 10%, #28C76F 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #E2B0FF 10%, #9F44D3 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #F97794 10%, #623AA2 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #FCCF31 10%, #F55555 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #F761A1 10%, #8C1BAB 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #43CBFF 10%, #9708CC 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #5EFCE8 10%, #736EFE 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #FAD7A1 10%, #E96D71 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #FFD26F 10%, #3677FF 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #A0FE65 10%, #FA016D 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #FFDB01 10%, #0E197D 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #FEC163 10%, #DE4313 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #92FFC0 10%, #002661 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #EEAD92 10%, #6018DC 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #F6CEEC 10%, #D939CD 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #52E5E7 10%, #130CB7 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #F1CA74 10%, #A64DB6 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #E8D07A 10%, #5312D6 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #EECE13 10%, #B210FF 100%)",
|
|
|
|
|
"linear-gradient( 135deg, #79F1A4 10%, #0E5CAD 100%)",
|
|
|
|
|
],
|
|
|
|
|
params: {
|
|
|
|
|
curr_page: 1,
|
|
|
|
|
page_count: 20,
|
|
|
|
|
},
|
|
|
|
|
total: 100,
|
|
|
|
|
current1: ["checkbox1", "checkbox2"],
|
|
|
|
|
current2: "checkbox1",
|
|
|
|
|
options: [
|
|
|
|
|
{ label: "多选", value: "checkbox1" },
|
|
|
|
|
{ label: "多选", value: "checkbox2" },
|
|
|
|
|
{
|
|
|
|
|
label:
|
|
|
|
|
"多选标题多行多选标题多行多选标题多行多选标题多行多选标题多行多选标题多行",
|
|
|
|
|
value: "checkbox3",
|
|
|
|
|
maxLabelRow: 2,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "多选",
|
|
|
|
|
value: "checkbox4",
|
|
|
|
|
content:
|
|
|
|
|
"描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息",
|
|
|
|
|
maxContentRow: 2,
|
|
|
|
|
},
|
|
|
|
|
{ label: "多选", value: "checkbox11" },
|
|
|
|
|
{ label: "多选", value: "checkbox21" },
|
|
|
|
|
{
|
|
|
|
|
label:
|
|
|
|
|
"多选标题多行多选标题多行多选标题多行多选标题多行多选标题多行多选标题多行",
|
|
|
|
|
value: "checkbox31",
|
|
|
|
|
maxLabelRow: 2,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "多选",
|
|
|
|
|
value: "checkbox41",
|
|
|
|
|
content:
|
|
|
|
|
"描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息",
|
|
|
|
|
maxContentRow: 2,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
authInfo: {} as any,
|
|
|
|
|
menuList: [] as any,
|
|
|
|
|
},
|
2025-11-28 16:49:36 +08:00
|
|
|
|
|
|
|
|
change() {
|
2026-01-14 16:54:47 +08:00
|
|
|
Subscribe.set("isLogin", "hello");
|
2025-11-28 16:49:36 +08:00
|
|
|
// wx.navigateTo({ url: "/pages/my/my" });
|
|
|
|
|
},
|
2026-01-14 16:54:47 +08:00
|
|
|
changePage(e: any) {
|
|
|
|
|
this.data.params.curr_page = e.detail.curr_page;
|
|
|
|
|
this.setData({ params: this.data.params });
|
|
|
|
|
},
|
|
|
|
|
changeSelect(e: any) {
|
|
|
|
|
console.log(e);
|
|
|
|
|
},
|
2025-11-28 16:49:36 +08:00
|
|
|
navToMy() {
|
|
|
|
|
wx.navigateTo({ url: "/pages/my/my" });
|
|
|
|
|
},
|
2026-01-14 16:54:47 +08:00
|
|
|
init() {
|
|
|
|
|
this.data.authInfo = {};
|
|
|
|
|
const companyInfo = toObject(wx.getStorageSync("company_info"));
|
|
|
|
|
this.data.menuList.length = 0;
|
|
|
|
|
menuConfig.forEach((el) => {
|
|
|
|
|
const children: any[] = [];
|
|
|
|
|
el.children.forEach((ell) => {
|
|
|
|
|
// todo 权限判断
|
|
|
|
|
// if (!ell.auth || this.data.authInfo[ell.auth]) {
|
|
|
|
|
children.push(ell);
|
|
|
|
|
// }
|
|
|
|
|
});
|
|
|
|
|
if (children.length) {
|
|
|
|
|
this.data.menuList.push({
|
|
|
|
|
...el,
|
|
|
|
|
children: children,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// this.getIndex();
|
|
|
|
|
this.setData({
|
|
|
|
|
authInfo: this.data.authInfo,
|
|
|
|
|
menuList: this.data.menuList,
|
|
|
|
|
hideTabKeys: companyInfo.staff_type == 3 ? ["2"] : [],
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
nav(e: any) {
|
|
|
|
|
const url = getDataSet(e).url;
|
|
|
|
|
wx.navigateTo({ url });
|
|
|
|
|
},
|
|
|
|
|
|
2025-11-28 16:49:36 +08:00
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
|
*/
|
|
|
|
|
onLoad() {},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
|
*/
|
|
|
|
|
onReady() {},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
|
*/
|
2026-01-14 16:54:47 +08:00
|
|
|
onShow() {
|
|
|
|
|
wx.hideHomeButton();
|
|
|
|
|
this.init();
|
|
|
|
|
},
|
2025-11-28 16:49:36 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
|
*/
|
|
|
|
|
onHide() {},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
|
*/
|
|
|
|
|
onUnload() {},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
|
*/
|
|
|
|
|
onPullDownRefresh() {},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
|
|
*/
|
|
|
|
|
onReachBottom() {},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 用户点击右上角分享
|
|
|
|
|
*/
|
|
|
|
|
onShareAppMessage() {},
|
|
|
|
|
});
|