wangxin 5 年之前
父節點
當前提交
86a2028e80
共有 6 個文件被更改,包括 181 次插入180 次删除
  1. 1 1
      app.js
  2. 1 1
      pages/index/index.js
  3. 1 1
      pages/login/login.js
  4. 1 1
      pages/person/person.js
  5. 176 175
      project.config.json
  6. 1 1
      utils/watch.js

+ 1 - 1
app.js

@@ -75,7 +75,7 @@ App({
    * 当小程序发生脚本错误,或者 api 调用失败时,会触发 onError 并带上错误信息
    */
   onError: function (msg) {
-
+    console.log(msg)
   },
   /**
    * 工具类

+ 1 - 1
pages/index/index.js

@@ -375,7 +375,7 @@ Page({
    */
   onLoad: function (options) {
     this.reload()
-    wx.$watch('is_login', this, () => {
+    wx.$on('is_login', this, () => {
       this.reload()
     })
   },

+ 1 - 1
pages/login/login.js

@@ -221,7 +221,7 @@ Page({
   onLoad: function (options) {
     this.options = options;
     // 监听是否离线
-    wx.$watch('offline', this, (value) => {
+    wx.$on('offline', this, (value) => {
       if (value) {
         clearInterval(this.setInter)
       }

+ 1 - 1
pages/person/person.js

@@ -53,7 +53,7 @@ Page({
         userinfo: wx.getStorageSync('userinfo'),
       }, _ => {
         // 监听个人信息变动
-        wx.$watch('userinfo', this, (data) => {
+        wx.$on('userinfo', this, (data) => {
 
           this.setData({
             userinfo: data

+ 176 - 175
project.config.json

@@ -1,177 +1,178 @@
 {
-	"description": "项目配置文件",
-	"packOptions": {
-		"ignore": []
-	},
-	"setting": {
-		"urlCheck": true,
-		"es6": true,
-		"enhance": true,
-		"postcss": true,
-		"preloadBackgroundData": false,
-		"minified": true,
-		"newFeature": true,
-		"coverView": true,
-		"autoAudits": true,
-		"showShadowRootInWxmlPanel": true,
-		"scopeDataCheck": false,
-		"uglifyFileName": true,
-		"checkInvalidKey": true,
-		"checkSiteMap": true,
-		"uploadWithSourceMap": true,
-		"compileHotReLoad": false,
-		"babelSetting": {
-			"ignore": [],
-			"disablePlugins": [],
-			"outputPath": ""
-		},
-		"bundle": true,
-		"useIsolateContext": true,
-		"useCompilerModule": true,
-		"userConfirmedUseCompilerModuleSwitch": true,
-		"packNpmManually": false,
-		"packNpmRelationList": []
-	},
-	"compileType": "miniprogram",
-	"libVersion": "2.7.7",
-	"appid": "wx997164f2857c1a1d",
-	"projectname": "Mina_B",
-	"debugOptions": {
-		"hidedInDevtools": []
-	},
-	"isGameTourist": false,
-	"simulatorType": "wechat",
-	"simulatorPluginLibVersion": {},
-	"condition": {
-		"search": {
-			"current": -1,
-			"list": []
-		},
-		"conversation": {
-			"current": -1,
-			"list": []
-		},
-		"plugin": {
-			"current": -1,
-			"list": []
-		},
-		"game": {
-			"currentL": -1,
-			"list": []
-		},
-		"gamePlugin": {
-			"current": -1,
-			"list": []
-		},
-		"miniprogram": {
-			"current": -1,
-			"list": [
-				{
-					"id": 0,
-					"name": "登录/注册",
-					"pathName": "pages/login/login",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": 1,
-					"name": "pages/success/success",
-					"pathName": "pages/success/success",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": 2,
-					"name": "需求详情",
-					"pathName": "pages/detail/detail",
-					"query": "id=113&status=1",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "个人中心",
-					"pathName": "pages/person/person",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "基本信息",
-					"pathName": "pages/userinfo/userinfo",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "我的报名",
-					"pathName": "pages/my-apply/my-apply",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": 6,
-					"name": "我的订单",
-					"pathName": "pages/my-order/my-order",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "收款记录",
-					"pathName": "pages/payment-records/payment-records",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "收款详情",
-					"pathName": "pages/payment-records-detail/payment-records-detail",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "完税证明",
-					"pathName": "pages/tax-certificate/tax-certificate",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": 10,
-					"name": "pages/index/index",
-					"pathName": "pages/index/index",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "登陆",
-					"pathName": "pages/login/login",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "注册协议",
-					"pathName": "pages/service_agreement/service_agreement",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": 13,
-					"name": "pages/web-view/web-view",
-					"pathName": "pages/web-view/web-view",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": 14,
-					"name": "更多",
-					"pathName": "pages/common-setting/common-setting",
-					"query": "",
-					"scene": null
-				}
-			]
-		}
-	}
+  "description": "项目配置文件",
+  "packOptions": {
+    "ignore": []
+  },
+  "setting": {
+    "urlCheck": true,
+    "es6": true,
+    "enhance": true,
+    "postcss": true,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "newFeature": true,
+    "coverView": true,
+    "autoAudits": true,
+    "showShadowRootInWxmlPanel": true,
+    "scopeDataCheck": false,
+    "uglifyFileName": true,
+    "checkInvalidKey": true,
+    "checkSiteMap": true,
+    "uploadWithSourceMap": true,
+    "compileHotReLoad": false,
+    "useMultiFrameRuntime": false,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "bundle": true,
+    "useIsolateContext": true,
+    "useCompilerModule": true,
+    "userConfirmedUseCompilerModuleSwitch": true,
+    "packNpmManually": false,
+    "packNpmRelationList": []
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.7.7",
+  "appid": "wx997164f2857c1a1d",
+  "projectname": "Mina_B",
+  "debugOptions": {
+    "hidedInDevtools": []
+  },
+  "isGameTourist": false,
+  "simulatorType": "wechat",
+  "simulatorPluginLibVersion": {},
+  "condition": {
+    "search": {
+      "current": -1,
+      "list": []
+    },
+    "conversation": {
+      "current": -1,
+      "list": []
+    },
+    "plugin": {
+      "current": -1,
+      "list": []
+    },
+    "game": {
+      "currentL": -1,
+      "list": []
+    },
+    "gamePlugin": {
+      "current": -1,
+      "list": []
+    },
+    "miniprogram": {
+      "current": -1,
+      "list": [
+        {
+          "id": 0,
+          "name": "登录/注册",
+          "pathName": "pages/login/login",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": 1,
+          "name": "pages/success/success",
+          "pathName": "pages/success/success",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": 2,
+          "name": "需求详情",
+          "pathName": "pages/detail/detail",
+          "query": "id=113&status=1",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "个人中心",
+          "pathName": "pages/person/person",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "基本信息",
+          "pathName": "pages/userinfo/userinfo",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我的报名",
+          "pathName": "pages/my-apply/my-apply",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": 6,
+          "name": "我的订单",
+          "pathName": "pages/my-order/my-order",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "收款记录",
+          "pathName": "pages/payment-records/payment-records",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "收款详情",
+          "pathName": "pages/payment-records-detail/payment-records-detail",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "完税证明",
+          "pathName": "pages/tax-certificate/tax-certificate",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": 10,
+          "name": "pages/index/index",
+          "pathName": "pages/index/index",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "登陆",
+          "pathName": "pages/login/login",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "注册协议",
+          "pathName": "pages/service_agreement/service_agreement",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": 13,
+          "name": "pages/web-view/web-view",
+          "pathName": "pages/web-view/web-view",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": 14,
+          "name": "更多",
+          "pathName": "pages/common-setting/common-setting",
+          "query": "",
+          "scene": null
+        }
+      ]
+    }
+  }
 }

+ 1 - 1
utils/watch.js

@@ -17,7 +17,7 @@ class Watch {
     //  watch函数回调集合
     that.$_watchCallBack = {}
     // 绑定到指定对象
-    that.$watch = this.$watch;
+    that.$on = this.$watch;
     that.$emit = this.$emit;
     that.$get = this.$get;
     that.$behavior = this.$behavior();