Quellcode durchsuchen

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

YY vor 2 Jahren
Ursprung
Commit
2e4705d239

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

@@ -4,7 +4,9 @@ Component({
      * 组件的属性列表
      */
     properties: {
-
+        fieldtabs: { type: Object },
+        matchList: { type: Array },
+        active: { type: String }
     },
 
     /**
@@ -18,6 +20,15 @@ Component({
      * 组件的方法列表
      */
     methods: {
-
+        fieldtabsChange: function (e) {
+            const that = this;
+            const { active } = e.detail;
+            that.triggerEvent('fieldtabsChange', active)
+        },
+        toCommon: function (e) {
+            const that = this;
+            const { item } = e.currentTarget.dataset;
+            that.triggerEvent('toCommon', item)
+        },
     }
 })

+ 3 - 1
commpents/pagesMatchs/match/match-4.json

@@ -1,4 +1,6 @@
 {
     "component": true,
-    "usingComponents": {}
+    "usingComponents": {
+        "s-tab": "/commpents/tabs/index"
+    }
 }

+ 82 - 0
commpents/pagesMatchs/match/match-4.less

@@ -0,0 +1,82 @@
+@import (css) "/app.wxss";
+
+.main {
+    .one {
+        width: 100vw;
+        margin: 1vw 0;
+    }
+
+    .two {
+        width: 94vw;
+        position: relative;
+        flex-grow: 1;
+        height: 74.5vh;
+        margin: 0 3vw;
+
+        .list {
+            background-color: #328d26;
+            margin: 0 0 2vw 0;
+            padding: 2vw;
+
+            .list_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;
+                        }
+                    }
+                }
+            }
+        }
+
+        .list:last-child {
+            margin: 0;
+        }
+    }
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 37 - 2
commpents/pagesMatchs/match/match-4.wxml

@@ -1,2 +1,37 @@
-<!--commpents/pagesMatchs/match/match-4.wxml-->
-<text>commpents/pagesMatchs/match/match-4.wxml</text>
+<view class="main">
+    <view class="one">
+        <s-tab tabs="{{fieldtabs}}" bind:tabsChange="fieldtabsChange"></s-tab>
+    </view>
+    <view wx:if="{{fieldtabs.active==active}}" class="two">
+        <scroll-view scroll-y="true" class="scroll-view">
+            <view class="list-scroll-view">
+                <view class="list" wx:for="{{matchList}}" wx:key="item" bindtap="toCommon" data-item="{{item}}">
+                    <view class="list_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">
+                                <text wx:if="{{item.is_change=='0'}}">{{item.player_one_name}}</text>
+                                <text wx:if="{{item.is_change=='1'}}">{{item.player_two_name}}</text>
+                            </view>
+                            <view class="pk_2">
+                                <view class="time">{{item.match_time}}</view>
+                                <view class="status">{{item.zhStatus}}</view>
+                                <view class="score" wx:if="{{item.is_change=='0'}}"><text>{{item.player_one_score||0}}</text>-{{item.player_two_score||0}}</view>
+                                <view class="score" wx:if="{{item.is_change=='1'}}"><text>{{item.player_two_score||0}}</text>-{{item.player_one_score||0}}</view>
+                            </view>
+                            <view class="pk_1">
+                                <text wx:if="{{item.is_change=='0'}}">{{item.player_two_name}}</text>
+                                <text wx:if="{{item.is_change=='1'}}">{{item.player_one_name}}</text>
+                            </view>
+                        </view>
+                    </view>
+                </view>
+            </view>
+        </scroll-view>
+    </view>
+</view>

+ 65 - 1
commpents/pagesMatchs/match/match-4.wxss

