guhongwei преди 2 години
родител
ревизия
c8055aa122

+ 2 - 2
app.json

@@ -1,6 +1,5 @@
 {
 {
     "pages": [
     "pages": [
-
         "pages/index/index",
         "pages/index/index",
         "pages/register/index",
         "pages/register/index",
         "pages/other/agree",
         "pages/other/agree",
@@ -34,7 +33,9 @@
         "pages/schAdmin/course/coachlist",
         "pages/schAdmin/course/coachlist",
         "pages/schAdmin/course/coachadd",
         "pages/schAdmin/course/coachadd",
         "pages/schAdmin/coursetryexam/list",
         "pages/schAdmin/coursetryexam/list",
+        "pages/schAdmin/coursetryexam/info",
         "pages/schAdmin/courseexam/list",
         "pages/schAdmin/courseexam/list",
+        "pages/schAdmin/courseexam/info",
         "pages/schAdmin/income/list",
         "pages/schAdmin/income/list",
         "pages/schAdmin/stustat/list",
         "pages/schAdmin/stustat/list",
         "pages/schAdmin/coachstat/list",
         "pages/schAdmin/coachstat/list",
@@ -53,7 +54,6 @@
         "pages/setting/contact",
         "pages/setting/contact",
         "pages/test/index",
         "pages/test/index",
         "pages/logs/logs"
         "pages/logs/logs"
-
     ],
     ],
     "usingComponents": {
     "usingComponents": {
         "van-sidebar": "@vant/weapp/sidebar/index",
         "van-sidebar": "@vant/weapp/sidebar/index",

+ 66 - 0
pages/schAdmin/courseexam/info.js

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

+ 3 - 0
pages/schAdmin/courseexam/info.json

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

+ 0 - 0
pages/schAdmin/courseexam/info.less


+ 2 - 0
pages/schAdmin/courseexam/info.wxml

@@ -0,0 +1,2 @@
+<!--pages/schAdmin/courseexam/info.wxml-->
+<text>pages/schAdmin/courseexam/info.wxml</text>

+ 1 - 0
pages/schAdmin/courseexam/info.wxss

@@ -0,0 +1 @@
+/* pages/schAdmin/courseexam/info.wxss */

+ 0 - 0
pages/schAdmin/coursetryexam/iinfo.less


+ 66 - 0
pages/schAdmin/coursetryexam/info.js

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

+ 3 - 0
pages/schAdmin/coursetryexam/info.json

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

+ 2 - 0
pages/schAdmin/coursetryexam/info.wxml

@@ -0,0 +1,2 @@
+<!--pages/schAdmin/coursetryexam/info.wxml-->
+<text>pages/schAdmin/coursetryexam/info.wxml</text>

+ 1 - 0
pages/schAdmin/coursetryexam/info.wxss

@@ -0,0 +1 @@
+/* pages/schAdmin/coursetryexam/info.wxss */

+ 93 - 16
pages/school/info.js

@@ -6,15 +6,26 @@ Page({
         user: {},
         user: {},
         id: '',
         id: '',
         form: {},
         form: {},
+
         // 选中
         // 选中
         tabs: {
         tabs: {
-            active: '0',
+            active: '2',
             menu: [
             menu: [
                 { title: '羽校信息', active: '0' },
                 { title: '羽校信息', active: '0' },
                 { title: '师资信息', active: '1' },
                 { title: '师资信息', active: '1' },
                 { title: '课程信息', active: '2' },
                 { title: '课程信息', active: '2' },
             ]
             ]
         },
         },
+        // 教练信息
+        coachList: [],
+        // 分页
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
+        // 字典表
+        // 教练等级
+        levelList: []
     },
     },
     // 跳转菜单
     // 跳转菜单
     back(e) {
     back(e) {
@@ -26,6 +37,17 @@ Page({
         let data = e.detail;
         let data = e.detail;
         that.setData({ 'tabs.active': data.active })
         that.setData({ 'tabs.active': data.active })
     },
     },
+    // 图片预览
+    imgView: function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        if (item && item.length > 0) {
+            wx.previewImage({
+                current: '',
+                urls: [item[0].url]
+            })
+        }
+    },
     //申请入学
     //申请入学
     toApply: function () {
     toApply: function () {
         const that = this;
         const that = this;
@@ -36,10 +58,10 @@ Page({
                 let user = that.data.user;
                 let user = that.data.user;
                 let form = that.data.form;
                 let form = that.data.form;
                 if (res.confirm) {
                 if (res.confirm) {
-                    var params = { student_id: user.info.id, school_id: form._id, time: moment().format('YYYY-MM-DD HH:mm:ss') };
+                    var params = { school_id: form._id, student_id: user.info.id, time: moment().format('YYYY-MM-DD HH:mm:ss') };
                     let arr = await app.$post(`/safs`, params);
                     let arr = await app.$post(`/safs`, params);
-                    if (arr.errcode == '0') { wx.showToast({ title: `申请入学成功`, icon: 'success', duration: 2000 }); that.watchLogin(); }
-                    else wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+                    if (arr.errcode == '0') { wx.showToast({ title: `申请入学成功`, icon: 'success', duration: 2000 }); }
+                    else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
                 } else if (res.cancel) { }
                 } else if (res.cancel) { }
             }
             }
         });
         });
@@ -50,15 +72,31 @@ Page({
         const { item } = e.currentTarget.dataset;
         const { item } = e.currentTarget.dataset;
         wx.navigateTo({ url: `/pages/stuAdmin/open/sign?id=${item._id}` })
         wx.navigateTo({ url: `/pages/stuAdmin/open/sign?id=${item._id}` })
     },
     },
+    // 分页
+    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.searchRcs();
+            wx.hideLoading()
+        } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
+    },
     /**
     /**
      * 生命周期函数--监听页面加载
      * 生命周期函数--监听页面加载
      */
      */
-    onLoad: function (options) {
-        console.log(options);
+    onLoad: async function (options) {
         const that = this;
         const that = this;
         that.setData({ id: options.id || '62fc48778f740d555aa5035d' })
         that.setData({ id: options.id || '62fc48778f740d555aa5035d' })
+        // 查询其他信息
+        await that.searchOther();
         // 监听用户是否登录
         // 监听用户是否登录
-        that.watchLogin();
+        await that.watchLogin();
     },
     },
     // 监听用户是否登录
     // 监听用户是否登录
     watchLogin: async function () {
     watchLogin: async function () {
@@ -66,17 +104,13 @@ Page({
         wx.getStorage({
         wx.getStorage({
             key: 'user',
             key: 'user',
             success: async res => {
             success: async res => {
-                that.setData({ user: res.data })
                 if (that.data.id) {
                 if (that.data.id) {
-                    let arr;
                     // 学校信息
                     // 学校信息
-                    arr = await app.$get(`/school/${that.data.id}`)
-                    if (arr.errcode == '0') { that.setData({ form: arr.data }) }
-                    else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
-                    // 公开课
-                    arr = await app.$get(`/lesson`, { school_id: that.data.id });
-                    if (arr.errcode == '0') { that.setData({ openList: arr.data }) }
-                    else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+                    await that.searchSchool(that.data.id);
+                    // 师资信息
+                    await that.searchRcs(that.data.id);
+                    // 课程信息
+                    await that.searchLesson(that.data.id);
                 }
                 }
             },
             },
             fail: async res => {
             fail: async res => {
@@ -84,6 +118,49 @@ Page({
             }
             }
         })
         })
     },
     },
+    // 学校信息
+    searchSchool: async function (e) {
+        const arr = await app.$get(`/school/${e}`)
+        if (arr.errcode == '0') { that.setData({ form: arr.data }) }
+        else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+    },
+    // 师资信息
+    searchRcs: async function () {
+        const that = this;
+        if (that.data.id) {
+            let info = { skip: that.data.skip, limit: that.data.limit }
+            const arr = await app.$get(`/rcs`, { school_id: that.data.id, ...info });
+            if (arr.errcode == '0') {
+                let list = [...that.data.coachList, ...arr.data];
+                for (const val of list) { val.zhLevel = that.searchLevel(val.coach_id_level) }
+                that.setData({ coachList: list });
+                that.setData({ total: arr.total })
+            }
+        }
+    },
+    // 查询类型
+    searchLevel: function () {
+        const that = this;
+        let levelList = that.data.levelList;
+        let data = levelList.find(i => i.value == e);
+        if (data) return data.label;
+        else return '暂无'
+    },
+    // 查询课程信息
+    searchLesson: function () {
+
+    },
+    // 查询其他信息
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        // 教练等级
+        arr = await app.$get(`/dict`, { code: 'coach_grade' })
+        if (arr.errcode == '0' && arr.total > 0) {
+            let data = arr.data[0];
+            if (data.list && data.list.length > 0) that.setData({ levelList: data.list })
+        }
+    },
     /**
     /**
      * 生命周期函数--监听页面初次渲染完成
      * 生命周期函数--监听页面初次渲染完成
      */
      */

+ 106 - 22
pages/school/info.less

@@ -11,14 +11,17 @@
         flex-grow: 1;
         flex-grow: 1;
 
 
         .a {
         .a {
-            width: 96vw;
-            padding: 2vw;
+            height: 83vh;
 
 
             .one {
             .one {
+
                 width: 96vw;
                 width: 96vw;
+                padding: 0 2vw;
+                margin: 0 0 2vw 0;
+
 
 
                 swiper {
                 swiper {
-                    height: 25vh;
+                    height: 30vh;
 
 
                     .image {
                     .image {
                         width: 100%;
                         width: 100%;
@@ -27,27 +30,108 @@
                     }
                     }
                 }
                 }
             }
             }
+
+            .two {
+                width: 96vw;
+                padding: 0 2vw;
+
+                .name {
+                    font-size: var(--font20Szie);
+                    font-weight: bold;
+                    margin: 0 0 2vw 0;
+                }
+
+                .other {
+                    margin: 0 0 2vw 0;
+
+                    .other_1 {
+                        padding: 2vw 0;
+                        font-size: var(--font16Szie);
+                        border-bottom: 1px dashed var(--f1Color);
+
+                        text:first-child {
+                            color: var(--f85Color);
+                        }
+                    }
+
+                    .image {
+                        width: 100%;
+                    }
+                }
+            }
+
         }
         }
 
 
-        .b {}
+        .b {
+            height: 83vh;
+
+            .list {
+                background-color: var(--f9Color);
+                margin: 0 0 2vw 0;
+                padding: 2vw;
+                margin: 0 2vw 2vw 2vw;
+                border-radius: 5px;
+
+                .name {
+                    font-size: var(--font18Szie);
+                    font-weight: bold;
+                    margin: 0 0 1vw 0;
+                }
+
+                .other {
+                    margin: 0 0 1vw 0;
+
+                    .other_1 {
+                        margin: 0 0 1vw 0;
+                        font-size: var(--font16Size);
+
+                        text:first-child {
+                            color: var(--f85Color);
+                        }
+                    }
+                }
+
+                .btn {
+                    text-align: center;
+
+                    button {
+                        margin: 0 2vw;
+                        font-size: var(--font14Size);
+                    }
+                }
+            }
+        }
     }
     }
 }
 }
 
 
