Browse Source

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

guhongwei 2 years ago
parent
commit
c5b6ccedac

BIN
image/beijing.jpeg


BIN
image/club.png


+ 1 - 1
pages/club/index.js

@@ -2,7 +2,7 @@ const app = getApp()
 Page({
     data: {
         frameStyle: { useTop: true, name: '俱乐部', leftArrow: false, useBar: true },
-        src: '/image/group.png',
+        src: '/image/club.png',
         list: [
             { name: '宝藏俱乐部', founder: '宝藏', add: '长春市朝阳区前进大街1244号', project: '羽毛球', time: '2000-02-01', tel: '0431-800-800-8800' },
             { name: '英语俱乐部', founder: '英语', time: '2000-02-01', add: '长春市朝阳区前进大街1244号', project: '羽毛球', tel: '0431-800-800-8800' },

+ 8 - 7
pages/club/index.less

@@ -34,6 +34,8 @@
         position: relative;
 
         .list {
+            display: flex;
+            flex-direction: row;
             height: 120px;
             padding: 2vw;
             margin: 2vw 2vw 0;
@@ -46,6 +48,7 @@
                 .name {
                     font-size: var(--font18Szie);
                     text-align: center;
+                    color: var(--whiteColor);
                 }
 
                 .text1 {
@@ -57,23 +60,21 @@
                 }
             }
 
-            .bg {
-                position: relative;
-                top: -120px;
-                left: 40vw;
+            .logo {
+                margin: 5vw 0;
 
                 image {
-                    width: 200px;
+                    width: 80px;
                 }
             }
         }
 
         .list:nth-child(1n) {
-            background-image: linear-gradient(to right, #9bd1fd, #44a2f0);
+            background-image: linear-gradient(to right, #9bd1fd,#44a2f0 );
         }
 
         .list:nth-child(2n) {
-            background-image: linear-gradient(to right, #ffaed4, #eb5299);
+            background-image: linear-gradient(to right, #eb5299, #ffaed4);
 
         }
     }

+ 1 - 1
pages/club/index.wxml

@@ -20,7 +20,7 @@
                             <view class="text1">电话:<text>{{item.tel}}</text></view>
                             <view class="text1">地址:<text>{{item.add}}</text></view>
                         </view>
-                        <view class="bg">
+                        <view class="logo">
                             <image src="{{src}}" mode="widthFix">
                             </image>
                         </view>

+ 8 - 7
pages/club/index.wxss

@@ -29,6 +29,8 @@
   position: relative;
 }
 .main .two .list {
+  display: flex;
+  flex-direction: row;
   height: 120px;
   padding: 2vw;
   margin: 2vw 2vw 0;
@@ -41,6 +43,7 @@
 .main .two .list .content .name {
   font-size: var(--font18Szie);
   text-align: center;
+  color: var(--whiteColor);
 }
 .main .two .list .content .text1 {
   font-size: var(--font14Size);
@@ -48,19 +51,17 @@
 .main .two .list .content .text1 text {
   color: var(--whiteColor);
 }
-.main .two .list .bg {
-  position: relative;
-  top: -120px;
-  left: 40vw;
+.main .two .list .logo {
+  margin: 5vw 0;
 }
-.main .two .list .bg image {
-  width: 200px;
+.main .two .list .logo image {
+  width: 80px;
 }
 .main .two .list:nth-child(1n) {
   background-image: linear-gradient(to right, #9bd1fd, #44a2f0);
 }
 .main .two .list:nth-child(2n) {
-  background-image: linear-gradient(to right, #ffaed4, #eb5299);
+  background-image: linear-gradient(to right, #eb5299, #ffaed4);
 }
 .scroll-view {
   position: absolute;

+ 40 - 6
pages/match/index.js

@@ -23,7 +23,7 @@ Page({
                 grade: '省市系列总决赛',
                 address: '吉林省长春市人民体育馆',
                 type: '3',
-                logo: [{ url: '/image/wechat.png' }],
+                logo: [{ url: '/image/beijing.jpeg' }],
                 status: '1'
             },
             {
@@ -33,7 +33,7 @@ Page({
                 grade: '省市系列总决赛',
                 address: '吉林省长春市人民体育馆',
                 type: '1',
-                logo: [{ url: '/image/wechat.png' }],
+                logo: [{ url: '/image/beijing.jpeg' }],
                 status: '2'
             },
             {
@@ -43,7 +43,7 @@ Page({
                 grade: '省市系列总决赛',
                 address: '吉林省长春市人民体育馆',
                 type: '1',
-                logo: [{ url: '/image/wechat.png' }],
+                logo: [{ url: '/image/beijing.jpeg' }],
                 status: '2'
             },
             {
@@ -53,10 +53,14 @@ Page({
                 grade: '省市系列总决赛',
                 address: '吉林省长春市人民体育馆',
                 type: '1',
-                logo: [{ url: '/image/wechat.png' }],
+                logo: [{ url: '/image/beijing.jpeg' }],
                 status: '2'
             }
-        ]
+        ],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
     },
     // 跳转菜单
     tabPath(e) {
@@ -75,10 +79,40 @@ Page({
         let data = that.data.statusList[e.detail.value];
         that.setData({ 'searchInfo.status': data.value });
     },
+    // 分页
+    toPage: function () {
+        const that = this;
+        let list = that.data.list;
+        let limit = that.data.limit;
+        if (that.data.total > list.length) {
+            wx.showLoading({ title: '加载中', mask: true })
+            let page = that.data.page + 1;
+            that.setData({ page: page })
+            let skip = page * limit;
+            that.setData({ skip: skip })
+            that.watchLogin();
+            wx.hideLoading()
+        } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
+    },
     /**
      * 生命周期函数--监听页面加载
      */
-    onLoad: function (options) { },
+    onLoad: function (options) {
+        const that = this;
+        // 监听用户是否登录
+        that.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => { },
+            fail: async res => {
+                // wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 59 - 61
pages/match/index.less

@@ -32,6 +32,7 @@
     .two {
         width: 96vw;
         margin: 2vw;
+
         .two_1 {
             display: flex;
             flex-direction: row;
@@ -58,85 +59,82 @@
                 justify-content: center;
                 background-color: var(--f1Color);
                 border-bottom: 1px dashed var(--f85Color);
-                width: 96vw;
+                width: 92vw;
                 padding: 2vw;
                 margin: 0 0 2vw 0;
 
                 .list_1 {
                     position: relative;
-                    width: 92vw;
-                    height: 110px;
+                    height: 210px;
 
                     .one_1 {
-                        height: 80px;
-                    }
-
-                    .one_2 {
-                        position: absolute;
-                        top: 10vw;
-                        width: 92vw;
-                        text-align: center;
+                        height: 100px;
 
                         .image {
-                            width: 60px;
-                            height: 60px;
-                            border-radius: 90px;
+                            width: 100%;
+                            height: 100%;
                             background-color: var(--mainColor);
                         }
-                    }
-
-                }
-
-                .list_2 {
-                    width: 92vw;
-                    text-align: center;
-
-                    .title {
-                        font-size: var(--font18Szie);
-                        font-weight: bold;
-                        margin: 0 0 2vw 0;
-                    }
-                }
 
-                .list_3 {
-                    display: flex;
-                    flex-wrap: wrap;
-                    flex-direction: row;
-                    justify-content: space-between;
-
-                    .other {
-                        margin: 0 0 1vw 0;
-                        font-size: var(--font16Size);
-                        color: var(--f85Color);
                     }
-                }
 
-                .list_4 {
-                    width: 92vw;
-                    text-align: center;
-                    padding: 2vw 0;
+                    .one_2 {
+                        position: absolute;
+                        top: 17vw;
+                        text-align: center;
+                        background-color: var(--mainColor);
+                        margin: 1vw;
+                        padding: 2vw;
+                        border-radius: 10px;
 
-                    .text {
-                        padding: 1vw 2vw;
-                        color: var(--mainColor);
-                        border-radius: 15px;
-                        font-size: var(--font14Size);
-                    }
+                        .title {
+                            font-size: var(--font18Szie);
+                            font-weight: bold;
+                            margin: 0 0 2vw 0;
+                            text-align: center;
 
-                    .color0 {
-                        background-color: #FFA500;
-                    }
-
-                    .color1 {
-                        background-color: #8B0000;
-                    }
+                        }
 
-                    .color2 {
-                        background-color: #006400;
-                    }
+                        .other {
+                            display: flex;
+                            flex-wrap: wrap;
+                            flex-direction: row;
+                            justify-content: space-between;
+                            margin: 0 0 2vw 0;
+
+                            .other_1 {
+                                margin: 0 0 1vw 0;
+                                font-size: var(--font16Size);
+                                color: var(--f85Color);
+                            }
+                        }
 
-                    .color3 {
-                        background-color: #808080;
+                        .status {
+                            .text {
+                                padding: 1vw 2vw;
+                                margin: 2vw 0;
+                                color: var(--mainColor);
+                                border-radius: 15px;
+                                font-size: var(--font14Size);
+                                text-align: center;
+                            }
+
+                            .color0 {
+                                background-color: #FFA500;
+                            }
+
+                            .color1 {
+                                background-color: #8B0000;
+                            }
+
+                            .color2 {
+                                background-color: #006400;
+                            }
+
+                            .color3 {
+                                background-color: #808080;
+                            }
+                        }
                     }
                 }
             }

+ 11 - 14
pages/match/index.wxml

@@ -25,24 +25,21 @@
                         <view class="list" wx:for="{{list}}" wx:key="item">
                             <view class="list_1">
                                 <view class="one_1">
-                                    <image style="width: 100%;height: 100%; background-color: #eeeeee;" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic01.1sucai.com%2F180213%2F330819-1P21310295866.jpg&refer=http%3A%2F%2Fpic01.1sucai.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1662879913&t=de473850e710092af364df8ad980c8b9"></image>
+                                    <image class="image" src="{{item.logo&&item.logo.length>0?item.logo[0].url:''}}"></image>
                                 </view>
                                 <view class="one_2">
-                                    <image class="image" src="{{item.logo&&item.logo.length>0?item.logo[0].url:''}}"></image>
+                                    <view class="title">{{item.title}}</view>
+                                    <view class="other">
+                                        <view class="other_1">时间:{{item.time}}</view>
+                                        <view class="other_1">等级:{{item.grade}}</view>
+                                        <view class="other_1">类型:{{item.type=='0'?'其他':item.type=='1'?'羽毛球':item.type=='2'?'篮球':'足球'}}</view>
+                                        <view class="other_1">地点:{{item.address}}</view>
+                                    </view>
+                                    <view class="status">
+                                        <text class="text color{{item.status}}">{{item.status=='0'?'计划中':item.status=='1'?'报名中':item.status=='2'?'进行中':'已结束'}}</text>
+                                    </view>
                                 </view>
                             </view>
-                            <view class="list_2">
-                                <view class="title">{{item.title}}</view>
-                            </view>
-                            <view class="list_3">
-                                <view class="other">时间:{{item.time}}</view>
-                                <view class="other">等级:{{item.grade}}</view>
-                                <view class="other">类型:{{item.type=='0'?'其他':item.type=='1'?'羽毛球':item.type=='2'?'篮球':'足球'}}</view>
-                                <view class="other">地点:{{item.address}}</view>
-                            </view>
-                            <view class="list_4">
-                                <text class="text color{{item.status}}">{{item.status=='0'?'计划中':item.status=='1'?'报名中':item.status=='2'?'进行中':'已结束'}}</text>
-                            </view>
                         </view>
                     </view>
                 </scroll-view>

+ 24 - 28
pages/match/index.wxss

@@ -52,71 +52,67 @@
   justify-content: center;
   background-color: var(--f1Color);
   border-bottom: 1px dashed var(--f85Color);
-  width: 96vw;
+  width: 92vw;
   padding: 2vw;
   margin: 0 0 2vw 0;
 }
 .main .thr .thr_1 .list .list_1 {
   position: relative;
-  width: 92vw;
-  height: 110px;
+  height: 210px;
 }
 .main .thr .thr_1 .list .list_1 .one_1 {
-  height: 80px;
+  height: 100px;
+}
+.main .thr .thr_1 .list .list_1 .one_1 .image {
+  width: 100%;
+  height: 100%;
+  background-color: var(--mainColor);
 }
 .main .thr .thr_1 .list .list_1 .one_2 {
   position: absolute;
-  top: 10vw;
-  width: 92vw;
+  top: 17vw;
   text-align: center;
-}
-.main .thr .thr_1 .list .list_1 .one_2 .image {
-  width: 60px;
-  height: 60px;
-  border-radius: 90px;
   background-color: var(--mainColor);
+  margin: 1vw;
+  padding: 2vw;
+  border-radius: 10px;
 }
-.main .thr .thr_1 .list .list_2 {
-  width: 92vw;
-  text-align: center;
-}
-.main .thr .thr_1 .list .list_2 .title {
+.main .thr .thr_1 .list .list_1 .one_2 .title {
   font-size: var(--font18Szie);
   font-weight: bold;
   margin: 0 0 2vw 0;
+  text-align: center;
 }
-.main .thr .thr_1 .list .list_3 {
+.main .thr .thr_1 .list .list_1 .one_2 .other {
   display: flex;
   flex-wrap: wrap;
   flex-direction: row;
   justify-content: space-between;
+  margin: 0 0 2vw 0;
 }
-.main .thr .thr_1 .list .list_3 .other {
+.main .thr .thr_1 .list .list_1 .one_2 .other .other_1 {
   margin: 0 0 1vw 0;
   font-size: var(--font16Size);
   color: var(--f85Color);
 }
-.main .thr .thr_1 .list .list_4 {
-  width: 92vw;
-  text-align: center;
-  padding: 2vw 0;
-}
-.main .thr .thr_1 .list .list_4 .text {
+.main .thr .thr_1 .list .list_1 .one_2 .status .text {
   padding: 1vw 2vw;
+  margin: 2vw 0;
   color: var(--mainColor);
   border-radius: 15px;
   font-size: var(--font14Size);
+  text-align: center;
 }
-.main .thr .thr_1 .list .list_4 .color0 {
+.main .thr .thr_1 .list .list_1 .one_2 .status .color0 {
   background-color: #FFA500;
 }
-.main .thr .thr_1 .list .list_4 .color1 {
+.main .thr .thr_1 .list .list_1 .one_2 .status .color1 {
   background-color: #8B0000;
 }
-.main .thr .thr_1 .list .list_4 .color2 {
+.main .thr .thr_1 .list .list_1 .one_2 .status .color2 {
   background-color: #006400;
 }
-.main .thr .thr_1 .list .list_4 .color3 {
+.main .thr .thr_1 .list .list_1 .one_2 .status .color3 {
   background-color: #808080;
 }
 .main .thr .thr_1 .list:last-child {