YY před 3 roky
rodič
revize
86823b82b3
2 změnil soubory, kde provedl 108 přidání a 73 odebrání
  1. 98 71
      pages/me/index.js
  2. 10 2
      pages/me/index.wxml

+ 98 - 71
pages/me/index.js

@@ -24,10 +24,12 @@ Page({
     item1: {},
     //团队列表
     list: [],
-
     //头像
     icon: '',
     showModal: false,
+    jumpList: [
+
+    ],
   },
   // 跳转菜单
   tabPath(e) {
@@ -73,64 +75,63 @@ Page({
       })
     }
   },
-
-  //已上传图片
-  Uploaded: function () {
-    wx.navigateTo({
-      url: `/pages/photo/index`,
-    })
-  },
-  //修改密码
-  change: function () {
-    wx.navigateTo({
-      url: `/pages/password/index`,
-    })
-  },
-  //审核队员
-  examine: function (e) {
-    let id = e.currentTarget.dataset.id;
-    wx.navigateTo({
-      url: `/pages/auditTeam/index?id=` + id,
-    })
-  },
-  //解散团队
-  clickme: function (e) {
-    let id = e.currentTarget.dataset.id;
-    wx.navigateTo({
-      url: `/pages/dissolution/detail?id=` + id,
-    })
-  },
-  //退出登录
-  tui() {
-    wx.showModal({
-      title: '',
-      content: '是否确认退出登录',
-      success(res) {
-        if (res.confirm) {
-          wx.removeStorage({
-            key: 'token',
-            success(res) {
-              return wx.redirectTo({ url: '/pages/index/index', })
-            }
-          })
-        } else if (res.cancel) {
-        }
-      }
-    })
-  },
-  //团队创建人-比赛管理
-  Administration: function (e) {
-    var list = JSON.stringify(this.data.list[0])
-    wx.navigateTo({
-      url: `/pages/meMatch/index?list=${list}`,
-    })
-  },
-  //管理员-比赛管理
-  manage: function (e) {
-    wx.navigateTo({
-      url: `/pages/meMatch/detail`,
-    })
-  },
+  // //已上传图片
+  // Uploaded: function () {
+  //   wx.navigateTo({
+  //     url: `/pages/photo/index`,
+  //   })
+  // },
+  // //修改密码
+  // change: function () {
+  //   wx.navigateTo({
+  //     url: `/pages/password/index`,
+  //   })
+  // },
+  // //审核队员
+  // examine: function (e) {
+  //   let id = e.currentTarget.dataset.id;
+  //   wx.navigateTo({
+  //     url: `/pages/auditTeam/index?id=` + id,
+  //   })
+  // },
+  // //解散团队
+  // clickme: function (e) {
+  //   let id = e.currentTarget.dataset.id;
+  //   wx.navigateTo({
+  //     url: `/pages/dissolution/detail?id=` + id,
+  //   })
+  // },
+  // //退出登录
+  // tui() {
+  //   wx.showModal({
+  //     title: '',
+  //     content: '是否确认退出登录',
+  //     success(res) {
+  //       if (res.confirm) {
+  //         wx.removeStorage({
+  //           key: 'token',
+  //           success(res) {
+  //             return wx.redirectTo({ url: '/pages/index/index', })
+  //           }
+  //         })
+  //       } else if (res.cancel) {
+  //       }
+  //     }
+  //   })
+  // },
+  // //团队创建人-比赛管理
+  // Administration: function (e) {
+  //   var list = JSON.stringify(this.data.list[0])
+  //   wx.navigateTo({
+  //     url: `/pages/meMatch/index?list=${list}`,
+  //   })
+  // },
+  // //管理员-比赛管理
+  // manage: function (e) {
+  //   wx.navigateTo({
+  //     url: `/pages/meMatch/detail`,
+  //   })
+  // },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -155,9 +156,36 @@ Page({
           header: {},
           success: res => {
             that.setData({ item1: res.data.data })
+            let type = res.data.data.type;
             let icon = res.data.data.icon[0];
             if (icon) this.setData({ icon: icon.url })
             else this.setData({ icon: '/image/tou.png' })
+            let list = [
+              { name: '已上传照片', icons: 'icon-shangchuanzhaopian',},
+              { name: '修改密码', icons: 'icon-xiugaimima' },
+              { name: '审核队员', icons: 'icon-shenhe' },
+              { name: '解散团队', icons: 'icon-ren_jiesantuandui_line' },
+              { name: '退出登录', icons: 'icon-tuichudenglu' },
+              { name: '比赛管理', icons: ' icon-bisaiguanli' }
+            ];
+            let list1 = [
+              { name: '已上传照片', icons: 'icon-shangchuanzhaopian' },
+              { name: '修改密码', icons: 'icon-xiugaimima' },
+              { name: '退出登录', icons: ' icon-tuichudenglu' },
+            ];
+            let list2 = [
+              { name: '已上传照片', icons: 'icon-shangchuanzhaopian' },
+              { name: '修改密码', icons: 'icon-xiugaimima' },
+              { name: '退出登录', icons: 'icon-tuichudenglu' },
+              { name: '比赛管理', icons: 'icon-bisaiguanli' }
+            ];
+            if (type == 1) {
+              that.setData({ jumpList: list });
+            } else if (type == 2) {
+              that.setData({ jumpList: list1 })
+            } else if (type == 0) {
+              that.setData({ jumpList: list2 })
+            }
           },
           error: err => {
           }
@@ -191,7 +219,6 @@ Page({
             }
           })
         }
-
       },
       fail: res => {
         wx.redirectTo({ url: '/pages/login/index', })
@@ -199,17 +226,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 })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 10 - 2
pages/me/index.wxml

@@ -128,7 +128,15 @@
     </view>
     <view class="six">
       <view class="six-11"><text class="fui">我的服务</text></view>
-      <view class="six-0" bindtap="Uploaded">
+      <view class="six-0" wx:for="{{jumpList}}" wx:key="item" bindtap="Uploaded">
+        <view class="six-left">
+          <text class="icon iconfont {{item.icons}}"></text>
+        </view>
+        <view class="six-right">
+          <text class="six-text">{{item.name}}</text>
+        </view>
+      </view>
+      <!-- <view class="six-0" bindtap="Uploaded">
         <view class="six-left">
           <text class=" icon iconfont icon-shangchuanzhaopian"></text>
         </view>
@@ -183,7 +191,7 @@
         <view class="six-right">
           <text class="six-text">比赛管理</text>
         </view>
-      </view>
+      </view> -->
     </view>
   </view>
 </mobile-main>