-// .school {
-//     position: fixed;
-//     width: 96vw;
-//     bottom: 8vh;
-//     right: 1vw;
-//     text-align: right;
-
-//     .school_txt {
-//         display: inline-block;
-//         width: 10vw;
-//         padding: 1vw;
-//         text-align: center;
-//         background-color: #53C9F8;
-//         color: var(--mainColor);
-//         font-size: var(--font14Size);
-//         border-radius: 5px;
-//     }
-// }
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}
+
+.inSchool {
+    position: fixed;
+    width: 96vw;
+    bottom: 8vh;
+    right: 2vw;
+    text-align: right;
+
+    .btn {
+        display: inline-block;
+        width: 10vw;
+        padding: 1vw;
+        text-align: center;
+        background-color: green;
+        color: var(--whiteColor);
+        font-size: var(--font14Size);
+        border-radius: 5px;
+    }
+}

+ 52 - 25
pages/school/info.wxml

@@ -5,33 +5,60 @@
         </view>
         </view>
         <view class="two">
         <view class="two">
             <view wx:if="{{tabs.active=='0'}}" class="a">
             <view wx:if="{{tabs.active=='0'}}" class="a">
-                <view class="one">
-                    <swiper autoplay="true" circular="true" interval="3000" duration="1000">
-                        <block wx:for="{{form.img_url}}" wx:key="tag" wx:for-item="tag" wx:for-index="tagindex">
-                            <swiper-item>
-                                <image class="image" src="{{tag.url}}"></image>
-                            </swiper-item>
-                        </block>
-                    </swiper>
-                </view>
-                <view class="two">
-                    <view class="name">{{form.name}}</view>
-                    <view class="other">
-                        <view class="other_1"><text>学校简介:</text><text>{{form.brief||'暂无'}}</text></view>
-                        <view class="other_1"><text>联系方式:</text><text>{{form.phone||'暂无'}}</text></view>
-                        <view class="other_1"><text>训练地址</text><text>{{form.address||'暂无'}}</text></view>
-                        <view class="other_1"><text>教练人数</text><text>{{form.coach_num||'暂无'}}</text></view>
-                        <view class="other_1"><text>学员人数</text><text>{{form.student_num||'暂无'}}</text></view>
-                        <view class="other_1"><text>过往荣誉</text><text>{{form.honor||'暂无'}}</text></view>
-                        <view class="other_1"><text>网址</text><text>{{form.url||'暂无'}}</text></view>
+                <scroll-view scroll-y="true" class="scroll-view">
+                    <view class="list-scroll-view">
+                        <view class="one">
+                            <swiper autoplay="true" circular="true" interval="3000" duration="1000">
+                                <block wx:for="{{form.img_url}}" wx:key="tag" wx:for-item="tag" wx:for-index="tagindex">
+                                    <swiper-item>
+                                        <image class="image" src="{{tag.url}}"></image>
+                                    </swiper-item>
+                                </block>
+                            </swiper>
+                        </view>
+                        <view class="two">
+                            <view class="name">{{form.name}}</view>
+                            <view class="other">
+                                <view class="other_1"><text>学校简介:</text><text>{{form.brief||'暂无'}}</text></view>
+                                <view class="other_1"><text>联系方式:</text><text>{{form.phone||'暂无'}}</text></view>
+                                <view class="other_1"><text>训练地址:</text><text>{{form.address||'暂无'}}</text></view>
+                                <view class="other_1"><text>教练人数:</text><text>{{form.coach_num||'暂无'}}</text></view>
+                                <view class="other_1"><text>学员人数:</text><text>{{form.student_num||'暂无'}}</text></view>
+                                <view class="other_1"><text>过往荣誉:</text><text>{{form.honor||'暂无'}}</text></view>
+                                <view class="other_1"><text>学校网址:</text><text>{{form.url||'暂无'}}</text></view>
+                                <view class="other_1"><text>营业执照:</text>
+                                    <image class="image" bindtap="imgView" data-item="{{form.yyzz}}" mode="aspectFit" src="{{form.yyzz&&form.yyzz.length>0?form.yyzz[0].url:''}}"></image>
+                                </view>
+                            </view>
+                        </view>
+                        <view class="inSchool">
+                            <text class="btn" bindtap="toApply">申请入学</text>
+                        </view>
                     </view>
                     </view>
