|
@@ -2,12 +2,17 @@
|
|
|
const app = getApp();
|
|
|
const util = require('../../utils/util.js');
|
|
|
Page({
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 页面的初始数据
|
|
|
+ */
|
|
|
data: {
|
|
|
imgPath: app.globalData.imgPath,
|
|
|
path: app.globalData.path,
|
|
|
username: app.globalData.userInfo.usernameShow,
|
|
|
role_name: app.globalData.roleInfo.name,
|
|
|
- app_bottom: '大城细管·大城众管·大城智管'
|
|
|
+ app_bottom: '大城细管·大城众管·大城智管',
|
|
|
+ nextMeeting: null
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -15,24 +20,71 @@ Page({
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
let that = this;
|
|
|
- that.setData({
|
|
|
- username: app.globalData.userInfo.usernameShow,
|
|
|
- role_name: app.globalData.roleInfo.name
|
|
|
- });
|
|
|
+ if (!app.globalData.userInfo.usernameShow || !app.globalData.userInfo.nickName || !app.globalData.userInfo.headImgUrl) {
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '轻应用需要取您的用户信息',
|
|
|
+ showCancel: false,
|
|
|
+ confirmText: '确定',
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ wx.getUserProfile({
|
|
|
+ desc: '提升用户体验感',
|
|
|
+ success: (res) => {
|
|
|
+ app.globalData.userInfo.usernameShow = res.userInfo.nickName;
|
|
|
+ app.globalData.userInfo.nickName = res.userInfo.nickName;
|
|
|
+ app.globalData.userInfo.headImgUrl = res.userInfo.avatarUrl;
|
|
|
+ that.setData({
|
|
|
+ username: app.globalData.userInfo.usernameShow,
|
|
|
+ role_name: app.globalData.roleInfo.name
|
|
|
+ });
|
|
|
+ util.post({
|
|
|
+ url: '/sys/user/updateNoAuth',
|
|
|
+ data: {
|
|
|
+ id: app.globalData.userInfo.id,
|
|
|
+ nickName: res.userInfo.nickName,
|
|
|
+ usernameShow: res.userInfo.nickName,
|
|
|
+ headImgUrl: res.userInfo.avatarUrl
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail: (res) => {
|
|
|
+ util.toast('拒绝授权将影响您的体验感');
|
|
|
+ that.setData({
|
|
|
+ username: '未知用户',
|
|
|
+ role_name: app.globalData.roleInfo.name
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.setData({
|
|
|
+ username: app.globalData.userInfo.usernameShow,
|
|
|
+ role_name: app.globalData.roleInfo.name
|
|
|
+ });
|
|
|
+ }
|
|
|
// 下一场会议
|
|
|
util.get({
|
|
|
url: '/api/meeting/info/getNextMeeting',
|
|
|
success: (res) => {
|
|
|
wx.hideLoading();
|
|
|
+ console.info(res)
|
|
|
if (res.data.code != 200) {
|
|
|
util.toast(res.data.msg);
|
|
|
} else {
|
|
|
let datas = res.data.data;
|
|
|
- that.setData({
|
|
|
- nextTitle: datas.title,
|
|
|
- nextTime: util.formatDate(datas.receptionTime),
|
|
|
- nextUnit: datas.receptionObject
|
|
|
- });
|
|
|
+ if (datas && datas.length > 0) {
|
|
|
+ that.setData({
|
|
|
+ nextMeeting: datas,
|
|
|
+ nextTitle: datas.title,
|
|
|
+ nextTime: util.formatDate(datas.receptionTime),
|
|
|
+ nextUnit: datas.receptionObject
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ util.toast('暂无下一场会议');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -88,6 +140,36 @@ Page({
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
+ * 点击查看下一场会议详情
|
|
|
+ */
|
|
|
+ meetingInfo: function () {
|
|
|
+ let nextMeeting = this.data.nextMeeting;
|
|
|
+ if (nextMeeting) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../meeting-cover/meeting-cover?item=' + JSON.stringify(nextMeeting),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ util.toast('暂无下一场会议');
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 日常巡检
|
|
|
+ */
|
|
|
+ dailyInspection: function () {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 会议巡检
|
|
|
+ */
|
|
|
+ meetingInspection: function () {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../meeting-list/meeting-list?type=INSPECTION',
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
* 点击参观议程跳转至会议列表
|
|
|
*/
|
|
|
visitAgenda: function () {
|
|
@@ -124,15 +206,6 @@ Page({
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
- * 会议巡检
|
|
|
- */
|
|
|
- meetingInspection: function () {
|
|
|
- wx.navigateTo({
|
|
|
- url: '../meeting-inspection/meeting-inspection',
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
changeRole: function () {
|
|
|
wx.redirectTo({
|
|
|
url: '../index-admin/index-admin',
|