guhongwei 2 years ago
parent
commit
01d3572da3

+ 2 - 0
app.json

@@ -46,6 +46,8 @@
         "pages/coaAdmin/money/list",
         "pages/coaAdmin/money/add",
         "pages/coaAdmin/archives/info",
+        "pages/coaAdmin/school/list",
+        "pages/coaAdmin/school/info",
         "pages/coaAdmin/cashout/list",
         "pages/coaAdmin/cashout/add",
         "pages/coaAdmin/course/list",

+ 101 - 0
pages/coaAdmin/school/info.js

@@ -0,0 +1,101 @@
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '羽校详细信息', leftArrow: true, useBar: false },
+        school_id: '',
+        form: {},
+    },
+
+    // 返回
+    back: function () {
+        wx.navigateBack({ delta: 1 })
+    },
+    // 图片预览
+    imgView: function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        if (item && item.length > 0) {
+            wx.previewImage({
+                current: '',
+                urls: [item[0].url]
+            })
+        }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function (options) {
+        const that = this;
+        that.setData({ school_id: options.school_id || '' });
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
+
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                let arr;
+                arr = await app.$get(`/school/${that.data.school_id}`,);
+                if (arr.errcode == '0') { that.setData({ form: arr.data }) }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () { },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/coaAdmin/school/info.json

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

+ 52 - 0
pages/coaAdmin/school/info.less

@@ -0,0 +1,52 @@
+.main {
+    background-color: var(--mainColor);
+
+    .one {
+        padding: 2vw;
+
+        .one_1 {
+
+            width: 96vw;
+            margin: 0 0 2vw 0;
+
+
+            swiper {
+                height: 30vh;
+
+                .image {
+                    width: 100%;
+                    height: 100%;
+                    border-radius: 10px;
+                }
+            }
+        }
+
+        .one_2 {
+            width: 96vw;
+
+            .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%;
+                }
+            }
+        }
+    }
+}

+ 30 - 0
pages/coaAdmin/school/info.wxml

@@ -0,0 +1,30 @@
+<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="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="one_2">
+                <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>
+    </view>
+</mobile-main>

+ 40 - 0
pages/coaAdmin/school/info.wxss

@@ -0,0 +1,40 @@
+.main {
+  background-color: var(--mainColor);
+}
+.main .one {
+  padding: 2vw;
+}
+.main .one .one_1 {
+  width: 96vw;
+  margin: 0 0 2vw 0;
+}
+.main .one .one_1 swiper {
+  height: 30vh;
+}
+.main .one .one_1 swiper .image {
+  width: 100%;
+  height: 100%;
+  border-radius: 10px;
+}
+.main .one .one_2 {
+  width: 96vw;
+}
+.main .one .one_2 .name {
+  font-size: var(--font20Szie);
+  font-weight: bold;
+  margin: 0 0 2vw 0;
+}
+.main .one .one_2 .other {
+  margin: 0 0 2vw 0;
+}
+.main .one .one_2 .other .other_1 {
+  padding: 2vw 0;
+  font-size: var(--font16Szie);
+  border-bottom: 1px dashed var(--f1Color);
+}
+.main .one .one_2 .other .other_1 text:first-child {
+  color: var(--f85Color);
+}
+.main .one .one_2 .other .image {
+  width: 100%;
+}

+ 117 - 0
pages/coaAdmin/school/list.js

