guhongwei 2 سال پیش
والد
کامیت
9d613aaa8e
10فایلهای تغییر یافته به همراه158 افزوده شده و 86 حذف شده
  1. 2 2
      app.json
  2. BIN
      image/indexbg.png
  3. 81 81
      pages/index/index.js
  4. 1 1
      pages/index/index.wxml
  5. 66 0
      pages/logs/index.js
  6. 3 0
      pages/logs/index.json
  7. 2 0
      pages/logs/index.wxml
  8. 1 0
      pages/logs/index.wxss
  9. 1 1
      pages/matchInfo/index.js
  10. 1 1
      pages/matchInfo/index.wxml

+ 2 - 2
app.json

@@ -1,6 +1,5 @@
 {
     "pages": [
-      
         "pages/index/index",
         "pages/register/index",
         "pages/home/index",
@@ -28,7 +27,8 @@
         "pages/order/index",
         "pages/matchInfo/sign",
         "pages/matchInfo/index",
-        "pages/test/index"
+        "pages/test/index",
+        "pages/logs/index"
     ],
     "usingComponents": {
         "van-sidebar": "@vant/weapp/sidebar/index",

BIN
image/indexbg.png


+ 81 - 81
pages/index/index.js

@@ -1,92 +1,92 @@
 const app = getApp();
 Page({
-  data: {
-    frameStyle: { useTop: false, name: '系统', leftArrow: false, useBar: false },
-    indexbg:'/image/indexbg.png'
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    const that = this;
+    data: {
+        frameStyle: { useTop: false, name: '系统', leftArrow: false, useBar: false },
+        fileUrl: app.globalData.fileUrl,
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const that = this;
+        // 监听用户是否登录
+        that.watchLogin();
+    },
     // 监听用户是否登录
-    that.watchLogin();
-  },
-  // 监听用户是否登录
-  watchLogin: async function () {
-    // 监听用户是否登录,
-    wx.getStorage({
-      key: 'user',
-      success: async (res) => {
-        if (res.data) wx.redirectTo({ url: '/pages/home/index' })
-      },
-      fail: async (res) => {
-        wx.login({
-          success: async (arr) => {
-            if(app.globalData?.wxInfo?.openid) {
-                await this.toLogin(app.globalData?.wxInfo?.openid);
-                return;
-            }
-            const { code: js_code } = arr;
-            const aee = await app.$get('/wechat/api/login/app', { js_code: js_code, config: 'newCourtApp' });
-            if (aee.errcode === 0 && aee.data?.openid) {
-              const openid = aee.data.openid;
-              app.globalData.wxInfo = { openid };
-              await this.toLogin(openid);
-            } else {
-              wx.showToast({ title: `${res.errMsg}`, icon: 'fail', duration: 2000 });
-              wx.redirectTo({ url: '/pages/login/index' });
-            }
-          },
+    watchLogin: async function () {
+        // 监听用户是否登录,
+        wx.getStorage({
+            key: 'user',
+            success: async (res) => {
+                if (res.data) wx.redirectTo({ url: '/pages/home/index' })
+            },
+            fail: async (res) => {
+                wx.login({
+                    success: async (arr) => {
+                        if (app.globalData?.wxInfo?.openid) {
+                            await this.toLogin(app.globalData?.wxInfo?.openid);
+                            return;
+                        }
+                        const { code: js_code } = arr;
+                        const aee = await app.$get('/wechat/api/login/app', { js_code: js_code, config: 'newCourtApp' });
+                        if (aee.errcode === 0 && aee.data?.openid) {
+                            const openid = aee.data.openid;
+                            app.globalData.wxInfo = { openid };
+                            await this.toLogin(openid);
+                        } else {
+                            wx.showToast({ title: `${res.errMsg}`, icon: 'fail', duration: 2000 });
+                            wx.redirectTo({ url: '/pages/login/index' });
+                        }
+                    },
+                });
+            },
         });
-      },
-    });
-  },
-  async toLogin(openid) {
-    const res = await app.$post('/newCourt/api/user/wxAppLogin', { openid });
-    if (app.$checkRes(res)) {
-      const { data } = res;
-      // 没有用户,去注册
-      if (!data) wx.redirectTo({ url: '/pages/register/index' });
-      else {
-        // 有用户,存起来,跳转
-        wx.setStorageSync('user', data);
-        wx.redirectTo({ url: '/pages/home/index' });
-      }
-    }
-  },
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {},
+    },
+    async toLogin(openid) {
+        const res = await app.$post('/newCourt/api/user/wxAppLogin', { openid });
+        if (app.$checkRes(res)) {
+            const { data } = res;
+            // 没有用户,去注册
+            if (!data) wx.redirectTo({ url: '/pages/register/index' });
+            else {
+                // 有用户,存起来,跳转
+                wx.setStorageSync('user', data);
+                wx.redirectTo({ url: '/pages/home/index' });
+            }
+        }
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
 
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {},
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () { },
 
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {},
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () { },
 
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {},
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () { },
 
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {},
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () { },
 
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {},
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () { },
 
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {},
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () { },
 });

+ 1 - 1
pages/index/index.wxml

@@ -1,5 +1,5 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back" bind:tabPath="tabPath">
     <view slot="info" class="container main">
-        <image class="image" src="{{indexbg}}"></image>
+        <image class="image" src="{{fileUrl}}/files/court/elimg/20220729140404.png"></image>
     </view>
 </mobile-main>

+ 66 - 0
pages/logs/index.js

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

+ 3 - 0
pages/logs/index.json

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

+ 2 - 0
pages/logs/index.wxml

@@ -0,0 +1,2 @@
+<!--pages/logs/index.wxml-->
+<text>pages/logs/index.wxml</text>

+ 1 - 0
pages/logs/index.wxss

@@ -0,0 +1 @@
+/* pages/logs/index.wxss */

+ 1 - 1
pages/matchInfo/index.js

@@ -7,6 +7,7 @@ Page({
      */
     data: {
         frameStyle: { useTop: true, name: '赛事信息', leftArrow: true, useBar: false },
+        fileUrl: app.globalData.fileUrl,
         user: {},
         id: '',
         info: {},
@@ -21,7 +22,6 @@ Page({
                 { title: '成绩册', name: 'e' },
             ],
         },
-        bg: '/image/bg.png',
         // 选手
         bActive: '0',
         groupList: [

+ 1 - 1
pages/matchInfo/index.wxml

@@ -6,7 +6,7 @@
                 <scroll-view scroll-y="true" class="scroll-view">
                     <view class="list-scroll-view">
                         <view class="a_1">
-                            <image class="image" src="{{bg}}"></image>
+                            <image class="image" src="{{fileUrl}}/files/court/elimg/20220729140648.png"></image>
                             <view class="a_1_info">
                                 <view class="a_1_1">
                                     <view class="name">{{info.name}}</view>