Explorar o código

秩序册组件修改

YY %!s(int64=2) %!d(string=hai) anos
pai
achega
fa7304ca14

+ 2 - 4
commpents/pagesMatchs/match/match-3.js

@@ -4,16 +4,14 @@ Component({
      * 组件的属性列表
      */
     properties: {
-
+        cList: { type: Array },
+        cType: { type: String },
     },
-
     /**
      * 组件的初始数据
      */
     data: {
-
     },
-
     /**
      * 组件的方法列表
      */

+ 99 - 0
commpents/pagesMatchs/match/match-3.less

@@ -0,0 +1,99 @@
+.c {
+    width: 96vw;
+    display: flex;
+    flex-direction: column;
+
+
+        .cList {
+            background-color: #328d26;
+            margin: 0 0 2vw 0;
+            padding: 2vw;
+
+            .cList_0 {
+                .name {
+                    padding: 1vw 0;
+                    color: var(--whiteColor);
+                    margin: 0 0 1vw 0;
+
+                    text {
+                        padding: 0 2vw 0 0;
+                    }
+                }
+
+                .pk {
+                    display: flex;
+                    flex-direction: row;
+                    justify-content: space-around;
+                    background-color: var(--whiteColor);
+
+                    .pk_1 {
+                        width: 30vw;
+                        text-align: center;
+                        padding: 2vw;
+                    }
+
+                    .pk_2 {
+                        text-align: center;
+                        box-shadow: 0 0 5px var(--fcColor);
+
+                        .time {
+                            background-color: #328d26;
+                            color: var(--whiteColor);
+                            padding: 1vw 0;
+                            font-size: var(--font14Size);
+                        }
+
+                        .score {
+                            font-size: var(--font20Szie);
+                            padding: 1vw 0;
+                            font-weight: bold;
+                        }
+                    }
+                }
+            }
+
+            .cList_1 {
+                text {
+                    padding: 0 1vw;
+                    color: var(--whiteColor);
+                }
+
+                .person {
+                    margin: 2vw 0 1vw 0;
+                    display: flex;
+                    flex-direction: row;
+                    justify-content: space-between;
+                    flex-wrap: wrap;
+                    background-color: var(--whiteColor);
+
+                    .user_name {
+                        width: 22vw;
+                        margin: 1vw;
+                        padding: 2vw;
+                        text-align: center;
+                        color: #328d26;
+                        font-weight: 700;
+                        border: 1px solid var(--f85Color);
+                        border-radius: 2px;
+                    }
+                }
+            }
+        }
+
+        .cList:last-child {
+            margin: 0;
+        }
+    
+}
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 43 - 2
commpents/pagesMatchs/match/match-3.wxml

@@ -1,2 +1,43 @@
-<!--commpents/pagesMatchs/match/match-3.wxml-->
-<text>commpents/pagesMatchs/match/match-3.wxml</text>
+<view class="c">
+    <scroll-view scroll-y="true" class="scroll-view">
+        <view class="list-scroll-view">
+            <view class="cList" wx:for="{{cList}}" wx:key="item" data-item="{{item}}">
+                <view class="cList_0" wx:if="{{cType=='0'}}">
+                    <view class="name">
+                        <text>{{item.group_id_name}}</text>
+                        <text>{{item.project_id_name}}</text>
+                        <text>{{item.team_id_name}}</text>
+                        <text>{{item.address_id_name}}</text>
+                    </view>
+                    <view class="pk">
+                        <view class="pk_1">
+                            <view>{{item.one_one||''||item.player_one_name}}</view>
+                            <view>{{item.one_two||''}}</view>
+                        </view>
+                        <view class="pk_2">
+                            <view class="time">{{item.match_time}}</view>
+                            <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||''||item.player_two_name}}</view>
+                            <view>{{item.two_two||''}}</view>
+                        </view>
+                    </view>
+                </view>
+                <view class="cList_1" wx:elif="{{cType=='1'}}">
+                    <text>{{item.group_id_name}}({{item.age}}周岁)</text>
+                    <text>{{item.project_id_name}}({{item.zhGender}})</text>
+                    <text>{{item.name}}</text>
+                    <view class="person">
+                        <view wx:for="{{item.person}}" wx:key="item">
+                            <view class="user_name">
+                                <view>{{item.one||''||item.name}}</view>
+                                <view>{{item.two||''}}</view>
+                            </view>
+                        </view>
+                    </view>
+                </view>
+            </view>
+        </view>
+    </scroll-view>
+</view>

+ 80 - 1
commpents/pagesMatchs/match/match-3.wxss

