|
@@ -7,19 +7,47 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
- frameStyle: { useTop: true, name: '赛制编排信息', leftArrow: true, useBar: false },
|
|
|
+ frameStyle: { useTop: true, name: '赛制信息', leftArrow: true, useBar: false },
|
|
|
// 主体高度
|
|
|
infoHeight: '',
|
|
|
+ // 比赛信息
|
|
|
+ match_id: '629eb5de78fa03648c0535d9',
|
|
|
+ list: [],
|
|
|
},
|
|
|
back: function () {
|
|
|
wx.navigateBack({ url: '/pages/matchadmin/index' })
|
|
|
},
|
|
|
+ // 添加
|
|
|
+ toAdd: function () {
|
|
|
+ const that = this;
|
|
|
+ wx.navigateTo({ url: `/pages/matchadmin/layout?id=${that.data.match_id}` })
|
|
|
+ },
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
+ const that = this;
|
|
|
+ if (options && options.id) that.setData({ match_id: options.id })
|
|
|
// 计算高度
|
|
|
- this.searchHeight()
|
|
|
+ this.searchHeight();
|
|
|
+ // 监听用户是否登录
|
|
|
+ this.watchLogin();
|
|
|
+ },
|
|
|
+ // 监听用户是否登录
|
|
|
+ watchLogin: function () {
|
|
|
+ const that = this;
|
|
|
+ wx.getStorage({
|
|
|
+ key: 'token',
|
|
|
+ success: async res => {
|
|
|
+ let arr;
|
|
|
+ // 查询赛制信息
|
|
|
+ arr = await app.$get(`/courtAdmin/api/schedule`, { match_id: that.data.match_id });
|
|
|
+ if (arr.errcode == '0') that.setData({ list: arr.data });
|
|
|
+ },
|
|
|
+ fail: res => {
|
|
|
+ return wx.redirectTo({ url: '/pages/login/index', })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 计算高度
|
|
|
searchHeight: function () {
|