guhongwei 2 år sedan
förälder
incheckning
f44cec6dce
37 ändrade filer med 1643 tillägg och 138 borttagningar
  1. 4 1
      app.json
  2. 2 5
      pages/index/index.js
  3. 4 1
      pagesSchool/coaAdmin/course/list.js
  4. 1 1
      pagesSchool/coaAdmin/course/list.wxml
  5. 142 0
      pagesSchool/coaAdmin/course/tpStudent.js
  6. 7 0
      pagesSchool/coaAdmin/course/tpStudent.json
  7. 117 0
      pagesSchool/coaAdmin/course/tpStudent.less
  8. 75 0
      pagesSchool/coaAdmin/course/tpStudent.wxml
  9. 91 0
      pagesSchool/coaAdmin/course/tpStudent.wxss
  10. 206 0
      pagesSchool/coaAdmin/course/tpStudentadd.js
  11. 8 0
      pagesSchool/coaAdmin/course/tpStudentadd.json
  12. 64 0
      pagesSchool/coaAdmin/course/tpStudentadd.less
  13. 75 0
      pagesSchool/coaAdmin/course/tpStudentadd.wxml
  14. 47 0
      pagesSchool/coaAdmin/course/tpStudentadd.wxss
  15. 55 33
      pagesSchool/coaAdmin/school/list.js
  16. 95 1
      pagesSchool/coaAdmin/school/list.less
  17. 16 11
      pagesSchool/coaAdmin/school/list.wxml
  18. 77 1
      pagesSchool/coaAdmin/school/list.wxss
  19. 2 0
      pagesSchool/common/coachinfo.js
  20. 7 1
      pagesSchool/common/lessoninfo.js
  21. 14 1
      pagesSchool/common/lessonstudent.js
  22. 29 29
      pagesSchool/common/lessonstudent.less
  23. 13 11
      pagesSchool/common/lessonstudent.wxml
  24. 16 17
      pagesSchool/common/lessonstudent.wxss
  25. 111 0
      pagesSchool/common/studentinfo.js
  26. 6 0
      pagesSchool/common/studentinfo.json
  27. 30 0
      pagesSchool/common/studentinfo.less
  28. 78 0
      pagesSchool/common/studentinfo.wxml
  29. 25 0
      pagesSchool/common/studentinfo.wxss
  30. 19 1
      pagesSchool/schAdmin/course/list.js
  31. 3 1
      pagesSchool/schAdmin/course/list.wxml
  32. 76 7
      pagesSchool/school/info.js
  33. 46 0
      pagesSchool/school/info.less
  34. 24 2
      pagesSchool/school/info.wxml
  35. 40 3
      pagesSchool/school/info.wxss
  36. 1 1
      utils/dict.js
  37. 17 10
      utils/util.js

+ 4 - 1
app.json

@@ -51,7 +51,10 @@
                 "schAdmin/student/add",
                 "schAdmin/course/add",
                 "schAdmin/course/coachlist",
