瀏覽代碼

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

guhongwei 2 年之前
父節點
當前提交
673d36ccf8

+ 1 - 0
app.json

@@ -36,6 +36,7 @@
         "pages/sonestustat/list",
         "pages/sonecoachstat/list",
         "pages/sthrfiles/list",
+        "pages/sthrcoach/list",
         "pages/sthrschool/list",
         "pages/sthropen/list",
         "pages/sthrprivate/list",

+ 123 - 0
pages/sthrcoach/list.js

@@ -0,0 +1,123 @@
+const app = getApp()
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '教练信息', leftArrow: true, useBar: false },
+        list: [],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
+        // 性别
+        genderList: [],
+        //运动等级
+        levelList: [],
+    },
+    // 返回
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    // 分页
+    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) {
+    },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        // 性别
+        arr = await app.$get(`/dict`, { code: 'gender' });
+        if (arr.errcode == '0' && arr.total > 0) {
+            let list = arr.data[0].list;
+            that.setData({ genderList: list })
+        }
+        // 运动等级
+        arr = await app.$get(`/dict`, { code: 'student_grade' });
+        if (arr.errcode == '0' && arr.total > 0) {
+            let list = arr.data[0].list;
+            that.setData({ levelList: list })
+        }
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        let genderList = that.data.genderList;
+        let levelList = that.data.levelList;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                let info = { skip: that.data.skip, limit: that.data.limit, student_id: res.data._id };
+                let arr = await app.$get(`/rsc`, { ...info });
+                if (arr.errcode == '0') {
+                    let list = [{ icon: [{ url: '/image/beijing.jpeg' }], id: '1', name: '教练名称', gender: '0', age: 22, phone: '12345678901', level: '0', honor: '荣誉' }]
+                    that.setData({ list: list })
+                    for (const val of arr.data) {
+                        let level = levelList.find(i => i.value == val.level); if (level) val.zhLevel = level.label;
+                        let gender = genderList.find(i => i.value == val.gender); if (gender) val.zhGender = level.label;
+                    }
+                    // that.setData({ list: [...that.data.list, ...arr.data] })
+                    // that.setData({ total: arr.total })
+                } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        const that = this;
+        // 监听用户是否登录
+        that.watchLogin();
+    },
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/sthrcoach/list.json

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

+ 101 - 0
pages/sthrcoach/list.less

