瀏覽代碼

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

zs 2 年之前
父節點
當前提交
d92c45de90

+ 1 - 1
app.js

@@ -25,7 +25,7 @@ App({
         // 当前设备信息
         client: {},
         // 数据请求接口域名
-        publicUrl: 'http://broadcast.waityou24.cn',
+        publicUrl: 'http://120.48.146.1',
         //图片请求接口域名
         fileUrl: "https://broadcast.waityou24.cn",
     },

+ 5 - 1
app.json

@@ -3,12 +3,16 @@
         "pages/index/index",
         "pages/register/index",
         "pages/school/index",
+        "pages/smy/index",
         "pages/club/index",
         "pages/match/index",
         "pages/other/agree",
         "pages/home/index",
         "pages/test/index",
-        "pages/logs/logs"
+        "pages/logs/logs",
+        "pages/user/basic",
+        "pages/setting/basic",
+        "pages/setting/contact"
     ],
     "usingComponents": {
         "van-sidebar": "@vant/weapp/sidebar/index",

+ 2 - 0
app.wxss

@@ -13,6 +13,8 @@
     white-space: nowrap;
 }
 
+@import "/icon/icon.wxss";
+
 /* 系统颜色字体配置 */
 page {
     /* 窗口可用高度 */

File diff suppressed because it is too large
+ 49 - 0
icon/icon.wxss


二進制
image/club.png


二進制
image/group.png


+ 26 - 0
pages/club/index.js

@@ -2,12 +2,38 @@ const app = getApp()
 Page({
     data: {
         frameStyle: { useTop: true, name: '俱乐部', leftArrow: false, useBar: true },
+        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' },
+            { 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' },
+        ],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
     },
     // 跳转菜单
     tabPath(e) {
         let { route } = e.detail.detail;
         if (route) wx.redirectTo({ url: `/${route}` })
     },
+    // 分页
+    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 }) }
+    },
     /**
      * 生命周期函数--监听页面加载
      */

+ 60 - 1
pages/club/index.less

@@ -30,6 +30,65 @@
     }
 
     .two {
-        background-color: #0000ff;
+        flex-grow: 1;
+        position: relative;
+
+        .list {
+            display: flex;
+            flex-direction: row;
+            height: 120px;
+            padding: 2vw;
+            margin: 2vw 2vw 0;
+            border-radius: 10px;
+
+            .content {
+                flex-grow: 1;
+                z-index: 999;
+
+                .name {
+                    font-size: var(--font18Szie);
+                    text-align: center;
+                    color: var(--whiteColor);
+                }
+
+                .text1 {
+                    font-size: var(--font14Size);
+
+                    text {
+                        color: var(--whiteColor);
+                    }
+                }
+            }
+
+            .logo {
+                margin: 5vw 0;
+
+                image {
+                    width: 80px;
+                }
+            }
+        }
+
+        .list:nth-child(1n) {
+            background-image: linear-gradient(to right, #44a2f0, #9bd1fd);
+        }
+
+        .list:nth-child(2n) {
+            background-image: linear-gradient(to right, #eb5299, #ffaed4);
+
+        }
+    }
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
     }
 }

+ 18 - 1
pages/club/index.wxml

@@ -9,7 +9,24 @@
             </view>
         </view>
         <view class="two">
-            俱乐部
+            <scroll-view scroll-y="true" class="scroll-view" bindscrolltolower="toPage">
+                <view class="list-scroll-view">
+                    <view class="list" wx:for="{{list}}" wx:key="item">
+                        <view class="content">
+                            <view class="name">{{item.name}}</view>
+                            <view class="text1">创始人:<text>{{item.founder}}</text></view>
+                            <view class="text1">创建时间:<text>{{item.time}}</text></view>
+                            <view class="text1">项目:<text>{{item.project}}</text></view>
+                            <view class="text1">电话:<text>{{item.tel}}</text></view>
+                            <view class="text1">地址:<text>{{item.add}}</text></view>
+                        </view>
+                        <view class="logo">
+                            <image src="{{src}}" mode="widthFix">
+                            </image>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
         </view>
     </view>
 </mobile-main>

+ 48 - 1
pages/club/index.wxss