-                </view>
-                <!-- {{form.name}}
-                <view class="school" wx:if="{{user.type=='3'}}">
-                    <text class="school_txt" bindtap="toApply">申请入学</text>
-                </view> -->
+                </scroll-view>
+            </view>
+            <view wx:elif="{{tabs.active=='1'}}" class="b">
+                <scroll-view scroll-y="true" class="scroll-view" bindscrolltolower="toPage">
+                    <view class="list-scroll-view">
+                        <view class="list" wx:for="{{coachList}}" wx:key="index">
+                            <view class="name">{{item.coach_id_name}}</view>
+                            <view class="other">
+                                <view class="other_1">
+                                    <text>教练等级:</text>
+                                    <text>{{item.zhLevel}}</text>
+                                </view>
+                                <view class="other_1">
+                                    <text>联系电话:</text>
+                                    <text>{{item.coach_id_phone}}</text>
+                                </view>
+                            </view>
+                            <view class="btn">
+                                <button type="primary" size="mini">详细信息</button>
+                            </view>
+                        </view>
+                    </view>
+                </scroll-view>
             </view>
             </view>
-            <view wx:elif="{{tabs.active=='1'}}" class="b">师资信息</view>
             <view wx:elif="{{tabs.active=='2'}}" class="c">
             <view wx:elif="{{tabs.active=='2'}}" class="c">
                 <view class="cList" wx:for="{{openList}}" wx:key="index">
                 <view class="cList" wx:for="{{openList}}" wx:key="index">
                     <view class="name">{{item.title}}</view>
                     <view class="name">{{item.title}}</view>

