Commit 957ab368 by 姜雷

Merge branch 'develop' into test

parents 996fe370 eaabc2d1
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var fetch_1 = require("../../api/fetch");
var app = getApp(); var app = getApp();
var tabList = [ var tabList = [
{ {
...@@ -19,6 +20,7 @@ var tabList = [ ...@@ -19,6 +20,7 @@ var tabList = [
]; ];
Page({ Page({
onLoad: function () { onLoad: function () {
this.fetchTemplate();
var userRoles = app.globalData.userRoles; var userRoles = app.globalData.userRoles;
var list = userRoles var list = userRoles
.map(function (item) { return tabList.find(function (menu) { return menu.code === item.menuCode; }); }) .map(function (item) { return tabList.find(function (menu) { return menu.code === item.menuCode; }); })
...@@ -38,6 +40,19 @@ Page({ ...@@ -38,6 +40,19 @@ Page({
data: { data: {
selected: '', selected: '',
list: [], list: [],
tmplIds: [],
},
fetchTemplate: function () {
var _this = this;
fetch_1.systemFetch({
url: '/boss/login/init/data',
method: 'GET',
}).then(function (res) {
console.log(res);
_this.setData({
tmplIds: res.templates,
});
});
}, },
clickHandle: function (e) { clickHandle: function (e) {
console.log('in click', e); console.log('in click', e);
...@@ -45,6 +60,18 @@ Page({ ...@@ -45,6 +60,18 @@ Page({
this.setData({ this.setData({
selected: index, selected: index,
}); });
wx.requestSubscribeMessage({
tmplIds: this.data.tmplIds.map(function (item) { return item.templateId; }),
success: function (res) {
console.log('in success', res);
},
fail: function (res) {
console.log('in fail', res);
},
complete: function (res) {
console.log('in complete', res);
},
});
}, },
}); });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9tZUFuZFJlcG9ydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImhvbWVBbmRSZXBvcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFTQSxJQUFNLEdBQUcsR0FBRyxNQUFNLEVBQVUsQ0FBQztBQUM3QixJQUFNLE9BQU8sR0FBV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2Q6ICdHRVQnLFxuICAgIH0pLnRoZW4ocmVzID0+IHtcbiAgICAgIGNvbnNvbGUubG9nKHJlcyk7XG4gICAgICB0aGlzLnNldERhdGEhKHtcbiAgICAgICAgdG1wbElkczogcmVzLnRlbXBsYXRlcyxcbiAgICAgIH0pO1xuICAgIH0pO1xuICB9LFxuICBjbGlja0hhbmRsZShlKSB7XG4gICAgY29uc29sZS5sb2coJ2luIGNsaWNrJywgZSk7XG4gICAgbGV0IHsgcGF0aCwgaW5kZXggfSA9IGUuZGV0YWlsO1xuICAgIC8vIGNvbnNvbGUubG9nKHBhdGgsIGluZGV4KTtcbiAgICAvLyB3eC5zd2l0Y2hUYWIoeyB1cmw6IHBhdGggfSk7XG4gICAgdGhpcy5zZXREYXRhISh7XG4gICAgICBzZWxlY3RlZDogaW5kZXgsXG4gICAgfSk7XG4gICAgd3gucmVxdWVzdFN1YnNjcmliZU1lc3NhZ2Uoe1xuICAgICAgdG1wbElkczogdGhpcy5kYXRhLnRtcGxJZHMubWFwKGl0ZW0gPT4gaXRlbS50ZW1wbGF0ZUlkKSxcbiAgICAgIHN1Y2Nlc3MocmVzKSB7XG4gICAgICAgIGNvbnNvbGUubG9nKCdpbiBzdWNjZXNzJywgcmVzKTtcbiAgICAgIH0sXG4gICAgICBmYWlsKHJlcykge1xuICAgICAgICBjb25zb2xlLmxvZygnaW4gZmFpbCcsIHJlcyk7XG4gICAgICB9LFxuICAgICAgY29tcGxldGUocmVzKSB7XG4gICAgICAgIGNvbnNvbGUubG9nKCdpbiBjb21wbGV0ZScsIHJlcyk7XG4gICAgICB9LFxuICAgIH0pO1xuICB9LFxufSk7XG4iXX0=
\ No newline at end of file \ No newline at end of file
import { IMyApp } from '../../app'; import { IMyApp } from '../../app';
import { systemFetch } from '../../api/fetch';
type Menu = { type Menu = {
pagePath: string; pagePath: string;
...@@ -27,6 +28,7 @@ const tabList: Menu[] = [ ...@@ -27,6 +28,7 @@ const tabList: Menu[] = [
Page({ Page({
onLoad() { onLoad() {
this.fetchTemplate();
let userRoles = app.globalData.userRoles; let userRoles = app.globalData.userRoles;
let list = userRoles let list = userRoles
.map(item => tabList.find(menu => menu.code === item.menuCode)) .map(item => tabList.find(menu => menu.code === item.menuCode))
...@@ -47,6 +49,18 @@ Page({ ...@@ -47,6 +49,18 @@ Page({
data: { data: {
selected: '', selected: '',
list: [], list: [],
tmplIds: [],
},
fetchTemplate() {
systemFetch({
url: '/boss/login/init/data',
method: 'GET',
}).then(res => {
console.log(res);
this.setData!({
tmplIds: res.templates,
});
});
}, },
clickHandle(e) { clickHandle(e) {
console.log('in click', e); console.log('in click', e);
...@@ -56,5 +70,17 @@ Page({ ...@@ -56,5 +70,17 @@ Page({
this.setData!({ this.setData!({
selected: index, 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