@@ -0,0 +1,117 @@
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '羽校信息', leftArrow: true, useBar: false },
+        list: [],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
+    },
+    // 返回
+    back: function () {
+        wx.navigateBack({ delta: 1 })
+    },
+    //添加信息,信息维护
+    toCommon: function (e) {
+        const that = this;
+        const { item, route } = e.currentTarget.dataset;
+        that.setData({ skip: 0, page: 0, list: [] });
+        wx.navigateTo({ url: `/pages/${route}?school_id=${item.school_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.watchLogin();
+            wx.hideLoading()
+        } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: async function () {
+        const that = this;
+        // 监听用户是否登录
+        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 }) }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/coaAdmin/school/list.json

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

+ 90 - 0
pages/coaAdmin/school/list.less

@@ -0,0 +1,90 @@
+.main {
+    height: var(--twoHeight);
+    background-color: var(--mainColor);
+
+    .one {
+        display: flex;
+        flex-direction: row;
+        padding: 2vw;
+        border-bottom: 1px solid var(--f1Color);
+
+        .one_1 {
+            flex-grow: 1;
+
+            input {
+                padding: 1vw 0 2vw 2vw;
+                background-color: var(--f1Color);
+                border-radius: 5px;
+            }
+        }
+
+        .one_2 {
+            width: 20vw;
+
+            button {
+                width: 100%;
+                padding: 2vw;
+                font-size: var(--font14Size);
+            }
+        }
+    }
+
+    .two {
+        flex-grow: 1;
+        position: relative;
+        width: 96vw;
+        margin: 2vw;
+        background-color: var(--mainColor);
+
+        .list {
+            display: flex;
+            flex-direction: column;
+            border: 2px dashed var(--f1Color);
+            padding: 2vw;
+            margin: 0 0 2vw 0;
+            border-radius: 10px;
+
+            .name {
+                font-size: var(--font16Szie);
+                font-weight: bold;
+                margin: 0 0 2vw 0;
+            }
+
+            .other {
+                margin: 0 0 2vw 0;
+
+                .other_1 {
+                    font-size: var(--font14Szie);
+                    margin: 0 0 1vw 0;
+
+                    text:first-child {
+                        color: var(--f85Color);
+                    }
+                }
+            }
+
+            .btn {
+                margin: 2vw 0 0 0;
+                text-align: center;
+
+                button {
+                    margin: 0 2vw;
+                }
+            }
+        }
+
+    }
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 27 - 0
pages/coaAdmin/school/list.wxml

@@ -0,0 +1,27 @@
+<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> -->
+        </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>
+                        <view class="btn">
+                            <button type="primary" size="mini" bindtap="toCommon" data-route="coaAdmin/school/info" data-item="{{item}}">详细信息</button>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
+    </view>
+</mobile-main>

+ 74 - 0
pages/coaAdmin/school/list.wxss

@@ -0,0 +1,74 @@
+.main {
+  height: var(--twoHeight);
+  background-color: var(--mainColor);
+}
+.main .one {
+  display: flex;
+  flex-direction: row;
+  padding: 2vw;
+  border-bottom: 1px solid var(--f1Color);
+}
+.main .one .one_1 {
+  flex-grow: 1;
+}
+.main .one .one_1 input {
+  padding: 1vw 0 2vw 2vw;
+  background-color: var(--f1Color);
+  border-radius: 5px;
+}
+.main .one .one_2 {
+  width: 20vw;
+}
+.main .one .one_2 button {
+  width: 100%;
+  padding: 2vw;
+  font-size: var(--font14Size);
+}
+.main .two {
+  flex-grow: 1;
+  position: relative;
+  width: 96vw;
+  margin: 2vw;
+  background-color: var(--mainColor);
+}
+.main .two .list {
+  display: flex;
+  flex-direction: column;
+  border: 2px dashed var(--f1Color);
+  padding: 2vw;
+  margin: 0 0 2vw 0;
+  border-radius: 10px;
+}
+.main .two .list .name {
+  font-size: var(--font16Szie);
+  font-weight: bold;
+  margin: 0 0 2vw 0;
+}
+.main .two .list .other {
+  margin: 0 0 2vw 0;
+}
+.main .two .list .other .other_1 {
+  font-size: var(--font14Szie);
+  margin: 0 0 1vw 0;
+}
+.main .two .list .other .other_1 text:first-child {
+  color: var(--f85Color);
+}
+.main .two .list .btn {
+  margin: 2vw 0 0 0;
+  text-align: center;
+}
+.main .two .list .btn button {
+  margin: 0 2vw;
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}

+ 1 - 0
utils/dict.js

@@ -90,6 +90,7 @@ export const school_menu = [
                 btn: [
                     { title: '账号余额', route: 'coaAdmin/money/list', icon: 'icon-xuexiao_xuexiaoxinxi' },
                     { title: '个人档案', route: 'coaAdmin/archives/info', icon: 'icon-xuexiao_xuexiaoxinxi' },
+                    { title: '羽校信息', route: 'coaAdmin/school/list', icon: 'icon-xuexiao_xuexiaoxinxi' },
                     // { title: '提现申请', route: 'coaAdmin/cashout/list', icon: 'icon-xuexiao_xuexiaoxinxi' },
                 ]
             },