+ 87 - 3
pages/school/info.wxss

@@ -10,17 +10,101 @@
   flex-grow: 1;
   flex-grow: 1;
 }
 }
 .main .two .a {
 .main .two .a {
-  width: 96vw;
-  padding: 2vw;
+  height: 83vh;
 }
 }
 .main .two .a .one {
 .main .two .a .one {
   width: 96vw;
   width: 96vw;
+  padding: 0 2vw;
+  margin: 0 0 2vw 0;
 }
 }
 .main .two .a .one swiper {
 .main .two .a .one swiper {
-  height: 25vh;
+  height: 30vh;
 }
 }
 .main .two .a .one swiper .image {
 .main .two .a .one swiper .image {
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
   border-radius: 10px;
   border-radius: 10px;
 }
 }
+.main .two .a .two {
+  width: 96vw;
+  padding: 0 2vw;
+}
+.main .two .a .two .name {
+  font-size: var(--font20Szie);
+  font-weight: bold;
+  margin: 0 0 2vw 0;
+}
+.main .two .a .two .other {
+  margin: 0 0 2vw 0;
+}
+.main .two .a .two .other .other_1 {
+  padding: 2vw 0;
+  font-size: var(--font16Szie);
+  border-bottom: 1px dashed var(--f1Color);
+}
+.main .two .a .two .other .other_1 text:first-child {
+  color: var(--f85Color);
+}
+.main .two .a .two .other .image {
+  width: 100%;
+}
+.main .two .b {
+  height: 83vh;
+}
+.main .two .b .list {
+  background-color: var(--f9Color);
+  margin: 0 0 2vw 0;
+  padding: 2vw;
+  margin: 0 2vw 2vw 2vw;
+  border-radius: 5px;
+}
+.main .two .b .list .name {
+  font-size: var(--font18Szie);
+  font-weight: bold;
+  margin: 0 0 1vw 0;
+}
+.main .two .b .list .other {
+  margin: 0 0 1vw 0;
+}
+.main .two .b .list .other .other_1 {
+  margin: 0 0 1vw 0;
+  font-size: var(--font16Size);
+}
+.main .two .b .list .other .other_1 text:first-child {
+  color: var(--f85Color);
+}
+.main .two .b .list .btn {
+  text-align: center;
+}
+.main .two .b .list .btn button {
+  margin: 0 2vw;
+  font-size: var(--font14Size);
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}
+.inSchool {
+  position: fixed;
+  width: 96vw;
+  bottom: 8vh;
+  right: 2vw;
+  text-align: right;
+}
+.inSchool .btn {
+  display: inline-block;
+  width: 10vw;
+  padding: 1vw;
+  text-align: center;
+  background-color: green;
+  color: var(--whiteColor);
+  font-size: var(--font14Size);
+  border-radius: 5px;
+}