@@ -25,5 +25,52 @@
   font-size: var(--font14Size);
 }
 .main .two {
-  background-color: #0000ff;
+  flex-grow: 1;
+  position: relative;
+}
+.main .two .list {
+  display: flex;
+  flex-direction: row;
+  height: 120px;
+  padding: 2vw;
+  margin: 2vw 2vw 0;
+  border-radius: 10px;
+}
+.main .two .list .content {
+  flex-grow: 1;
+  z-index: 999;
+}
+.main .two .list .content .name {
+  font-size: var(--font18Szie);
+  text-align: center;
+  color: var(--whiteColor);
+}
+.main .two .list .content .text1 {
+  font-size: var(--font14Size);
+}
+.main .two .list .content .text1 text {
+  color: var(--whiteColor);
+}
+.main .two .list .logo {
+  margin: 5vw 0;
+}
+.main .two .list .logo image {
+  width: 80px;
+}
+.main .two .list:nth-child(1n) {
+  background-image: linear-gradient(to right, #44a2f0, #9bd1fd);
+}
+.main .two .list:nth-child(2n) {
+  background-image: linear-gradient(to right, #eb5299, #ffaed4);
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
 }

+ 1 - 1
pages/index/index.wxml

@@ -4,7 +4,7 @@
             <view>系统首页</view>
             <view>
                 <button type="primary" size="mini" bindtap="toCommon" data-route="register/index">去注册</button>
-                <button type="primary" size="mini" bindtap="toCommon" data-route="home/index">系统首页</button>
+                <button type="primary" size="mini" bindtap="toCommon" data-route="school/index">系统首页</button>
                 <!-- <button type="primary" size="mini" bindtap="toCommon" data-route="test/index">组件页面</button> -->
             </view>
         </view>

+ 7 - 11
pages/school/index.js

@@ -2,22 +2,16 @@ const app = getApp()
 Page({
     data: {
         frameStyle: { useTop: true, name: '羽校', leftArrow: false, useBar: true },
-        dialog: { title: '弹框标题', show: false, type: '1' }
+        user: {}
     },
     // 跳转菜单
     tabPath(e) {
         let { route } = e.detail.detail;
         if (route) wx.redirectTo({ url: `/${route}` })
     },
-    // 打开弹框
+    // 进入系统
     toJoin: function () {
-        const that = this;
-        that.setData({ dialog: { title: '弹框标题', show: true, type: '1' } });
-    },
-    // 关闭弹框
-    toClose: function () {
-        const that = this;
-        that.setData({ dialog: { title: '弹框标题', show: false, type: '1' } });
+        wx.navigateTo({ url: `/pages/smy/index` })
     },
     /**
      * 生命周期函数--监听页面加载
@@ -40,9 +34,11 @@ Page({
         const that = this;
         wx.getStorage({
             key: 'user',
-            success: async res => { },
+            success: async res => {
+                that.setData({ user: res.data })
+            },
             fail: async res => {
-                // wx.redirectTo({ url: '/pages/index/index' })
+                wx.redirectTo({ url: '/pages/index/index' })
             }
         })
     },

+ 1 - 2
pages/school/index.json

@@ -1,7 +1,6 @@
 {
     "component": true,
     "usingComponents": {
-        "mobile-main": "/commpents/mobile-frame/index",
-        "dialog": "/commpents/dialog/index"
+        "mobile-main": "/commpents/mobile-frame/index"
     }
 }

+ 1 - 1
pages/school/index.less

@@ -30,6 +30,6 @@
     }
 
     .two {
-        background-color: #0000ff;
+        background-color: #ffffff;
     }
 }

+ 2 - 9
pages/school/index.wxml

@@ -4,7 +4,7 @@
             <view class="one_1">
                 <input type="text" placeholder="请输入关键词" />
             </view>
-            <view class="one_2">
+            <view class="one_2" wx:if="{{user&&user._id}}">
                 <button type="primary" bindtap="toJoin">进入系统</button>
             </view>
         </view>
@@ -12,11 +12,4 @@
             学校
         </view>
     </view>
-</mobile-main>
-<dialog dialog="{{dialog}}" bind:toClose="toClose">
-    <view slot="info" class="dialog">
-        <view class="dialog_1" wx:if="{{dialog.type=='1'}}">
-            类型一
-        </view>
-    </view>
-</dialog>
+</mobile-main>

+ 1 - 1
pages/school/index.wxss

@@ -25,5 +25,5 @@
   font-size: var(--font14Size);
 }
 .main .two {
-  background-color: #0000ff;
+  background-color: #ffffff;
 }

+ 66 - 0
pages/setting/basic.js

@@ -0,0 +1,66 @@
+// pages/setting/basic.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
pages/setting/basic.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 0 - 0
pages/setting/basic.less


+ 2 - 0
pages/setting/basic.wxml

@@ -0,0 +1,2 @@
+<!--pages/setting/basic.wxml-->
+<text>pages/setting/basic.wxml</text>

+ 1 - 0
pages/setting/basic.wxss

@@ -0,0 +1 @@
+/* pages/setting/basic.wxss */

+ 66 - 0
pages/setting/contact.js

@@ -0,0 +1,66 @@
+// pages/setting/contact.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
pages/setting/contact.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 0 - 0
pages/setting/contact.less


+ 2 - 0
pages/setting/contact.wxml

@@ -0,0 +1,2 @@
+<!--pages/setting/contact.wxml-->
+<text>pages/setting/contact.wxml</text>

+ 1 - 0
pages/setting/contact.wxss

@@ -0,0 +1 @@
+/* pages/setting/contact.wxss */

+ 88 - 0
pages/smy/index.js

@@ -0,0 +1,88 @@
+const app = getApp();
+import { school_menu, school_sysmenu } from "../../utils/dict";
+
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '系统首页', leftArrow: true, useBar: false },
+        user: {},
+        list: []
+    },
+    // 返回
+    back: function () { wx.navigateBack({ delta: 1 }) },
+    // 功能跳转
+    toCommon: function (e) {
+        const { route, type } = e.currentTarget.dataset;
+        if (type && type == 'logout') {
+            // 退出登录
+            try { wx.clearStorage(); wx.redirectTo({ url: '/pages/index/index' }) }
+            catch (e) { console.log(e); }
+        } else {
+            wx.navigateTo({ url: `/pages/${route}` });
+        }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) { },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        const that = this;
+        // 监听用户是否登录
+        that.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                that.setData({ user: res.data })
+                let btnData = school_menu.find((i) => i.type == res.data.type);
+                that.setData({ list: [...btnData.menu, ...school_sysmenu] })
+                // const arr = await app.$get(`/newCourt/api/user/${res.data._id}`);
+                // if (arr.errcode == '0') { that.setData({ user: arr.data }) }
+                // else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }); }
+
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/smy/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+      "mobile-main": "/commpents/mobile-frame/index"
+    }
+  }

