Commit 957ab368 by 姜雷

Merge branch 'develop' into test

parents 996fe370 eaabc2d1
import { IMyApp } from '../../app';
import { systemFetch } from '../../api/fetch';
type Menu = {
pagePath: string;
......@@ -27,6 +28,7 @@ const tabList: Menu[] = [
Page({
onLoad() {
this.fetchTemplate();
let userRoles = app.globalData.userRoles;
let list = userRoles
.map(item => tabList.find(menu => menu.code === item.menuCode))
......@@ -47,6 +49,18 @@ Page({
data: {
selected: '',
list: [],
tmplIds: [],
},
fetchTemplate() {
systemFetch({
url: '/boss/login/init/data',
method: 'GET',
}).then(res => {
console.log(res);
this.setData!({
tmplIds: res.templates,
});
});
},
clickHandle(e) {
console.log('in click', e);
......@@ -56,5 +70,17 @@ Page({
this.setData!({
selected: index,
});
wx.requestSubscribeMessage({
tmplIds: this.data.tmplIds.map(item => item.templateId),
success(res) {
console.log('in success', res);
},
fail(res) {
console.log('in fail', res);
},
complete(res) {
console.log('in complete', res);
},
});
},
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment