123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- import WxValidate from '../../utils/wxValidate'
- const app = getApp()
- Page({
-
- data: {
- frameStyle: { useTop: false, name: '团队详情', leftArrow: true, useBar: false },
- ids: '',
- src: '/image/adimges.jpg',
-
- infoHeight: '',
-
- teamlist: [],
-
- historylist: [],
- },
- back: function () {
- wx.navigateBack({ url: '/pages/home/index' })
- },
-
- onLoad: function (options) {
- this.setData({ ids: options.id });
-
- this.searchHeight()
-
- this.watchLogin();
- },
-
- watchLogin: function () {
- var that = this;
- let id = that.data.ids;
- wx.getStorage({
- key: 'token',
- success: res => {
-
- wx.request({
- url: `${app.globalData.publicUrl}/courtAdmin/api/team/${id}`,
- method: 'get',
- data: '',
- success(res) {
- that.setData({
- teamlist: res.data.data,
- });
- }
- })
-
- this.searchMatch(res.data.data);
- },
- fail: res => {
- return wx.redirectTo({ url: '/pages/login/index', })
- }
- })
- },
-
- searchMatch: async function (e) {
- const that = this;
- let id = that.data.ids;
- let data = [];
- const res = await app.$get('/courtAdmin/api/schedule', { red_id: id, status: '2' });
- if (res.errcode === 0) data = res.data;
- const arr = await app.$get('/courtAdmin/api/schedule', { blue_id: id, status: '2' });
- if (arr.errcode === 0) data = [...data, ...arr.data];
- that.setData({ historylist: data })
- },
-
- searchHeight: function () {
- let frameStyle = this.data.frameStyle;
- let client = app.globalData.client;
- let infoHeight = client.windowHeight;
-
- if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
-
- if (frameStyle.useBar) infoHeight = infoHeight - 50;
- if (infoHeight) this.setData({ infoHeight: infoHeight })
- },
-
- onReady: function () {
- },
-
- onShow: function () {
- },
-
- onHide: function () {
- },
-
- onUnload: function () {
- },
-
- onPullDownRefresh: function () {
- },
-
- onReachBottom: function () {
- },
-
- onShareAppMessage: function () {
- }
- })
|