Selaa lähdekoodia

Merge branch 'master' of http://git.cc-lotus.info/ball-court/court-mobile

YY 3 vuotta sitten
vanhempi
commit
ec10880d9f
1 muutettua tiedostoa jossa 21 lisäystä ja 23 poistoa
  1. 21 23
      pages/home/index.js

+ 21 - 23
pages/home/index.js

@@ -12,23 +12,28 @@ Page({
     infoHeight: '',
     teamlist: [],
   },
+  // 跳转菜单
+  tabPath(e) {
+    let query = e.detail.detail;
+    if (query) wx.redirectTo({ url: `/pages/${query}/index` })
+  },
   //跳转详情
   tiao: function (e) {
-    let id = e.currentTarget.dataset.id;
-    wx.navigateTo({
-      url: '/pages/list/index?id=' + id,
-    })
+    console.log(e);
+
+    // let id = e.currentTarget.dataset.id;
+    // wx.navigateTo({
+    //   url: '/pages/list/index?id=' + id,
+    // })
   },
   //跳转循环赛
-  xun: function () {
-    wx.navigateTo({
-      url: '/pages/match/detail',
-    })
-  },
-  tabPath(e) {
-    let query = e.detail.detail;
-    if (query) wx.redirectTo({ url: `/pages/${query}/index` })
+  xun: function (e) {
+    console.log(e);
+    // wx.navigateTo({
+    //   url: '/pages/match/detail',
+    // })
   },
+
   /**
    * 生命周期函数--监听页面加载
    */
@@ -40,26 +45,19 @@ Page({
   },
   // 监听用户是否登录
   watchLogin: function () {
+    const that = this;
     wx.getStorage({
       key: 'token',
       success: res => {
-        var that = this;
         wx.request({
-          url: `${app.globalData.publicUrl}/courtAdmin/api/match`, //接口地址
+          url: `${app.globalData.publicUrl}/courtAdmin/api/match`,
           method: 'get',
           data: {},
           success(res) {
             if (res.data.errcode == 0) {
-              let datas = res.data.data
-              that.setData({
-                teamlist: datas,
-              });
+              that.setData({ teamlist: res.data.data });
             } else {
-              wx.showToast({
-                title: res.data.errmsg,
-                icon: 'none',
-                duration: 2000
-              })
+              wx.showToast({ title: res.data.errmsg, icon: 'none', duration: 2000 })
             }
           }
         })