|
@@ -3,82 +3,103 @@ import WxValidate from '../../utils/wxValidate'
|
|
|
const app = getApp()
|
|
|
Page({
|
|
|
|
|
|
-
|
|
|
- * 页面的初始数据
|
|
|
- */
|
|
|
- data: {
|
|
|
- frameStyle: { useTop: true, name: '登录', leftArrow: false, useBar: false },
|
|
|
-
|
|
|
- infoHeight: '',
|
|
|
- },
|
|
|
- back: function () {
|
|
|
- wx.navigateBack({ url: '/pages/home/index' })
|
|
|
- },
|
|
|
-
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
- */
|
|
|
- onLoad: function (options) {
|
|
|
+
|
|
|
+ * 页面的初始数据
|
|
|
+ */
|
|
|
+ data: {
|
|
|
+ frameStyle: { useTop: true, name: '登录', leftArrow: false, useBar: false },
|
|
|
+
|
|
|
+ infoHeight: '',
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ skip: 0,
|
|
|
+ limit: 5,
|
|
|
+ },
|
|
|
+ back: function () {
|
|
|
+ wx.navigateBack({ url: '/pages/home/index' })
|
|
|
+ },
|
|
|
+
|
|
|
+ * 生命周期函数--监听页面加载
|
|
|
+ */
|
|
|
+ onLoad: function (options) {
|
|
|
+
|
|
|
+ this.searchHeight();
|
|
|
+
|
|
|
+ this.watchLogin();
|
|
|
+ },
|
|
|
+
|
|
|
+ watchLogin: function () {
|
|
|
+ const that = this;
|
|
|
+ wx.getStorage({
|
|
|
+ key: 'token',
|
|
|
+ success: async res => {
|
|
|
+ let page = { skip: that.data.skip, limit: that.data.limit }
|
|
|
+ const arr = await app.$get(`/courtAdmin/api/team`, page);
|
|
|
+ if (arr.errcode == '0') { that.setData({ list: arr.data }); that.setData({ total: arr.total }); }
|
|
|
+ else wx.showToast({ title: `${arr.errmsg}`, duration: 2000, icon: 'error' })
|
|
|
+ },
|
|
|
+ fail: res => {
|
|
|
+ wx.redirectTo({ url: '/pages/index/index', })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
- this.searchHeight()
|
|
|
- },
|
|
|
-
|
|
|
- searchHeight: function () {
|
|
|
- let frameStyle = this.data.frameStyle;
|
|
|
- let client = app.globalData.client;
|
|
|
- let infoHeight = client.windowHeight;
|
|
|
-
|
|
|
- if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
|
|
|
-
|
|
|
- if (frameStyle.useBar) infoHeight = infoHeight - 50;
|
|
|
- if (infoHeight) this.setData({ infoHeight: infoHeight })
|
|
|
- },
|
|
|
+ searchHeight: function () {
|
|
|
+ let frameStyle = this.data.frameStyle;
|
|
|
+ let client = app.globalData.client;
|
|
|
+ let infoHeight = client.windowHeight;
|
|
|
+
|
|
|
+ if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
|
|
|
+
|
|
|
+ if (frameStyle.useBar) infoHeight = infoHeight - 50;
|
|
|
+ if (infoHeight) this.setData({ infoHeight: infoHeight })
|
|
|
+ },
|
|
|
|
|
|
-
|
|
|
- * 生命周期函数--监听页面初次渲染完成
|
|
|
- */
|
|
|
- onReady: function () {
|
|
|
+
|
|
|
+ * 生命周期函数--监听页面初次渲染完成
|
|
|
+ */
|
|
|
+ onReady: function () {
|
|
|
+ },
|
|
|
|
|
|
- },
|
|
|
+
|
|
|
+ * 生命周期函数--监听页面显示
|
|
|
+ */
|
|
|
+ onShow: function () {
|
|
|
|
|
|
-
|
|
|
- * 生命周期函数--监听页面显示
|
|
|
- */
|
|
|
- onShow: function () {
|
|
|
+ },
|
|
|
|
|
|
- },
|
|
|
+
|
|
|
+ * 生命周期函数--监听页面隐藏
|
|
|
+ */
|
|
|
+ onHide: function () {
|
|
|
|
|
|
-
|
|
|
- * 生命周期函数--监听页面隐藏
|
|
|
- */
|
|
|
- onHide: function () {
|
|
|
+ },
|
|
|
|
|
|
- },
|
|
|
+
|
|
|
+ * 生命周期函数--监听页面卸载
|
|
|
+ */
|
|
|
+ onUnload: function () {
|
|
|
|
|
|
-
|
|
|
- * 生命周期函数--监听页面卸载
|
|
|
- */
|
|
|
- onUnload: function () {
|
|
|
+ },
|
|
|
|
|
|
- },
|
|
|
+
|
|
|
+ * 页面相关事件处理函数--监听用户下拉动作
|
|
|
+ */
|
|
|
+ onPullDownRefresh: function () {
|
|
|
+ console.log('2');
|
|
|
+ },
|
|
|
|
|
|
-
|
|
|
- * 页面相关事件处理函数--监听用户下拉动作
|
|
|
- */
|
|
|
- onPullDownRefresh: function () {
|
|
|
+
|
|
|
+ * 页面上拉触底事件的处理函数
|
|
|
+ */
|
|
|
+ onReachBottom: function () {
|
|
|
+ console.log('1');
|
|
|
+ },
|
|
|
|
|
|
- },
|
|
|
+
|
|
|
+ * 用户点击右上角分享
|
|
|
+ */
|
|
|
+ onShareAppMessage: function () {
|
|
|
|
|
|
-
|
|
|
- * 页面上拉触底事件的处理函数
|
|
|
- */
|
|
|
- onReachBottom: function () {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- * 用户点击右上角分享
|
|
|
- */
|
|
|
- onShareAppMessage: function () {
|
|
|
-
|
|
|
- }
|
|
|
+ }
|
|
|
})
|