YY преди 2 години
родител
ревизия
95114db25a

+ 2 - 0
app.json

@@ -26,8 +26,10 @@
         "pages/setting/contact",
         "pages/soneschool/list",
         "pages/sonecoach/list",
+        "pages/sonecoach/add",
         "pages/sonefee/list",
         "pages/sonestudent/list",
+        "pages/sonestudent/add",
         "pages/soneopen/list",
         "pages/soneprivate/list",
         "pages/sonecourse/list",

+ 166 - 0
pages/sonecoach/add.js

@@ -0,0 +1,166 @@
+const app = getApp()
+import WxValidate from '../../utils/wxValidate'
+
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '教练信息', leftArrow: true, useBar: false },
+        id: '',
+        school_id: '',
+        form: { icon: [] },
+        // 性别
+        genderList: [],
+        // 等级列表
+        levelList: [],
+    },
+    initValidate() {
+        const rules = { icon: { required: true }, name: { required: true }, gender: { required: true }, age: { required: true }, phone: { required: true, tel: true } }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { icon: { required: '请选择头像', }, name: { required: '请输入用户姓名', }, gender: { required: '请选择性别', }, age: { required: '请输入年龄', }, phone: { required: '请输入联系电话', } };
+        this.WxValidate = new WxValidate(rules, messages)
+    },
+    // 返回
+    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 });
+        }
+    },
+    //选择等级
+    coachChange: 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 params = e.detail.value;
+        const form = that.data.form;
+        params.icon = form.icon;
+        params.school_id = that.data.school_id;
+        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(`/coach/${form._id}`, params); }
+            else { arr = await app.$post(`/coach`, params); console.log(params); }
+            if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
+            else wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+        }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const that = this;
+        that.setData({ id: options.id || '' })
+        //验证规则函数
+        that.initValidate();
+        // 监听用户是否登录
+        that.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                that.setData({ school_id: res.data.info.id })
+                const aee = await app.$get(`/dict`, { code: "coach_grade" });
+                if (aee.errcode == '0' && aee.total > 0) that.setData({ levelList: aee.data[0].list });
+                const ree = await app.$get(`/dict`, { code: "gender" });
+                if (ree.errcode == '0' && ree.total > 0) that.setData({ genderList: ree.data[0].list });
+                if (that.data.id) {
+                    const arr = await app.$get(`/coach/${that.data.id}`);
+                    if (arr.errcode == '0') {
+                        let gender = that.data.genderList.find(i => i.value == arr.data.gender)
+                        if (gender) arr.data.zhGender = gender.label;
+                        let level = that.data.levelList.find(i => i.value == arr.data.level)
+                        if (level) arr.data.zhLevel = level.label;
+                        that.setData({ form: arr.data });
+                    }
+                }
+            },
+            fail: res => {
+                wx.redirectTo({ url: '/pages/index/index', })
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 7 - 0
pages/sonecoach/add.json

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

+ 53 - 0
pages/sonecoach/add.less

@@ -0,0 +1,53 @@
+.main {
+    background-color: var(--mainColor);
+    height: var(--twoHeight);
+
+    .one {
+        flex-grow: 1;
+        position: relative;
+        height: 81vh;
+
+        .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;
+        }
+    }
+
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 73 - 0
pages/sonecoach/add.wxml

@@ -0,0 +1,73 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <form catchsubmit="onSubmit">
+            <view class="one">
+                <scroll-view scroll-y="true" class="scroll-view">
+                    <view class="list-scroll-view">
+                        <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 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="number" name="phone" maxlength="11" value="{{form.phone}}" placeholder="请输入联系电话" />
+                            </view>
+                        </view>
+                        <view class="content">
+                            <view class="label">教练等级:</view>
+                            <view class="value">
+                                <picker mode="selector" bindchange="coachChange" 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" value="{{form.brief}}" auto-height maxlength="-1" placeholder="请输入教练简介" />
+                            </view>
+                        </view>
+                        <view class="content">
+                            <view class="label">过往荣誉:</view>
+                            <view class="value">
+                                <textarea name="honor" value="{{form.honor}}" auto-height maxlength="-1" placeholder="请输入过往荣誉" />
+                            </view>
+                        </view>
+                        <view class="content">
+                            <view class="label">教学经历:</view>
+                            <view class="value">
+                                <textarea name="exp" value="{{form.exp}}" auto-height maxlength="-1" placeholder="请输入教学经历" />
+                            </view>
+                        </view>
+                    </view>
+                </scroll-view>
+            </view>
+            <view class="btn">
+                <button type="primary" size="mini" formType="submit">提交保存</button>
+            </view>
+        </form>
+    </view>
+</mobile-main>

+ 44 - 0
pages/sonecoach/add.wxss

@@ -0,0 +1,44 @@
+.main {
+  background-color: var(--mainColor);
+  height: var(--twoHeight);
+}
+.main .one {
+  flex-grow: 1;
+  position: relative;
+  height: 81vh;
+}
+.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 .btn {
+  text-align: center;
+  margin: 5vw 0 0 0;
+}
+.main .btn button {
+  width: 40vw;
+  margin: 0 2vw;
+  padding: 1vw 0;
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}

+ 137 - 16
pages/sonecoach/list.js

@@ -1,31 +1,121 @@
 const app = getApp()
+import QRCode from '../../utils/weapp-qrcode.js';
+
 Page({
+
+    /**
+     * 页面的初始数据
+     */
     data: {
         frameStyle: { useTop: true, name: '教练信息', leftArrow: true, useBar: false },
+        list: [],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
+        // 等级列表
+        levelList: [],
+        // dialog弹框
+        dialog: { title: '账号绑定', show: false, type: '1' },
+        form: {}
+
     },
     // 返回
-    back(e) {
+    back: function () {
         wx.navigateBack({ delta: 1 })
     },
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) { },
-    // 监听用户是否登录
-    watchLogin: async function () {
+    // 添加
+    toAdd() {
         const that = this;
-        wx.getStorage({
-            key: 'user',
-            success: async res => { },
-            fail: async res => {
-                // wx.redirectTo({ url: '/pages/index/index' })
+        that.setData({ skip: 0, page: 0, list: [] })
+        wx.navigateTo({ url: '/pages/sonecoach/add' })
+    },
+    // 修改
+    toEdit: function (e) {
+        const that = this;
+        let { item } = e.currentTarget.dataset;
+        that.setData({ skip: 0, page: 0, list: [] })
+        wx.navigateTo({ url: `/pages/sonecoach/add?id=${item.coach_id}` })
+    },
+    // 删除
+    toDel: async function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认删除该条数据?',
+            async success(res) {
+                if (res.confirm) {
+                    const arr = await app.$delete(`/school/${item.id}`);
+                    if (arr.errcode == '0') {
+                        wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
+                        that.setData({ skip: 0, page: 0, list: [] })
+                        that.watchLogin()
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
             }
         })
     },
+    // 绑定账号
+    toBind: async function (e) {
+        const that = this;
+        let { item } = e.currentTarget.dataset;
+        const arr = await app.$get(`/coach/${item.id}`);
+        if (arr.errcode == '0') {
+            that.setData({ form: arr.data })
+            // 生成二维码
+            that.makeQRCode();
+            that.setData({ dialog: { title: '账号绑定', show: true, type: '1' } })
+        } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+    },
+    makeQRCode(template = 0) {
+        const that = this;
+        const url = `${app.globalData.publicUrl}/courtappbind?id=${that.data.form.id}&type='2'`;
+        var qrcode = new QRCode(`myQrcode`, {
+            text: url,
+            width: 110,
+            height: 110,
+            padding: 3,
+            colorDark: "#000000",
+            colorLight: "#ffffff",
+            correctLevel: QRCode.CorrectLevel.L,
+        });
+    },
+
+    // 关闭弹框
+    toClose: function () {
+        const that = this;
+        that.setData({ form: {} })
+        that.setData({ dialog: { title: '账号绑定', show: false, type: '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) { },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
-    onReady: function () { },
+    onReady: function () {
+
+    },
+
     /**
      * 生命周期函数--监听页面显示
      */
@@ -34,9 +124,33 @@ Page({
         // 监听用户是否登录
         that.watchLogin();
     },
-    /**
-     * 页面上拉触底事件的处理函数
-     */
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                // 教练等级
+                let aee = await app.$get(`/dict`, { code: 'coach_grade' });
+                if (aee.errcode == '0' && aee.total > 0) that.setData({ levelList: aee.data[0].list })
+                let info = { skip: that.data.skip, limit: that.data.limit, school_id: res.data.info.id };
+                const arr = await app.$get(`/rcs`, { ...info });
+                if (arr.errcode == '0') {
+                    for (const val of arr.data) {
+                        let level = that.data.levelList.find(i => i.value == val.coach_id_level)
+                        if (level) val.zhLevel = 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' })
+            }
+        })
+    },
+
     /**
      * 生命周期函数--监听页面隐藏
      */
@@ -58,6 +172,13 @@ Page({
 
     },
 
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
     /**
      * 用户点击右上角分享
      */

+ 175 - 0
pages/sonecoach/list.less

@@ -1,4 +1,179 @@
 .main {
+    height: var(--twoHeight);
     background-color: var(--mainColor);
+
+    .one {
+        display: flex;
+        flex-direction: row;
+        padding: 2vw;
+        border-bottom: 1px solid var(--f1Color);
+
+        .one_1 {
+            flex-grow: 1;
+
+            input {
+                padding: 1vw 0 2vw 2vw;
+                background-color: var(--f1Color);
+                border-radius: 5px;
+            }
+        }
+
+        .one_2 {
+            width: 20vw;
+
+            button {
+                width: 100%;
+                padding: 2vw;
+                font-size: var(--font14Size);
+            }
+        }
+    }
+
+    .two {
+        flex-grow: 1;
+        position: relative;
+
+        .list {
+            display: flex;
+            flex-direction: column;
+            padding: 2vw;
+            margin: 2vw 2vw 0;
+            border-radius: 10px;
+
+            .list_1 {
+                display: flex;
+                flex-direction: row;
+                margin: 0 0 2vw 0;
+                border: 2px dashed var(--whiteColor);
+                border-radius: 10px;
+
+                .icon {
+                    width: 18vw;
+                    height: 18vw;
+                    margin-top: 2vw;
+                    margin-left: 2vw;
+
+                    image {
+                        width: 100%;
+                        height: 100%;
+                        border-radius: 50%;
+                        background-color: var(--whiteColor);
+                    }
+                }
+
+                .content {
+                    display: flex;
+                    flex-direction: column;
+                    margin: 0 0 0 3vw;
+
+                    .name {
+                        font-weight: 700;
+                        font-size: var(--font18Szie);
+                        color: var(--whiteColor);
+                        margin: 1vw 0;
+                    }
+
+                    .other {
+                        font-size: var(--font15Size);
+                        color: var(--f9Color);
+                        margin: 0.5vw 0 1vw 0;
+
+                        text {
+                            color: var(--whiteColor);
+                        }
+                    }
+                }
+            }
+
+            .btn {
+                display: flex;
+                flex-direction: row;
+
+                button {
+                    width: 100%;
+                    padding: 2vw;
+                    font-size: var(--font14Size);
+                    color: var(--whiteColor);
+                    border-radius: 50px;
+                    margin: 0 2vw;
+                    background-color: #35d4bd;
+                    box-sizing: content-box;
+                    border: 2px dashed var(--whiteColor);
+                }
+
+                button:nth-child(2n) {
+                    background-color: #f860df;
+                }
+
+                button:last-child {
+                    background-color: #FF7F50;
+                }
+            }
+        }
+
+        // 助教
+        .level_0 {
+            background-size: 100%, 100%;
+            background-image: url('https://broadcast.waityou24.cn/files/court/elimg/20220816172614.png');
+        }
+
+        // 专业一级
+        .level_1 {
+            background-size: 100%, 100%;
+            background-image: url('https://broadcast.waityou24.cn/files/court/elimg/20220816172720.png');
+        }
+
+        // 专业二级
+        .level_2 {
+            background-size: 100%, 100%;
+            background-image: url('https://broadcast.waityou24.cn/files/court/elimg/20220816172649.png');
+        }
+
+        // 其他
+        .level_3 {
+            background-color: #d39474;
+        }
+    }
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
 }
 
+.dialog {
+    .dialog_1 {
+        .name {
+            text-align: center;
+            font-size: var(--font18Szie);
+            font-weight: bold;
+            margin: 3vw 0;
+        }
+
+        .image {
+            text-align: center;
+            height: 18vh;
+            overflow: hidden;
+
+            .qrcode {
+                height: 22vh;
+                position: absolute;
+                left: 32vw;
+            }
+        }
+
+        .remark {
+            text-align: center;
+            font-size: 15px;
+            margin: 0 0 4vw 0;
+        }
+    }
+}

+ 45 - 2
pages/sonecoach/list.wxml

@@ -1,5 +1,48 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
-        1
+        <view class="one">
+            <view class="one_1">
+                <input type="text" placeholder="请输入关键词" />
+            </view>
+            <view class="one_2">
+                <button type="primary" bindtap="toAdd">添加</button>
+            </view>
+        </view>
+        <view class="two">
+            <scroll-view scroll-y="true" class="scroll-view" bindscrolltolower="toPage">
+                <view class="list-scroll-view">
+                    <view class="list {{item.coach_id_level=='0'?'level_0':item.coach_id_level=='1'?'level_1':item.coach_id_level=='2'?'level_2':'level_3'}}" wx:for="{{list}}" wx:key="item">
+                        <view class="list_1">
+                            <view class="icon">
+                                <image src="{{item.icon&&item.icon.length>0?item.icon[0].url:''}}">
+                                </image>
+                            </view>
+                            <view class="content">
+                                <view class="name textOver">{{item.coach_id_name}}</view>
+                                <view class="other">教练等级:<text>{{item.zhLevel||'暂无'}}</text></view>
+                                <view class="other">联系电话:<text>{{item.coach_id_phone}}</text>
+                                </view>
+                            </view>
+                        </view>
+                        <view class="btn">
+                            <button bindtap="toEdit" data-item="{{item}}">信息维护</button>
+                            <button bindtap="toBind" data-item="{{item}}">绑定账号</button>
+                            <button bindtap="toDel" data-item="{{item}}">删除信息</button>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
     </view>
-</mobile-main>
+</mobile-main>
+<dialog dialog="{{dialog}}" bind:toClose="toClose">
+    <view slot="info" class="dialog">
+        <view class="dialog_1" wx:if="{{dialog.type=='1'}}">
+            <view class="name">{{form.name}}</view>
+            <view class="image">
+                <canvas class="qrcode" canvas-id="myQrcode"></canvas>
+            </view>
+            <view class="remark">用户可扫描二维码进行账号绑定</view>
+        </view>
+    </view>
+</dialog>

+ 140 - 0
pages/sonecoach/list.wxss

@@ -1,3 +1,143 @@
 .main {
+  height: var(--twoHeight);
   background-color: var(--mainColor);
 }
+.main .one {
+  display: flex;
+  flex-direction: row;
+  padding: 2vw;
+  border-bottom: 1px solid var(--f1Color);
+}
+.main .one .one_1 {
+  flex-grow: 1;
+}
+.main .one .one_1 input {
+  padding: 1vw 0 2vw 2vw;
+  background-color: var(--f1Color);
+  border-radius: 5px;
+}
+.main .one .one_2 {
+  width: 20vw;
+}
+.main .one .one_2 button {
+  width: 100%;
+  padding: 2vw;
+  font-size: var(--font14Size);
+}
+.main .two {
+  flex-grow: 1;
+  position: relative;
+}
+.main .two .list {
+  display: flex;
+  flex-direction: column;
+  padding: 2vw;
+  margin: 2vw 2vw 0;
+  border-radius: 10px;
+}
+.main .two .list .list_1 {
+  display: flex;
+  flex-direction: row;
+  margin: 0 0 2vw 0;
+  border: 2px dashed var(--whiteColor);
+  border-radius: 10px;
+}
+.main .two .list .list_1 .icon {
+  width: 18vw;
+  height: 18vw;
+  margin-top: 2vw;
+  margin-left: 2vw;
+}
+.main .two .list .list_1 .icon image {
+  width: 100%;
+  height: 100%;
+  border-radius: 50%;
+  background-color: var(--whiteColor);
+}
+.main .two .list .list_1 .content {
+  display: flex;
+  flex-direction: column;
+  margin: 0 0 0 3vw;
+}
+.main .two .list .list_1 .content .name {
+  font-weight: 700;
+  font-size: var(--font18Szie);
+  color: var(--whiteColor);
+  margin: 1vw 0;
+}
+.main .two .list .list_1 .content .other {
+  font-size: var(--font15Size);
+  color: var(--f9Color);
+  margin: 0.5vw 0 1vw 0;
+}
+.main .two .list .list_1 .content .other text {
+  color: var(--whiteColor);
+}
+.main .two .list .btn {
+  display: flex;
+  flex-direction: row;
+}
+.main .two .list .btn button {
+  width: 100%;
+  padding: 2vw;
+  font-size: var(--font14Size);
+  color: var(--whiteColor);
+  border-radius: 50px;
+  margin: 0 2vw;
+  background-color: #35d4bd;
+  box-sizing: content-box;
+  border: 2px dashed var(--whiteColor);
+}
+.main .two .list .btn button:nth-child(2n) {
+  background-color: #f860df;
+}
+.main .two .list .btn button:last-child {
+  background-color: #FF7F50;
+}
+.main .two .level_0 {
+  background-size: 100%, 100%;
+  background-image: url('https://broadcast.waityou24.cn/files/court/elimg/20220816172614.png');
+}
+.main .two .level_1 {
+  background-size: 100%, 100%;
+  background-image: url('https://broadcast.waityou24.cn/files/court/elimg/20220816172720.png');
+}
+.main .two .level_2 {
+  background-size: 100%, 100%;
+  background-image: url('https://broadcast.waityou24.cn/files/court/elimg/20220816172649.png');
+}
+.main .two .level_3 {
+  background-color: #d39474;
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}
+.dialog .dialog_1 .name {
+  text-align: center;
+  font-size: var(--font18Szie);
+  font-weight: bold;
+  margin: 3vw 0;
+}
+.dialog .dialog_1 .image {
+  text-align: center;
+  height: 18vh;
+  overflow: hidden;
+}
+.dialog .dialog_1 .image .qrcode {
+  height: 22vh;
+  position: absolute;
+  left: 32vw;
+}
+.dialog .dialog_1 .remark {
+  text-align: center;
+  font-size: 15px;
+  margin: 0 0 4vw 0;
+}

+ 2 - 1
pages/sonefee/list.js

@@ -1,7 +1,8 @@
 const app = getApp()
 Page({
     data: {
-        frameStyle: { useTop: true, name: '学员信息', leftArrow: true, useBar: false },
+        frameStyle: { useTop: true, name: '审批教练费', leftArrow: true, useBar: false },
+        list: [{}, {}],
     },
     // 返回
     back(e) {

+ 123 - 0
pages/sonefee/list.less

@@ -1,4 +1,127 @@
 .main {
+    height: var(--twoHeight);
     background-color: var(--mainColor);
+
+    .one {
+        display: flex;
+        flex-direction: row;
+        padding: 2vw;
+        border-bottom: 1px solid var(--f1Color);
+
+        .one_1 {
+            flex-grow: 1;
+
+            input {
+                padding: 1vw 0 2vw 2vw;
+                background-color: var(--f1Color);
+                border-radius: 5px;
+            }
+        }
+
+        .one_2 {
+            width: 20vw;
+
+            button {
+                width: 100%;
+                padding: 2vw;
+                font-size: var(--font14Size);
+            }
+        }
+    }
+
+    .two {
+        flex-grow: 1;
+        position: relative;
+
+        .list {
+            display: flex;
+            flex-direction: column;
+            padding: 2vw;
+            margin: 2vw 2vw 0;
+            border-radius: 10px;
+
+            .list_1 {
+                display: flex;
+                flex-direction: row;
+                margin: 0 0 2vw 0;
+                border: 2px dashed var(--blackColor);
+                border-radius: 10px;
+
+                .icon {
+                    width: 18vw;
+                    height: 18vw;
+                    margin-top: 2vw;
+                    margin-left: 2vw;
+
+                    image {
+                        width: 100%;
+                        height: 100%;
+                        border-radius: 50%;
+                        background-color: var(--f85Color);
+                    }
+                }
+
+                .content {
+                    display: flex;
+                    flex-direction: column;
+                    margin: 0 0 0 3vw;
+
+                    .name {
+                        font-weight: 700;
+                        font-size: var(--font18Szie);
+                        color: var(--blackColor);
+                        margin: 1vw 0;
+                    }
+
+                    .other {
+                        font-size: var(--font15Size);
+                        color: var(--f85Color);
+                        margin: 0.5vw 0 1vw 0;
+
+                        text {
+                            color: var(--redColor);
+                        }
+                    }
+                }
+            }
+
+            .btn {
+                display: flex;
+                flex-direction: row;
+
+                button {
+                    width: 100%;
+                    padding: 2vw;
+                    font-size: var(--font14Size);
+                    color: var(--whiteColor);
+                    border-radius: 50px;
+                    margin: 0 2vw;
+                    background-color: #35d4bd;
+                    box-sizing: content-box;
+                    border: 2px dashed var(--whiteColor);
+                }
+
+                button:nth-child(2n) {
+                    background-color: #f860df;
+                }
+
+                button:last-child {
+                    background-color: #FF7F50;
+                }
+            }
+        }
+    }
 }
 
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 30 - 1
pages/sonefee/list.wxml

@@ -1,5 +1,34 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
-        1
+        <view class="one">
+            <view class="one_1">
+                <input type="text" placeholder="请输入关键词" />
+            </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="list_1">
+                            <view class="icon">
+                                <image src="{{item.icon&&item.icon.length>0?item.icon[0].url:''}}">
+                                </image>
+                            </view>
+                            <view class="content">
+                                <view class="name textOver">{{item.name||'教练姓名'}}</view>
+                                <view class="other">提现金额:<text>{{item.money||'0.00'}}元</text>
+                                </view>
+                                <view class="other">申请时间:{{item.time||'暂无'}}
+                                </view>
+                            </view>
+                        </view>
+                        <view class="btn">
+                            <button bindtap="toEdit">通过</button>
+                            <button bindtap="toDel">拒绝</button>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
     </view>
 </mobile-main>

+ 104 - 0
pages/sonefee/list.wxss

@@ -1,3 +1,107 @@
 .main {
+  height: var(--twoHeight);
   background-color: var(--mainColor);
 }
+.main .one {
+  display: flex;
+  flex-direction: row;
+  padding: 2vw;
+  border-bottom: 1px solid var(--f1Color);
+}
+.main .one .one_1 {
+  flex-grow: 1;
+}
+.main .one .one_1 input {
+  padding: 1vw 0 2vw 2vw;
+  background-color: var(--f1Color);
+  border-radius: 5px;
+}
+.main .one .one_2 {
+  width: 20vw;
+}
+.main .one .one_2 button {
+  width: 100%;
+  padding: 2vw;
+  font-size: var(--font14Size);
+}
+.main .two {
+  flex-grow: 1;
+  position: relative;
+}
+.main .two .list {
+  display: flex;
+  flex-direction: column;
+  padding: 2vw;
+  margin: 2vw 2vw 0;
+  border-radius: 10px;
+}
+.main .two .list .list_1 {
+  display: flex;
+  flex-direction: row;
+  margin: 0 0 2vw 0;
+  border: 2px dashed var(--blackColor);
+  border-radius: 10px;
+}
+.main .two .list .list_1 .icon {
+  width: 18vw;
+  height: 18vw;
+  margin-top: 2vw;
+  margin-left: 2vw;
+}
+.main .two .list .list_1 .icon image {
+  width: 100%;
+  height: 100%;
+  border-radius: 50%;
+  background-color: var(--f85Color);
+}
+.main .two .list .list_1 .content {
+  display: flex;
+  flex-direction: column;
+  margin: 0 0 0 3vw;
+}
+.main .two .list .list_1 .content .name {
+  font-weight: 700;
+  font-size: var(--font18Szie);
+  color: var(--blackColor);
+  margin: 1vw 0;
+}
+.main .two .list .list_1 .content .other {
+  font-size: var(--font15Size);
+  color: var(--f85Color);
+  margin: 0.5vw 0 1vw 0;
+}
+.main .two .list .list_1 .content .other text {
+  color: var(--redColor);
+}
+.main .two .list .btn {
+  display: flex;
+  flex-direction: row;
+}
+.main .two .list .btn button {
+  width: 100%;
+  padding: 2vw;
+  font-size: var(--font14Size);
+  color: var(--whiteColor);
+  border-radius: 50px;
+  margin: 0 2vw;
+  background-color: #35d4bd;
+  box-sizing: content-box;
+  border: 2px dashed var(--whiteColor);
+}
+.main .two .list .btn button:nth-child(2n) {
+  background-color: #f860df;
+}
+.main .two .list .btn button:last-child {
+  background-color: #FF7F50;
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}

Файловите разлики са ограничени, защото са твърде много
+ 71 - 6
pages/soneschool/list.js


+ 3 - 2
pages/soneschool/list.json

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

+ 31 - 1
pages/soneschool/list.less

@@ -1,4 +1,34 @@
 .main {
     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;
+            }
+        }
+    }
+}

+ 67 - 1
pages/soneschool/list.wxml

@@ -1,5 +1,71 @@
 <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">
+                        <textarea name="name" value="{{form.name}}" auto-height placeholder="请输入名称" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">简介:</view>
+                    <view class="value">
+                        <textarea name="brief" value="{{form.brief}}" auto-height placeholder="请输入简介" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">联系方式:</view>
+                    <view class="value">
+                        <input name="phone" value="{{form.phone}}" placeholder="请输入联系方式" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">训练地址:</view>
+                    <view class="value">
+                        <input name="address" value="{{form.address}}" placeholder="请输入训练地址" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">教练人数:</view>
+                    <view class="value">
+                        <input type="number" name="coach_num" value="{{form.coach_num}}" placeholder="请输入教练人数" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">学员人数:</view>
+                    <view class="value">
+                        <input type="number" name="student_num" value="{{form.student_num}}" placeholder="请输入学员人数" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">过往荣誉:</view>
+                    <view class="value">
+                        <textarea name="honor" value="{{form.honor}}" auto-height placeholder="请输入过往荣誉" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">网址:</view>
+                    <view class="value">
+                        <input name="url" value="{{form.url}}" placeholder="请输入网址(http://)" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">营业执照(1):</view>
+                    <view class="value">
+                        <upload list="{{form.yyzz}}" count="{{1}}" previewSize="{{33}}" bind:imgUpload="yzimgUpl" bind:imgDel="yzimgDel"></upload>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">机构图片(6):</view>
+                    <view class="value">
+                        <upload list="{{form.img_url}}" count="{{6}}" previewSize="{{25}}" bind:imgUpload="imgUpl" bind:imgDel="imgDel"></upload>
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
     </view>
 </mobile-main>

+ 24 - 0
pages/soneschool/list.wxss

@@ -1,3 +1,27 @@
 .main {
   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;
+}

+ 177 - 0
pages/sonestudent/add.js

@@ -0,0 +1,177 @@
+const app = getApp()
+import WxValidate from '../../utils/wxValidate';
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '学员信息管理', leftArrow: true, useBar: false },
+        id: '',
+        school_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: 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;
+        params.school_id = that.data.school_id;
+        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);
+            else arr = await app.$post(`/student`, params)
+            if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
+            else wx.showToast({ title: `${errmsg}`, icon: 'error', duration: 2000 })
+        }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    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 => {
+                that.setData({ school_id: res.data.info.id })
+                if (that.data.id) {
+                    const arr = await app.$get(`/student/${that.data.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' })
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 7 - 0
pages/sonestudent/add.json

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

+ 35 - 0
pages/sonestudent/add.less

@@ -0,0 +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;
+            }
+        }
+    }
+}

+ 70 - 0
pages/sonestudent/add.wxml

@@ -0,0 +1,70 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <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>

+ 28 - 0
pages/sonestudent/add.wxss

@@ -0,0 +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;
+}

+ 114 - 3
pages/sonestudent/list.js

@@ -1,7 +1,102 @@
 const app = getApp()
 Page({
     data: {
-        frameStyle: { useTop: true, name: '审批教练费', leftArrow: true, useBar: false },
+        frameStyle: { useTop: true, name: '学员信息', leftArrow: true, useBar: false },
+        list: [{}, {}, {}],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
+        // 等级列表
+        levelList: [],
+        // dialog弹框
+        dialog: { title: '账号绑定', show: false, type: '1' },
+        form: {},
+    },
+    // 返回
+    back: function () {
+        wx.navigateBack({ delta: 1 })
+    },
+    // 添加
+    toAdd() {
+        const that = this;
+        that.setData({ skip: 0, page: 0, list: [] })
+        wx.navigateTo({ url: '/pages/sonestudent/add' })
+    },
+    // 修改
+    toEdit: function (e) {
+        const that = this;
+        let { item } = e.currentTarget.dataset;
+        that.setData({ skip: 0, page: 0, list: [] })
+        // wx.navigateTo({ url: `/pages/sonecoach/add?id=${item.coach_id}` })
+    },
+    // 删除
+    toDel: async function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认删除该条数据?',
+            async success(res) {
+                if (res.confirm) {
+                    const arr = await app.$delete(`/rss/${item.id}`);
+                    if (arr.errcode == '0') {
+                        wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
+                        that.setData({ skip: 0, page: 0, list: [] })
+                        that.watchLogin()
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            }
+        })
+    },
+    // 绑定账号
+    toBind: async function (e) {
+        const that = this;
+        let { item } = e.currentTarget.dataset;
+        const arr = await app.$get(`/coach/${item.id}`);
+        if (arr.errcode == '0') {
+            that.setData({ form: arr.data })
+            // 生成二维码
+            that.makeQRCode();
+            that.setData({ dialog: { title: '账号绑定', show: true, type: '1' } })
+        } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+    },
+    makeQRCode(template = 0) {
+        const that = this;
+        const url = `${app.globalData.publicUrl}/courtappbind?id=${that.data.form.id}&type='2'`;
+        var qrcode = new QRCode(`myQrcode`, {
+            text: url,
+            width: 110,
+            height: 110,
+            padding: 3,
+            colorDark: "#000000",
+            colorLight: "#ffffff",
+            correctLevel: QRCode.CorrectLevel.L,
+        });
+    },
+
+    // 关闭弹框
+    toClose: function () {
+        const that = this;
+        that.setData({ form: {} })
+        that.setData({ dialog: { title: '账号绑定', show: false, type: '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 }) }
     },
     // 返回
     back(e) {
@@ -16,9 +111,25 @@ Page({
         const that = this;
         wx.getStorage({
             key: 'user',
-            success: async res => { },
+            success: async res => {
+                // 学员等级
+                let aee = await app.$get(`/dict`, { code: 'student_grade' });
+                if (aee.errcode == '0' && aee.total > 0) that.setData({ levelList: aee.data[0].list })
+                let info = { skip: that.data.skip, limit: that.data.limit, school_id: res.data.info.id };
+                const arr = await app.$get(`/rss`, { ...info });
+                if (arr.errcode == '0') {
+                    for (const val of arr.data) {
+                        let level = that.data.levelList.find(i => i.value == val.coach_id_level)
+                        if (level) val.zhLevel = level.label;
+                    }
+                    // that.setData({ list: [...that.data.list, ...arr.data] });
+                    // that.setData({ total: arr.total });
+                    // console.log(arr.data);
+                }
+                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' })
             }
         })
     },

+ 123 - 0
pages/sonestudent/list.less

@@ -1,4 +1,127 @@
 .main {
+    height: var(--twoHeight);
     background-color: var(--mainColor);
+
+    .one {
+        display: flex;
+        flex-direction: row;
+        padding: 2vw;
+        border-bottom: 1px solid var(--f1Color);
+
+        .one_1 {
+            flex-grow: 1;
+
+            input {
+                padding: 1vw 0 2vw 2vw;
+                background-color: var(--f1Color);
+                border-radius: 5px;
+            }
+        }
+
+        .one_2 {
+            width: 20vw;
+
+            button {
+                width: 100%;
+                padding: 2vw;
+                font-size: var(--font14Size);
+            }
+        }
+    }
+
+    .two {
+        flex-grow: 1;
+        position: relative;
+
+        .list {
+            display: flex;
+            flex-direction: column;
+            padding: 2vw;
+            margin: 2vw 2vw 0;
+            border-radius: 10px;
+
+            .list_1 {
+                display: flex;
+                flex-direction: row;
+                margin: 0 0 2vw 0;
+                border: 2px dashed var(--blackColor);
+                border-radius: 10px;
+
+                .icon {
+                    width: 18vw;
+                    height: 18vw;
+                    margin-top: 2vw;
+                    margin-left: 2vw;
+
+                    image {
+                        width: 100%;
+                        height: 100%;
+                        border-radius: 50%;
+                        background-color: var(--f85Color);
+                    }
+                }
+
+                .content {
+                    display: flex;
+                    flex-direction: column;
+                    margin: 0 0 0 3vw;
+
+                    .name {
+                        font-weight: 700;
+                        font-size: var(--font18Szie);
+                        color: var(--blackColor);
+                        margin: 1vw 0;
+                    }
+
+                    .other {
+                        font-size: var(--font15Size);
+                        color: var(--f85Color);
+                        margin: 0.5vw 0 1vw 0;
+
+                        text {
+                            color: var(--redColor);
+                        }
+                    }
+                }
+            }
+
+            .btn {
+                display: flex;
+                flex-direction: row;
+
+                button {
+                    width: 100%;
+                    padding: 2vw;
+                    font-size: var(--font14Size);
+                    color: var(--whiteColor);
+                    border-radius: 50px;
+                    margin: 0 2vw;
+                    background-color: #35d4bd;
+                    box-sizing: content-box;
+                    border: 2px dashed var(--whiteColor);
+                }
+
+                button:nth-child(2n) {
+                    background-color: #f860df;
+                }
+
+                button:last-child {
+                    background-color: #FF7F50;
+                }
+            }
+        }
+    }
 }
 
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 34 - 1
pages/sonestudent/list.wxml

@@ -1,5 +1,38 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
-        1
+        <view class="one">
+            <view class="one_1">
+                <input type="text" placeholder="请输入关键词" />
+            </view>
+            <view class="one_2">
+                <button type="primary" bindtap="toAdd">添加</button>
+            </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="list_1">
+                            <view class="icon">
+                                <image src="{{item.icon&&item.icon.length>0?item.icon[0].url:''}}">
+                                </image>
+                            </view>
+                            <view class="content">
+                                <view class="name textOver">{{item.name||'学员姓名'}}</view>
+                                <view class="other">学员等级:<text>{{item.zhLevel||'一级'}}</text>
+                                </view>
+                                <view class="other">联系电话:{{item.phone||'暂无'}}
+                                </view>
+                            </view>
+                        </view>
+                        <view class="btn">
+                            <button bindtap="toEdit" data-item="{{item}}">信息维护</button>
+                            <button bindtap="toBind" data-item="{{item}}">绑定账号</button>
+                            <button bindtap="toDel" data-item="{{item}}">删除信息</button>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
     </view>
 </mobile-main>

+ 104 - 0
pages/sonestudent/list.wxss

@@ -1,3 +1,107 @@
 .main {
+  height: var(--twoHeight);
   background-color: var(--mainColor);
 }
+.main .one {
+  display: flex;
+  flex-direction: row;
+  padding: 2vw;
+  border-bottom: 1px solid var(--f1Color);
+}
+.main .one .one_1 {
+  flex-grow: 1;
+}
+.main .one .one_1 input {
+  padding: 1vw 0 2vw 2vw;
+  background-color: var(--f1Color);
+  border-radius: 5px;
+}
+.main .one .one_2 {
+  width: 20vw;
+}
+.main .one .one_2 button {
+  width: 100%;
+  padding: 2vw;
+  font-size: var(--font14Size);
+}
+.main .two {
+  flex-grow: 1;
+  position: relative;
+}
+.main .two .list {
+  display: flex;
+  flex-direction: column;
+  padding: 2vw;
+  margin: 2vw 2vw 0;
+  border-radius: 10px;
+}
+.main .two .list .list_1 {
+  display: flex;
+  flex-direction: row;
+  margin: 0 0 2vw 0;
+  border: 2px dashed var(--blackColor);
+  border-radius: 10px;
+}
+.main .two .list .list_1 .icon {
+  width: 18vw;
+  height: 18vw;
+  margin-top: 2vw;
+  margin-left: 2vw;
+}
+.main .two .list .list_1 .icon image {
+  width: 100%;
+  height: 100%;
+  border-radius: 50%;
+  background-color: var(--f85Color);
+}
+.main .two .list .list_1 .content {
+  display: flex;
+  flex-direction: column;
+  margin: 0 0 0 3vw;
+}
+.main .two .list .list_1 .content .name {
+  font-weight: 700;
+  font-size: var(--font18Szie);
+  color: var(--blackColor);
+  margin: 1vw 0;
+}
+.main .two .list .list_1 .content .other {
+  font-size: var(--font15Size);
+  color: var(--f85Color);
+  margin: 0.5vw 0 1vw 0;
+}
+.main .two .list .list_1 .content .other text {
+  color: var(--redColor);
+}
+.main .two .list .btn {
+  display: flex;
+  flex-direction: row;
+}
+.main .two .list .btn button {
+  width: 100%;
+  padding: 2vw;
+  font-size: var(--font14Size);
+  color: var(--whiteColor);
+  border-radius: 50px;
+  margin: 0 2vw;
+  background-color: #35d4bd;
+  box-sizing: content-box;
+  border: 2px dashed var(--whiteColor);
+}
+.main .two .list .btn button:nth-child(2n) {
+  background-color: #f860df;
+}
+.main .two .list .btn button:last-child {
+  background-color: #FF7F50;
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}