+ 138 - 0
pages/smy/index.less

@@ -0,0 +1,138 @@
+.main {
+    height: var(--twoHeight);
+    background-color: var(--mainColor);
+
+    .one {
+        position: relative;
+        width: 100vw;
+        height: 120px;
+        border-bottom: 1px solid var(--fcColor);
+        margin: 0 0 2vw 0;
+
+        .one_1 {
+            height: 80px;
+            background-color: #216EC7;
+            border-bottom-left-radius: 10px;
+            border-bottom-right-radius: 10px;
+            color: transparent;
+        }
+
+        .one_2 {
+            position: absolute;
+            top: 5vw;
+            width: 92vw;
+            height: 86px;
+            margin: 0 2vw;
+            padding: 2vw;
+            background-color: var(--whiteColor);
+            display: flex;
+            justify-content: space-between;
+
+            .l {
+                display: flex;
+                justify-content: start;
+                width: 72vw;
+
+                .l_1 {
+                    padding: 3vw 0;
+
+                    .icon {
+                        width: 60px;
+                        height: 60px;
+                        border-radius: 90px;
+                    }
+                }
+
+                .l_2 {
+                    width: 56vw;
+                    padding: 4vw 0 0 0;
+
+                    .info {
+                        margin: 0 0 2vw 0;
+                        padding: 0 2vw;
+                        font-size: var(--font16Size);
+                    }
+
+                    .info:nth-child(1) {
+                        font-weight: bold;
+                        font-size: var(--font18Size);
+                    }
+
+                    .info:nth-child(2) {
+                        color: var(--f85Color);
+                        font-size: var(--font15Size);
+                    }
+                }
+            }
+
+            .r {
+                padding: 8vw 0;
+                font-size: var(--font16Size);
+                color: var(--f85Color);
+            }
+        }
+    }
+
+    .two {
+        position: relative;
+        flex-grow: 1;
+
+        .list {
+            margin: 0 2vw 2vw 2vw;
+            padding: 2vw;
+            background-color: var(--f9Color);
+
+            .list_1 {
+                font-size: var(--font16Size);
+                margin: 0 0 2vw 0;
+
+                text {
+                    padding: 0 2vw 0 0;
+                }
+            }
+
+            .list_2 {
+                display: flex;
+                flex-direction: row;
+                justify-content: flex-start;
+                flex-wrap: wrap;
+
+                .btn {
+                    width: 28vw;
+                    margin: 0 4vw 2vw 0;
+                    padding: 2vw 0;
+                    background-color: var(--whiteColor);
+                    text-align: center;
+                    border-radius: 5px;
+
+                    .iconfont {
+                        display: inline-block;
+                        font-size: 25px;
+                        margin: 0 0 2vw 0;
+                    }
+
+                    .btn_1 {
+                        font-size: var(--font14Size);
+                    }
+                }
+
+                .btn:nth-child(3n) {
+                    margin: 0 0 2vw 0;
+                }
+            }
+        }
+    }
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 39 - 0
pages/smy/index.wxml

@@ -0,0 +1,39 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <view class="one_1">1</view>
+            <view class="one_2">
+                <view class="l">
+                    <view class="l_1">
+                        <image class="icon" src="{{user.icon&&user.icon.length>0?user.icon[0].url:''}}"></image>
+                    </view>
+                    <view class="l_2">
+                        <view class="info textOver">{{user.name}}</view>
+                        <view class="info textOver">{{user.phone}}</view>
+                    </view>
+                </view>
+                <view class="r">
+                    <text bindtap="toCommon" data-route="user/basic">详细></text>
+                </view>
+            </view>
+        </view>
+        <view class="two">
+            <scroll-view scroll-y="true" class="scroll-view">
+                <view class="list-scroll-view">
+                    <view class="list" wx:for="{{list}}" wx:key="item">
+                        <view class="list_1">
+                            <text class="iconfont {{item.icon}}"></text>
+                            <text class="title">{{item.title}}</text>
+                        </view>
+                        <view class="list_2">
+                            <view class="btn" wx:for="{{item.btn}}" wx:for-item="tag" wx:key="tagIndex" bindtap="toCommon" data-route="{{tag.route}}" data-type="{{tag.type}}">
+                                <text class="iconfont {{tag.icon}}"></text>
+                                <view class="btn_1 textOver">{{tag.title}}</view>
+                            </view>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
+    </view>
+</mobile-main>

+ 116 - 0
pages/smy/index.wxss

@@ -0,0 +1,116 @@
+.main {
+  height: var(--twoHeight);
+  background-color: var(--mainColor);
+}
+.main .one {
+  position: relative;
+  width: 100vw;
+  height: 120px;
+  border-bottom: 1px solid var(--fcColor);
+  margin: 0 0 2vw 0;
+}
+.main .one .one_1 {
+  height: 80px;
+  background-color: #216EC7;
+  border-bottom-left-radius: 10px;
+  border-bottom-right-radius: 10px;
+  color: transparent;
+}
+.main .one .one_2 {
+  position: absolute;
+  top: 5vw;
+  width: 92vw;
+  height: 86px;
+  margin: 0 2vw;
+  padding: 2vw;
+  background-color: var(--whiteColor);
+  display: flex;
+  justify-content: space-between;
+}
+.main .one .one_2 .l {
+  display: flex;
+  justify-content: start;
+  width: 72vw;
+}
+.main .one .one_2 .l .l_1 {
+  padding: 3vw 0;
+}
+.main .one .one_2 .l .l_1 .icon {
+  width: 60px;
+  height: 60px;
+  border-radius: 90px;
+}
+.main .one .one_2 .l .l_2 {
+  width: 56vw;
+  padding: 4vw 0 0 0;
+}
+.main .one .one_2 .l .l_2 .info {
+  margin: 0 0 2vw 0;
+  padding: 0 2vw;
+  font-size: var(--font16Size);
+}
+.main .one .one_2 .l .l_2 .info:nth-child(1) {
+  font-weight: bold;
+  font-size: var(--font18Size);
+}
+.main .one .one_2 .l .l_2 .info:nth-child(2) {
+  color: var(--f85Color);
+  font-size: var(--font15Size);
+}
+.main .one .one_2 .r {
+  padding: 8vw 0;
+  font-size: var(--font16Size);
+  color: var(--f85Color);
+}
+.main .two {
+  position: relative;
+  flex-grow: 1;
+}
+.main .two .list {
+  margin: 0 2vw 2vw 2vw;
+  padding: 2vw;
+  background-color: var(--f9Color);
+}
+.main .two .list .list_1 {
+  font-size: var(--font16Size);
+  margin: 0 0 2vw 0;
+}
+.main .two .list .list_1 text {
+  padding: 0 2vw 0 0;
+}
+.main .two .list .list_2 {
+  display: flex;
+  flex-direction: row;
+  justify-content: flex-start;
+  flex-wrap: wrap;
+}
+.main .two .list .list_2 .btn {
+  width: 28vw;
+  margin: 0 4vw 2vw 0;
+  padding: 2vw 0;
+  background-color: var(--whiteColor);
+  text-align: center;
+  border-radius: 5px;
+}
+.main .two .list .list_2 .btn .iconfont {
+  display: inline-block;
+  font-size: 25px;
+  margin: 0 0 2vw 0;
+}
+.main .two .list .list_2 .btn .btn_1 {
+  font-size: var(--font14Size);
+}
+.main .two .list .list_2 .btn:nth-child(3n) {
+  margin: 0 0 2vw 0;
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}

+ 73 - 0
pages/user/basic.js

@@ -0,0 +1,73 @@
+const app = getApp()
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '基本信息', leftArrow: true, useBar: false },
+        form: {}
+    },
+    // 跳转菜单
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) { },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        const that = this;
+        // 监听用户是否登录
+        that.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                that.setData({ form: res.data })
+                // const arr = await app.$get(`/newCourt/api/user/${res.data._id}`);
+                // if (arr.errcode == '0') { that.setData({ form: arr.data }) }
+                // else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }); }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/user/basic.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "mobile-main": "/commpents/mobile-frame/index"
+    }
+}

