zs 1 рік тому
батько
коміт
4616c7497b

+ 2 - 1
app.json

@@ -40,7 +40,8 @@
             "root": "pagesCommon",
             "root": "pagesCommon",
             "independent": true,
             "independent": true,
             "pages": [
             "pages": [
-                "agree/index"
+                "login/index",
+                "register/index"
             ]
             ]
         }
         }
     ],
     ],

+ 10 - 38
pages/index/index.js

@@ -29,49 +29,21 @@ Page({
         const that = this;
         const that = this;
         wx.showLoading({ title: '加载中', mask: true })
         wx.showLoading({ title: '加载中', mask: true })
         await this.searchConfig()
         await this.searchConfig()
-        await that.search();
         wx.hideLoading()
         wx.hideLoading()
     },
     },
     async searchConfig() {
     async searchConfig() {
         const that = this;
         const that = this;
-        // const res = await app.$api('config', 'GET', {});
-        // if (res.errcode == '0') {
-        //     // index,长图。
-        //     if (res.data && res.data.longlogo_url && res.data.longlogo_url.length > 0) {
-        //         let logo = res.data.longlogo_url[0].url
-        //         that.setData({ logo })
-        //     }
-        //     wx.setStorage({ key: "config", data: res.data })
-        // }
+        const res = await app.$api('config', 'GET', {});
+        if (res.errcode == '0') {
+            // index,长图。
+            if (res.data && res.data.longlogo_url && res.data.longlogo_url.length > 0) {
+                let logo = res.data.longlogo_url[0].url
+                that.setData({ logo })
+                wx.redirectTo({ url: '/pagesCommon/login/index'})
+            }
+            wx.setStorage({ key: "config", data: res.data })
+        }
     },
     },
-    async search() {
-        let url = '/pagesHome/home/index';
-        wx.redirectTo({ url })
-        // wx.login({
-        //     success: async (arr) => {
-        //         const { code: js_code } = arr;
-        //         const { wx_config } = app.globalData;
-        //         wx.getStorage({
-        //             key: 'openid',
-        //             success(res) {
-        //                 if (res.data) wx.redirectTo({ url })
-        //             },
-        //             async fail(err) {
-        //                 const aee = await app.$api('token/app', 'GET', { js_code: js_code, config: wx_config.config });
-        //                 if (aee.errcode == '0') {
-        //                     wx.setStorage({ key: "openid", data: aee.data.openid })
-        //                     wx.redirectTo({ url })
-        //                 } else {
-        //                     wx.showToast({ title: `${aee.errmsg}`, icon: 'fail' });
-        //                 }
-        //             }
-        //         })
-
-        //     },
-        // });
-
-    },
-
     /**
     /**
      * 生命周期函数--监听页面隐藏
      * 生命周期函数--监听页面隐藏
      */
      */

+ 0 - 1
pages/index/index.wxml

@@ -1,6 +1,5 @@
 <view class="main content">
 <view class="main content">
     <view class="one">
     <view class="one">
-        <!-- aspectFit -->
         <image class="image" src="{{logo}}" mode="" />
         <image class="image" src="{{logo}}" mode="" />
     </view>
     </view>
 </view>
 </view>

+ 5 - 3
pages/index/index.wxss

@@ -1,10 +1,12 @@
 .main .one {
 .main .one {
     width: 100%;
     width: 100%;
     height: 100vh;
     height: 100vh;
-    overflow: hidden;
+    display: flex;
+    justify-content: center;
+    align-items: center;
 }
 }
 
 
 .main .one .image {
 .main .one .image {
-    width: 100%;
-    height: 100%;
+    width: 50vw;
+    height: 50vw;
 }
 }

+ 0 - 3
pagesCommon/agree/index.json

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

+ 0 - 2
pagesCommon/agree/index.wxml

@@ -1,2 +0,0 @@
-<!--pagesCommon/agree/index.wxml-->
-<text>pagesCommon/agree/index.wxml</text>

+ 0 - 1
pagesCommon/agree/index.wxss

@@ -1 +0,0 @@
-/* pagesCommon/agree/index.wxss */

+ 18 - 7
pagesCommon/agree/index.js

@@ -1,18 +1,29 @@
-// pagesCommon/agree/index.js
+const app = getApp()
 Page({
 Page({
-
-    /**
-     * 页面的初始数据
-     */
     data: {
     data: {
-
+        info: {}
+    },
+    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 })
     },
     },
 
 
     /**
     /**
      * 生命周期函数--监听页面加载
      * 生命周期函数--监听页面加载
      */
      */
     onLoad(options) {
     onLoad(options) {
-
+        const that = this;
+        wx.showLoading({ title: '加载中', mask: true })
+        that.search()
+        wx.hideLoading()
+    },
+    // 查询通知
+    async search() {
+        const that = this;
     },
     },
 
 
     /**
     /**

+ 3 - 0
pagesCommon/login/index.json

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

+ 3 - 0
pagesCommon/login/index.wxml

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

+ 3 - 0
pagesCommon/login/index.wxss

@@ -0,0 +1,3 @@
+.main {
+    padding: 1vw;
+}

+ 77 - 0
pagesCommon/register/index.js

@@ -0,0 +1,77 @@
+const app = getApp()
+Page({
+    data: {
+        info: {}
+    },
+    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 })
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    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() {
+
+    }
+})

+ 3 - 0
pagesCommon/register/index.json

@@ -0,0 +1,3 @@
+{
+    "navigationBarTitleText": "注册"
+}

+ 3 - 0
pagesCommon/register/index.wxml

@@ -0,0 +1,3 @@
+<view class="main">
+    注册
+</view>

+ 3 - 0
pagesCommon/register/index.wxss

@@ -0,0 +1,3 @@
+.main {
+    padding: 1vw;
+}

+ 2 - 1
project.private.config.json

@@ -2,6 +2,7 @@
     "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
     "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
     "projectname": "applet",
     "projectname": "applet",
     "setting": {
     "setting": {
-        "compileHotReLoad": true
+        "compileHotReLoad": true,
+        "urlCheck": false
     }
     }
 }
 }

+ 1 - 1
utils/wxValidate.js

@@ -7,7 +7,7 @@
  */
  */
 class WxValidate {
 class WxValidate {
     constructor(rules = {}, messages = {}) {
     constructor(rules = {}, messages = {}) {
-        Object.assign(this, {
+        Object.assign(this, { 
             data: {},
             data: {},
             rules,
             rules,
             messages,
             messages,