Browse Source

修改BUG

xjc 2 years ago
parent
commit
229a93e8d6

+ 9 - 8
pages/homepage/homepage.js

@@ -17,6 +17,7 @@ Page({
     index:0,
     id:'',
     user_id:'',
+    auth_user_id:'',
     ec: {
       onInit: null
     },
@@ -42,18 +43,18 @@ Page({
           title: '我的主页',
         })
     }
-    // $api.getAuthinfo().then(res=>{
-    //   this.setData({
-    //     user_id:res.data.data.id
-    //   })
-    // })
+    $api.getAuthinfo().then(res=>{
+      this.setData({
+        auth_user_id:res.data.data.id
+      })
+    })
+    let _this = this;
     $api.getMatchList().then(res=>{
       let l = res.data.data.length - 1;
-      
       this.setData({
         match:res.data.data,
-        index: l,
-        id: res.data.data[l].id
+        index: 4,
+        // id: res.data.data[l].id
       })
       this.getData();
     })

+ 3 - 3
pages/homepage/homepage.wxml

@@ -8,9 +8,9 @@
           <navigator url="../follow/follow?id={{user_id}}&type=1" style="display: inline-block;"><text style="margin-left: 20rpx;">{{followers}}</text>关注</navigator>
       </view>
     </view>
-    <block wx:if='{{user_id!=datas.today_record.user_id}}'>
-    <view class="follow" style="width:140rpx;" wx:if='{{is_follow}}' data-action='cancel' bindtap="followPlayer">取消关注</view>
-    <view class="follow" wx:else  bindtap="followPlayer">+ 关注</view>
+    <block wx:if='{{auth_user_id!=datas.today_record.user_id}}'>
+      <view class="follow" style="width:140rpx;" wx:if='{{is_follow}}' data-action='cancel' bindtap="followPlayer">取消关注</view>
+      <view class="follow" wx:else  bindtap="followPlayer">+ 关注</view>
     </block>
     <navigator class="follow" url="../style/style" wx:else>编辑</navigator>
 </view>

+ 1 - 1
pages/rank/rank.wxml

@@ -38,7 +38,7 @@
                    <image style="width:24rpx;" mode="widthFix" src="../../images/icon_down@2x.png"></image>
                 </view>
     </picker>
-    <navigator hover-class="none" class="search" url="../search/search"><image  mode="heightFix" src="../../images/ss2.png"></image></navigator>
+    <navigator hover-class="none" class="search" url="../search/search?match_id={{match[index].id}}"><image  mode="heightFix" src="../../images/ss2.png"></image></navigator>
 </view>
 <view class="top">
     <text>排名</text><text style="width:25%;text-align:center;">选手</text>

+ 5 - 3
pages/search/search.js

@@ -30,7 +30,8 @@ Page({
    */
   onLoad: function (options) {
     this.setData({
-      id: options.id
+      id: options.id,
+      
     })
     $api.getEnumList().then(res=>{
       var zq = res.data.data.zq, cw = res.data.data.cw,
@@ -44,7 +45,7 @@ Page({
         arr3:df
       })
     })
-    this.getData();
+    this.getData(options.match_id?options.match_id:null);
   },
   next: function () {
     if (this.data.list.length < this.data.total) {
@@ -55,13 +56,14 @@ Page({
       this.getData()
     }
   },
-  getData() {
+  getData(match_id) {
     wx.showLoading({
       title: '正在加载',
     })
     var list = this.data.list
     var form=this.data.form;
     form.page = this.data.page;
+    form.match_id = match_id;
     $api.getPlayerList(form).then(res => {
       wx.hideLoading()
       res.data.data.list.forEach(item => {

+ 1 - 1
project.private.config.json

@@ -1,5 +1,5 @@
 {
-  "projectname": "xiaochengxu",
+  "projectname": "wanzb_xcxv3",
   "setting": {
     "compileHotReLoad": true
   },