@@ -0,0 +1,101 @@
+.main {
+    height: var(--twoHeight);
+
+    .one {
+        width: 96vw;
+        padding: 2vw;
+
+        input {
+            padding: 2vw;
+            background-color: var(--f1Color);
+            border-radius: 5px;
+        }
+    }
+
+    .two {
+        flex-grow: 1;
+        position: relative;
+        width: 96vw;
+        margin: 0 2vw 2vw 2vw;
+
+        .list {
+            display: flex;
+            flex-direction: column;
+            padding: 2vw;
+            margin: 0 0 2vw 0;
+            background-color: var(--mainColor);
+
+            .list_1 {
+                display: flex;
+                align-items: center;
+
+                .image {
+                    width: 90px;
+                    height: 90px;
+                }
+
+                .content {
+                    width: 65vw;
+                    margin: 0 0 0 2vw;
+
+                    .name {
+                        font-size: var(--font16Size);
+                        font-weight: bold;
+                        margin: 0 0 1vw 0;
+                        text-align: center;
+                        border-bottom: 1px dashed var(--f1Color);
+                    }
+
+                    .txt {
+                        font-size: var(--font14Size);
+                        padding: 0 0 1vw 0;
+                        border-bottom: 1px dashed var(--f1Color);
+                    }
+
+                    .txt text:nth-child(1) {
+                        color: #666;
+                    }
+
+                    .other {
+                        display: flex;
+                        flex-direction: row;
+                        justify-content: space-between;
+                        font-size: var(--font14Size);
+                        border-bottom: 1px dashed var(--f1Color);
+
+                        .other_1 {
+                            padding: 0 0 1vw 0;
+                        }
+
+                        .other_1 text:nth-child(1) {
+                            color: #666;
+                        }
+                    }
+                }
+            }
+
+            .btn {
+                width: 92vw;
+                text-align: center;
+                margin: 2vw 0 0 0;
+
+                button {
+                    background: -webkit-linear-gradient(right, lightblue, rgb(83, 201, 248));
+                }
+            }
+        }
+    }
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 31 - 0
pages/sthrcoach/list.wxml

@@ -0,0 +1,31 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <input type="text" placeholder="请输入关键词" />
+        </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="list_1">
+                            <image class="image" src="{{item.icon&&item.icon.length>0?item.icon[0].url:''}}"></image>
+                            <view class="content">
+                                <view class="name textOver">{{item.name||'暂无'}}</view>
+                                <view class="txt textOver"><text>联系电话:</text><text>{{item.phone||'暂无'}}</text></view>
+                                <view class="other textOver">
+                                    <view class="other_1 textOver"><text>性别:</text><text>{{item.zhGender||'暂无'}}</text></view>
+                                    <view class="other_1 textOver"><text>年龄:</text><text>{{item.age||'暂无'}}岁</text></view>
+                                </view>
+                                <view class="txt textOver"><text>教练等级:</text><text>{{item.zhLevel||'暂无'}}</text></view>
+                                <view class="txt textOver"><text>所获荣誉:</text><text>{{item.honor||'暂无'}}</text></view>
+                            </view>
+                        </view>
+                        <view class="btn">
+                            <button size="mini" type="primary" bindtap="toView" data-item="{{item}}">详细信息</button>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
+    </view>
+</mobile-main>

+ 84 - 0
pages/sthrcoach/list.wxss

@@ -0,0 +1,84 @@
+.main {
+  height: var(--twoHeight);
+}
+.main .one {
+  width: 96vw;
+  padding: 2vw;
+}
+.main .one input {
+  padding: 2vw;
+  background-color: var(--f1Color);
+  border-radius: 5px;
+}
+.main .two {
+  flex-grow: 1;
+  position: relative;
+  width: 96vw;
+  margin: 0 2vw 2vw 2vw;
+}
+.main .two .list {
+  display: flex;
+  flex-direction: column;
+  padding: 2vw;
+  margin: 0 0 2vw 0;
+  background-color: var(--mainColor);
+}
+.main .two .list .list_1 {
+  display: flex;
+  align-items: center;
+}
+.main .two .list .list_1 .image {
+  width: 90px;
+  height: 90px;
+}
+.main .two .list .list_1 .content {
+  width: 65vw;
+  margin: 0 0 0 2vw;
+}
+.main .two .list .list_1 .content .name {
+  font-size: var(--font16Size);
+  font-weight: bold;
+  margin: 0 0 1vw 0;
+  text-align: center;
+  border-bottom: 1px dashed var(--f1Color);
+}
+.main .two .list .list_1 .content .txt {
+  font-size: var(--font14Size);
+  padding: 0 0 1vw 0;
+  border-bottom: 1px dashed var(--f1Color);
+}
+.main .two .list .list_1 .content .txt text:nth-child(1) {
+  color: #666;
+}
+.main .two .list .list_1 .content .other {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  font-size: var(--font14Size);
+  border-bottom: 1px dashed var(--f1Color);
+}
+.main .two .list .list_1 .content .other .other_1 {
+  padding: 0 0 1vw 0;
+}
+.main .two .list .list_1 .content .other .other_1 text:nth-child(1) {
+  color: #666;
+}
+.main .two .list .btn {
+  width: 92vw;
+  text-align: center;
+  margin: 2vw 0 0 0;
+}
+.main .two .list .btn button {
+  background: -webkit-linear-gradient(right, lightblue, #53c9f8);
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}

+ 116 - 12
pages/sthrfiles/list.js

@@ -1,42 +1,139 @@
 const app = getApp()
+import WxValidate from '../../utils/wxValidate';
 Page({
     data: {
-        frameStyle: { useTop: true, name: '个人档案', leftArrow: true, useBar: false },
+        frameStyle: { useTop: true, name: '学员信息管理', leftArrow: true, useBar: false },
+        id: '',
+        form: { icon: [] },
+        // 性别
+        genderList: [],
+        //运动等级
+        levelList: [],
+    },
+    initValidate() {
+        const rules = { icon: { required: true }, name: { required: true }, age: { required: true }, gender: { required: true }, phone: { required: true, tel: true } }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { icon: { required: '请选择头像' }, name: { required: '请输入学员姓名' }, age: { required: '请输入年龄' }, gender: { required: '请选择性别' }, phone: { required: '请输入联系电话' } };
+        this.WxValidate = new WxValidate(rules, messages)
     },
     // 返回
-    back(e) {
+    back: function () {
         wx.navigateBack({ delta: 1 })
     },
+    //上传图片
+    imgUpl: function (e) {
+        const that = this;
+        let data = that.data.form.icon;
+        data.push(e.detail)
+        that.setData({ 'form.icon': data })
+    },
+    // 删除图片
+    imgDel: function (e) {
+        const that = this;
+        let list = that.data.form.icon;
+        let arr = list.filter((i, index) => index != e.detail.index)
+        that.setData({ 'form.icon': arr })
+    },
+    // 选择性别
+    genderChange: function (e) {
+        const that = this;
+        let data = that.data.genderList[e.detail.value];
+        if (data) {
+            that.setData({ 'form.gender': data.value });
+            that.setData({ 'form.zhGender': data.label });
+        }
+    },
+    // 选择等级
+    levelChange: function (e) {
+        const that = this;
+        let data = that.data.levelList[e.detail.value];
+        if (data) {
+            that.setData({ 'form.level': data.value });
+            that.setData({ 'form.zhLevel': data.label });
+        }
+    },
+    //提交
+    onSubmit: async function (e) {
+        const that = this;
+        const form = that.data.form;
+        const params = e.detail.value;
+        params.icon = form.icon;
+        if (!this.WxValidate.checkForm(params)) {
+            const error = this.WxValidate.errorList[0];
+            wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+            return false
+        } else {
+            let arr;
+            if (form._id) arr = await app.$post(`/student/${form._id}`, params);
+            if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
+            else wx.showToast({ title: `${errmsg}`, icon: 'error', duration: 2000 })
+        }
+    },
     /**
      * 生命周期函数--监听页面加载
      */
-    onLoad: function (options) { },
+    onLoad: async function (options) {
+        const that = this;
+        that.setData({ id: options.id || '' })
+        //验证规则函数
+        that.initValidate();
+        // 查询其他信息
+        await that.searchOther();
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        // 性别
+        arr = await app.$get(`/dict`, { code: 'gender' });
+        if (arr.errcode == '0' && arr.total > 0) {
+            let list = arr.data[0].list;
+            that.setData({ genderList: list })
+        }
+        // 运动等级
+        arr = await app.$get(`/dict`, { code: 'student_grade' });
+        if (arr.errcode == '0' && arr.total > 0) {
+            let list = arr.data[0].list;
+            that.setData({ levelList: list })
+        }
+    },
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
+        let genderList = that.data.genderList;
+        let levelList = that.data.levelList;
         wx.getStorage({
             key: 'user',
-            success: async res => { },
+            success: async res => {
+                const arr = await app.$get(`/student/${res.data?.info?._id}`);
+                if (arr.errcode == '0') {
+                    let gender = genderList.find(i => i.value == arr.data.gender)
+                    if (gender) arr.data.zhGender = gender.label;
+                    let level = levelList.find(i => i.value == arr.data.level)
+                    if (level) arr.data.zhLevel = level.label;
+                    that.setData({ form: arr.data });
+                }
+            },
             fail: async res => {
-                // wx.redirectTo({ url: '/pages/index/index' })
+                wx.redirectTo({ url: '/pages/index/index' })
             }
         })
     },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
-    onReady: function () { },
+    onReady: function () {
+
+    },
+
     /**
      * 生命周期函数--监听页面显示
      */
     onShow: function () {
-        const that = this;
-        // 监听用户是否登录
-        that.watchLogin();
+
     },
-    /**
-     * 页面上拉触底事件的处理函数
-     */
+
     /**
      * 生命周期函数--监听页面隐藏
      */
@@ -58,6 +155,13 @@ Page({
 
     },
 
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
     /**
      * 用户点击右上角分享
      */

+ 6 - 5
pages/sthrfiles/list.json

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

+ 32 - 1
pages/sthrfiles/list.less

@@ -1,4 +1,35 @@
 .main {
+    height: var(--twoHeight);
     background-color: var(--mainColor);
-}
 
+    .one {
+        .content {
+            display: flex;
+            flex-direction: row;
+            border-bottom: 1px dashed var(--f1Color);
+            padding: 2vw 0;
+            margin: 0 2vw 2vw 2vw;
+
+            .value {
+                flex-grow: 1;
+                color: var(--blackColor);
+
+                textarea {
+                    position: static;
+                    width: 73vw;
+                }
+            }
+        }
+
+        .btn {
+            text-align: center;
+            margin: 5vw 0 0 0;
+
+            button {
+                width: 40vw;
+                margin: 0 2vw;
+                padding: 1vw 0;
+            }
+        }
+    }
+}

+ 66 - 1
pages/sthrfiles/list.wxml

@@ -1,5 +1,70 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
-        1
+        <view class="one">
+            <form catchsubmit="onSubmit">
+                <view class="content">
+                    <view class="label">头像:</view>
+                    <view class="value">
+                        <upload list="{{form.icon}}" count="{{1}}" previewSize="{{30}}" bind:imgUpload="imgUpl" bind:imgDel="imgDel"></upload>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">姓名:</view>
+                    <view class="value">
+                        <input type="text" name="name" value="{{form.name}}" placeholder="请输入姓名" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">性别:</view>
+                    <view class="value">
+                        <picker mode="selector" bindchange="genderChange" name="gender" value="{{form.gender}}" range="{{genderList}}" range-key="label">
+                            <view class="picker">{{form.zhGender||'请选择性别'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">年龄:</view>
+                    <view class="value">
+                        <input type="number" name="age" value="{{form.age}}" placeholder="请输入年龄" />
+                    </view>
+                </view>
+
+                <view class="content">
+                    <view class="label">联系电话:</view>
+                    <view class="value">
+                        <input type="text" name="phone" value="{{form.phone}}" placeholder="请输入联系电话" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">运动等级:</view>
+                    <view class="value">
+                        <picker mode="selector" bindchange="levelChange" name="level" value="{{form.level}}" range="{{levelList}}" range-key="label">
+                            <view class="picker">{{form.zhLevel||'请选择运动等级'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">学员简介:</view>
+                    <view class="value">
+                        <textarea name="brief" maxlength="-1" auto-height value="{{form.brief}}" placeholder="请输入学员简介" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">过往荣誉:</view>
+                    <view class="value">
+                        <textarea name="honer" maxlength="-1" auto-height value="{{form.honer}}" placeholder="请输入过往荣誉" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">训练经历:</view>
+                    <view class="value">
+                        <textarea name="exp" maxlength="-1" auto-height value="{{form.exp}}" placeholder="请输入训练经历" />
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
     </view>
 </mobile-main>

+ 25 - 0
pages/sthrfiles/list.wxss

@@ -1,3 +1,28 @@
 .main {
+  height: var(--twoHeight);
   background-color: var(--mainColor);
 }
+.main .one .content {
+  display: flex;
+  flex-direction: row;
+  border-bottom: 1px dashed var(--f1Color);
+  padding: 2vw 0;
+  margin: 0 2vw 2vw 2vw;
+}
+.main .one .content .value {
+  flex-grow: 1;
+  color: var(--blackColor);
+}
+.main .one .content .value textarea {
+  position: static;
+  width: 73vw;
+}
+.main .one .btn {
+  text-align: center;
+  margin: 5vw 0 0 0;
+}
+.main .one .btn button {
+  width: 40vw;
+  margin: 0 2vw;
+  padding: 1vw 0;
+}

+ 47 - 3
pages/sthropen/list.js

@@ -2,23 +2,67 @@ const app = getApp()
 Page({
     data: {
         frameStyle: { useTop: true, name: '公开课信息', leftArrow: true, useBar: false },
+        list: [],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
+        //类型
+        typeList: [],
+        //状态
+        statusList: []
     },
     // 返回
     back(e) {
         wx.navigateBack({ delta: 1 })
     },
+    // 分页
+    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) {
+    },
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
+        let typeList = that.data.typeList;
+        let statusList = that.data.statusList;
         wx.getStorage({
             key: 'user',
-            success: async res => { },
+            success: async res => {
+                let info = { skip: that.data.skip, limit: that.data.limit, type: '1' };
+                let arr = await app.$get(`/lesson`, { ...info });
+                if (arr.errcode == '0') {
+                    let list = [{ id: '1', title: '测试名称', class_hour: 10, money: 10, type: '1', time: '2022-08-17', status: '0' }]
+                    that.setData({ list: list })
+                    for (const val of arr.data) {
+                        if (val.student.length > 0) {
+                            let student = val.student.find(i => i._id == res.data._id);
+                            if (student) { let list = []; list.push(val); }
+                        }
+                        let type = typeList.find(i => i.value == val.type); if (type) val.zhType = type.label;
+                        let status = statusList.find(i => i.value == val.status); if (status) val.zhStatus = status.label;
+                    }
+                    // that.setData({ list: [...that.data.list, ...list] })
+                    // that.setData({ total: arr.total })
+                } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+            },
             fail: async res => {
-                // wx.redirectTo({ url: '/pages/index/index' })
+                wx.redirectTo({ url: '/pages/index/index' })
             }
         })
     },

+ 78 - 1
pages/sthropen/list.less

@@ -1,4 +1,81 @@
 .main {
-    background-color: var(--mainColor);
+    height: var(--twoHeight);
+
+    .one {
+        width: 96vw;
+        padding: 2vw;
+
+        input {
+            padding: 2vw;
+            background-color: var(--f1Color);
+            border-radius: 5px;
+        }
+    }
+
+    .two {
+        flex-grow: 1;
+        position: relative;
+        width: 96vw;
+        margin: 0 2vw 2vw 2vw;
+
+        .list {
+            display: flex;
+            flex-direction: column;
+            padding: 2vw;
+            margin: 0 0 2vw 0;
+            background-color: var(--mainColor);
+
+            .list_1 {
+                .name {
+                    font-size: var(--font16Size);
+                    font-weight: bold;
+                    margin: 0 0 1vw 0;
+                    text-align: center;
+                }
+
+                .other {
+                    display: flex;
+                    flex-direction: column;
+                    width: 90vw;
+                    justify-content: space-between;
+                    border-top: 1px dashed var(--f1Color);
+                    border-bottom: 1px dashed var(--f1Color);
+                    padding: 1vw;
+                    font-size: var(--font14Size);
+                    margin: 0 0 1vw 0;
+
+                    .other_1 {
+                        padding: 0 0 1vw 0;
+                    }
+
+                    .other_1 text:nth-child(1) {
+                        color: #666;
+                    }
+                }
+            }
+
+            .btn {
+                width: 92vw;
+                text-align: center;
+                margin: 2vw 0 0 0;
+
+                button {
+                    background: -webkit-linear-gradient(right, lightblue, rgb(83, 201, 248));
+                }
+            }
+        }
+    }
 }
 
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 24 - 1
pages/sthropen/list.wxml

@@ -1,5 +1,28 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
-        1
+        <view class="one">
+            <input type="text" placeholder="请输入关键词" />
+        </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="list_1">
+                            <view class="name textOver">{{item.title||'暂无'}}</view>
+                            <view class="other">
+                                <view class="other_1 textOver"><text>课时:</text><text>{{item.class_hour||'暂无'}}小时</text></view>
+                                <view class="other_1 textOver"><text>金额:</text><text>¥{{item.money||'暂无'}}元</text></view>
+                                <view class="other_1 textOver"><text>类型:</text><text>{{item.zhType||'暂无'}}</text></view>
+                                <view class="other_1 textOver"><text>上课时间:</text><text>{{item.time||'暂无'}}</text></view>
+                                <view class="other_1 textOver"><text>状态:</text><text>{{item.zhStatus||'暂无'}}</text></view>
+                            </view>
+                        </view>
+                        <view class="btn">
+                            <button size="mini" type="primary" bindtap="toView" data-item="{{item}}">详细信息</button>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
     </view>
 </mobile-main>

+ 64 - 0
pages/sthropen/list.wxss

@@ -1,3 +1,67 @@
 .main {
+  height: var(--twoHeight);
+}
+.main .one {
+  width: 96vw;
+  padding: 2vw;
+}
+.main .one input {
+  padding: 2vw;
+  background-color: var(--f1Color);
+  border-radius: 5px;
+}
+.main .two {
+  flex-grow: 1;
+  position: relative;
+  width: 96vw;
+  margin: 0 2vw 2vw 2vw;
+}
+.main .two .list {
+  display: flex;
+  flex-direction: column;
+  padding: 2vw;
+  margin: 0 0 2vw 0;
   background-color: var(--mainColor);
 }
+.main .two .list .list_1 .name {
+  font-size: var(--font16Size);
+  font-weight: bold;
+  margin: 0 0 1vw 0;
+  text-align: center;
+}
+.main .two .list .list_1 .other {
+  display: flex;
+  flex-direction: column;
+  width: 90vw;
+  justify-content: space-between;
+  border-top: 1px dashed var(--f1Color);
+  border-bottom: 1px dashed var(--f1Color);
+  padding: 1vw;
+  font-size: var(--font14Size);
+  margin: 0 0 1vw 0;
+}
+.main .two .list .list_1 .other .other_1 {
+  padding: 0 0 1vw 0;
+}
+.main .two .list .list_1 .other .other_1 text:nth-child(1) {
+  color: #666;
+}
+.main .two .list .btn {
+  width: 92vw;
+  text-align: center;
+  margin: 2vw 0 0 0;
+}
+.main .two .list .btn button {
+  background: -webkit-linear-gradient(right, lightblue, #53c9f8);
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}

+ 47 - 3
pages/sthrprivate/list.js

@@ -2,23 +2,67 @@ const app = getApp()
 Page({
     data: {
         frameStyle: { useTop: true, name: '私教课信息', leftArrow: true, useBar: false },
+        list: [],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
+        //类型
+        typeList: [],
+        //状态
+        statusList: []
     },
     // 返回
     back(e) {
         wx.navigateBack({ delta: 1 })
     },
+    // 分页
+    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) {
+    },
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
+        let typeList = that.data.typeList;
+        let statusList = that.data.statusList;
         wx.getStorage({
             key: 'user',
-            success: async res => { },
+            success: async res => {
+                let info = { skip: that.data.skip, limit: that.data.limit, type: '1' };
+                let arr = await app.$get(`/lesson`, { ...info });
+                if (arr.errcode == '0') {
+                    let list = [{ id: '1', title: '测试名称', class_hour: 10, money: 10, type: '1', time: '2022-08-17', status: '0' }]
+                    that.setData({ list: list })
+                    for (const val of arr.data) {
+                        if (val.student.length > 0) {
+                            let student = val.student.find(i => i._id == res.data._id);
+                            if (student) { let list = []; list.push(val); }
+                        }
+                        let type = typeList.find(i => i.value == val.type); if (type) val.zhType = type.label;
+                        let status = statusList.find(i => i.value == val.status); if (status) val.zhStatus = status.label;
+                    }
+                    // that.setData({ list: [...that.data.list, ...list] })
+                    // that.setData({ total: arr.total })
+                } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+            },
             fail: async res => {
-                // wx.redirectTo({ url: '/pages/index/index' })
+                wx.redirectTo({ url: '/pages/index/index' })
             }
         })
     },

+ 78 - 1
pages/sthrprivate/list.less

@@ -1,4 +1,81 @@
 .main {
-    background-color: var(--mainColor);
+    height: var(--twoHeight);
+
+    .one {
+        width: 96vw;
+        padding: 2vw;
+
+        input {
+            padding: 2vw;
+            background-color: var(--f1Color);
+            border-radius: 5px;
+        }
+    }
+
+    .two {
+        flex-grow: 1;
+        position: relative;
+        width: 96vw;
+        margin: 0 2vw 2vw 2vw;
+
+        .list {
+            display: flex;
+            flex-direction: column;
+            padding: 2vw;
+            margin: 0 0 2vw 0;
+            background-color: var(--mainColor);
+
+            .list_1 {
+                .name {
+                    font-size: var(--font16Size);
+                    font-weight: bold;
+                    margin: 0 0 1vw 0;
+                    text-align: center;
+                }
+
+                .other {
+                    display: flex;
+                    flex-direction: column;
+                    width: 90vw;
+                    justify-content: space-between;
+                    border-top: 1px dashed var(--f1Color);
+                    border-bottom: 1px dashed var(--f1Color);
+                    padding: 1vw;
+                    font-size: var(--font14Size);
+                    margin: 0 0 1vw 0;
+
+                    .other_1 {
+                        padding: 0 0 1vw 0;
+                    }
+
+                    .other_1 text:nth-child(1) {
+                        color: #666;
+                    }
+                }
+            }
+
+            .btn {
+                width: 92vw;
+                text-align: center;
+                margin: 2vw 0 0 0;
+
+                button {
+                    background: -webkit-linear-gradient(right, lightblue, rgb(83, 201, 248));
+                }
+            }
+        }
+    }
 }
 
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 24 - 1
pages/sthrprivate/list.wxml

@@ -1,5 +1,28 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
-        1
+        <view class="one">
+            <input type="text" placeholder="请输入关键词" />
+        </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="list_1">
+                            <view class="name textOver">{{item.title||'暂无'}}</view>
+                            <view class="other">
+                                <view class="other_1 textOver"><text>课时:</text><text>{{item.class_hour||'暂无'}}小时</text></view>
+                                <view class="other_1 textOver"><text>金额:</text><text>¥{{item.money||'暂无'}}元</text></view>
+                                <view class="other_1 textOver"><text>类型:</text><text>{{item.zhType||'暂无'}}</text></view>
+                                <view class="other_1 textOver"><text>上课时间:</text><text>{{item.time||'暂无'}}</text></view>
+                                <view class="other_1 textOver"><text>状态:</text><text>{{item.zhStatus||'暂无'}}</text></view>
+                            </view>
+                        </view>
+                        <view class="btn">
+                            <button size="mini" type="primary" bindtap="toView" data-item="{{item}}">详细信息</button>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
     </view>
 </mobile-main>

+ 64 - 0
pages/sthrprivate/list.wxss

@@ -1,3 +1,67 @@
 .main {
+  height: var(--twoHeight);
+}
+.main .one {
+  width: 96vw;
+  padding: 2vw;
+}
+.main .one input {
+  padding: 2vw;
+  background-color: var(--f1Color);
+  border-radius: 5px;
+}
+.main .two {
+  flex-grow: 1;
+  position: relative;
+  width: 96vw;
+  margin: 0 2vw 2vw 2vw;
+}
+.main .two .list {
+  display: flex;
+  flex-direction: column;
+  padding: 2vw;
+  margin: 0 0 2vw 0;
   background-color: var(--mainColor);
 }
+.main .two .list .list_1 .name {
+  font-size: var(--font16Size);
+  font-weight: bold;
+  margin: 0 0 1vw 0;
+  text-align: center;
+}
+.main .two .list .list_1 .other {
+  display: flex;
+  flex-direction: column;
+  width: 90vw;
+  justify-content: space-between;
+  border-top: 1px dashed var(--f1Color);
+  border-bottom: 1px dashed var(--f1Color);
+  padding: 1vw;
+  font-size: var(--font14Size);
+  margin: 0 0 1vw 0;
+}
+.main .two .list .list_1 .other .other_1 {
+  padding: 0 0 1vw 0;
+}
+.main .two .list .list_1 .other .other_1 text:nth-child(1) {
+  color: #666;
+}
+.main .two .list .btn {
+  width: 92vw;
+  text-align: center;
+  margin: 2vw 0 0 0;
+}
+.main .two .list .btn button {
+  background: -webkit-linear-gradient(right, lightblue, #53c9f8);
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}

+ 33 - 3
pages/sthrschool/list.js

@@ -2,23 +2,53 @@ const app = getApp()
 Page({
     data: {
         frameStyle: { useTop: true, name: '羽校信息', leftArrow: true, useBar: false },
+        list: [],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
     },
     // 返回
     back(e) {
         wx.navigateBack({ delta: 1 })
     },
+    // 分页
+    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) {
+    },
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
         wx.getStorage({
             key: 'user',
-            success: async res => { },
+            success: async res => {
+                let info = { skip: that.data.skip, limit: that.data.limit, student_id: res.data._id };
+                let arr = await app.$get(`/rss`, { ...info });
+                if (arr.errcode == '0') {
+                    let list = [{ img_url: [{ url: '/image/beijing.jpeg' }], id: '1', name: '学校名称', coach_num: 9, student_num: 22, address: '地址', brief: '简介', phone: '12345678901' }]
+                    that.setData({ list: list })
+                    // that.setData({ list: [...that.data.list, ...arr.data] })
+                    // that.setData({ total: arr.total })
+                } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+            },
             fail: async res => {
-                // wx.redirectTo({ url: '/pages/index/index' })
+                wx.redirectTo({ url: '/pages/index/index' })
             }
         })
     },

+ 98 - 1
pages/sthrschool/list.less

@@ -1,4 +1,101 @@
 .main {
-    background-color: var(--mainColor);
+    height: var(--twoHeight);
+
+    .one {
+        width: 96vw;
+        padding: 2vw;
+
+        input {
+            padding: 2vw;
+            background-color: var(--f1Color);
+            border-radius: 5px;
+        }
+    }
+
+    .two {
+        flex-grow: 1;
+        position: relative;
+        width: 96vw;
+        margin: 0 2vw 2vw 2vw;
+
+        .list {
+            display: flex;
+            flex-direction: column;
+            padding: 2vw;
+            margin: 0 0 2vw 0;
+            background-color: var(--mainColor);
+
+            .list_1 {
+                display: flex;
+                align-items: center;
+
+                .image {
+                    width: 90px;
+                    height: 90px;
+                }
+
+                .content {
+                    width: 65vw;
+                    margin: 0 0 0 2vw;
+
+                    .name {
+                        font-size: var(--font16Size);
+                        font-weight: bold;
+                        margin: 0 0 1vw 0;
+                        text-align: center;
+                        border-bottom: 1px dashed var(--f1Color);
+                    }
+
+                    .txt {
+                        font-size: var(--font14Size);
+                        padding: 0 0 1vw 0;
+                        border-bottom: 1px dashed var(--f1Color);
+                    }
+
+                    .txt text:nth-child(1) {
+                        color: #666;
+                    }
+
+                    .other {
+                        display: flex;
+                        flex-direction: row;
+                        justify-content: space-between;
+                        font-size: var(--font14Size);
+                        border-bottom: 1px dashed var(--f1Color);
+
+                        .other_1 {
+                            padding: 0 0 1vw 0;
+                        }
+
+                        .other_1 text:nth-child(1) {
+                            color: #666;
+                        }
+                    }
+                }
+            }
+
+            .btn {
+                width: 92vw;
+                text-align: center;
+                margin: 2vw 0 0 0;
+
+                button {
+                    background: -webkit-linear-gradient(right, lightblue, rgb(83, 201, 248));
+                }
+            }
+        }
+    }
 }
 
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 27 - 1
pages/sthrschool/list.wxml

@@ -1,5 +1,31 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
-        1
+        <view class="one">
+            <input type="text" placeholder="请输入关键词" />
+        </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="list_1">
+                            <image class="image" src="{{item.img_url&&item.img_url.length>0?item.img_url[0].url:''}}"></image>
+                            <view class="content">
+                                <view class="name textOver">{{item.name||'暂无'}}</view>
+                                <view class="txt textOver"><text>联系电话:</text><text>{{item.phone||'暂无'}}</text></view>
+                                <view class="other textOver">
+                                    <view class="other_1 textOver"><text>教练人数:</text><text>{{item.coach_num||'0'}}人</text></view>
+                                    <view class="other_1 textOver"><text>学员人数:</text><text>{{item.student_num||'0'}}人</text></view>
+                                </view>
+                                <view class="txt textOver"><text>训练地址:</text><text>{{item.address||'暂无'}}</text></view>
+                                <view class="txt textOver"><text>羽校简介:</text><text>{{item.brief||'暂无'}}</text></view>
+                            </view>
+                        </view>
+                        <view class="btn">
+                            <button size="mini" type="primary" bindtap="toView" data-item="{{item}}">详细信息</button>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
     </view>
 </mobile-main>

+ 81 - 0
pages/sthrschool/list.wxss

@@ -1,3 +1,84 @@
 .main {
+  height: var(--twoHeight);
+}
+.main .one {
+  width: 96vw;
+  padding: 2vw;
+}
+.main .one input {
+  padding: 2vw;
+  background-color: var(--f1Color);
+  border-radius: 5px;
+}
+.main .two {
+  flex-grow: 1;
+  position: relative;
+  width: 96vw;
+  margin: 0 2vw 2vw 2vw;
+}
+.main .two .list {
+  display: flex;
+  flex-direction: column;
+  padding: 2vw;
+  margin: 0 0 2vw 0;
   background-color: var(--mainColor);
 }
+.main .two .list .list_1 {
+  display: flex;
+  align-items: center;
+}
+.main .two .list .list_1 .image {
+  width: 90px;
+  height: 90px;
+}
+.main .two .list .list_1 .content {
+  width: 65vw;
+  margin: 0 0 0 2vw;
+}
+.main .two .list .list_1 .content .name {
+  font-size: var(--font16Size);
+  font-weight: bold;
+  margin: 0 0 1vw 0;
+  text-align: center;
+  border-bottom: 1px dashed var(--f1Color);
+}
+.main .two .list .list_1 .content .txt {
+  font-size: var(--font14Size);
+  padding: 0 0 1vw 0;
+  border-bottom: 1px dashed var(--f1Color);
+}
+.main .two .list .list_1 .content .txt text:nth-child(1) {
+  color: #666;
+}
+.main .two .list .list_1 .content .other {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  font-size: var(--font14Size);
+  border-bottom: 1px dashed var(--f1Color);
+}
+.main .two .list .list_1 .content .other .other_1 {
+  padding: 0 0 1vw 0;
+}
+.main .two .list .list_1 .content .other .other_1 text:nth-child(1) {
+  color: #666;
+}
+.main .two .list .btn {
+  width: 92vw;
+  text-align: center;
+  margin: 2vw 0 0 0;
+}
+.main .two .list .btn button {
+  background: -webkit-linear-gradient(right, lightblue, #53c9f8);
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}

+ 2 - 1
utils/dict.js

@@ -86,10 +86,11 @@ export const school_menu = [
         type: '3',
         menu: [
             {
-                title: '档案管理',
+                title: '信息管理',
                 icon: 'icon-yonghu',
                 btn: [
                     { title: '个人档案', route: 'sthrfiles/list', icon: 'icon-weibiaoti1' },
+                    { title: '教练信息', route: 'sthrcoach/list', icon: 'icon-weibiaoti1' },
                 ]
             },
             {