@@ -1 +1,65 @@
-/* commpents/pagesMatchs/match/match-4.wxss */
+@import "/app.wxss";
+.main .one {
+  width: 100vw;
+  margin: 1vw 0;
+}
+.main .two {
+  width: 94vw;
+  position: relative;
+  flex-grow: 1;
+  height: 74.5vh;
+  margin: 0 3vw;
+}
+.main .two .list {
+  background-color: #328d26;
+  margin: 0 0 2vw 0;
+  padding: 2vw;
+}
+.main .two .list .list_0 .name {
+  padding: 1vw 0;
+  color: var(--whiteColor);
+  margin: 0 0 1vw 0;
+}
+.main .two .list .list_0 .name text {
+  padding: 0 2vw 0 0;
+}
+.main .two .list .list_0 .pk {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+  background-color: var(--whiteColor);
+}
+.main .two .list .list_0 .pk .pk_1 {
+  width: 30vw;
+  text-align: center;
+  padding: 2vw;
+}
+.main .two .list .list_0 .pk .pk_2 {
+  text-align: center;
+  box-shadow: 0 0 5px var(--fcColor);
+}
+.main .two .list .list_0 .pk .pk_2 .time {
+  background-color: #328d26;
+  color: var(--whiteColor);
+  padding: 1vw 0;
+  font-size: var(--font14Size);
+}
+.main .two .list .list_0 .pk .pk_2 .score {
+  font-size: var(--font20Szie);
+  padding: 1vw 0;
+  font-weight: bold;
+}
+.main .two .list: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;
+}

+ 15 - 17
pagesMatch/match/info.js

@@ -56,24 +56,22 @@ Page({
     fieldtabsChange: async function (e) {
         const that = this;
         let match = that.data.info;
-        const { active } = e.detail;
+        if (e.detail) var active = e.detail;
+        if (e.detail == 0) var active = 0;
         that.setData({ 'fieldtabs.active': active });
         that.setData({ active: active });
         let address = that.data.fieldtabs.menu.find((i) => i.active == active);
         if (address && address.menu != 0) {
             let arr;
-            if (address._id == '') arr = await app.$get(`/msgs`, { match: match._id }, 'race');
-            else arr = await app.$get(`/msgs`, { match: match._id, address_id: address._id }, 'race');
+            if (address._id == '') arr = await app.$get(`/msgs`, { match_id: match._id }, 'race');
+            else arr = await app.$get(`/msgs`, { match_id: match._id, address_id: address._id }, 'race');
             if (arr.errcode == '0') that.setData({ matchList: arr.data });
             else wx.showToast({ title: `${arr.errmsg}`, icon: 'fail', duration: 2000 });
         }
     },
     // 赛况详情
     toCommon: function (e) {
-        const that = this;
-        const { item, route } = e.currentTarget.dataset;
-        that.setData({ skip: 0, page: 0, list: [] });
-        wx.navigateTo({ url: `/pagesMatch/${route}?id=${item && item._id ? item._id : ''}` })
+        wx.navigateTo({ url: `/pagesMatch/userAdmin/schedule/sinfo?id=${e.detail._id}` })
     },
     //比赛报名
     toSign: function (e) {
@@ -128,16 +126,6 @@ Page({
         // 赛制列表
         arr = await app.$get(`/dict`, { code: "match_format" });
         if (arr.errcode == '0' && arr.total > 0) that.setData({ formatList: arr.data[0].list });
-        // 场地
-        arr = await app.$get(`/matchAddress`, { is_use: '0' }, 'race');
-        if (arr.errcode == '0') {
-            let groundList = []
-            arr.data.unshift({ _id: '', title: '全部场地', active: '0' });
-            for (const [index, val] of arr.data.entries()) {
-                groundList.push({ _id: val._id, title: val.title || val.name, active: index })
-            }
-            that.setData({ 'fieldtabs.menu': groundList })
-        }
         arr = await app.$get(`/dict`, { code: "gender" });
         if (arr.errcode == '0' && arr.total > 0) that.setData({ genderList: arr.data[0].list });
     },
@@ -174,6 +162,16 @@ Page({
                     let regular = arr.data.regular.replace(/\<img/gi, '<img style="width:100%;height:auto;margin: 5px 0"');
                     if (regular) arr.data.zhRegular = regular;
                     that.setData({ info: arr.data })
+                    // 场地
+                    let address = await app.$get(`/matchAddress`, { is_use: '0', belong_id: arr.data.belong_id }, 'race');
+                    if (address.errcode == '0') {
+                        let groundList = []
+                        address.data.unshift({ _id: '', title: '全部场地', active: 0 });
+                        for (const [index, val] of address.data.entries()) {
+                            groundList.push({ _id: val._id, title: val.title || val.name, active: index })
+                        }
+                        that.setData({ 'fieldtabs.menu': groundList })
+                    }
                 } else { wx.showToast({ title: `${res.errmsg}`, icon: 'fail', duration: 2000 }); }
                 // 选手
                 arr = await app.$get(`/match/getAll/${that.data.id}`, {}, 'race');

+ 0 - 73
pagesMatch/match/info.less

@@ -127,79 +127,6 @@
 
         .d {
             height: 83vh;
-
-            .d_1 {
-                width: 100vw;
-                margin: 1vw 0;
-            }
-
-            .d_2 {
-                width: 94vw;
-                position: relative;
-                flex-grow: 1;
-                height: 74.5vh;
-                margin: 0 3vw;
-
-                .dList {
-                    background-color: #328d26;
-                    margin: 0 0 2vw 0;
-                    padding: 2vw;
-
-                    .dList_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;
-                                }
-                            }
-                        }
-                    }
-
-                    .dList_1 {
-                        text {
-                            padding: 0 1vw;
-                            color: #ffffff;
-                        }
-                    }
-                }
-
-                .dList:last-child {
-                    margin: 0;
-                }
-            }
         }
     }
 }

