liyongli vor 2 Jahren
Ursprung
Commit
89b1238fd0

+ 1 - 1
miniprogram/api/index.ts

@@ -102,7 +102,7 @@ function seaveUserData(params: WechatMiniprogram.requestParamsData) {
  */
 function getPageInfo(params: WechatMiniprogram.requestParamsData) {
   return request({
-    url: "https://djweb.smcic.net/video/PageInfo.json",
+    url: "https://djweb.smcic.net/video/PageInfo.json?" + Date.now(),
     data: params.data,
     method: params.method,
     baseUrlNone: true,

+ 1 - 0
miniprogram/app.json

@@ -1,5 +1,6 @@
 {
   "pages": [
+    "pages/spread/index",
     "pages/home/index",
     "pages/faceRecognition/index",
     "pages/faceRecognitionVK/index",

+ 28 - 41
miniprogram/pages/home/index.ts

@@ -31,7 +31,7 @@ Page({
           wx.navigateTo({ url })
           return;
         }
-        wx.redirectTo({
+        wx.navigateTo({
           url: "/pages/downloadPage/index"
         })
       }
@@ -50,81 +50,68 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad() {
-    if (!app.globalData.configPage) app.getPageInfo({
+    app.getPageInfo({
       success: (res: any) => {
-        app.globalData.configPage = res || {};
-        this.inited(app.globalData.configPage);
+        const configPage = res || {};
+        this.inited(configPage);
       }
     })
-    else this.inited(app.globalData.configPage);
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady() {
-
-  },
+  onReady() { },
 
   /**
    * 生命周期函数--监听页面显示
    */
   onShow() {
     // 获取用户信息
-    app.getUser({
-      data: {},
-      success: (res: any) => {
-        if (!res) return;
-        if (res.UPLOAD_FACE && res.SAVE_USER_INFO) {
-          // 已经录过脸并且用户信息已经上传,跳转视频下载页
-          // this.setData({
-          //   btnText: "进入下载页"
-          // })
-          return wx.reLaunch({
-            url: "/pages/downloadPage/index"
-          })
-        }
-      },
-      complete: () => {
-        app.globalData.getUserLoad = false;
-      }
-    })
+    // app.getUser({
+    //   data: {},
+    //   success: (res: any) => {
+    //     if (!res) return;
+    //     if (res.UPLOAD_FACE && res.SAVE_USER_INFO) {
+    //       // 已经录过脸并且用户信息已经上传,跳转视频下载页
+    //       // this.setData({
+    //       //   btnText: "进入下载页"
+    //       // })
+    //       return wx.reLaunch({
+    //         url: "/pages/downloadPage/index"
+    //       })
+    //     }
+    //   },
+    //   complete: () => {
+    //     app.globalData.getUserLoad = false;
+    //   }
+    // })
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
-  onHide() {
-
-  },
+  onHide() { },
 
   /**
    * 生命周期函数--监听页面卸载
    */
-  onUnload() {
-
-  },
+  onUnload() { },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
-  onPullDownRefresh() {
-
-  },
+  onPullDownRefresh() { },
 
   /**
    * 页面上拉触底事件的处理函数
    */
-  onReachBottom() {
-
-  },
+  onReachBottom() { },
 
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage() {
-
-  }
+  onShareAppMessage() { }
 })
 
 export { }

+ 5 - 0
miniprogram/pages/spread/index.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarBackgroundColor": "#2AB0FF",
+  "navigationBarTextStyle": "white",
+  "usingComponents": {}
+}

+ 35 - 0
miniprogram/pages/spread/index.scss

@@ -0,0 +1,35 @@
+/* pages/home/index.wxss */
+.page {
+  position: relative;
+  background-size: 100% 100%;
+  background-repeat: no-repeat;
+  padding-top: 86rpx;
+  box-sizing: border-box;
+
+  .buttom {
+    background-size: 100% 100%;
+    background-repeat: no-repeat;
+    position: absolute;
+    bottom: 180rpx;
+    left: 50%;
+    transform: translateX(-50%);
+    color: #FFFFFF;
+    text-align: center;
+    font-size: 28rpx;
+    font-weight: 500;
+    width: 340rpx;
+    height: 80rpx;
+    line-height: 80rpx;
+    box-sizing: border-box;
+  }
+
+  .support {
+    position: absolute;
+    width: 100%;
+    text-align: center;
+    color: #FFFFFF;
+    bottom: 62rpx;
+    font-size: 24rpx;
+    font-family: PingFangSC-Regular, PingFang SC;
+  }
+}

+ 76 - 0
miniprogram/pages/spread/index.ts

@@ -0,0 +1,76 @@
+// pages/home/index.ts
+const app = getApp<IAppOption>();
+import { compareVersion } from "../../utils/util";
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    pageBGIMG: "",
+    btnBGIMG: "",
+  },
+
+  lvru() {
+    wx.navigateTo({
+      url: "/pages/home/index"
+    })
+  },
+
+  inited(res: any) {
+    const { BGIMG, btnBGIMG } = res?.spreadPage;
+    this.setData({
+      pageBGIMG: BGIMG + "?" + Date.now(),
+      btnBGIMG: btnBGIMG + "?" + Date.now()
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad() {
+    app.getPageInfo({
+      success: (res: any) => {
+        const configPage = res || {};
+        this.inited(configPage);
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() { },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() { },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() { },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() { },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() { },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() { },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() { }
+})
+
+export { }

+ 9 - 0
miniprogram/pages/spread/index.wxml

@@ -0,0 +1,9 @@
+<!--pages/home/index.wxml-->
+<view class="page" style="background-image: url({{pageBGIMG}});">
+  <view class="buttom" style="background-image: url({{btnBGIMG}});" bindtap="lvru">
+    查看活动流程
+  </view>
+  <view class="support"> 
+    本项目由西安交通大学情感计算与智能分析团队支持
+  </view>
+</view>