+ 19 - 0
pages/user/basic.less

@@ -0,0 +1,19 @@
+.main {
+    background-color: var(--mainColor);
+
+    .one {
+        .content {
+            display: flex;
+            flex-direction: row;
+            border-bottom: 1px dashed var(--fcColor);
+            padding: 2vw 0;
+            margin: 0 2vw 2vw 2vw;
+
+            .value {
+                flex-grow: 1;
+                color: var(--font16Size);
+
+            }
+        }
+    }
+}

+ 44 - 0
pages/user/basic.wxml

@@ -0,0 +1,44 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <form>
+                <view class="content">
+                    <view class="label">头像:</view>
+                    <view class="value">
+                        <image src="{{form.icon&&form.icon.length>0?form.icon[0].url:''}}" style="width:66px;height: 66px;"></image>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">姓名:</view>
+                    <view class="value">
+                        <input type="text" name="name" value="{{form.name}}" placeholder="请输入姓名" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">身份证号:</view>
+                    <view class="value">
+                        <input type="text" name="card" value="{{form.card}}" placeholder="请输入身份证号" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">性别:</view>
+                    <view class="value">
+                        {{form.gender=='0'?'男':form.gender=='1'?'女':form.gender=='2'?'未知':'暂无'}}
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">手机号:</view>
+                    <view class="value">
+                        <input type="text" name="phone" value="{{form.phone}}" placeholder="请输入手机号" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">用户类型:</view>
+                    <view class="value">
+                        {{form.type=='-1'?'超级管理员':form.type=='0'?'普通用户':form.type=='1'?'管理员':form.type=='2'?'教练用户':'暂无'}}
+                    </view>
+                </view>
+            </form>
+        </view>
+    </view>
+</mobile-main>

