YY пре 2 година
родитељ
комит
5a9c454308
2 измењених фајлова са 13 додато и 7 уклоњено
  1. 10 4
      pagesMatch/match/info.js
  2. 3 3
      pagesMatch/match/info.wxml

+ 10 - 4
pagesMatch/match/info.js

@@ -102,10 +102,16 @@ Page({
         that.setData({ cList: that.data.cType == '0' ? that.data.raceList : that.data.raceteamList })
     },
     // 秩序册查询
-    cSearch: function name(params) {
+    cSearch: async function (e) {
         const that = this;
-        that.setData({ 'searchInfo.name': e.detail.value });
-        that.searchOrderBook()
+        const name = e.detail.value;
+        const type = that.data.cType;
+        if (name) {
+            let arr;
+            if (type == '0') { arr = await app.$get(`/msgs`, { match_id: that.data.id, user_name: name }, 'race'); }
+            else { arr = await app.$get(`/matchTeamGroup`, { match_id: that.data.info._id, name: name }, 'race'); }
+            if (arr.errcode == '0') { that.setData({ cList: arr.data }); };
+        }
     },
     /**
      * 生命周期函数--监听页面加载
@@ -219,7 +225,7 @@ Page({
         }
         else wx.showToast({ title: `${arr.errmsg}`, icon: 'fail', duration: 2000 });
         //小组赛赛程--对阵表
-        arr = await app.$get(`/msgs`, { match: match._id }, 'race');
+        arr = await app.$get(`/msgs`, { match_id: match._id }, 'race');
         if (arr.errcode == '0') {
             for (const val of arr.data) {
                 val.one_one = val.player_one_name.split("-")[0];

+ 3 - 3
pagesMatch/match/info.wxml

@@ -124,7 +124,7 @@
                                     </view>
                                     <view class="pk">
                                         <view class="pk_1">
-                                            <view>{{item.one_one||''}}</view>
+                                            <view>{{item.one_one||''||item.player_one_name}}</view>
                                             <view>{{item.one_two||''}}</view>
                                         </view>
                                         <view class="pk_2">
@@ -132,7 +132,7 @@
                                             <view class="score"><text>{{item.player_one_score||0}}</text>-{{item.player_two_score||0}}</view>
                                         </view>
                                         <view class="pk_1">
-                                            <view>{{item.two_one||''}}</view>
+                                            <view>{{item.two_one||''||item.player_two_name}}</view>
                                             <view>{{item.two_two||''}}</view>
                                         </view>
                                     </view>
@@ -144,7 +144,7 @@
                                     <view class="person">
                                         <view wx:for="{{item.person}}" wx:key="item">
                                             <view class="user_name">
-                                                <view>{{item.one||''}}</view>
+                                                <view>{{item.one||''||item.name}}</view>
                                                 <view>{{item.two||''}}</view>
                                             </view>
                                         </view>