@@ -1 +1,80 @@
-/* commpents/pagesMatchs/match/match-3.wxss */
+.c {
+  width: 96vw;
+  display: flex;
+  flex-direction: column;
+}
+.c .cList {
+  background-color: #328d26;
+  margin: 0 0 2vw 0;
+  padding: 2vw;
+}
+.c .cList .cList_0 .name {
+  padding: 1vw 0;
+  color: var(--whiteColor);
+  margin: 0 0 1vw 0;
+}
+.c .cList .cList_0 .name text {
+  padding: 0 2vw 0 0;
+}
+.c .cList .cList_0 .pk {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+  background-color: var(--whiteColor);
+}
+.c .cList .cList_0 .pk .pk_1 {
+  width: 30vw;
+  text-align: center;
+  padding: 2vw;
+}
+.c .cList .cList_0 .pk .pk_2 {
+  text-align: center;
+  box-shadow: 0 0 5px var(--fcColor);
+}
+.c .cList .cList_0 .pk .pk_2 .time {
+  background-color: #328d26;
+  color: var(--whiteColor);
+  padding: 1vw 0;
+  font-size: var(--font14Size);
+}
+.c .cList .cList_0 .pk .pk_2 .score {
+  font-size: var(--font20Szie);
+  padding: 1vw 0;
+  font-weight: bold;
+}
+.c .cList .cList_1 text {
+  padding: 0 1vw;
+  color: var(--whiteColor);
+}
+.c .cList .cList_1 .person {
+  margin: 2vw 0 1vw 0;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  flex-wrap: wrap;
+  background-color: var(--whiteColor);
+}
+.c .cList .cList_1 .person .user_name {
+  width: 22vw;
+  margin: 1vw;
+  padding: 2vw;
+  text-align: center;
+  color: #328d26;
+  font-weight: 700;
+  border: 1px solid var(--f85Color);
+  border-radius: 2px;
+}
+.c .cList:last-child {
+  margin: 0;
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}

+ 8 - 10
pagesMatch/match/info.js