+ 1 - 32
pagesMatch/match/info.wxml

@@ -67,40 +67,9 @@
             <view wx:if="{{tabs.active=='d'}}" class="d">
                 <scroll-view scroll-y="true" class="scroll-view">
                     <view class="list-scroll-view">
-                        <match-4></match-4>
+                        <match-4 active="{{active}}" fieldtabs="{{fieldtabs}}" matchList="{{matchList}}" bind:fieldtabsChange="fieldtabsChange" bind:toCommon="toCommon"></match-4>
                     </view>
                 </scroll-view>
-                <!-- <view class="d_1">
-                    <s-tab tabs="{{fieldtabs}}" bind:tabsChange="fieldtabsChange"></s-tab>
-                </view>
-                <view wx:if="{{fieldtabs.active==active}}" class="d_2">
-                    <scroll-view scroll-y="true" class="scroll-view">
-                        <view class="list-scroll-view">
-                            <view class="dList" wx:for="{{matchList}}" wx:key="item" bindtap="toCommon" data-route="userAdmin/schedule/sinfo" data-item="{{item}}">
-                                <view class="dList_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">
-                                            <text>{{item.player_one_name}}</text>
-                                        </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">
-                                            <text>{{item.player_two_name}}</text>
-                                        </view>
-                                    </view>
-                                </view>
-                            </view>
-                        </view>
-                    </scroll-view>
-                </view> -->
             </view>
             <view wx:if="{{tabs.active=='e'}}" class="e">
                 <scroll-view scroll-y="true" class="scroll-view">

+ 0 - 57
pagesMatch/match/info.wxss

@@ -101,63 +101,6 @@
 .main .two .d {
   height: 83vh;
 }
-.main .two .d .d_1 {
-  width: 100vw;
-  margin: 1vw 0;
-}
-.main .two .d .d_2 {
-  width: 94vw;
-  position: relative;
-  flex-grow: 1;
-  height: 74.5vh;
-  margin: 0 3vw;
-}
-.main .two .d .d_2 .dList {
-  background-color: #328d26;
-  margin: 0 0 2vw 0;
-  padding: 2vw;
-}
-.main .two .d .d_2 .dList .dList_0 .name {
-  padding: 1vw 0;
-  color: var(--whiteColor);
-  margin: 0 0 1vw 0;
-}
-.main .two .d .d_2 .dList .dList_0 .name text {
-  padding: 0 2vw 0 0;
-}
-.main .two .d .d_2 .dList .dList_0 .pk {
-  display: flex;
-  flex-direction: row;
-  justify-content: space-around;
-  background-color: var(--whiteColor);
-}
-.main .two .d .d_2 .dList .dList_0 .pk .pk_1 {
-  width: 30vw;
-  text-align: center;
-  padding: 2vw;
-}
-.main .two .d .d_2 .dList .dList_0 .pk .pk_2 {
-  text-align: center;
-  box-shadow: 0 0 5px var(--fcColor);
-}
-.main .two .d .d_2 .dList .dList_0 .pk .pk_2 .time {
-  background-color: #328d26;
-  color: var(--whiteColor);
-  padding: 1vw 0;
-  font-size: var(--font14Size);
-}
-.main .two .d .d_2 .dList .dList_0 .pk .pk_2 .score {
-  font-size: var(--font20Szie);
-  padding: 1vw 0;
-  font-weight: bold;
-}
-.main .two .d .d_2 .dList .dList_1 text {
-  padding: 0 1vw;
-  color: #ffffff;
-}
-.main .two .d .d_2 .dList:last-child {
-  margin: 0;
-}
 .scroll-view {
   position: absolute;
   top: 0;