zs 1 jaar geleden
bovenliggende
commit
d496e39dc0

+ 3 - 2
app.json

@@ -7,7 +7,8 @@
             "root": "pagesTeam",
             "independent": true,
             "pages": [
-                "home/index"
+                "home/index",
+                "apply/index"
             ]
         },
         {
@@ -30,10 +31,10 @@
             "pages": [
                 "home/index",
                 "basic/index",
-                "exit/index",
                 "match/index",
                 "team/index",
                 "teamCreate/index",
+                "apply/index",
                 "update/index"
             ]
         },

+ 2 - 2
pagesHome/home/index.wxss

@@ -5,7 +5,7 @@
 }
 
 .main .one {
-    padding: 2vw 0;
+    padding: 0 0 2vw 0;
 }
 
 .main .one .input {
@@ -16,7 +16,7 @@
 }
 
 .main .two .scroll-view {
-    height: 81vh;
+    height: 83vh;
 }
 
 .main .two .list {

+ 206 - 0
pagesMy/apply/index.js

@@ -0,0 +1,206 @@
+const app = getApp()
+Page({
+    data: {
+        logo: '',
+        team_id: "",
+        searchInfo: {},
+        list: [],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
+        statusList: [],
+        genderList: []
+    },
+    // 审核
+    toExam(e) {
+        const that = this;
+        let item = e.currentTarget.dataset.item
+        wx.showActionSheet({
+            itemList: ['审核中', '审核通过', '审核拒绝'],    // 文字数组
+            success: async (res) => {
+                switch (res.tapIndex) {
+                    case 0: {
+                        let data = { status: '0' }
+                        let res = await app.$api(`teamApply/${item._id}`, 'POST', data);
+                        if (res.errcode == '0') {
+                            that.clearPage();
+                            that.search()
+                            break;
+                        }
+                    }
+                     case 1: {
+                        let data = { status: '1' }
+                        let res = await app.$api(`teamApply/${item._id}`, 'POST', data);
+                        if (res.errcode == '0') {
+                            that.clearPage();
+                            that.search()
+                            break;
+                        }
+                    }
+                    case 2: {
+                        let data = { status: '-1' }
+                        let res = await app.$api(`teamApply/${item._id}`, 'POST', data);
+                        if (res.errcode == '0') {
+                            that.clearPage();
+                            that.search()
+                            break;
+                        }
+                    }
+                }
+            }, fail(res) { console.log('取消选项') }
+        })
+    },
+    // 查询
+    async toSearch(e) {
+        const that = this;
+        that.setData({ 'searchInfo.apply_name': e.detail.value })
+        that.clearPage();
+        that.search()
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    async onLoad(options) {
+        const that = this;
+        that.setData({ team_id: options.id });
+        wx.showLoading({ title: '加载中', mask: true })
+        await that.searchConfig()
+        await that.searchOther()
+        await that.search()
+        wx.hideLoading()
+    },
+    async searchConfig() {
+        const that = this;
+        wx.getStorage({
+            key: 'config',
+            async success(res) {
+                // logo
+                if (res.data && res.data.logo_url && res.data.logo_url.length > 0) {
+                    let logo = res.data.logo_url[0].url
+                    that.setData({ logo })
+                }
+            },
+            fail(err) {
+                console.log(err);
+            }
+        })
+    },
+    // 查询通知
+    async search() {
+        const that = this;
+        let info = { skip: that.data.skip, limit: that.data.limit, team_id: that.data.team_id };
+        let res = await app.$api('teamApply', 'GET', { ...info, ...that.data.searchInfo })
+        if (res.errcode == '0') {
+            let list = [...that.data.list, ...res.data]
+            for (const val of list) {
+                let arr = await app.$api(`user/${val.apply_id}`, 'GET', {})
+                if (arr.errcode == '0') {
+                    let data = that.data.genderList.find(i => i.value == arr.data.gender)
+                    if (data) arr.data.gender_name = data.label
+                    val.userInfo = arr.data
+                }
+                val.status_name = that.getDict(val.status, 'status')
+            }
+            that.setData({ list })
+            that.setData({ total: res.total })
+        }
+    },
+    // 分页-触底
+    toLower() {
+        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 })
+            let skip = page * limit
+            that.setData({ skip })
+            that.search()
+            wx.hideLoading()
+        } else {
+            wx.showToast({ title: `到底了没数据了`, icon: 'none' });
+        }
+    },
+    // 分页-滚动
+    toScroll() {
+        // console.log('滚动');
+    },
+    // 字典
+    getDict(value, model) {
+        const that = this;
+        if (model == 'status') {
+            if (value) {
+                let data = that.data.statusList.find(i => i.value == value)
+                if (data) return data.label
+                else return '暂无'
+            }
+        }
+    },
+    // 查询其他信息
+    async searchOther() {
+        const that = this;
+        let res;
+        res = await app.$api('dictData', 'GET', { type: 'status', is_use: '0' })
+        if (res.errcode == '0') that.setData({ statusList: res.data })
+        res = await app.$api('dictData', 'GET', { type: 'gender', is_use: '0' })
+        if (res.errcode == '0') that.setData({ genderList: res.data })
+    },
+    // 清空列表
+    clearPage() {
+        const that = this;
+        that.setData({ list: [] })
+        that.setData({ skip: 0 })
+        that.setData({ limit: 5 })
+        that.setData({ total: 0 })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
pagesMy/apply/index.json

@@ -0,0 +1,3 @@
+{
+    "navigationBarTitleText": "团队审核"
+}

+ 34 - 0
pagesMy/apply/index.wxml

@@ -0,0 +1,34 @@
+<view class="content main">
+    <view class="one">
+        <input class="input" type="text" bindconfirm="toSearch" confirm-type="search" placeholder-style=' text-align: center;' placeholder="搜索" />
+    </view>
+    <view class="two">
+        <scroll-view class="scroll-view" scroll-y="true" bindscrolltolower="toLower" bindscroll="toScroll">
+            <view class="list" wx:for="{{list}}" wx:key="index" wx:for-item="item" data-item="{{item}}" bindtap="toView">
+                <view class="list_1">
+                    <image class="images" src="{{item.userInfo.icon&&item.userInfo.icon.length>0?item.userInfo.icon[0].url:logo}}" mode="" />
+                    <view class="other">
+                        <view class="name textOver">
+                            <view class="title"> {{item.apply_name||"暂无姓名"}} </view>
+                            <view class="color{{item.status}}"> {{item.status_name||'暂无状态'}} </view>
+                        </view>
+                        <view class="other_1">
+                            年龄:{{item.userInfo.age||'暂无年龄'}}
+                        </view>
+                        <view class="other_1">
+                            性别:{{item.userInfo.gender_name||'暂无性别'}}
+                        </view>
+                        <view class="other_1">
+                            手机号:{{item.userInfo.phone||'暂无手机号'}}
+                        </view>
+                    </view>
+                </view>
+                <view class="button">
+                    <button class="btn" type="primary" size="mini" data-item="{{item}}" bindtap="toExam">
+                        审核
+                    </button>
+                </view>
+            </view>
+        </scroll-view>
+    </view>
+</view>

+ 86 - 0
pagesMy/apply/index.wxss

@@ -0,0 +1,86 @@
+@import "../../app.wxss";
+
+.main {
+    padding: 2vw;
+}
+
+.main .one {
+    padding: 0 0 2vw 0;
+}
+
+.main .one .input {
+    border: 1px solid var(--rgb8b8);
+    padding: 8rpx;
+    border-radius: 15rpx;
+    background-color: #ffffff;
+}
+
+.main .two .scroll-view {
+    height: 91vh;
+}
+
+.main .two .list {
+    display: flex;
+    flex-direction: column;
+    margin: 0 0 2vw 0;
+    padding: 2vw;
+    border-radius: 5px;
+    border: 1px solid var(--rgb40E);
+    background-color: #ffffff;
+}
+
+.main .two .list .list_1 {
+    display: flex;
+    justify-content: space-between;
+}
+
+.main .two .list .list_1 .other {
+    flex-grow: 1;
+}
+
+.main .two .list .list_1 .images {
+    width: 15vh;
+    height: 15vh;
+    margin: 0 2vw 0 0;
+    border-radius: 15rpx;
+}
+
+.main .two .list .list_1 .other .name {
+    display: flex;
+    justify-content: space-between;
+    margin: 0 0 1vw 0;
+}
+
+.main .two .list .list_1 .other .name .title {
+    font-size: 18px;
+    font-weight: bold;
+}
+
+.main .two .list .list_1 .other .name .color0 {
+    color: var(--rgb67c)
+}
+
+.main .two .list .list_1 .other .name .color1 {
+    color: var(--rgbff0)
+}
+.main .two .list .list_1 .other .name .color-1 {
+    color: var(--rgb8b8)
+}
+
+.main .two .list .list_1 .other .other_1 {
+    margin: 0 0 1vw 0;
+    font-size: 14px;
+    color: #868686;
+}
+
+.main .two .list .button {
+    text-align: center;
+}
+
+.main .two .list .button .btn {
+    margin: 0 2vw;
+    background-color: var(--rgb40E);
+    background-image: linear-gradient(to right, var(--rgb3AB), var(--rgb40E));
+    border-radius: 20rpx;
+    font-size: 15px;
+}

+ 0 - 68
pagesMy/exit/index.js

@@ -1,68 +0,0 @@
-const app = getApp()
-Page({
-    data: {
-        info: {}
-    },
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad(options) {
-        const that = this;
-        wx.showLoading({ title: '加载中', mask: true })
-        that.search()
-        wx.hideLoading()
-    },
-    // 查询通知
-    async search() {
-        const that = this;
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
-
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
-
-    }
-})

+ 0 - 3
pagesMy/exit/index.json

@@ -1,3 +0,0 @@
-{
-    "navigationBarTitleText": "退出登录"
-}

+ 0 - 3
pagesMy/exit/index.wxml

@@ -1,3 +0,0 @@
-<view class=" content main">
-    退出登录
-</view>

+ 0 - 1
pagesMy/exit/index.wxss

@@ -1 +0,0 @@
-@import "../../app.wxss";

+ 12 - 13
pagesMy/team/index.js

@@ -11,14 +11,6 @@ Page({
         limit: 5,
         statusList: []
     },
-    toPath(e) {
-        let data = e.detail;
-        let url = `/${data.route}`;
-        if (data.type == '0') wx.navigateTo({ url })
-        else if (data.type == '1') wx.redirectTo({ url })
-        else if (data.type == '2') wx.relaunch({ url })
-        else if (data.type == '3') wx.switchTab({ url })
-    },
     // 查询
     async toSearch(e) {
         const that = this;
@@ -32,11 +24,18 @@ Page({
     },
     // 查看
     toView(e) {
-
-    },
-    // 加入比赛
-    toMatch(e) {
-
+        let item = e.currentTarget.dataset.item
+        wx.navigateTo({ url: '/pagesTeam/apply/index?id=' + item._id })
+    },
+    // 审核
+    toExam(e) {
+        let item = e.currentTarget.dataset.item
+        wx.navigateTo({ url: '/pagesMy/apply/index?id=' + item._id })
+    },
+    // 修改
+    toEdit(e) {
+        let item = e.currentTarget.dataset.item
+        wx.navigateTo({ url: '/pagesMy/teamCreate/index?id=' + item._id })
     },
     /**
      * 生命周期函数--监听页面加载

+ 5 - 2
pagesMy/team/index.wxml

@@ -32,8 +32,11 @@
                     <button class="btn" type="primary" size="mini" data-item="{{item}}" bindtap="toView">
                         查看详情
                     </button>
-                    <button wx:if="{{user.type=='0'}}" class="btn" type="primary" size="mini" data-item="{{item}}" bindtap="toMatch">
-                        加入比赛
+                    <button wx:if="{{user.type=='1'}}" class="btn" type="primary" size="mini" data-item="{{item}}" bindtap="toExam">
+                        审核成员
+                    </button>
+                    <button wx:if="{{user.type=='1'&&item.status=='0'}}" class="btn" type="primary" size="mini" data-item="{{item}}" bindtap="toEdit">
+                        修改
                     </button>
                 </view>
             </view>

+ 12 - 0
pagesMy/teamCreate/index.js

@@ -6,6 +6,7 @@ Page({
      * 页面的初始数据
      */
     data: {
+        id: "",
         form: {},
         // 用户
         userList: [],
@@ -96,6 +97,7 @@ Page({
      */
     async onLoad(options) {
         const that = this;
+        that.setData({ id: options.id });
         wx.showLoading({ title: '加载中', mask: true })
         //验证规则函数
         that.initValidate();
@@ -127,6 +129,16 @@ Page({
         wx.getStorage({
             key: 'token',
             async success(res) {
+                if (that.data.id) {
+                    let res = await app.$api(`team/${that.data.id}`, 'GET', {})
+                    if (res.errcode == '0') {
+                        let arr = res.data.create_time.split(/\s+/);
+                        if (arr) { res.data.date = arr[0]; res.data.time = arr[1] }
+                        that.setData({ imgList: res.data.logo, memberList: res.data.member, form: res.data })
+                    } else {
+                        wx.showToast({ title: `${res.errmsg}`, icon: 'none' });
+                    }
+                }
                 that.setData({ "form.administrator": res.data._id })
             },
             fail(err) {

+ 174 - 0
pagesTeam/apply/index.js

@@ -0,0 +1,174 @@
+const app = getApp()
+const moment = require("../../utils/moment.min");
+Page({
+    data: {
+        id: "",
+        log: '',
+        info: {},
+        user: {},
+        adminList: [],
+        is_apply: true
+    },
+    // 申请加入团队
+    async toAdd() {
+        const that = this;
+        let user = {}
+        let arr = await app.$api(`user/${that.data.user._id}`, 'GET', {})
+        if (arr.errcode == '0') {
+            if (arr.data.name && arr.data.icon.length > 0) user = arr.data
+            else {
+                wx.showToast({ title: `请维护基础信息`, icon: 'none' });
+                return
+            }
+        } else {
+            wx.showToast({ title: `请维护基础信息`, icon: 'none' });
+            return
+        }
+        const info = that.data.info
+        const data = {
+            team_id: info._id,
+            team_name: info.name,
+            apply_id: user._id,
+            apply_name: user.name,
+            apply_time: moment().format('YYYY-MM-DD HH:mm:ss')
+        }
+        let res = await app.$api(`teamApply`, 'POST', data);
+        if (res.errcode == '0') {
+            wx.showToast({ title: `申请加入团队成功`, icon: 'none' });
+            that.search()
+        } else {
+            wx.showToast({ title: `${res.errmsg}`, icon: 'none' });
+        }
+    },
+    // 退出团队
+    async toOut() {
+        const that = this;
+        const memberList = that.data.info.member.filter(i => i._id !== that.data.user._id)
+        const number = memberList.length.toString()
+        const data = { member: memberList, number: number }
+        let res = await app.$api(`team/${that.data.info._id}`, 'POST', data);
+        if (res.errcode == '0') {
+            that.setData({ is_apply: true })
+            // 退出把申请都删掉
+            await app.$api(`teamApply/out`, 'GET', { apply_id: that.data.user._id });
+            wx.showToast({ title: `退出团队成功`, icon: 'success' });
+            that.search()
+        } else {
+            wx.showToast({ title: `${res.errmsg}`, icon: 'none' });
+        }
+    },
+    // 字典
+    getDict(value, model) {
+        const that = this;
+        if (model == 'admin') {
+            if (value) {
+                let data = that.data.adminList.find(i => i._id == value)
+                if (data) return data.name
+                else return '暂无'
+            }
+        }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    async onLoad(options) {
+        const that = this;
+        that.setData({ id: options.id });
+        wx.showLoading({ title: '加载中', mask: true })
+        await that.searchConfig()
+        await that.searchOther()
+        await that.search()
+        wx.hideLoading()
+    },
+    async searchConfig() {
+        const that = this;
+        wx.getStorage({
+            key: 'config',
+            async success(res) {
+                // logo
+                if (res.data && res.data.logo_url && res.data.logo_url.length > 0) {
+                    let logo = res.data.logo_url[0].url
+                    that.setData({ logo })
+                }
+            },
+            fail(err) {
+                console.log(err);
+            }
+        })
+        wx.getStorage({
+            key: 'token',
+            async success(res) {
+                that.setData({ user: res.data })
+            },
+            fail(err) {
+                console.log(err);
+            }
+        })
+    },
+    // 查询其他信息
+    async searchOther() {
+        const that = this;
+        let res;
+        res = await app.$api('user', 'GET', { status: '1', type: '1' })
+        if (res.errcode == '0') that.setData({ adminList: res.data })
+    },
+    // 查询通知
+    async search() {
+        const that = this;
+        let res = await app.$api(`team/${that.data.id}`, 'GET', {})
+        if (res.errcode == '0') {
+            let data = res.data.member.find(i => i._id === that.data.user._id)
+            if (data) that.setData({ is_apply: false })
+            res.data.admin_name = that.getDict(res.data.administrator, 'admin')
+            that.setData({ info: res.data })
+        }
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
pagesTeam/apply/index.json

@@ -0,0 +1,3 @@
+{
+    "navigationBarTitleText": "团队详情"
+}

+ 32 - 0
pagesTeam/apply/index.wxml

@@ -0,0 +1,32 @@
+<view class="main">
+    <view class="one">
+        <image class="images" src="{{info.logo&&info.logo.length>0?info.logo[0].url:logo}}" mode="" />
+    </view>
+    <view class="two">
+        <view class="name textOver">{{info.name||"暂无团队名称"}}</view>
+        <view class="other">所属管理员:{{info.admin_name||"暂无管理员"}}</view>
+        <view class="other">手机号:{{info.phone||"暂无手机号"}}</view>
+        <view class="other">成立时间:{{info.create_time||"暂无成立时间"}}</view>
+        <view class="other">单位地址:{{info.address||"暂无单位地址"}}</view>
+        <view class="other">成员人数:{{info.number||"暂无成员人数"}}人</view>
+    </view>
+    <view class="two">
+        <view class="name">团队成员</view>
+        <view class="two_1">
+            <view class="list" wx:for="{{info.member}}" wx:key="index" wx:for-item="item">
+                <image class="images" src="{{item.icon&&item.icon.length>0?item.icon[0].url:logo}}" mode="" />
+                <view class="title">
+                    {{item.name}}
+                </view>
+            </view>
+        </view>
+    </view>
+    <view class="thr">
+        <button wx:if="{{user.type=='0'&&is_apply==true}}" class="btn" type="primary" size="mini" bindtap="toAdd">
+            加入团队
+        </button>
+        <button wx:if="{{user.type=='0'&&is_apply==false}}" class="btn" type="primary" size="mini" bindtap="toOut">
+            退出团队
+        </button>
+    </view>
+</view>

+ 78 - 0
pagesTeam/apply/index.wxss

@@ -0,0 +1,78 @@
+@import "../../app.wxss";
+
+.main {
+    padding: 2vw;
+}
+
+.main .one {
+    width: 100%;
+    height: 35vh;
+    border: 1px solid var(--rgb40E);
+    border-radius: 20rpx;
+    box-shadow: 0 0 10px 2px var(--rgb40E);
+}
+
+.main .one .images {
+    width: 100%;
+    height: 35vh;
+    border-radius: 20rpx;
+}
+
+.main .two {
+    border: 1px solid var(--rgb40E);
+    margin: 4vw 0 0 0;
+    padding: 1vw 2vw;
+    border-radius: 20rpx;
+    box-shadow: 0 0 10px 2px var(--rgb40E);
+}
+
+.main .two .two_1 {
+    width: 96%;
+    display: flex;
+    justify-content: space-around;
+    flex-wrap: wrap;
+    padding: 2vw;
+}
+
+.main .two .name {
+    text-align: center;
+    font-size: 18px;
+    font-weight: bold;
+    margin: 0 0 1vw 0;
+}
+
+.main .two .other {
+    margin: 0 0 1vw 0;
+    font-size: 14px;
+    color: #868686;
+}
+
+.main .two .two_1 .list {
+    width: 20%;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+}
+
+.main .two .two_1 .list .title {
+    margin: 2vw 0 0 0;
+}
+
+.main .two .two_1 .images {
+    width: 10vh;
+    height: 10vh;
+    border-radius: 80rpx;
+}
+
+.main .thr {
+    margin: 2vw 0;
+    text-align: center;
+}
+
+.main .thr .btn {
+    margin: 0 2vw;
+    background-color: var(--rgb40E);
+    background-image: linear-gradient(to right, var(--rgb3AB), var(--rgb40E));
+    border-radius: 20rpx;
+    font-size: 15px;
+}

+ 106 - 5
pagesTeam/home/index.js

@@ -1,7 +1,14 @@
 const app = getApp()
 Page({
     data: {
-        info: {}
+        logo: "",
+        user: {},
+        searchInfo: {},
+        list: [],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
     },
     toPath(e) {
         let data = e.detail;
@@ -11,21 +18,115 @@ Page({
         else if (data.type == '2') wx.relaunch({ url })
         else if (data.type == '3') wx.switchTab({ url })
     },
-
+    // 查询
+    async toSearch(e) {
+        const that = this;
+        that.setData({ 'searchInfo.name': e.detail.value })
+        that.clearPage();
+        that.search()
+    },
+    // 查看详情
+    toView(e) {
+        const that = this;
+        if (that.data.user._id) {
+            const item = e.currentTarget.dataset.item
+            wx.navigateTo({ url: '/pagesTeam/apply/index?id=' + item._id })
+        } else {
+            wx.navigateTo({ url: '/pagesCommon/login/index' })
+        }
+    },
     /**
      * 生命周期函数--监听页面加载
      */
-    onLoad(options) {
+    async onLoad(options) {
         const that = this;
         wx.showLoading({ title: '加载中', mask: true })
-        that.search()
+        await that.searchConfig()
+        await that.searchOther()
+        await that.clearPage();
+        await that.search()
         wx.hideLoading()
     },
+    async searchConfig() {
+        const that = this;
+        wx.getStorage({
+            key: 'config',
+            async success(res) {
+                // logo
+                if (res.data && res.data.logo_url && res.data.logo_url.length > 0) {
+                    let logo = res.data.logo_url[0].url
+                    that.setData({ logo })
+                }
+            },
+            fail(err) {
+                console.log(err);
+            }
+        })
+        wx.getStorage({
+            key: 'token',
+            async success(res) {
+                that.setData({ user: res.data })
+            },
+            fail(err) {
+                console.log(err);
+            }
+        })
+    },
     // 查询通知
     async search() {
         const that = this;
+        let info = { skip: that.data.skip, limit: that.data.limit, status: '1' };
+        let res = await app.$api('team', 'GET', { ...info, ...that.data.searchInfo })
+        if (res.errcode == '0') {
+            let list = [...that.data.list, ...res.data]
+            that.setData({ list })
+            that.setData({ total: res.total })
+        }
+    },
+    // 分页-触底
+    toLower() {
+        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 })
+            let skip = page * limit
+            that.setData({ skip })
+            that.search()
+            wx.hideLoading()
+        } else {
+            wx.showToast({ title: `到底了没数据了`, icon: 'none' });
+        }
+    },
+    // 分页-滚动
+    toScroll() {
+        // console.log('滚动');
+    },
+    // 字典
+    getDict(value, model) {
+        const that = this;
+        if (model == 'status') {
+            if (value) {
+                let data = that.data.statusList.find(i => i.value == value)
+                if (data) return data.label
+                else return '暂无'
+            }
+        }
+    },
+    // 查询其他信息
+    async searchOther() {
+        const that = this;
+    },
+    // 清空列表
+    clearPage() {
+        const that = this;
+        that.setData({ list: [] })
+        that.setData({ skip: 0 })
+        that.setData({ limit: 5 })
+        that.setData({ total: 0 })
     },
-
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 22 - 1
pagesTeam/home/index.wxml

@@ -1,5 +1,26 @@
 <home-frame bind:toPath="toPath">
     <view class="main">
-        团队
+        <view class="one">
+            <input class="input" type="text" bindconfirm="toSearch" confirm-type="search" placeholder-style=' text-align: center;' placeholder="搜索" />
+        </view>
+        <view class="two">
+            <scroll-view class="scroll-view" scroll-y="true" bindscrolltolower="toLower" bindscroll="toScroll">
+                <view class="list" wx:for="{{list}}" wx:key="index" wx:for-item="item"  data-item="{{item}}" bindtap="toView">
+                    <image class="images" src="{{item.logo&&item.logo.length>0?item.logo[0].url:logo}}" mode="" />
+                    <view class="list_1">
+                        <view class="name textOver"> {{item.name||"暂无团队名称"}} </view>
+                        <view class="other_1">
+                            手机号:{{item.phone||'暂无手机号'}}
+                        </view>
+                        <view class="other_1">
+                            成立时间:{{item.create_time||'暂无成立时间'}}
+                        </view>
+                        <view class="other_1 textOver">
+                            单位地址:{{item.address||'暂无单位地址'}}
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
     </view>
 </home-frame>

+ 52 - 1
pagesTeam/home/index.wxss

@@ -1,3 +1,54 @@
+@import "../../app.wxss";
+
 .main {
-    padding: 1vw;
+    padding: 2vw;
+}
+
+.main .one {
+    padding: 0 0 2vw 0;
+}
+
+.main .one .input {
+    border: 1px solid var(--rgb8b8);
+    padding: 8rpx;
+    border-radius: 15rpx;
+    background-color: #ffffff;
+}
+
+.main .two .scroll-view {
+    height: 83vh;
+}
+
+.main .two .list {
+    display: flex;
+    justify-content: space-between;
+    align-items: flex-start;
+    margin: 0 0 2vw 0;
+    padding: 2vw;
+    border-radius: 5px;
+    border: 1px solid var(--rgb40E);
+    background-color: #ffffff;
+}
+
+.main .two .list .images {
+    width: 15vh;
+    height: 15vh;
+    margin: 0 2vw 0 0;
+    border-radius: 15rpx;
+}
+
+.main .two .list .list_1 {
+    flex-grow: 1;
+}
+
+.main .two .list .list_1 .name {
+    font-size: 18px;
+    font-weight: bold;
+    margin: 0 0 1vw 0;
+}
+
+.main .two .list .list_1 .other_1 {
+    margin: 0 0 1vw 0;
+    font-size: 14px;
+    color: #868686;
 }