@@ -102,14 +102,8 @@ Page({
     // 秩序册查询
     cSearch: async function (e) {
         const that = this;
-        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 }); };
-        }
+        that.setData({ 'searchInfo.name': e.detail.value });
+        that.searchOrderBook();
     },
     /**
      * 生命周期函数--监听页面加载
@@ -198,9 +192,13 @@ Page({
         const that = this;
         let type = that.data.cType;
         let match = that.data.info;
+        let searchInfo = that.data.searchInfo;
+        let info = { match_id: match._id, };
+        if (type == '0') if (searchInfo && searchInfo.name) info.user_name = searchInfo.name;
+        if (type == '1') if (searchInfo && searchInfo.name) info.project_name = searchInfo.name;
         let arr;
         //小组赛组--场次表
-        arr = await app.$get(`/matchTeamGroup`, { match_id: match._id }, 'race');
+        arr = await app.$get(`/matchTeamGroup`, { ...info }, 'race');
         if (arr.errcode == '0') {
             for (const val of arr.data) {
                 const project = await app.$get(`/matchProject`, { id: val.project_id, group_id: val.group_id, match_id: match._id }, 'race');
@@ -223,7 +221,7 @@ Page({
         }
         else wx.showToast({ title: `${arr.errmsg}`, icon: 'fail', duration: 2000 });
         //小组赛赛程--对阵表
-        arr = await app.$get(`/msgs`, { match_id: match._id }, 'race');
+        arr = await app.$get(`/msgs`, { ...info }, 'race');
         if (arr.errcode == '0') {
             for (const val of arr.data) {
                 val.one_one = val.player_one_name.split("-")[0];

+ 0 - 79
pagesMatch/match/info.less

@@ -122,85 +122,6 @@
                 height: 74.5vh;
                 margin: 0 3vw;
 
-                .cList {
-                    background-color: #328d26;
-                    margin: 0 0 2vw 0;
-                    padding: 2vw;
-
-                    .cList_0 {
-                        .name {
-                            padding: 1vw 0;
-                            color: var(--whiteColor);
-                            margin: 0 0 1vw 0;
-
-                            text {
-                                padding: 0 2vw 0 0;
-                            }
-                        }
-
-                        .pk {
-                            display: flex;
-                            flex-direction: row;
-                            justify-content: space-around;
-                            background-color: var(--whiteColor);
-
-                            .pk_1 {
-                                width: 30vw;
-                                text-align: center;
-                                padding: 2vw;
-                            }
-
-                            .pk_2 {
-                                text-align: center;
-                                box-shadow: 0 0 5px var(--fcColor);
-
-                                .time {
-                                    background-color: #328d26;
-                                    color: var(--whiteColor);
-                                    padding: 1vw 0;
-                                    font-size: var(--font14Size);
-                                }
-
-                                .score {
-                                    font-size: var(--font20Szie);
-                                    padding: 1vw 0;
-                                    font-weight: bold;
-                                }
-                            }
-                        }
-                    }
-
-                    .cList_1 {
-                        text {
-                            padding: 0 1vw;
-                            color: var(--whiteColor);
-                        }
-
-                        .person {
-                            margin: 2vw 0 1vw 0;
-                            display: flex;
-                            flex-direction: row;
-                            justify-content: space-between;
-                            flex-wrap: wrap;
-                            background-color: var(--whiteColor);
-
-                            .user_name {
-                                width: 22vw;
-                                margin: 1vw;
-                                padding: 2vw;
-                                text-align: center;
-                                color: #328d26;
-                                font-weight: 700;
-                                border: 1px solid var(--f85Color);
-                                border-radius: 2px;
-                            }
-                        }
-                    }
-                }
-
-                .cList:last-child {
-                    margin: 0;
-                }
             }
         }
 

+ 1 - 37
pagesMatch/match/info.wxml

@@ -59,43 +59,7 @@
                 <view class="c_2">
                     <scroll-view scroll-y="true" class="scroll-view">
                         <view class="list-scroll-view">
-                            <view class="cList" wx:for="{{cList}}" wx:key="item" bindtap="toAchieve" data-item="{{item}}">
-                                <view class="cList_0" wx:if="{{cType=='0'}}">
-                                    <view class="name">
-                                        <text>{{item.group_id_name}}</text>
-                                        <text>{{item.project_id_name}}</text>
-                                        <text>{{item.team_id_name}}</text>
-                                        <text>{{item.address_id_name}}</text>
-                                    </view>
-                                    <view class="pk">
-                                        <view class="pk_1">
-                                            <view>{{item.one_one||''||item.player_one_name}}</view>
-                                            <view>{{item.one_two||''}}</view>
-                                        </view>
-                                        <view class="pk_2">
-                                            <view class="time">{{item.match_time}}</view>
-                                            <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||''||item.player_two_name}}</view>
-                                            <view>{{item.two_two||''}}</view>
-                                        </view>
-                                    </view>
-                                </view>
-                                <view class="cList_1" wx:elif="{{cType=='1'}}">
-                                    <text>{{item.group_id_name}}({{item.age}}周岁)</text>
-                                    <text>{{item.project_id_name}}({{item.zhGender}})</text>
-                                    <text>{{item.name}}</text>
-                                    <view class="person">
-                                        <view wx:for="{{item.person}}" wx:key="item">
-                                            <view class="user_name">
-                                                <view>{{item.one||''||item.name}}</view>
-                                                <view>{{item.two||''}}</view>
-                                            </view>
-                                        </view>
-                                    </view>
-                                </view>
-                            </view>
+                            <match-3 cList="{{cList}}" cType="{{cType}}"></match-3>
                         </view>
                     </scroll-view>
                 </view>

+ 0 - 64
pagesMatch/match/info.wxss

@@ -98,70 +98,6 @@
   height: 74.5vh;
   margin: 0 3vw;
 }
-.main .two .c .c_2 .cList {
-  background-color: #328d26;
-  margin: 0 0 2vw 0;
-  padding: 2vw;
-}
-.main .two .c .c_2 .cList .cList_0 .name {
-  padding: 1vw 0;
-  color: var(--whiteColor);
-  margin: 0 0 1vw 0;
-}
-.main .two .c .c_2 .cList .cList_0 .name text {
-  padding: 0 2vw 0 0;
-}
-.main .two .c .c_2 .cList .cList_0 .pk {
-  display: flex;
-  flex-direction: row;
-  justify-content: space-around;
-  background-color: var(--whiteColor);
-}
-.main .two .c .c_2 .cList .cList_0 .pk .pk_1 {
-  width: 30vw;
-  text-align: center;
-  padding: 2vw;
-}
-.main .two .c .c_2 .cList .cList_0 .pk .pk_2 {
-  text-align: center;
-  box-shadow: 0 0 5px var(--fcColor);
-}
-.main .two .c .c_2 .cList .cList_0 .pk .pk_2 .time {
-  background-color: #328d26;
-  color: var(--whiteColor);
-  padding: 1vw 0;
-  font-size: var(--font14Size);
-}
-.main .two .c .c_2 .cList .cList_0 .pk .pk_2 .score {
-  font-size: var(--font20Szie);
-  padding: 1vw 0;
-  font-weight: bold;
-}
-.main .two .c .c_2 .cList .cList_1 text {
-  padding: 0 1vw;
-  color: var(--whiteColor);
-}
-.main .two .c .c_2 .cList .cList_1 .person {
-  margin: 2vw 0 1vw 0;
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-  flex-wrap: wrap;
-  background-color: var(--whiteColor);
-}
-.main .two .c .c_2 .cList .cList_1 .person .user_name {
-  width: 22vw;
-  margin: 1vw;
-  padding: 2vw;
-  text-align: center;
-  color: #328d26;
-  font-weight: 700;
-  border: 1px solid var(--f85Color);
-  border-radius: 2px;
-}
-.main .two .c .c_2 .cList:last-child {
-  margin: 0;
-}
 .main .two .d {
   height: 83vh;
 }