zs %!s(int64=2) %!d(string=hai) anos
pai
achega
b21b345e9f
Modificáronse 44 ficheiros con 1078 adicións e 129 borrados
  1. 4 0
      app.json
  2. 21 3
      pages/school/info.js
  3. 20 1
      pages/school/info.less
  4. 6 1
      pages/school/info.wxml
  5. 17 0
      pages/school/info.wxss
  6. 104 0
      pages/sthrcoach/info.js
  7. 6 0
      pages/sthrcoach/info.json
  8. 32 0
      pages/sthrcoach/info.less
  9. 42 0
      pages/sthrcoach/info.wxml
  10. 27 0
      pages/sthrcoach/info.wxss
  11. 31 27
      pages/sthrcoach/list.js
  12. 2 1
      pages/sthrcoach/list.less
  13. 5 5
      pages/sthrcoach/list.wxml
  14. 2 1
      pages/sthrcoach/list.wxss
  15. 96 0
      pages/sthropen/info.js
  16. 6 0
      pages/sthropen/info.json
  17. 32 0
      pages/sthropen/info.less
  18. 46 0
      pages/sthropen/info.wxml
  19. 27 0
      pages/sthropen/info.wxss
  20. 41 24
      pages/sthropen/list.js
  21. 5 5
      pages/sthropen/list.json
  22. 2 1
      pages/sthropen/list.less
  23. 2 3
      pages/sthropen/list.wxml
  24. 2 1
      pages/sthropen/list.wxss
  25. 96 0
      pages/sthrprivate/info.js
  26. 6 0
      pages/sthrprivate/info.json
  27. 32 0
      pages/sthrprivate/info.less
  28. 46 0
      pages/sthrprivate/info.wxml
  29. 27 0
      pages/sthrprivate/info.wxss
  30. 41 25
      pages/sthrprivate/list.js
  31. 5 5
      pages/sthrprivate/list.json
  32. 2 1
      pages/sthrprivate/list.less
  33. 2 3
      pages/sthrprivate/list.wxml
  34. 2 1
      pages/sthrprivate/list.wxss
  35. 82 0
      pages/sthrschool/info.js
  36. 6 0
      pages/sthrschool/info.json
  37. 42 0
      pages/sthrschool/info.less
  38. 46 0
      pages/sthrschool/info.wxml
  39. 35 0
      pages/sthrschool/info.wxss
  40. 12 5
      pages/sthrschool/list.js
  41. 5 5
      pages/sthrschool/list.json
  42. 3 2
      pages/sthrschool/list.less
  43. 7 7
      pages/sthrschool/list.wxml
  44. 3 2
      pages/sthrschool/list.wxss

+ 4 - 0
app.json

@@ -39,9 +39,13 @@
         "pages/sonecoachstat/list",
         "pages/sonecoachstat/list",
         "pages/sthrfiles/list",
         "pages/sthrfiles/list",
         "pages/sthrcoach/list",
         "pages/sthrcoach/list",
+        "pages/sthrcoach/info",
         "pages/sthrschool/list",
         "pages/sthrschool/list",
+        "pages/sthrschool/info",
         "pages/sthropen/list",
         "pages/sthropen/list",
+        "pages/sthropen/info",
         "pages/sthrprivate/list",
         "pages/sthrprivate/list",
+        "pages/sthrprivate/info",
         "pages/sthrstudystat/list",
         "pages/sthrstudystat/list",
         "pages/sthrfeestat/list"
         "pages/sthrfeestat/list"
     ],
     ],

+ 21 - 3
pages/school/info.js

@@ -1,4 +1,5 @@
 const app = getApp()
 const app = getApp()
+const moment = require("../../utils/moment.min")
 Page({
 Page({
     data: {
     data: {
         frameStyle: { useTop: true, name: '羽校信息', leftArrow: true, useBar: false },
         frameStyle: { useTop: true, name: '羽校信息', leftArrow: true, useBar: false },
@@ -12,7 +13,7 @@ Page({
                 { title: '羽校信息', active: '0' },
                 { title: '羽校信息', active: '0' },
                 { title: '师资信息', active: '1' },
                 { title: '师资信息', active: '1' },
             ]
             ]
-        }
+        },
     },
     },
     // 跳转菜单
     // 跳转菜单
     back(e) {
     back(e) {
@@ -24,8 +25,24 @@ Page({
         let data = e.detail;
         let data = e.detail;
         that.setData({ 'tabs.active': data.active })
         that.setData({ 'tabs.active': data.active })
     },
     },
-
-
+    //申请入学
+    toApply: function () {
+        const that = this;
+        wx.showModal({
+            title: '提示',
+            content: '您是否确定加入此学校?',
+            async success(res) {
+                let user = that.data.user;
+                let form = that.data.form;
+                if (res.confirm) {
+                    var params = { student_id: user.info.id, school_id: form._id, time: moment().format('YYYY-MM-DD HH:mm:ss') };
+                    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 })
+                } else if (res.cancel) { }
+            }
+        });
+    },
     /**
     /**
      * 生命周期函数--监听页面加载
      * 生命周期函数--监听页面加载
      */
      */
@@ -41,6 +58,7 @@ 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) {
                     const arr = await app.$get(`/school/${that.data.id}`)
                     const arr = await app.$get(`/school/${that.data.id}`)
                     if (arr.errcode == '0') {
                     if (arr.errcode == '0') {

+ 20 - 1
pages/school/info.less

@@ -11,7 +11,26 @@
         flex-grow: 1;
         flex-grow: 1;
         background-color: #0000ff;
         background-color: #0000ff;
 
 
-        .a {}
+        .a {
+            .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;
+                }
+            }
+        }
 
 
         .b {}
         .b {}
     }
     }

+ 6 - 1
pages/school/info.wxml

@@ -4,7 +4,12 @@
             <s-tab tabs="{{tabs}}" bind:tabsChange="tabsChange"></s-tab>
             <s-tab tabs="{{tabs}}" bind:tabsChange="tabsChange"></s-tab>
         </view>
         </view>
         <view class="two">
         <view class="two">
