YY 3 rokov pred
rodič
commit
ed5e4d93ab
2 zmenil súbory, kde vykonal 33 pridanie a 36 odobranie
  1. 15 16
      pages/teamDetails/detail.js
  2. 18 20
      pages/teamDetails/index.js

+ 15 - 16
pages/teamDetails/detail.js

@@ -42,7 +42,7 @@ Page({
           }
           that.setData({ ['list.members']: members })
           wx.request({
-            url: `${app.globalData.publicUrl}/courtAdmin/api/team/${ids}`, //接口地址
+            url: `${app.globalData.publicUrl}/courtAdmin/api/team/${ids}`,
             method: "post",
             data: list,
             header: {},
@@ -59,20 +59,19 @@ Page({
   onLoad: function (options) {
     // 计算高度
     this.searchHeight()
-    this.ids = options.id;
+    this.setData({ ids: options.id })
     // 监听用户是否登录
     this.watchLogin();
   },
   // 监听用户是否登录
   watchLogin: function () {
     const that = this;
-    let id = that.ids
+    let id = that.data.ids
     wx.getStorage({
       key: 'token',
       success: res => {
-        //查询数据
         wx.request({
-          url: `${app.globalData.publicUrl}/courtAdmin/api/team/` + id, //接口地址
+          url: `${app.globalData.publicUrl}/courtAdmin/api/team/` + id, 
           method: 'get',
           data: '',
           success(res) {
@@ -85,17 +84,17 @@ Page({
       }
     })
   },
- // 计算高度
- 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 })
-},
+  // 计算高度
+  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 })
+  },
 
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 18 - 20
pages/teamDetails/index.js

@@ -27,14 +27,13 @@ Page({
       title: '是否退出团队',
       success(res) {
         if (res.confirm) {
-          //数据请求
           wx.request({
-            url: `${app.globalData.publicUrl}/courtAdmin/api/team/leaves`, //接口地址
-            method: "get",//请求方法
-            data: { user_id: id1, team_id: id },//请求参数
+            url: `${app.globalData.publicUrl}/courtAdmin/api/team/leaves`, 
+            method: "get",
+            data: { user_id: id1, team_id: id },
             header: {},
             success: res => {
-              return wx.redirectTo({ url: '/pages/me/index' })// 跳转页面
+              return wx.redirectTo({ url: '/pages/me/index' })
             },
             error: err => {
             }
@@ -52,7 +51,7 @@ Page({
   onLoad: function (options) {
     // 计算高度
     this.searchHeight()
-    this.ids = options.id;
+    this.setData({ ids: options.id })
     // 监听用户是否登录
     this.watchLogin();
 
@@ -60,13 +59,12 @@ Page({
   // 监听用户是否登录
   watchLogin: function () {
     const that = this;
-    let id = that.ids
+    let id = that.data.ids
     wx.getStorage({
       key: 'token',
       success: res => {
-        //查询数据
         wx.request({
-          url: `${app.globalData.publicUrl}/courtAdmin/api/team/` + id, //接口地址
+          url: `${app.globalData.publicUrl}/courtAdmin/api/team/` + id,
           method: 'get',
           data: '',
           success(res) {
@@ -79,17 +77,17 @@ Page({
       }
     })
   },
- // 计算高度
- 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 })
-},
+  // 计算高度
+  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 })
+  },
 
   /**
    * 生命周期函数--监听页面初次渲染完成