-                "common/lessonstudent"
+                "common/lessonstudent",
+                "common/studentinfo",
+                "coaAdmin/course/tpStudent",
+                "coaAdmin/course/tpStudentadd"
             ]
         },
         {

+ 2 - 5
pages/index/index.js

@@ -18,11 +18,8 @@ Page({
             key: 'user',
             success: async res => {
                 if (res.data) wx.redirectTo({ url: '/pages/school/index' })
-                // /pages/school/index
-                // /pagesSchool/common/lessoninfo
-                // /pagesSchool/schAdmin/course/coachlist
-                // /pagesSchool/stuAdmin/money/list
-                // /pagesSchool/stuAdmin/course/list
+                // /pagesSchool/coaAdmin/course/tpStudentadd
+                // /pagesSchool/coaAdmin/course/tpStudent
             },
             fail: async res => {
                 wx.login({

+ 4 - 1
pagesSchool/coaAdmin/course/list.js

@@ -52,7 +52,10 @@ Page({
     toTem(e) {
         const that = this;
         let { item } = e.currentTarget.dataset;
-        console.log(item);
+        that.clearPage();
+        wx.navigateTo({
+            url: `/pagesSchool/coaAdmin/course/tpStudent?lesson_id=${item.lesson_id}`,
+        })
     },
     /**
      * 生命周期函数--监听页面加载

+ 1 - 1
pagesSchool/coaAdmin/course/list.wxml

@@ -20,7 +20,7 @@
                         </view>
                         <view class="money">
                             <text>¥</text>
-                            <text>{{item.money}}</text>
+                            <text>{{item.lesson_id_money}}</text>
                         </view>
                         <view class="btn">
                             <button type="primary" size="mini" bindtap="toView" data-item="{{item}}">详细信息</button>

+ 142 - 0
pagesSchool/coaAdmin/course/tpStudent.js

@@ -0,0 +1,142 @@
+const app = getApp();
+Page({
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '临时上课学员', leftArrow: true, useBar: false },
+        iconUrl: app.globalData.icon,
+        lesson_id: '',
+        // 查询
+        search: {},
+        list: [],
+        total: 0,
+        skip: 0,
+        limit: 6,
+        page: 0,
+    },
+
+    // 跳转菜单
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    // 查询
+    toInput(e) {
+        const that = this;
+        let value = e.detail.value;
+        if (value) that.setData({ 'search.name': value })
+        else that.setData({ search: {} })
+        that.clearPage();
+        that.search();
+    },
+    // 清空列表
+    clearPage() {
+        const that = this;
+        that.setData({ list: [], skip: 0, limit: 6, page: 0 })
+    },
+    // 添加
+    toAdd() {
+        const that = this;
+        let lesson_id = that.data.lesson_id;
+        that.clearPage();
+        wx.navigateTo({
+            url: `/pagesSchool/coaAdmin/course/tpStudentadd?lesson_id=${lesson_id}`,
+        })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const that = this;
+        that.setData({ lesson_id: options.id || '63563bbd8018a39220eca774' });
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: async function () {
+        const that = this;
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                await that.search();
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    async search() {
+        const that = this;
+        let lesson_id = that.data.lesson_id;
+        let info = { skip: that.data.skip, limit: that.data.limit, lesson_id: lesson_id };
+        let res = await app.$get(`/tempLessonApply`, { ...info, ...that.data.search });
+        if (res.errcode == '0') {
+            let list = [...that.data.list, ...res.data];
+            that.setData({ list });
+            that.setData({ total: res.total });
+        }
+        else { wx.showToast({ title: res.errmsg, icon: 'none' }) }
+    },
+    // 分页
+    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 }) }
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 7 - 0
pagesSchool/coaAdmin/course/tpStudent.json

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

+ 117 - 0
pagesSchool/coaAdmin/course/tpStudent.less

@@ -0,0 +1,117 @@
+@import (css) "/app.wxss";
+
+.main {
+    height: 91vh;
+
+    .one {
+        display: flex;
+        padding: 2vw;
+        border-bottom: 1px solid #858585;
+        margin: 0 0 2vw 0;
+
+        .one_1 {
+            flex-grow: 1;
+
+            input {
+                padding: 2vw;
+                font-size: 12px;
+                border-radius: 5px;
+                background-color: #fff;
+            }
+        }
+
+        .one_2 {
+            button {
+                line-height: 2.6;
+                font-size: 14px;
+            }
+        }
+    }
+
+    .two {
+        position: relative;
+        flex-grow: 1;
+
+        .list {
+            margin: 2vw 2vw 0 2vw;
+            display: flex;
+            padding: 2vw;
+            border-radius: 5px;
+            background-color: #fff;
+
+            .list_1 {
+                width: 20vw;
+                height: 20vw;
+
+                .image {
+                    width: 100%;
+                    height: 100%;
+                    border-radius: 90px;
+                }
+            }
+
+            .list_2 {
+                width: 72vw;
+                padding: 0 0 0 2vw;
+
+                .name {
+                    font-size: 16px;
+                    font-weight: bold;
+                    margin: 0 0 1vw 0;
+                }
+
+                .other_1 {
+                    font-size: 14px;
+                    margin: 0 0 1vw 0;
+                }
+            }
+        }
+    }
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}
+
+.dialog {
+    .dialog_1 {
+        .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 {
+                    width: 100%;
+                    height: 120px;
+                }
+
+            }
+        }
+
+        .btn {
+            text-align: center;
+            margin: 5vw 0 0 0;
+
+            button {
+                width: 40vw;
+                margin: 0 2vw;
+                padding: 1vw 0;
+            }
+        }
+    }
+}

+ 75 - 0
pagesSchool/coaAdmin/course/tpStudent.wxml

@@ -0,0 +1,75 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <view class="one_1">
+                <input type="text" value="{{search.name}}" bindconfirm="toInput" placeholder="请输入关键词" />
+            </view>
+            <view class="one_2">
+                <button type="primary" size="mini" 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="index">
+                        <view class="list_1">
+                            <image class="image" src="{{item.student_id_icon[0].url||iconUrl}}"></image>
+                        </view>
+                        <view class="list_2">
+                            <view class="name textOver">{{item.name}}</view>
+                            <view class="other_1 textOver">
+                                <text>联系电话:{{item.phone}}</text>
+                            </view>
+                            <view class="other_1 textOver">
+                                <text>是否缴费:{{item.is_pay=='0'?'否':'是'}}</text>
+                            </view>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
+    </view>
+</mobile-main>
+<dialog dialog="{{dialog}}" bind:toClose="toClose">
+    <view slot="info" class="dialog">
+        <view class="dialog_1" wx:if="{{dialog.type=='1'}}">
+            <form catchsubmit="onSubmit">
+                <view class="content">
+                    <view class="label">学校id:</view>
+                    <view class="value">
+                        <input name="school_id" type="text" value="{{form.school_id}}" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">教练id:</view>
+                    <view class="value">
+                        <input name="coach_id" type="text" value="{{form.coach_id}}" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课程id:</view>
+                    <view class="value">
+                        <input name="lesson_id" type="text" value="{{form.lesson_id}}" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课时费:</view>
+                    <view class="value">
+                        <input name="money" type="number" value="{{form.money}}" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">学员:</view>
+                    <view class="value">
+                        <picker mode="selector" bindchange="coachChange" name="student_id" value="{{form.student_id}}" range="{{studentlist}}" range-key="coach_id_name">
+                            <view class="picker">{{form.student_id_name||'请选择学员'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
+    </view>
+</dialog>

+ 91 - 0
pagesSchool/coaAdmin/course/tpStudent.wxss

@@ -0,0 +1,91 @@
+@import "/app.wxss";
+.main {
+  height: 91vh;
+}
+.main .one {
+  display: flex;
+  padding: 2vw;
+  border-bottom: 1px solid #858585;
+  margin: 0 0 2vw 0;
+}
+.main .one .one_1 {
+  flex-grow: 1;
+}
+.main .one .one_1 input {
+  padding: 2vw;
+  font-size: 12px;
+  border-radius: 5px;
+  background-color: #fff;
+}
+.main .one .one_2 button {
+  line-height: 2.6;
+  font-size: 14px;
+}
+.main .two {
+  position: relative;
+  flex-grow: 1;
+}
+.main .two .list {
+  margin: 2vw 2vw 0 2vw;
+  display: flex;
+  padding: 2vw;
+  border-radius: 5px;
+  background-color: #fff;
+}
+.main .two .list .list_1 {
+  width: 20vw;
+  height: 20vw;
+}
+.main .two .list .list_1 .image {
+  width: 100%;
+  height: 100%;
+  border-radius: 90px;
+}
+.main .two .list .list_2 {
+  width: 72vw;
+  padding: 0 0 0 2vw;
+}
+.main .two .list .list_2 .name {
+  font-size: 16px;
+  font-weight: bold;
+  margin: 0 0 1vw 0;
+}
+.main .two .list .list_2 .other_1 {
+  font-size: 14px;
+  margin: 0 0 1vw 0;
+}
+.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 .content {
+  display: flex;
+  flex-direction: row;
+  border-bottom: 1px dashed var(--f1Color);
+  padding: 2vw 0;
+  margin: 0 2vw 2vw 2vw;
+}
+.dialog .dialog_1 .content .value {
+  flex-grow: 1;
+  color: var(--blackColor);
+}
+.dialog .dialog_1 .content .value textarea {
+  width: 100%;
+  height: 120px;
+}
+.dialog .dialog_1 .btn {
+  text-align: center;
+  margin: 5vw 0 0 0;
+}
+.dialog .dialog_1 .btn button {
+  width: 40vw;
+  margin: 0 2vw;
+  padding: 1vw 0;
+}

+ 206 - 0
pagesSchool/coaAdmin/course/tpStudentadd.js

@@ -0,0 +1,206 @@
+const app = getApp()
+import WxValidate from '../../../utils/wxValidate'
+import QRCode from '../../../utils/weapp-qrcode.js';
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '信息管理', leftArrow: true, useBar: false },
+        user: {},
+        lesson_id: '',
+        lessonInfo: {},
+        id: '',
+        form: { file: [] },
+        studentlist: [],
+        payUrl: '',
+        // dialog弹框
+        dialog: { title: '二维码支付', show: false, type: '1' },
+        payUrl: ''
+    },
+    initValidate() {
+        const rules = { name: { required: true }, phone: { required: true }, file: { required: true } }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { name: { required: '学员姓名', }, phone: { required: '联系方式', }, file: { required: '图片', } };
+        this.WxValidate = new WxValidate(rules, messages)
+    },
+    // 跳转菜单
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    // 选择学员
+    stuChange(e) {
+        const that = this;
+        let data = that.data.studentlist[e.detail.value];
+        if (data) that.setData({ 'form.student_id': data.student_id, 'form.name': data.student_id_name, 'form.phone': data.student_id_phone, })
+    },
+    // 上传照片
+    imgUpl: function (e) {
+        const that = this;
+        let data = that.data.form.file;
+        data.push(e.detail)
+        that.setData({ 'form.file': data })
+    },
+    // 删除图片
+    imgDel: function (e) {
+        const that = this;
+        let list = that.data.form.file;
+        let arr = list.filter((i, index) => index != e.detail.index)
+        that.setData({ 'form.file': arr })
+    },
+    // 提交登录
+    onSubmit: async function (e) {
+        const that = this;
+        const params = e.detail.value;
+        const form = that.data.form;
+        params.file = form.file;
+        if (!this.WxValidate.checkForm(params)) {
+            const error = this.WxValidate.errorList[0];
+            wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+            return false
+        } else {
+            let res = await app.$post(`/tempLessonApply`, params);
+            if (res.errcode == '0') {
+                let data = JSON.parse(res.data);
+                that.createPayUrl(data.code_url);
+                that.setData({ dialog: { title: '二维码支付', show: true, type: '1' } })
+            } else {
+                wx.showToast({ title: res.errmsg, icon: 'none' })
+            }
+        }
+    },
+    createPayUrl(e) {
+        // 生成二维码
+        const that = this;
+        const url = `${e}`;
+        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({ dialog: { title: '二维码支付', show: false, type: '1' } })
+    },
+    // 付款成功
+    paySuccess() {
+        const that = this;
+        that.setData({ form: {} })
+        that.toClose();
+        that.back();
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const that = this;
+        that.setData({ lesson_id: options.lesson_id || '63563bbd8018a39220eca774', id: options.id || '' });
+        //验证规则函数
+        that.initValidate();
+        // 监听用户是否登录
+        that.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                that.setData({ user: res.data });
+                await that.searchLesson();
+                await that.search();
+                await that.searchStu();
+            },
+            fail: res => {
+                wx.redirectTo({ url: '/pages/index/index', })
+            }
+        })
+    },
+    async searchLesson() {
+        const that = this;
+        let lesson_id = that.data.lesson_id;
+        let res = await app.$get(`/lesson/${lesson_id}`);
+        if (res.errcode == '0') {
+            that.setData({ lessonInfo: res.data });
+        }
+        else { wx.showToast({ title: res.errmsg, icon: 'none' }) }
+    },
+    async search() {
+        const that = this;
+        let lessonInfo = that.data.lessonInfo;
+        let user = that.data.user;
+        let id = that.data.id;
+        let form = { school_id: lessonInfo.school_id, coach_id: user.info.id, lesson_id: lessonInfo.id, money: lessonInfo.money, file: [] };
+        let res;
+        if (id) {
+            res = await app.$get(`/tempLessonApply/${id}`);
+            if (res.errcode == '0') form = res.data
+            else { wx.showToast({ title: res.errmsg, icon: 'none' }) }
+        }
+        that.setData({ form })
+    },
+    async searchStu() {
+        const that = this;
+        let lessonInfo = that.data.lessonInfo;
+        let res = await app.$get(`/rss`, { school_id: lessonInfo.school_id });
+        if (res.errcode == '0') {
+            that.setData({ studentlist: res.data })
+        } else { wx.showToast({ title: res.errmsg, icon: 'none' }) }
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 8 - 0
pagesSchool/coaAdmin/course/tpStudentadd.json

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

+ 64 - 0
pagesSchool/coaAdmin/course/tpStudentadd.less

@@ -0,0 +1,64 @@
+@import (css) "/app.wxss";
+
+.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 {
+                    width: 100%;
+                    height: 120px;
+                }
+
+            }
+        }
+
+        .btn {
+            text-align: center;
+            margin: 5vw 0 0 0;
+
+            button {
+                width: 40vw;
+                margin: 0 2vw;
+                padding: 1vw 0;
+            }
+        }
+    }
+}
+
+.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: 34vw;
+            }
+        }
+
+        .btn {
+            text-align: center;
+        }
+    }
+}

+ 75 - 0
pagesSchool/coaAdmin/course/tpStudentadd.wxml

@@ -0,0 +1,75 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <form catchsubmit="onSubmit">
+                <view class="content" style="display: none;">
+                    <view class="label">学校id:</view>
+                    <view class="value">
+                        <input name="school_id" type="text" value="{{form.school_id}}" disabled />
+                    </view>
+                </view>
+                <view class="content" style="display: none;">
+                    <view class="label">教练id:</view>
+                    <view class="value">
+                        <input name="coach_id" type="text" value="{{form.coach_id}}" disabled />
+                    </view>
+                </view>
+                <view class="content" style="display: none;">
+                    <view class="label">课程id:</view>
+                    <view class="value">
+                        <input name="lesson_id" type="text" value="{{form.lesson_id}}" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课程费:</view>
+                    <view class="value">
+                        <input name="money" type="number" value="{{form.money}}" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">选择学员:</view>
+                    <view class="value">
+                        <picker mode="selector" bindchange="stuChange" name="student_id" value="{{form.student_id}}" range="{{studentlist}}" range-key="student_id_name">
+                            <view class="picker">{{form.name||'请选择学员'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">学员姓名:</view>
+                    <view class="value">
+                        <input name="name" type="text" value="{{form.name}}" placeholder="请输入学员姓名" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">联系方式:</view>
+                    <view class="value">
+                        <input name="phone" type="number" value="{{form.phone}}" placeholder="请输入联系方式" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">图片(6):</view>
+                    <view class="value">
+                        <upload list="{{form.file}}" 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>
+<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="btn">
+                <button type="primary" size="mini" bindtap="paySuccess">付款成功</button>
+            </view>
+        </view>
+    </view>
+</dialog>

+ 47 - 0
pagesSchool/coaAdmin/course/tpStudentadd.wxss

@@ -0,0 +1,47 @@
+@import "/app.wxss";
+.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 {
+  width: 100%;
+  height: 120px;
+}
+.main .one .btn {
+  text-align: center;
+  margin: 5vw 0 0 0;
+}
+.main .one .btn button {
+  width: 40vw;
+  margin: 0 2vw;
+  padding: 1vw 0;
+}
+.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: 34vw;
+}
+.dialog .dialog_1 .btn {
+  text-align: center;
+}

+ 55 - 33
pagesSchool/coaAdmin/school/list.js

@@ -1,42 +1,44 @@
-const app = getApp()
+const app = getApp();
 Page({
-
     /**
      * 页面的初始数据
      */
     data: {
         frameStyle: { useTop: true, name: '羽校信息', leftArrow: true, useBar: false },
+        user: {},
+        // 查询
+        search: {},
         list: [],
         total: 0,
-        page: 0,
         skip: 0,
-        limit: 5,
+        limit: 6,
+        page: 0,
     },
-    // 返回
-    back: function () {
+    // 跳转菜单
+    back(e) {
         wx.navigateBack({ delta: 1 })
     },
-    //添加信息,信息维护
-    toCommon: function (e) {
+    // 查询
+    toInput(e) {
         const that = this;
-        const { item, route } = e.currentTarget.dataset;
-        that.setData({ skip: 0, page: 0, list: [] });
-        wx.navigateTo({ url: `/pagesSchool/${route}?school_id=${item.school_id}` })
+        let value = e.detail.value;
+        if (value) that.setData({ 'search.name': value })
+        else that.setData({ search: {} })
+        that.clearPage(); that.watchLogin();
     },
-    // 分页
-    toPage: function () {
+    // 清空列表
+    clearPage() {
         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 }) }
+        that.setData({ list: [], skip: 0, limit: 6, page: 0 })
+    },
+    // 详细信息
+    toView: function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        that.clearPage()
+        wx.navigateTo({
+            url: `/pagesSchool/school/info?id=${item.school_id}`,
+        })
     },
     /**
      * 生命周期函数--监听页面加载
@@ -44,7 +46,6 @@ Page({
     onLoad: function (options) {
 
     },
-
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
@@ -60,25 +61,46 @@ Page({
         // 监听用户是否登录
         await that.watchLogin();
     },
-    // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
         wx.getStorage({
             key: 'user',
             success: async res => {
-                let info = { skip: that.data.skip, limit: that.data.limit, coach_id: res.data.info.id };
-                let arr = await app.$get(`/rcs`, { ...info });
-                if (arr.errcode == '0') {
-                    let list = [...that.data.list, ...arr.data];
-                    that.setData({ list: list })
-                    that.setData({ total: arr.total })
-                } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+                that.setData({ user: res.data });
+                that.search()
             },
             fail: async res => {
                 wx.redirectTo({ url: '/pages/index/index' })
             }
         })
     },
+    async search() {
+        const that = this;
+        let user = that.data.user;
+        let info = { skip: that.data.skip, limit: that.data.limit, coach_id: user.info.id };
+        let arr = await app.$get(`/rcs`, { ...info });
+        if (arr.errcode == '0') {
+            let list = [...that.data.list, ...arr.data];
+            that.setData({ list })
+            that.setData({ total: arr.total })
+        } else { wx.showToast({ title: arr.errmsg, icon: 'error' }) }
+    },
+    // 分页
+    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.search();
+            wx.hideLoading()
+        } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
+    },
+
 
     /**
      * 生命周期函数--监听页面隐藏

+ 95 - 1
pagesSchool/coaAdmin/school/list.less

@@ -1 +1,95 @@
-@import (css) "/app.wxss";
+@import (css) "/app.wxss";
+
+.main {
+    height: 91vh;
+
+    .one {
+        padding: 2vw;
+        border-bottom: 1px solid #858585;
+        margin: 0 0 2vw 0;
+
+        input {
+            padding: 2vw;
+            font-size: 12px;
+            border-radius: 5px;
+            background-color: #fff;
+        }
+    }
+
+    .two {
+        position: relative;
+        flex-grow: 1;
+
+
+        .list {
+            margin: 0 2vw 2vw 2vw;
+            padding: 2vw;
+            background-color: #fff;
+            border-radius: 5px;
+
+            .list_1 {
+                display: flex;
+                margin: 0 0 1vw 0;
+
+                .img {
+                    width: 20vw;
+                    height: 20vw;
+
+                    .image {
+                        width: 100%;
+                        height: 100%;
+                        border: 1px solid #f1f1f1;
+                        border-radius: 90px;
+                    }
+                }
+
+                .info {
+                    width: 70vw;
+                    padding: 0 0 0 2vw;
+
+                    .name {
+                        font-size: 16px;
+                        margin: 0 0 1vw 0;
+                        font-weight: bold;
+                    }
+
+                    .other_1 {
+                        font-size: 14px;
+                        margin: 0 0 1vw 0;
+                        color: #858585;
+
+                        text:last-child {
+                            color: #000000;
+                        }
+                    }
+                }
+            }
+
+            .btn {
+                text-align: center;
+
+                button {
+                    margin: 0 2vw;
+                    font-size: 14px;
+                }
+            }
+        }
+
+        .list:last-child {
+            margin: 0 2vw 0 2vw;
+        }
+    }
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 16 - 11
pagesSchool/coaAdmin/school/list.wxml

@@ -1,23 +1,28 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
         <view class="one">
-            <view class="one_1">
-                <input type="text" placeholder="请输入关键词" />
-            </view>
-            <!-- <view class="one_2">
-                <button type="primary" bindtap="toCommon" data-route="coaAdmin/student/add">添加</button>
-            </view> -->
+            <input type="text" value="{{search.name}}" bindconfirm="toInput" 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="name">{{item.school_id_name}}</view>
-                        <view class="other">
-                            <view class="other_1"><text>联系电话:</text><text>{{item.school_id_phone||'暂无'}}</text></view>
+                    <view class="list" wx:for="{{list}}" wx:key="index">
+                        <view class="list_1">
+                            <view class="img">
+                                <image class="image" src="{{item.school_id_yyzz.length>0?item.school_id_yyzz[0].url:''}}"></image>
+                            </view>
+                            <view class="info">
+                                <view class="name">{{item.school_id_name}}</view>
+                                <view class="other_1">
+                                    <text>联系电话:{{item.school_id_phone||'暂无'}}</text>
+                                </view>
+                                <view class="other_1">
+                                    <text>通讯地址:{{item.school_id_address||'暂无'}}</text>
+                                </view>
+                            </view>
                         </view>
                         <view class="btn">
-                            <button type="primary" size="mini" bindtap="toCommon" data-route="coaAdmin/school/info" data-item="{{item}}">详细信息</button>
+                            <button type="primary" size="mini" bindtap="toView" data-item="{{item}}">详细信息</button>
                         </view>
                     </view>
                 </view>

+ 77 - 1
pagesSchool/coaAdmin/school/list.wxss

@@ -1 +1,77 @@
-/* pagesSchool/coaAdmin/school/list.wxss */
+@import "/app.wxss";
+.main {
+  height: 91vh;
+}
+.main .one {
+  padding: 2vw;
+  border-bottom: 1px solid #858585;
+  margin: 0 0 2vw 0;
+}
+.main .one input {
+  padding: 2vw;
+  font-size: 12px;
+  border-radius: 5px;
+  background-color: #fff;
+}
+.main .two {
+  position: relative;
+  flex-grow: 1;
+}
+.main .two .list {
+  margin: 0 2vw 2vw 2vw;
+  padding: 2vw;
+  background-color: #fff;
+  border-radius: 5px;
+}
+.main .two .list .list_1 {
+  display: flex;
+  margin: 0 0 1vw 0;
+}
+.main .two .list .list_1 .img {
+  width: 20vw;
+  height: 20vw;
+}
+.main .two .list .list_1 .img .image {
+  width: 100%;
+  height: 100%;
+  border: 1px solid #f1f1f1;
+  border-radius: 90px;
+}
+.main .two .list .list_1 .info {
+  width: 70vw;
+  padding: 0 0 0 2vw;
+}
+.main .two .list .list_1 .info .name {
+  font-size: 16px;
+  margin: 0 0 1vw 0;
+  font-weight: bold;
+}
+.main .two .list .list_1 .info .other_1 {
+  font-size: 14px;
+  margin: 0 0 1vw 0;
+  color: #858585;
+}
+.main .two .list .list_1 .info .other_1 text:last-child {
+  color: #000000;
+}
+.main .two .list .btn {
+  text-align: center;
+}
+.main .two .list .btn button {
+  margin: 0 2vw;
+  font-size: 14px;
+}
+.main .two .list:last-child {
+  margin: 0 2vw 0 2vw;
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}

+ 2 - 0
pagesSchool/common/coachinfo.js

@@ -1,4 +1,5 @@
 const app = getApp()
+const util = require('../../utils/util.js')
 Page({
     data: {
         frameStyle: { useTop: true, name: '教练信息', leftArrow: true, useBar: false },
@@ -55,6 +56,7 @@ Page({
                 if (gender) arr.data.zhGender = gender.label;
                 let level = levelList.find(i => i.value == arr.data.level)
                 if (level) arr.data.zhLevel = level.label;
+                if (arr.data.phone) arr.data.phone = util.hidePhone(arr.data.phone);
                 that.setData({ form: arr.data })
             } else {
                 wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })

+ 7 - 1
pagesSchool/common/lessoninfo.js

@@ -1,5 +1,6 @@
 const app = getApp()
 const moment = require("../../utils/moment.min")
+const util = require('../../utils/util.js')
 Page({
     data: {
         frameStyle: { useTop: true, name: '课程详细信息', leftArrow: true, useBar: false },
@@ -137,6 +138,9 @@ Page({
         let id = that.data.id;
         let res = await app.$get(`/lessonCoach`, { lesson_id: id });
         if (res.errcode == '0') {
+            for (const val of res.data) {
+                if (val.coach_id_phone) val.coach_id_phone = util.hidePhone(val.coach_id_phone);
+            }
             that.setData({ coachList: res.data })
         } else {
             wx.showToast({ title: res.errmsg, icon: 'none' })
@@ -149,7 +153,9 @@ Page({
         let res = await app.$get(`/lessonStudent`, { ...info });
         if (res.errcode == '0') {
             let list = [...that.data.studentList, ...res.data];
-            console.log(list);
+            for (const val of list) {
+                if (val.student_id_phone) val.student_id_phone = util.hidePhone(val.student_id_phone);
+            }
             that.setData({ studentList: list })
             that.setData({ total: res.total })
         } else {

+ 14 - 1
pagesSchool/common/lessonstudent.js

@@ -35,7 +35,20 @@ Page({
     toSign(e) {
         const that = this;
         let { item } = e.currentTarget.dataset;
-        console.log(item);
+        wx.showModal({
+            title: '提示',
+            content: '是否确认签到?',
+            async success(res) {
+                if (res.confirm) {
+                    let res = await app.$post(`/lessonStudent/${item._id}`, { is_sign: '1' });
+                    if (res.errcode == '0') {
+                        wx.showToast({ title: '签到成功', icon: 'none' })
+                        that.clearPage();
+                        that.watchLogin();
+                    } else wx.showToast({ title: res.errmsg, icon: 'none' })
+                }
+            }
+        })
     },
     /**
      * 生命周期函数--监听页面加载

+ 29 - 29
pagesSchool/common/lessonstudent.less

@@ -19,55 +19,55 @@
     .two {
         position: relative;
         flex-grow: 1;
-        width: 96vw;
-        margin: 0 2vw;
 
         .list {
-            display: flex;
-            align-items: center;
+            background-color: #fff;
+            margin: 0 2vw 2vw 2vw;
             padding: 2vw;
-            margin: 0 0 2vw 0;
-            border: 1px dashed #858585;
             border-radius: 5px;
 
             .list_1 {
-                width: 20vw;
-                height: 20vw;
+                display: flex;
+                margin: 0 0 1vw 0;
+
+                .list_1_1 {
+                    width: 20vw;
+                    height: 20vw;
 
-                .image {
-                    width: 100%;
-                    height: 100%;
-                    border-radius: 90px;
+                    .image {
+                        width: 100%;
+                        height: 100%;
+                        border-radius: 90px;
+                    }
                 }
-            }
 
-            .list_2 {
-                width: 60vw;
-                padding: 0 0 0 2vw;
+                .list_1_2 {
+                    width: 70vw;
+                    padding: 0 0 0 2vw;
 
-                .name {
-                    font-size: 16px;
-                    font-weight: bold;
-                    margin: 0 0 2vw 0;
-                }
+                    .name {
+                        font-size: 16px;
+                        font-weight: bold;
+                        margin: 0 0 1vw 0;
+                    }
 
-                .other_1 {
-                    font-size: 14px;
-                    color: #858585;
-                    margin: 0 0 1vw 0;
+                    .other_1 {
+                        font-size: 15px;
+                        color: #858585;
+                        margin: 0 0 1vw 0;
 
-                    text:last-child {
-                        color: #000000;
+                        text:last-child {
+                            color: #000;
+                        }
                     }
                 }
             }
 
             .btn {
-                width: 20vw;
                 text-align: center;
 
                 button {
-                    margin: 0 2vw 2vw 2vw;
+                    margin: 0 2vw;
                     font-size: 14px;
                 }
             }

+ 13 - 11
pagesSchool/common/lessonstudent.wxml

@@ -8,21 +8,23 @@
                 <view class="list-scroll-view">
                     <view class="list" wx:for="{{list}}" wx:key="index">
                         <view class="list_1">
-                            <image class="image" src="{{item.student_id_icon.length>0?item.student_id_icon[0].url:iconUrl}}"></image>
-                        </view>
-                        <view class="list_2">
-                            <view class="name">{{item.student_id_name}}</view>
-                            <view class="other_1">
-                                <text>联系电话:</text>
-                                <text>{{item.student_id_phone||'暂无'}}</text>
+                            <view class="list_1_1">
+                                <image class="image" src="{{item.student_id_icon.length>0?item.student_id_icon[0].url:iconUrl}}"></image>
                             </view>
-                            <view class="other_1">
-                                <text>是否签到:</text>
-                                <text>{{item.is_sign=='0'?'未签到':'已签到'}}</text>
+                            <view class="list_1_2">
+                                <view class="name">{{item.student_id_name}}</view>
+                                <view class="other_1">
+                                    <text>联系电话:</text>
+                                    <text>{{item.student_id_phone||'暂无'}}</text>
+                                </view>
+                                <view class="other_1">
+                                    <text>是否签到:</text>
+                                    <text>{{item.is_sign=='0'?'未签到':'已签到'}}</text>
+                                </view>
                             </view>
                         </view>
                         <view class="btn">
-                            <button type="primary" size="mini" bindtap="toSign" data-item="{{item}}">签到</button>
+                            <button type="primary" size="mini" bindtap="toSign" data-item="{{item}}" wx:if="{{item.is_sign=='0'}}">签到</button>
                         </view>
                     </view>
                 </view>

+ 16 - 17
pagesSchool/common/lessonstudent.wxss

@@ -16,49 +16,48 @@
 .main .two {
   position: relative;
   flex-grow: 1;
-  width: 96vw;
-  margin: 0 2vw;
 }
 .main .two .list {
-  display: flex;
-  align-items: center;
+  background-color: #fff;
+  margin: 0 2vw 2vw 2vw;
   padding: 2vw;
-  margin: 0 0 2vw 0;
-  border: 1px dashed #858585;
   border-radius: 5px;
 }
 .main .two .list .list_1 {
+  display: flex;
+  margin: 0 0 1vw 0;
+}
+.main .two .list .list_1 .list_1_1 {
   width: 20vw;
   height: 20vw;
 }
-.main .two .list .list_1 .image {
+.main .two .list .list_1 .list_1_1 .image {
   width: 100%;
   height: 100%;
   border-radius: 90px;
 }
-.main .two .list .list_2 {
-  width: 60vw;
+.main .two .list .list_1 .list_1_2 {
+  width: 70vw;
   padding: 0 0 0 2vw;
 }
-.main .two .list .list_2 .name {
+.main .two .list .list_1 .list_1_2 .name {
   font-size: 16px;
   font-weight: bold;
-  margin: 0 0 2vw 0;
+  margin: 0 0 1vw 0;
 }
-.main .two .list .list_2 .other_1 {
-  font-size: 14px;
+.main .two .list .list_1 .list_1_2 .other_1 {
+  font-size: 15px;
   color: #858585;
   margin: 0 0 1vw 0;
 }
-.main .two .list .list_2 .other_1 text:last-child {
-  color: #000000;
+.main .two .list .list_1 .list_1_2 .other_1 text:last-child {
+  color: #000;
 }
 .main .two .list .btn {
-  width: 20vw;
   text-align: center;
 }
 .main .two .list .btn button {
-  margin: 0 2vw 2vw 2vw;
+  margin: 0 2vw;
   font-size: 14px;
 }
 .main .two .list:last-child {

+ 111 - 0
pagesSchool/common/studentinfo.js

@@ -0,0 +1,111 @@
+const app = getApp()
+const util = require('../../utils/util.js')
+
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '学员信息', leftArrow: true, useBar: false },
+        id: '',
+        form: {},
+    },
+    // 跳转菜单
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    // 预览
+    toView(e) {
+        const { item } = e.currentTarget.dataset;
+        wx.previewImage({ current: '', urls: [item.url] })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function (options) {
+        const that = this;
+        that.setData({ id: options.id || '' })
+        // 查询其他信息
+        await that.searchOther();
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        let id = that.data.id;
+        if (id) {
+            let arr = await app.$get(`/student/${id}`);
+            if (arr.errcode == '0') {
+                arr.data.zhGender = that.searchGender(arr.data.gender);
+                arr.data.zhLevel = that.searchLevel(arr.data.level);
+                if (arr.data.phone) arr.data.phone = util.hidePhone(arr.data.phone);
+                that.setData({ form: arr.data })
+            } else {
+                wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+            }
+        }
+    },
+    // 性别
+    searchGender: function (e) {
+        const that = this;
+        let data = that.data.genderList.find(i => i.value == e);
+        if (data) return data.label;
+        else return '暂无'
+    },
+    // 等级
+    searchLevel(e) {
+        const that = this;
+        let data = that.data.levelList.find(i => i.value == e);
+        if (data) return data.label;
+        else return '暂无'
+    },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        // 性别
+        arr = await app.$get(`/dict`, { code: 'gender' });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ genderList: arr.data[0].list });
+        // 运动等级
+        arr = await app.$get(`/dict`, { code: 'student_grade' });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ levelList: arr.data[0].list });
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pagesSchool/common/studentinfo.json

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

+ 30 - 0
pagesSchool/common/studentinfo.less

@@ -0,0 +1,30 @@
+@import (css) "/app.wxss";
+
+.main {
+    background-color: var(--mainColor);
+
+    .one {
+        padding: 0 2vw;
+
+        .one_1 {
+            display: flex;
+            justify-content: space-between;
+            border: 1px dashed #858585;
+            padding: 2vw;
+            border-radius: 5px;
+            margin: 2vw 0 0 0;
+
+            .image {
+                width: 15vw;
+                height: 15vw;
+                border-radius: 5px;
+            }
+
+            view:last-child {
+                flex-grow: 1;
+                width: 10vw;
+                text-align: right;
+            }
+        }
+    }
+}

+ 78 - 0
pagesSchool/common/studentinfo.wxml

@@ -0,0 +1,78 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <view class="one_1">
+                <view>
+                    <text>头像:</text>
+                </view>
+                <view>
+                    <image class="image" src="{{form.icon&&form.icon.length>0?form.icon[0].url:''}}" bindtap="toView" data-item="{{form.icon[0]}}"></image>
+                </view>
+            </view>
+            <view class="one_1">
+                <view>
+                    <text>姓名:</text>
+                </view>
+                <view>
+                    <text>{{form.name||'暂无'}}</text>
+                </view>
+            </view>
+            <view class="one_1">
+                <view>
+                    <text>性别:</text>
+                </view>
+                <view>
+                    <text>{{form.zhGender||'暂无'}}</text>
+                </view>
+            </view>
+            <view class="one_1">
+                <view>
+                    <text>出生日期:</text>
+                </view>
+                <view>
+                    <text>{{form.birth||'暂无'}}</text>
+                </view>
+            </view>
+            <view class="one_1">
+                <view>
+                    <text>电话:</text>
+                </view>
+                <view>
+                    <text>{{form.phone||'暂无'}}</text>
+                </view>
+            </view>
+            <view class="one_1">
+                <view>
+                    <text>等级:</text>
+                </view>
+                <view>
+                    <text>{{form.zhLevel||'暂无'}}</text>
+                </view>
+            </view>
+            <view class="one_1">
+                <view>
+                    <text>简介:</text>
+                </view>
+                <view>
+                    <text>{{form.brief||'暂无'}}</text>
+                </view>
+            </view>
+            <view class="one_1">
+                <view>
+                    <text>荣誉:</text>
+                </view>
+                <view>
+                    <text>{{form.honor||'暂无'}}</text>
+                </view>
+            </view>
+            <view class="one_1">
+                <view>
+                    <text>训练经历:</text>
+                </view>
+                <view>
+                    <text>{{form.exp||'暂无'}}</text>
+                </view>
+            </view>
+        </view>
+    </view>
+</mobile-main>

+ 25 - 0
pagesSchool/common/studentinfo.wxss

@@ -0,0 +1,25 @@
+@import "/app.wxss";
+.main {
+  background-color: var(--mainColor);
+}
+.main .one {
+  padding: 0 2vw;
+}
+.main .one .one_1 {
+  display: flex;
+  justify-content: space-between;
+  border: 1px dashed #858585;
+  padding: 2vw;
+  border-radius: 5px;
+  margin: 2vw 0 0 0;
+}
+.main .one .one_1 .image {
+  width: 15vw;
+  height: 15vw;
+  border-radius: 5px;
+}
+.main .one .one_1 view:last-child {
+  flex-grow: 1;
+  width: 10vw;
+  text-align: right;
+}

+ 19 - 1
pagesSchool/schAdmin/course/list.js

@@ -68,13 +68,31 @@ Page({
             }
         })
     },
-    // 课程教练管理
+    // 教练管理
     toCoach(e) {
         const that = this;
         let { item } = e.currentTarget.dataset;
         that.clearPage();
         wx.navigateTo({ url: `/pagesSchool/schAdmin/course/coachlist?id=${item.id}` })
     },
+    // 学员管理
+    toManage(e) {
+        const that = this;
+        let { item } = e.currentTarget.dataset;
+        that.clearPage();
+        wx.navigateTo({
+            url: `/pagesSchool/common/lessonstudent?id=${item._id}`,
+        })
+    },
+    // 临时上课学员
+    toTem(e) {
+        const that = this;
+        let { item } = e.currentTarget.dataset;
+        that.clearPage();
+        wx.navigateTo({
+            url: `/pagesSchool/coaAdmin/course/tpStudent?lesson_id=${item.id}`,
+        })
+    },
     // 详细信息
     toView(e) {
         const that = this;

+ 3 - 1
pagesSchool/schAdmin/course/list.wxml

@@ -28,9 +28,11 @@
                             <text>{{item.money}}</text>
                         </view>
                         <view class="btn">
+                            <button type="primary" size="mini" bindtap="toView" data-item="{{item}}">详细信息</button>
                             <button type="primary" size="mini" bindtap="toEdit" data-item="{{item}}">信息维护</button>
                             <button type="primary" size="mini" bindtap="toCoach" data-item="{{item}}">教练管理</button>
-                            <button type="primary" size="mini" bindtap="toView" data-item="{{item}}">详细信息</button>
+                            <button type="primary" size="mini" bindtap="toManage" data-item="{{item}}">学员管理</button>
+                            <button type="primary" size="mini" bindtap="toTem" data-item="{{item}}">临时上课学员</button>
                             <button type="warn" size="mini" bindtap="toDel" data-item="{{item}}">删除信息</button>
                         </view>
                     </view>

+ 76 - 7
pagesSchool/school/info.js

@@ -1,4 +1,5 @@
 const app = getApp()
+const util = require('../../utils/util.js')
 Page({
     /**
      * 页面的初始数据
@@ -12,13 +13,16 @@ Page({
             menu: [
                 { title: '羽校信息', active: '0' },
                 { title: '师资信息', active: '1' },
-                { title: '课程信息', active: '2' },
+                { title: '学员信息', active: '2' },
+                { title: '课程信息', active: '3' },
             ]
         },
         // 学校详细信息
         info: {},
-        // 師資信息
+        // 师资信息
         teacherList: [],
+        // 学员信息
+        studentList: [],
         // 课程信息
         lessonList: [],
         // 分页
@@ -33,16 +37,27 @@ Page({
         typeList: [],
         // 课程状态
         statusList: [],
+        //运动等级
+        stlevelList: [],
     },
     // 跳转菜单
     back(e) {
         wx.navigateBack({ delta: 1 })
     },
+    // 清空列表
+    clearPage() {
+        const that = this;
+        that.setData({ teacherList: [], studentList: [], lessonList: [], skip: 0, limit: 6, page: 0 })
+    },
     // 选项卡选择
     tabsChange: function (e) {
         const that = this;
         let data = e.detail;
-        that.setData({ 'tabs.active': data.active })
+        that.setData({ 'tabs.active': data.active });
+        if (data.active == '1' || data.active == '2' || data.active == '3') {
+            that.clearPage();
+            that.search();
+        }
     },
     // 公共跳转
     toCommon(e) {
@@ -54,7 +69,7 @@ Page({
      */
     onLoad: async function (options) {
         const that = this;
-        that.setData({ id: options.id || '630ddb17b5956e61e27b794a' });
+        that.setData({ id: options.id || '6355f251cb0f85380e83520b' });
         await that.searchOther();
         await that.search();
     },
@@ -67,13 +82,15 @@ Page({
             if (res.errcode == '0') { that.setData({ info: res.data }) }
             else { wx.showToast({ title: res.errmsg, icon: 'none' }) }
             // 查询师资信息
-            that.searchTea();
+            that.searchCoach();
+            // 查询学员信息
+            that.searchStu();
             // 查询课程信息
             that.searchLess();
         }
     },
     // 查询师资信息
-    async searchTea() {
+    async searchCoach() {
         const that = this;
         let id = that.data.id;
         let info = { skip: that.data.skip, limit: that.data.limit, school_id: id }
@@ -81,7 +98,10 @@ Page({
         if (arr.errcode == '0') {
             let list = [...that.data.teacherList, ...arr.data];
             // 教练等级
-            for (const val of list) { val.zhLevel = that.searchLevel(val.coach_id_level) }
+            for (const val of list) {
+                if (val.coach_id_phone) val.coach_id_phone = util.hidePhone(val.coach_id_phone);
+                val.zhLevel = that.searchLevel(val.coach_id_level)
+            }
             that.setData({ teacherList: list });
             that.setData({ total: arr.total })
         }
@@ -94,6 +114,30 @@ Page({
         if (data) return data.label;
         else return '暂无'
     },
+    // 查询学员信息
+    async searchStu() {
+        const that = this;
+        let id = that.data.id;
+        let info = { skip: that.data.skip, limit: that.data.limit, school_id: id }
+        const arr = await app.$get(`/rss`, { ...info });
+        if (arr.errcode == '0') {
+            let list = [...that.data.studentList, ...arr.data];
+            for (const val of list) {
+                if (val.student_id_phone) val.student_id_phone = util.hidePhone(val.student_id_phone);
+                val.student_id_zhlevel = that.searchstLevel(val.student_id_level)
+            }
+            that.setData({ studentList: list });
+            that.setData({ total: arr.total })
+        }
+    },
+    // 运动等级
+    searchstLevel: function (e) {
+        const that = this;
+        let stlevelList = that.data.stlevelList;
+        let data = stlevelList.find(i => i.value == e);
+        if (data) return data.label;
+        else return '暂无'
+    },
     // 查询课程信息
     async searchLess() {
         const that = this;
@@ -126,6 +170,25 @@ Page({
         if (data) return data.label;
         else return '暂无'
     },
+    // 分页
+    toPage: function () {
+        const that = this;
+        let active = that.data.tabs.active;
+        let list = [];
+        if (active == '1') list = that.data.teacherList;
+        else if (active == '2') list = that.data.studentList;
+        else if (active == '3') list = that.data.lessonList;
+        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.search();
+            wx.hideLoading()
+        } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
+    },
     // 查询其他信息
     searchOther: async function () {
         const that = this;
@@ -148,6 +211,12 @@ Page({
             let data = arr.data[0];
             if (data.list && data.list.length > 0) that.setData({ statusList: data.list })
         }
+        // 运动等级
+        arr = await app.$get(`/dict`, { code: 'student_grade' });
+        if (arr.errcode == '0' && arr.total > 0) {
+            let list = arr.data[0].list;
+            that.setData({ stlevelList: list })
+        }
     },
     /**
      * 生命周期函数--监听页面初次渲染完成

+ 46 - 0
pagesSchool/school/info.less

@@ -111,6 +111,52 @@
             .c_1 {
                 padding: 2vw 2vw 0 2vw;
 
+                .list {
+                    margin: 0 0 2vw 0;
+                    display: flex;
+                    padding: 2vw;
+                    border-radius: 5px;
+                    box-shadow: 0 0 5px #858585;
+
+                    .list_1 {
+                        width: 20vw;
+
+                        .image {
+                            width: 100%;
+                            height: 66px;
+                            border-radius: 90px;
+                        }
+                    }
+
+                    .list_2 {
+                        width: 72vw;
+                        padding: 0 0 0 2vw;
+
+                        .name {
+                            font-size: 16px;
+                            font-weight: bold;
+                            margin: 0 0 1vw 0;
+                        }
+
+                        .other_1 {
+                            font-size: 14px;
+                            margin: 0 0 1vw 0;
+                        }
+                    }
+                }
+            }
+
+        }
+
+        .d {
+            position: relative;
+            width: 100vw;
+            height: 83vh;
+            background-color: #ffffff;
+
+            .d_1 {
+                padding: 2vw 2vw 0 2vw;
+
                 .list {
                     margin: 0 0 2vw 0;
                     padding: 2vw;

+ 24 - 2
pagesSchool/school/info.wxml

@@ -35,7 +35,7 @@
                 </scroll-view>
             </view>
             <view wx:elif="{{tabs.active=='1'}}" class="b">
-                <scroll-view scroll-y="true" class="scroll-view">
+                <scroll-view scroll-y="true" class="scroll-view" bindscrolltolower="toPage">
                     <view class="list-scroll-view">
                         <view class="b_1">
                             <view class="list" wx:for="{{teacherList}}" wx:key="index" bindtap="toCommon" data-route="common/coachinfo" data-id="{{item.coach_id}}">
@@ -57,9 +57,31 @@
                 </scroll-view>
             </view>
             <view wx:elif="{{tabs.active=='2'}}" class="c">
-                <scroll-view scroll-y="true" class="scroll-view">
+                <scroll-view scroll-y="true" class="scroll-view" bindscrolltolower="toPage">
                     <view class="list-scroll-view">
                         <view class="c_1">
+                            <view class="list" wx:for="{{studentList}}" wx:key="index" bindtap="toCommon" data-route="common/studentinfo" data-id="{{item.student_id}}">
+                                <view class="list_1">
+                                    <image class="image" src="{{item.student_id_icon[0].url}}"></image>
+                                </view>
+                                <view class="list_2">
+                                    <view class="name textOver">{{item.student_id_name}}</view>
+                                    <view class="other_1 textOver">
+                                        <text>运动等级:{{item.student_id_zhlevel}}</text>
+                                    </view>
+                                    <view class="other_1 textOver">
+                                        <text>联系电话:{{item.student_id_phone}}</text>
+                                    </view>
+                                </view>
+                            </view>
+                        </view>
+                    </view>
+                </scroll-view>
+            </view>
+            <view wx:elif="{{tabs.active=='3'}}" class="d">
+                <scroll-view scroll-y="true" class="scroll-view" bindscrolltolower="toPage">
+                    <view class="list-scroll-view">
+                        <view class="d_1">
                             <view class="list" wx:for="{{lessonList}}" wx:key="index" bindtap="toCommon" data-route="common/lessoninfo" data-id="{{item._id}}">
                                 <view class="name">{{item.title}}</view>
                                 <view class="other_1">

+ 40 - 3
pagesSchool/school/info.wxss

@@ -90,22 +90,59 @@
   padding: 2vw 2vw 0 2vw;
 }
 .main .two .c .c_1 .list {
+  margin: 0 0 2vw 0;
+  display: flex;
+  padding: 2vw;
+  border-radius: 5px;
+  box-shadow: 0 0 5px #858585;
+}
+.main .two .c .c_1 .list .list_1 {
+  width: 20vw;
+}
+.main .two .c .c_1 .list .list_1 .image {
+  width: 100%;
+  height: 66px;
+  border-radius: 90px;
+}
+.main .two .c .c_1 .list .list_2 {
+  width: 72vw;
+  padding: 0 0 0 2vw;
+}
+.main .two .c .c_1 .list .list_2 .name {
+  font-size: 16px;
+  font-weight: bold;
+  margin: 0 0 1vw 0;
+}
+.main .two .c .c_1 .list .list_2 .other_1 {
+  font-size: 14px;
+  margin: 0 0 1vw 0;
+}
+.main .two .d {
+  position: relative;
+  width: 100vw;
+  height: 83vh;
+  background-color: #ffffff;
+}
+.main .two .d .d_1 {
+  padding: 2vw 2vw 0 2vw;
+}
+.main .two .d .d_1 .list {
   margin: 0 0 2vw 0;
   padding: 2vw;
   border-radius: 5px;
   box-shadow: 0 0 5px #858585;
   text-align: center;
 }
-.main .two .c .c_1 .list .name {
+.main .two .d .d_1 .list .name {
   font-size: 16px;
   font-weight: bold;
   margin: 0 0 2vw 0;
 }
-.main .two .c .c_1 .list .other_1 {
+.main .two .d .d_1 .list .other_1 {
   font-size: 14px;
   margin: 0 0 2vw 0;
 }
-.main .two .c .c_1 .list .btn button {
+.main .two .d .d_1 .list .btn button {
   background-color: #ffffff;
   box-shadow: 0 0 5px #f1f1f1;
 }

+ 1 - 1
utils/dict.js

@@ -61,7 +61,7 @@ export const school_menu = [
                 icon: 'icon-yonghu',
                 btn: [
                     { title: '课程管理', route: 'schAdmin/course/list', icon: 'icon-gongkaikekaifangke' },
-                    { title: '临时上课学员', route: 'schAdmin/courseexam/list', icon: 'icon-tianshenpi' },
+                    // { title: '临时上课学员', route: 'schAdmin/courseexam/list', icon: 'icon-tianshenpi' },
                 ]
             },
             {

+ 17 - 10
utils/util.js

@@ -1,19 +1,26 @@
 const formatTime = date => {
-  const year = date.getFullYear()
-  const month = date.getMonth() + 1
-  const day = date.getDate()
-  const hour = date.getHours()
-  const minute = date.getMinutes()
-  const second = date.getSeconds()
+    const year = date.getFullYear()
+    const month = date.getMonth() + 1
+    const day = date.getDate()
+    const hour = date.getHours()
+    const minute = date.getMinutes()
+    const second = date.getSeconds()
 
-  return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
+    return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
 }
 
 const formatNumber = n => {
-  n = n.toString()
-  return n[1] ? n : `0${n}`
+    n = n.toString()
+    return n[1] ? n : `0${n}`
+}
+
+// 隐藏手机号
+const hidePhone = (e) => {
+    var reg = /^(\d{3})\d{4}(\d{4})$/;
+    return e.replace(reg, "$1****$2");
 }
 
 module.exports = {
-  formatTime
+    formatTime,
+    hidePhone
 }