-            <view wx:if="{{tabs.active=='0'}}" class="a">{{form.name}}</view>
+            <view wx:if="{{tabs.active=='0'}}" class="a">
+                {{form.name}}
+                <view class="school" wx:if="{{user.type=='3'}}">
+                    <text class="school_txt" bindtap="toApply">申请入学</text>
+                </view>
+            </view>
             <view wx:elif="{{tabs.active=='1'}}" class="b">第二</view>
             <view wx:elif="{{tabs.active=='1'}}" class="b">第二</view>
         </view>
         </view>
     </view>
     </view>

+ 17 - 0
pages/school/info.wxss

@@ -10,3 +10,20 @@
   flex-grow: 1;
   flex-grow: 1;
   background-color: #0000ff;
   background-color: #0000ff;
 }
 }
+.main .two .a .school {
+  position: fixed;
+  width: 96vw;
+  bottom: 8vh;
+  right: 1vw;
+  text-align: right;
+}
+.main .two .a .school .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;
+}

+ 104 - 0
pages/sthrcoach/info.js

@@ -0,0 +1,104 @@
+const app = getApp()
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '教练信息', leftArrow: true, useBar: false },
+        id: '',
+        form: {},
+        // 性别
+        genderList: [],
+        //运动等级
+        levelList: [],
+    },
+    // 跳转菜单
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function (options) {
+        const that = this;
+        await that.setData({ id: options.id || null })
+        // 查询其他信息
+        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) 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 });
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        let genderList = that.data.genderList;
+        let levelList = that.data.levelList;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                if (that.data.id) {
+                    const arr = await app.$get(`/coach/${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 })
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/sthrcoach/info.json

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

+ 32 - 0
pages/sthrcoach/info.less

@@ -0,0 +1,32 @@
+.main {
+    height: var(--twoHeight);
+
+    .one {
+        width: 96vw;
+        padding: 0 2vw;
+
+        .one_1 {
+            display: flex;
+            flex-direction: row;
+            justify-content: space-between;
+            border: 1px dashed var(--f85Color);
+            border-radius: 5px;
+            margin: 0 0 10px 0;
+            padding: 10px;
+
+            .text {
+                color: var(--f85Color);
+                font-size: var(--font16Size);
+            }
+
+            .text1 {
+                font-size: var(--font16Size);
+            }
+
+            .image {
+                width: 15vw;
+                height: 15vw;
+            }
+        }
+    }
+}

+ 42 - 0
pages/sthrcoach/info.wxml

@@ -0,0 +1,42 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <view class="one_1">
+                <text class="text">头像:</text>
+                <image class="image" src="{{form.icon[0].url}}"></image>
+            </view>
+            <view class="one_1">
+                <text class="text">姓名:</text>
+                <text class="text1">{{form.name||'暂无昵称'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">性别:</text>
+                <text class="text1">{{form.zhGender||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">年龄:</text>
+                <text class="text1">{{form.age||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">电话:</text>
+                <text class="text1">{{form.phone||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">等级:</text>
+                <text class="text1">{{form.zhLevel||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">简介:</text>
+                <text class="text1">{{form.brief||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">荣誉:</text>
+                <text class="text1">{{form.honor||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">教学经历:</text>
+                <text class="text1">{{form.exp||'暂无'}}</text>
+            </view>
+        </view>
+    </view>
+</mobile-main>

+ 27 - 0
pages/sthrcoach/info.wxss

@@ -0,0 +1,27 @@
+.main {
+  height: var(--twoHeight);
+}
+.main .one {
+  width: 96vw;
+  padding: 0 2vw;
+}
+.main .one .one_1 {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  border: 1px dashed var(--f85Color);
+  border-radius: 5px;
+  margin: 0 0 10px 0;
+  padding: 10px;
+}
+.main .one .one_1 .text {
+  color: var(--f85Color);
+  font-size: var(--font16Size);
+}
+.main .one .one_1 .text1 {
+  font-size: var(--font16Size);
+}
+.main .one .one_1 .image {
+  width: 15vw;
+  height: 15vw;
+}

+ 31 - 27
pages/sthrcoach/list.js

@@ -7,6 +7,9 @@ Page({
         page: 0,
         page: 0,
         skip: 0,
         skip: 0,
         limit: 5,
         limit: 5,
+        info: {},
+        info: {},
+        dialog: { title: '详细信息', show: false, type: '1' },
         // 性别
         // 性别
         genderList: [],
         genderList: [],
         //运动等级
         //运动等级
@@ -16,6 +19,13 @@ Page({
     back(e) {
     back(e) {
         wx.navigateBack({ delta: 1 })
         wx.navigateBack({ delta: 1 })
     },
     },
+    // 查看
+    toView: async function (e) {
+        const that = this;
+        that.setData({ skip: 0, page: 0, list: [] })
+        const { item } = e.currentTarget.dataset;
+        wx.navigateTo({ url: `/pages/sthrcoach/info?id=${item.coach_id}` })
+    },
     // 分页
     // 分页
     toPage: function () {
     toPage: function () {
         const that = this;
         const that = this;
@@ -36,21 +46,29 @@ Page({
      */
      */
     onLoad: function (options) {
     onLoad: function (options) {
     },
     },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: async function () {
+        const that = this;
+        // 查询其他信息
+        await that.searchOther();
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
     searchOther: async function () {
     searchOther: async function () {
         const that = this;
         const that = this;
         let arr;
         let arr;
         // 性别
         // 性别
         arr = await app.$get(`/dict`, { code: 'gender' });
         arr = await app.$get(`/dict`, { code: 'gender' });
-        if (arr.errcode == '0' && arr.total > 0) {
-            let list = arr.data[0].list;
-            that.setData({ genderList: list })
-        }
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ genderList: arr.data[0].list });
         // 运动等级
         // 运动等级
         arr = await app.$get(`/dict`, { code: 'student_grade' });
         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 })
-        }
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ levelList: arr.data[0].list });
     },
     },
     // 监听用户是否登录
     // 监听用户是否登录
     watchLogin: async function () {
     watchLogin: async function () {
@@ -60,17 +78,15 @@ Page({
         wx.getStorage({
         wx.getStorage({
             key: 'user',
             key: 'user',
             success: async res => {
             success: async res => {
-                let info = { skip: that.data.skip, limit: that.data.limit, student_id: res.data._id };
+                let info = { skip: that.data.skip, limit: that.data.limit, student_id: res.data.info.id };
                 let arr = await app.$get(`/rsc`, { ...info });
                 let arr = await app.$get(`/rsc`, { ...info });
                 if (arr.errcode == '0') {
                 if (arr.errcode == '0') {
-                    let list = [{ icon: [{ url: '/image/beijing.jpeg' }], id: '1', name: '教练名称', gender: '0', age: 22, phone: '12345678901', level: '0', honor: '荣誉' }]
-                    that.setData({ list: list })
                     for (const val of arr.data) {
                     for (const val of arr.data) {
-                        let level = levelList.find(i => i.value == val.level); if (level) val.zhLevel = level.label;
-                        let gender = genderList.find(i => i.value == val.gender); if (gender) val.zhGender = level.label;
+                        let level = levelList.find(i => i.value == val.coach_id_level); if (level) val.zhLevel = level.label;
+                        let gender = genderList.find(i => i.value == val.coach_id_gender); if (gender) val.zhGender = level.label;
                     }
                     }
-                    // that.setData({ list: [...that.data.list, ...arr.data] })
-                    // that.setData({ total: arr.total })
+                    that.setData({ list: [...that.data.list, ...arr.data] })
+                    that.setData({ total: arr.total })
                 } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
                 } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
             },
             },
             fail: async res => {
             fail: async res => {
@@ -78,18 +94,6 @@ Page({
             }
             }
         })
         })
     },
     },
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () { },
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        const that = this;
-        // 监听用户是否登录
-        that.watchLogin();
-    },
     /**
     /**
      * 页面上拉触底事件的处理函数
      * 页面上拉触底事件的处理函数
      */
      */

+ 2 - 1
pages/sthrcoach/list.less

@@ -80,7 +80,8 @@
                 margin: 2vw 0 0 0;
                 margin: 2vw 0 0 0;
 
 
                 button {
                 button {
-                    background: -webkit-linear-gradient(right, lightblue, rgb(83, 201, 248));
+                    font-size: var(--font14Size);
+                    background: -webkit-linear-gradient(right, lightblue, #53C9F8);
                 }
                 }
             }
             }
         }
         }

+ 5 - 5
pages/sthrcoach/list.wxml

@@ -8,16 +8,16 @@
                 <view class="list-scroll-view">
                 <view class="list-scroll-view">
                     <view class="list" wx:for="{{list}}" wx:key="item">
                     <view class="list" wx:for="{{list}}" wx:key="item">
                         <view class="list_1">
                         <view class="list_1">
-                            <image class="image" src="{{item.icon&&item.icon.length>0?item.icon[0].url:''}}"></image>
+                            <image class="image" src="{{item.coach_id_icon&&item.coach_id_icon.length>0?item.coach_id_icon[0].url:''}}"></image>
                             <view class="content">
                             <view class="content">
-                                <view class="name textOver">{{item.name||'暂无'}}</view>
-                                <view class="txt textOver"><text>联系电话:</text><text>{{item.phone||'暂无'}}</text></view>
+                                <view class="name textOver">{{item.coach_id_name||'暂无'}}</view>
+                                <view class="txt textOver"><text>联系电话:</text><text>{{item.coach_id_phone||'暂无'}}</text></view>
                                 <view class="other textOver">
                                 <view class="other textOver">
                                     <view class="other_1 textOver"><text>性别:</text><text>{{item.zhGender||'暂无'}}</text></view>
                                     <view class="other_1 textOver"><text>性别:</text><text>{{item.zhGender||'暂无'}}</text></view>
-                                    <view class="other_1 textOver"><text>年龄:</text><text>{{item.age||'暂无'}}岁</text></view>
+                                    <view class="other_1 textOver"><text>年龄:</text><text>{{item.coach_id_age||'暂无'}}岁</text></view>
                                 </view>
                                 </view>
                                 <view class="txt textOver"><text>教练等级:</text><text>{{item.zhLevel||'暂无'}}</text></view>
                                 <view class="txt textOver"><text>教练等级:</text><text>{{item.zhLevel||'暂无'}}</text></view>
-                                <view class="txt textOver"><text>所获荣誉:</text><text>{{item.honor||'暂无'}}</text></view>
+                                <view class="txt textOver"><text>所获荣誉:</text><text>{{item.coach_id_honor||'暂无'}}</text></view>
                             </view>
                             </view>
                         </view>
                         </view>
                         <view class="btn">
                         <view class="btn">

+ 2 - 1
pages/sthrcoach/list.wxss

@@ -69,7 +69,8 @@
   margin: 2vw 0 0 0;
   margin: 2vw 0 0 0;
 }
 }
 .main .two .list .btn button {
 .main .two .list .btn button {
-  background: -webkit-linear-gradient(right, lightblue, #53c9f8);
+  font-size: var(--font14Size);
+  background: -webkit-linear-gradient(right, lightblue, #53C9F8);
 }
 }
 .scroll-view {
 .scroll-view {
   position: absolute;
   position: absolute;

+ 96 - 0
pages/sthropen/info.js

@@ -0,0 +1,96 @@
+const app = getApp()
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '公开课信息', leftArrow: true, useBar: false },
+        id: '',
+        form: {},
+        //状态
+        statusList: []
+    },
+    // 跳转菜单
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function (options) {
+        const that = this;
+        await that.setData({ id: options.id || null })
+        // 查询其他信息
+        await that.searchOther();
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        // 状态
+        arr = await app.$get(`/dict`, { code: 'lesson_status' });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ statusList: arr.data[0].list });
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        let statusList = that.data.statusList;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                if (that.data.id) {
+                    const arr = await app.$get(`/lessonPublic/${that.data.id}`);
+                    if (arr.errcode == '0') {
+                        let status = statusList.find(i => i.value == arr.data.status)
+                        if (status) arr.data.zhStatus = level.label;
+                        that.setData({ form: arr.data })
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/sthropen/info.json

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

+ 32 - 0
pages/sthropen/info.less

@@ -0,0 +1,32 @@
+.main {
+    height: var(--twoHeight);
+
+    .one {
+        width: 96vw;
+        padding: 0 2vw;
+
+        .one_1 {
+            display: flex;
+            flex-direction: row;
+            justify-content: space-between;
+            border: 1px dashed var(--f85Color);
+            border-radius: 5px;
+            margin: 0 0 10px 0;
+            padding: 10px;
+
+            .text {
+                color: var(--f85Color);
+                font-size: var(--font16Size);
+            }
+
+            .text1 {
+                font-size: var(--font16Size);
+            }
+
+            .image {
+                width: 15vw;
+                height: 15vw;
+            }
+        }
+    }
+}

+ 46 - 0
pages/sthropen/info.wxml

@@ -0,0 +1,46 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <view class="one_1">
+                <text class="text">课程标题:</text>
+                <text class="text1">{{form.title||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">学校名称:</text>
+                <text class="text1">{{form.school_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">人数上限:</text>
+                <text class="text1">{{form.limit||'暂无'}}人</text>
+            </view>
+            <view class="one_1">
+                <text class="text">开始时间:</text>
+                <text class="text1">{{form.time_start||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">结束时间:</text>
+                <text class="text1">{{form.time_end||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">状态:</text>
+                <text class="text1">{{form.zhStatus||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">简介:</text>
+                <text class="text1">{{form.brief||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">教练人员:</text>
+                <view class="name" wx:if="{{form.coach_id&&item.coach_id.length>0}}" wx:for="{{form.coach_id}}" wx:key="item">
+                    <text class="text1">姓名:{{item.name||'暂无'}}</text>
+                </view>
+            </view>
+            <view class="one_1">
+                <text class="text">学生人员:</text>
+                <view class="name" wx:if="{{form.student&&item.student.length>0}}" wx:for="{{form.student}}" wx:key="item">
+                    <text class="text1">姓名:{{item.name||'暂无'}}</text>
+                </view>
+            </view>
+        </view>
+    </view>
+</mobile-main>

+ 27 - 0
pages/sthropen/info.wxss

@@ -0,0 +1,27 @@
+.main {
+  height: var(--twoHeight);
+}
+.main .one {
+  width: 96vw;
+  padding: 0 2vw;
+}
+.main .one .one_1 {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  border: 1px dashed var(--f85Color);
+  border-radius: 5px;
+  margin: 0 0 10px 0;
+  padding: 10px;
+}
+.main .one .one_1 .text {
+  color: var(--f85Color);
+  font-size: var(--font16Size);
+}
+.main .one .one_1 .text1 {
+  font-size: var(--font16Size);
+}
+.main .one .one_1 .image {
+  width: 15vw;
+  height: 15vw;
+}

+ 41 - 24
pages/sthropen/list.js

@@ -7,8 +7,6 @@ Page({
         page: 0,
         page: 0,
         skip: 0,
         skip: 0,
         limit: 5,
         limit: 5,
-        //类型
-        typeList: [],
         //状态
         //状态
         statusList: []
         statusList: []
     },
     },
@@ -16,6 +14,13 @@ Page({
     back(e) {
     back(e) {
         wx.navigateBack({ delta: 1 })
         wx.navigateBack({ delta: 1 })
     },
     },
+    // 查看
+    toView: async function (e) {
+        const that = this;
+        that.setData({ skip: 0, page: 0, list: [] })
+        const { item } = e.currentTarget.dataset;
+        wx.navigateTo({ url: `/pages/sthropen/info?id=${item._id}` })
+    },
     // 分页
     // 分页
     toPage: function () {
     toPage: function () {
         const that = this;
         const that = this;
@@ -36,29 +41,53 @@ Page({
      */
      */
     onLoad: function (options) {
     onLoad: function (options) {
     },
     },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: async function () {
+        const that = this;
+        // 查询其他信息
+        await that.searchOther();
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        // 状态
+        arr = await app.$get(`/dict`, { code: 'lesson_status' });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ statusList: arr.data[0].list });
+    },
     // 监听用户是否登录
     // 监听用户是否登录
     watchLogin: async function () {
     watchLogin: async function () {
         const that = this;
         const that = this;
+        var list = [];
         let typeList = that.data.typeList;
         let typeList = that.data.typeList;
         let statusList = that.data.statusList;
         let statusList = that.data.statusList;
         wx.getStorage({
         wx.getStorage({
             key: 'user',
             key: 'user',
             success: async res => {
             success: async res => {
-                let info = { skip: that.data.skip, limit: that.data.limit, type: '1' };
-                let arr = await app.$get(`/lesson`, { ...info });
+                let info = { skip: that.data.skip, limit: that.data.limit };
+                let arr = await app.$get(`/lessonPublic`, { ...info });
                 if (arr.errcode == '0') {
                 if (arr.errcode == '0') {
-                    let list = [{ id: '1', title: '测试名称', class_hour: 10, money: 10, type: '1', time: '2022-08-17', status: '0' }]
-                    that.setData({ list: list })
                     for (const val of arr.data) {
                     for (const val of arr.data) {
                         if (val.student.length > 0) {
                         if (val.student.length > 0) {
-                            let student = val.student.find(i => i._id == res.data._id);
-                            if (student) { let list = []; list.push(val); }
+                            let student = val.student.find(i => i._id == res.data.info.id);
+                            if (student) {
+                                let type = typeList.find(i => i.value == val.type); if (type) val.zhType = type.label;
+                                let status = statusList.find(i => i.value == val.status); if (status) val.zhStatus = status.label;
+                                list.push(val);
+                            }
                         }
                         }
-                        let type = typeList.find(i => i.value == val.type); if (type) val.zhType = type.label;
-                        let status = statusList.find(i => i.value == val.status); if (status) val.zhStatus = status.label;
                     }
                     }
-                    // that.setData({ list: [...that.data.list, ...list] })
-                    // that.setData({ total: arr.total })
+                    if (list) {
+                        that.setData({ list: [...that.data.list, ...list] })
+                        that.setData({ total: list.length })
+                    }
                 } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
                 } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
             },
             },
             fail: async res => {
             fail: async res => {
@@ -66,18 +95,6 @@ Page({
             }
             }
         })
         })
     },
     },
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () { },
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        const that = this;
-        // 监听用户是否登录
-        that.watchLogin();
-    },
     /**
     /**
      * 页面上拉触底事件的处理函数
      * 页面上拉触底事件的处理函数
      */
      */

+ 5 - 5
pages/sthropen/list.json

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

+ 2 - 1
pages/sthropen/list.less

@@ -60,7 +60,8 @@
                 margin: 2vw 0 0 0;
                 margin: 2vw 0 0 0;
 
 
                 button {
                 button {
-                    background: -webkit-linear-gradient(right, lightblue, rgb(83, 201, 248));
+                    font-size: var(--font14Size);
+                    background: -webkit-linear-gradient(right, lightblue, #53C9F8);
                 }
                 }
             }
             }
         }
         }

+ 2 - 3
pages/sthropen/list.wxml

@@ -10,11 +10,10 @@
                         <view class="list_1">
                         <view class="list_1">
                             <view class="name textOver">{{item.title||'暂无'}}</view>
                             <view class="name textOver">{{item.title||'暂无'}}</view>
                             <view class="other">
                             <view class="other">
-                                <view class="other_1 textOver"><text>课时:</text><text>{{item.class_hour||'暂无'}}小时</text></view>
                                 <view class="other_1 textOver"><text>金额:</text><text>¥{{item.money||'暂无'}}元</text></view>
                                 <view class="other_1 textOver"><text>金额:</text><text>¥{{item.money||'暂无'}}元</text></view>
-                                <view class="other_1 textOver"><text>类型:</text><text>{{item.zhType||'暂无'}}</text></view>
-                                <view class="other_1 textOver"><text>上课时间:</text><text>{{item.time||'暂无'}}</text></view>
                                 <view class="other_1 textOver"><text>状态:</text><text>{{item.zhStatus||'暂无'}}</text></view>
                                 <view class="other_1 textOver"><text>状态:</text><text>{{item.zhStatus||'暂无'}}</text></view>
+                                <view class="other_1 textOver"><text>人数上限:</text><text>{{item.limit||'暂无'}}人</text></view>
+                                <view class="other_1 textOver"><text>上课时间:</text><text>{{item.time_start||'暂无'}}-{{item.time_end||'暂无'}}</text></view>
                             </view>
                             </view>
                         </view>
                         </view>
                         <view class="btn">
                         <view class="btn">

+ 2 - 1
pages/sthropen/list.wxss

@@ -52,7 +52,8 @@
   margin: 2vw 0 0 0;
   margin: 2vw 0 0 0;
 }
 }
 .main .two .list .btn button {
 .main .two .list .btn button {
-  background: -webkit-linear-gradient(right, lightblue, #53c9f8);
+  font-size: var(--font14Size);
+  background: -webkit-linear-gradient(right, lightblue, #53C9F8);
 }
 }
 .scroll-view {
 .scroll-view {
   position: absolute;
   position: absolute;

+ 96 - 0
pages/sthrprivate/info.js

@@ -0,0 +1,96 @@
+const app = getApp()
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '私教课信息', leftArrow: true, useBar: false },
+        id: '',
+        form: {},
+        //状态
+        statusList: []
+    },
+    // 跳转菜单
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function (options) {
+        const that = this;
+        await that.setData({ id: options.id || null })
+        // 查询其他信息
+        await that.searchOther();
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        // 状态
+        arr = await app.$get(`/dict`, { code: 'lesson_status' });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ statusList: arr.data[0].list });
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        let statusList = that.data.statusList;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                if (that.data.id) {
+                    const arr = await app.$get(`/lessonPublic/${that.data.id}`);
+                    if (arr.errcode == '0') {
+                        let status = statusList.find(i => i.value == arr.data.status)
+                        if (status) arr.data.zhStatus = level.label;
+                        that.setData({ form: arr.data })
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/sthrprivate/info.json

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

+ 32 - 0
pages/sthrprivate/info.less

@@ -0,0 +1,32 @@
+.main {
+    height: var(--twoHeight);
+
+    .one {
+        width: 96vw;
+        padding: 0 2vw;
+
+        .one_1 {
+            display: flex;
+            flex-direction: row;
+            justify-content: space-between;
+            border: 1px dashed var(--f85Color);
+            border-radius: 5px;
+            margin: 0 0 10px 0;
+            padding: 10px;
+
+            .text {
+                color: var(--f85Color);
+                font-size: var(--font16Size);
+            }
+
+            .text1 {
+                font-size: var(--font16Size);
+            }
+
+            .image {
+                width: 15vw;
+                height: 15vw;
+            }
+        }
+    }
+}

+ 46 - 0
pages/sthrprivate/info.wxml

@@ -0,0 +1,46 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <view class="one_1">
+                <text class="text">课程标题:</text>
+                <text class="text1">{{form.title||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">学校名称:</text>
+                <text class="text1">{{form.school_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">人数上限:</text>
+                <text class="text1">{{form.limit||'暂无'}}人</text>
+            </view>
+            <view class="one_1">
+                <text class="text">开始时间:</text>
+                <text class="text1">{{form.time_start||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">结束时间:</text>
+                <text class="text1">{{form.time_end||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">状态:</text>
+                <text class="text1">{{form.zhStatus||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">简介:</text>
+                <text class="text1">{{form.brief||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">教练人员:</text>
+                <view class="name" wx:if="{{form.coach_id&&item.coach_id.length>0}}" wx:for="{{form.coach_id}}" wx:key="item">
+                    <text class="text1">姓名:{{item.name||'暂无'}}</text>
+                </view>
+            </view>
+            <view class="one_1">
+                <text class="text">学生人员:</text>
+                <view class="name" wx:if="{{form.student&&item.student.length>0}}" wx:for="{{form.student}}" wx:key="item">
+                    <text class="text1">姓名:{{item.name||'暂无'}}</text>
+                </view>
+            </view>
+        </view>
+    </view>
+</mobile-main>

+ 27 - 0
pages/sthrprivate/info.wxss

@@ -0,0 +1,27 @@
+.main {
+  height: var(--twoHeight);
+}
+.main .one {
+  width: 96vw;
+  padding: 0 2vw;
+}
+.main .one .one_1 {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  border: 1px dashed var(--f85Color);
+  border-radius: 5px;
+  margin: 0 0 10px 0;
+  padding: 10px;
+}
+.main .one .one_1 .text {
+  color: var(--f85Color);
+  font-size: var(--font16Size);
+}
+.main .one .one_1 .text1 {
+  font-size: var(--font16Size);
+}
+.main .one .one_1 .image {
+  width: 15vw;
+  height: 15vw;
+}

+ 41 - 25
pages/sthrprivate/list.js

@@ -7,8 +7,6 @@ Page({
         page: 0,
         page: 0,
         skip: 0,
         skip: 0,
         limit: 5,
         limit: 5,
-        //类型
-        typeList: [],
         //状态
         //状态
         statusList: []
         statusList: []
     },
     },
@@ -16,6 +14,13 @@ Page({
     back(e) {
     back(e) {
         wx.navigateBack({ delta: 1 })
         wx.navigateBack({ delta: 1 })
     },
     },
+    // 查看
+    toView: async function (e) {
+        const that = this;
+        that.setData({ skip: 0, page: 0, list: [] })
+        const { item } = e.currentTarget.dataset;
+        wx.navigateTo({ url: `/pages/sthrprivate/info?id=${item._id}` })
+    },
     // 分页
     // 分页
     toPage: function () {
     toPage: function () {
         const that = this;
         const that = this;
@@ -36,29 +41,52 @@ Page({
      */
      */
     onLoad: function (options) {
     onLoad: function (options) {
     },
     },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: async function () {
+        const that = this;
+        // 查询其他信息
+        await that.searchOther();
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        // 状态
+        arr = await app.$get(`/dict`, { code: 'lesson_status' });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ statusList: arr.data[0].list });
+    },
     // 监听用户是否登录
     // 监听用户是否登录
     watchLogin: async function () {
     watchLogin: async function () {
         const that = this;
         const that = this;
-        let typeList = that.data.typeList;
+        var list = [];
         let statusList = that.data.statusList;
         let statusList = that.data.statusList;
         wx.getStorage({
         wx.getStorage({
             key: 'user',
             key: 'user',
             success: async res => {
             success: async res => {
-                let info = { skip: that.data.skip, limit: that.data.limit, type: '1' };
-                let arr = await app.$get(`/lesson`, { ...info });
+                let info = { skip: that.data.skip, limit: that.data.limit };
+                let arr = await app.$get(`/lessonPrivate`, { ...info });
                 if (arr.errcode == '0') {
                 if (arr.errcode == '0') {
-                    let list = [{ id: '1', title: '测试名称', class_hour: 10, money: 10, type: '1', time: '2022-08-17', status: '0' }]
-                    that.setData({ list: list })
                     for (const val of arr.data) {
                     for (const val of arr.data) {
                         if (val.student.length > 0) {
                         if (val.student.length > 0) {
-                            let student = val.student.find(i => i._id == res.data._id);
-                            if (student) { let list = []; list.push(val); }
+                            let student = val.student.find(i => i._id == res.data.info.id);
+                            if (student) {
+                                let type = typeList.find(i => i.value == val.type); if (type) val.zhType = type.label;
+                                let status = statusList.find(i => i.value == val.status); if (status) val.zhStatus = status.label;
+                                list.push(val);
+                            }
                         }
                         }
-                        let type = typeList.find(i => i.value == val.type); if (type) val.zhType = type.label;
-                        let status = statusList.find(i => i.value == val.status); if (status) val.zhStatus = status.label;
                     }
                     }
-                    // that.setData({ list: [...that.data.list, ...list] })
-                    // that.setData({ total: arr.total })
+                    if (list) {
+                        that.setData({ list: [...that.data.list, ...list] })
+                        that.setData({ total: list.length })
+                    }
                 } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
                 } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
             },
             },
             fail: async res => {
             fail: async res => {
@@ -66,18 +94,6 @@ Page({
             }
             }
         })
         })
     },
     },
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () { },
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        const that = this;
-        // 监听用户是否登录
-        that.watchLogin();
-    },
     /**
     /**
      * 页面上拉触底事件的处理函数
      * 页面上拉触底事件的处理函数
      */
      */

+ 5 - 5
pages/sthrprivate/list.json

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

+ 2 - 1
pages/sthrprivate/list.less

@@ -60,7 +60,8 @@
                 margin: 2vw 0 0 0;
                 margin: 2vw 0 0 0;
 
 
                 button {
                 button {
-                    background: -webkit-linear-gradient(right, lightblue, rgb(83, 201, 248));
+                    font-size: var(--font14Size);
+                    background: -webkit-linear-gradient(right, lightblue, #53C9F8);
                 }
                 }
             }
             }
         }
         }

+ 2 - 3
pages/sthrprivate/list.wxml

@@ -10,11 +10,10 @@
                         <view class="list_1">
                         <view class="list_1">
                             <view class="name textOver">{{item.title||'暂无'}}</view>
                             <view class="name textOver">{{item.title||'暂无'}}</view>
                             <view class="other">
                             <view class="other">
-                                <view class="other_1 textOver"><text>课时:</text><text>{{item.class_hour||'暂无'}}小时</text></view>
                                 <view class="other_1 textOver"><text>金额:</text><text>¥{{item.money||'暂无'}}元</text></view>
                                 <view class="other_1 textOver"><text>金额:</text><text>¥{{item.money||'暂无'}}元</text></view>
-                                <view class="other_1 textOver"><text>类型:</text><text>{{item.zhType||'暂无'}}</text></view>
-                                <view class="other_1 textOver"><text>上课时间:</text><text>{{item.time||'暂无'}}</text></view>
                                 <view class="other_1 textOver"><text>状态:</text><text>{{item.zhStatus||'暂无'}}</text></view>
                                 <view class="other_1 textOver"><text>状态:</text><text>{{item.zhStatus||'暂无'}}</text></view>
+                                <view class="other_1 textOver"><text>人数上限:</text><text>{{item.limit||'暂无'}}人</text></view>
+                                <view class="other_1 textOver"><text>上课时间:</text><text>{{item.time_start||'暂无'}}-{{item.time_end||'暂无'}}</text></view>
                             </view>
                             </view>
                         </view>
                         </view>
                         <view class="btn">
                         <view class="btn">

+ 2 - 1
pages/sthrprivate/list.wxss

@@ -52,7 +52,8 @@
   margin: 2vw 0 0 0;
   margin: 2vw 0 0 0;
 }
 }
 .main .two .list .btn button {
 .main .two .list .btn button {
-  background: -webkit-linear-gradient(right, lightblue, #53c9f8);
+  font-size: var(--font14Size);
+  background: -webkit-linear-gradient(right, lightblue, #53C9F8);
 }
 }
 .scroll-view {
 .scroll-view {
   position: absolute;
   position: absolute;

+ 82 - 0
pages/sthrschool/info.js

@@ -0,0 +1,82 @@
+const app = getApp()
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '学校信息', leftArrow: true, useBar: false },
+        id: '',
+        form: {},
+    },
+    // 跳转菜单
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const that = this;
+        that.setData({ id: options.id || null })
+        // 监听用户是否登录
+        that.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                if (that.data.id) {
+                    const 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 })
+                    }
+                }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/sthrschool/info.json

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

+ 42 - 0
pages/sthrschool/info.less

@@ -0,0 +1,42 @@
+.main {
+    height: var(--twoHeight);
+
+    .one {
+        width: 96vw;
+        padding: 0 2vw;
+
+        .one_1 {
+            display: flex;
+            flex-direction: row;
+            justify-content: space-between;
+            border: 1px dashed var(--f85Color);
+            border-radius: 5px;
+            margin: 0 0 10px 0;
+            padding: 10px;
+
+            .text {
+                color: var(--f85Color);
+                font-size: var(--font16Size);
+            }
+
+            .text1 {
+                font-size: var(--font16Size);
+            }
+
+            .image {
+                width: 90vw;
+                height: 90vw;
+            }
+
+            swiper {
+                width: 90vw;
+                height: 25vh;
+
+                .image {
+                    width: 100%;
+                    height: 100%;
+                }
+            }
+        }
+    }
+}

+ 46 - 0
pages/sthrschool/info.wxml

@@ -0,0 +1,46 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <view class="one_1">
+                <swiper autoplay="true" circular="true" interval="3000" duration="1000">
+                    <block wx:for="{{form.img_url}}" wx:key="index">
+                        <swiper-item>
+                            <image class="image" src="{{item.url}}"></image>
+                        </swiper-item>
+                    </block>
+                </swiper>
+            </view>
+            <view class="one_1">
+                <text class="text">名称:</text>
+                <text class="text1">{{form.name||'暂无名称'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">电话:</text>
+                <text class="text1">{{form.phone||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">地址:</text>
+                <text class="text1">{{form.address||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">教练人数:</text>
+                <text class="text1">{{form.coach_num||'暂无'}}人</text>
+            </view>
+            <view class="one_1">
+                <text class="text">学员人数:</text>
+                <text class="text1">{{form.student_num||'暂无'}}人</text>
+            </view>
+            <view class="one_1">
+                <text class="text">所获荣誉:</text>
+                <text class="text1">{{form.honor||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">学校简介:</text>
+                <text class="text1">{{form.brief||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <image class="image" src="{{form.yyzz[0].url}}"></image>
+            </view>
+        </view>
+    </view>
+</mobile-main>

+ 35 - 0
pages/sthrschool/info.wxss

@@ -0,0 +1,35 @@
+.main {
+  height: var(--twoHeight);
+}
+.main .one {
+  width: 96vw;
+  padding: 0 2vw;
+}
+.main .one .one_1 {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  border: 1px dashed var(--f85Color);
+  border-radius: 5px;
+  margin: 0 0 10px 0;
+  padding: 10px;
+}
+.main .one .one_1 .text {
+  color: var(--f85Color);
+  font-size: var(--font16Size);
+}
+.main .one .one_1 .text1 {
+  font-size: var(--font16Size);
+}
+.main .one .one_1 .image {
+  width: 90vw;
+  height: 90vw;
+}
+.main .one .one_1 swiper {
+  width: 90vw;
+  height: 25vh;
+}
+.main .one .one_1 swiper .image {
+  width: 100%;
+  height: 100%;
+}

+ 12 - 5
pages/sthrschool/list.js

@@ -7,11 +7,20 @@ Page({
         page: 0,
         page: 0,
         skip: 0,
         skip: 0,
         limit: 5,
         limit: 5,
+        info: {},
+        dialog: { title: '详细信息', show: false, type: '1' },
     },
     },
     // 返回
     // 返回
     back(e) {
     back(e) {
         wx.navigateBack({ delta: 1 })
         wx.navigateBack({ delta: 1 })
     },
     },
+    // 查看
+    toView: async function (e) {
+        const that = this;
+        that.setData({ skip: 0, page: 0, list: [] })
+        const { item } = e.currentTarget.dataset;
+        wx.navigateTo({ url: `/pages/sthrschool/info?id=${item.school_id}` })
+    },
     // 分页
     // 分页
     toPage: function () {
     toPage: function () {
         const that = this;
         const that = this;
@@ -38,13 +47,11 @@ Page({
         wx.getStorage({
         wx.getStorage({
             key: 'user',
             key: 'user',
             success: async res => {
             success: async res => {
-                let info = { skip: that.data.skip, limit: that.data.limit, student_id: res.data._id };
+                let info = { skip: that.data.skip, limit: that.data.limit, student_id: res.data.info.id };
                 let arr = await app.$get(`/rss`, { ...info });
                 let arr = await app.$get(`/rss`, { ...info });
                 if (arr.errcode == '0') {
                 if (arr.errcode == '0') {
-                    let list = [{ img_url: [{ url: '/image/beijing.jpeg' }], id: '1', name: '学校名称', coach_num: 9, student_num: 22, address: '地址', brief: '简介', phone: '12345678901' }]
-                    that.setData({ list: list })
-                    // that.setData({ list: [...that.data.list, ...arr.data] })
-                    // that.setData({ total: arr.total })
+                    that.setData({ list: [...that.data.list, ...arr.data] })
+                    that.setData({ total: arr.total })
                 } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
                 } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
             },
             },
             fail: async res => {
             fail: async res => {

+ 5 - 5
pages/sthrschool/list.json

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

+ 3 - 2
pages/sthrschool/list.less

@@ -68,7 +68,7 @@
                         }
                         }
 
 
                         .other_1 text:nth-child(1) {
                         .other_1 text:nth-child(1) {
-                            color: #666;
+                            color: var(--f85Color);
                         }
                         }
                     }
                     }
                 }
                 }
@@ -80,7 +80,8 @@
                 margin: 2vw 0 0 0;
                 margin: 2vw 0 0 0;
 
 
                 button {
                 button {
-                    background: -webkit-linear-gradient(right, lightblue, rgb(83, 201, 248));
+                    font-size: var(--font14Size);
+                    background: -webkit-linear-gradient(right, lightblue, #53C9F8);
                 }
                 }
             }
             }
         }
         }

+ 7 - 7
pages/sthrschool/list.wxml

@@ -8,16 +8,16 @@
                 <view class="list-scroll-view">
                 <view class="list-scroll-view">
                     <view class="list" wx:for="{{list}}" wx:key="item">
                     <view class="list" wx:for="{{list}}" wx:key="item">
                         <view class="list_1">
                         <view class="list_1">
-                            <image class="image" src="{{item.img_url&&item.img_url.length>0?item.img_url[0].url:''}}"></image>
+                            <image class="image" src="{{item.school_id_img_url&&item.school_id_img_url.length>0?item.school_id_img_url[0].url:''}}"></image>
                             <view class="content">
                             <view class="content">
-                                <view class="name textOver">{{item.name||'暂无'}}</view>
-                                <view class="txt textOver"><text>联系电话:</text><text>{{item.phone||'暂无'}}</text></view>
+                                <view class="name textOver">{{item.school_id_name||'暂无'}}</view>
+                                <view class="txt textOver"><text>联系电话:</text><text>{{item.school_id_phone||'暂无'}}</text></view>
                                 <view class="other textOver">
                                 <view class="other textOver">
-                                    <view class="other_1 textOver"><text>教练人数:</text><text>{{item.coach_num||'0'}}人</text></view>
-                                    <view class="other_1 textOver"><text>学员人数:</text><text>{{item.student_num||'0'}}人</text></view>
+                                    <view class="other_1 textOver"><text>教练人数:</text><text>{{item.school_id_coach_num||'0'}}人</text></view>
+                                    <view class="other_1 textOver"><text>学员人数:</text><text>{{item.school_id_student_num||'0'}}人</text></view>
                                 </view>
                                 </view>
-                                <view class="txt textOver"><text>训练地址:</text><text>{{item.address||'暂无'}}</text></view>
-                                <view class="txt textOver"><text>羽校简介:</text><text>{{item.brief||'暂无'}}</text></view>
+                                <view class="txt textOver"><text>训练地址:</text><text>{{item.school_id_address||'暂无'}}</text></view>
+                                <view class="txt textOver"><text>羽校简介:</text><text>{{item.school_id_brief||'暂无'}}</text></view>
                             </view>
                             </view>
                         </view>
                         </view>
                         <view class="btn">
                         <view class="btn">

+ 3 - 2
pages/sthrschool/list.wxss

@@ -61,7 +61,7 @@
   padding: 0 0 1vw 0;
   padding: 0 0 1vw 0;
 }
 }
 .main .two .list .list_1 .content .other .other_1 text:nth-child(1) {
 .main .two .list .list_1 .content .other .other_1 text:nth-child(1) {
-  color: #666;
+  color: var(--f85Color);
 }
 }
 .main .two .list .btn {
 .main .two .list .btn {
   width: 92vw;
   width: 92vw;
@@ -69,7 +69,8 @@
   margin: 2vw 0 0 0;
   margin: 2vw 0 0 0;
 }
 }
 .main .two .list .btn button {
 .main .two .list .btn button {
-  background: -webkit-linear-gradient(right, lightblue, #53c9f8);
+  font-size: var(--font14Size);
+  background: -webkit-linear-gradient(right, lightblue, #53C9F8);
 }
 }
 .scroll-view {
 .scroll-view {
   position: absolute;
   position: absolute;