+ 14 - 0
pages/user/basic.wxss

@@ -0,0 +1,14 @@
+.main {
+  background-color: var(--mainColor);
+}
+.main .one .content {
+  display: flex;
+  flex-direction: row;
+  border-bottom: 1px dashed var(--fcColor);
+  padding: 2vw 0;
+  margin: 0 2vw 2vw 2vw;
+}
+.main .one .content .value {
+  flex-grow: 1;
+  color: var(--font16Size);
+}

+ 30 - 0
utils/dict.js

@@ -9,4 +9,34 @@ export const gender = [
     { label: '男', value: '0' },
     { label: '女', value: '1' },
     { label: '未知', value: '2' },
+];
+// 羽校系统菜单
+// -1: 管理员,0:普通用户,1:管理员,2:教练
+// 系统默认菜单
+export const school_sysmenu = [
+    {
+        title: '账号管理',
+        icon: 'icon-zhanghaoguanli',
+        btn: [
+            { title: '资料修改', route: 'setting/basic', icon: 'icon-weibiaoti1' },
+            { title: '联系我们', route: 'setting/contact', icon: 'icon-lianxiwomen' },
+            { title: '退出登录', route: '', type: 'logout', icon: 'icon-tuichudenglu' },
+        ]
+    },
+];
+export const school_menu = [
+    {
+        type: '-1',
+        menu: [
+            {
+                title: '用户管理',
+                icon: 'icon-yonghu',
+                btn: [
+                    { title: '管理用户', route: 'sadmin/list', icon: 'icon-xitongguanli-yonghuchaxun' },
+                    { title: '教练用户', route: 'scoach/list', icon: 'icon-jiaolian1' },
+                    { title: '普通用户', route: 'suser/list', icon: 'icon-putongyonghu' },
+                ]
+            },
+        ]
+    }
 ]