Browse Source

1.登录
2.处理undefined和null转为空白字符串

guo 3 years ago
parent
commit
66b9014b8c
18 changed files with 96 additions and 26 deletions
  1. 9 1
      operatingCompany/main.js
  2. 0 1
      operatingCompany/pages/logIn/logIn.vue
  3. 15 7
      operatingCompany/pages/teamStore/teamStore.vue
  4. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map
  5. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map
  6. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/accountSet/accountSet.js.map
  7. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/changePassWord/changePassWord.js.map
  8. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map
  9. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/logIn/logIn.js.map
  10. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/team/manageStore.js.map
  11. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/team/myTeam.js.map
  12. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/teamStore/teamStore.js.map
  13. 1 1
      operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/upcoming/upcoming.js.map
  14. 2 1
      operatingCompany/unpackage/dist/dev/mp-weixin/app.json
  15. 19 0
      operatingCompany/unpackage/dist/dev/mp-weixin/common/main.js
  16. 0 1
      operatingCompany/unpackage/dist/dev/mp-weixin/pages/logIn/logIn.js
  17. 8 0
      operatingCompany/unpackage/dist/dev/mp-weixin/pages/teamStore/teamStore.js
  18. 33 5
      operatingCompany/unpackage/dist/dev/mp-weixin/project.config.json

+ 9 - 1
operatingCompany/main.js

@@ -25,4 +25,12 @@ export function createApp() {
     app
   }
 }
-// #endif
+// #endif
+
+// Vue全局处理undefined和null转为空白字符串
+Vue.prototype.$praseStrEmpty = function(str) {
+    if (typeof str === 'undefined' || str === null) {
+        return "";
+    }
+    return str;
+}

+ 0 - 1
operatingCompany/pages/logIn/logIn.vue

@@ -84,7 +84,6 @@
 					code: this.codeValue,
 					type: this.roleType,
 				}, 'POST').then(res => {
-					console.log(res)
 
 					uni.setStorage({
 						key: 'logInData',

+ 15 - 7
operatingCompany/pages/teamStore/teamStore.vue

@@ -132,13 +132,13 @@
 				this.data.province = e.detail.value[0]
 				this.data.city = e.detail.value[1]
 				this.data.area = e.detail.value[2]
-				this.data.address = this.data.province + this.data.city + this.data.area
+				this.data.address = this.data.province + this.data.city + this.data.area
 				this.page = 1
 				this.getShopData()
 			},
 			bindPickerChange3(e) {
 				this.thirdIndex = e.target.value
-				this.managerId = this.thirdArr[this.thirdIndex].ID
+				this.managerId = this.thirdArr[this.thirdIndex].ID
 				this.page = 1
 				this.getShopData()
 			},
@@ -146,10 +146,10 @@
 				console.log('地图导航');
 			},
 			call(e) {
-				if(e.length != 0) {
-					uni.makePhoneCall({
-						phoneNumber:e
-					})
+				if (e.length != 0) {
+					uni.makePhoneCall({
+						phoneNumber: e
+					})
 				}
 			},
 			history() {
@@ -185,7 +185,15 @@
 						lat: this.lat,
 					}
 				this.$http(url, params, 'GET').then(res => {
-					var list = res.data
+					var list = res.data
+					// 处理 undefined和null转为空白字符串
+					list.forEach((item, index) => {
+						for (const key in item) {
+							item[key] = this.$praseStrEmpty(item[key])
+						}
+					})
+
+
 					if (list.length < 10) {
 						this.noMoreShow = true
 					}

File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/accountSet/accountSet.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/changePassWord/changePassWord.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/logIn/logIn.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/team/manageStore.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/team/myTeam.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/teamStore/teamStore.js.map


File diff suppressed because it is too large
+ 1 - 1
operatingCompany/unpackage/dist/dev/.sourcemap/mp-weixin/pages/upcoming/upcoming.js.map


+ 2 - 1
operatingCompany/unpackage/dist/dev/mp-weixin/app.json

@@ -21,5 +21,6 @@
       "desc": "获取门店地址"
     }
   },
-  "usingComponents": {}
+  "usingComponents": {},
+  "sitemapLocation": "sitemap.json"
 }

+ 19 - 0
operatingCompany/unpackage/dist/dev/mp-weixin/common/main.js

@@ -24,6 +24,25 @@ var app = new _vue.default(_objectSpread({},
 _App.default));
 
 createApp(app).$mount();
+
+
+
+
+
+
+
+
+
+
+
+
+// Vue全局处理undefined和null转为空白字符串
+_vue.default.prototype.$praseStrEmpty = function (str) {
+  if (typeof str === 'undefined' || str === null) {
+    return "";
+  }
+  return str;
+};
 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["createApp"]))
 
 /***/ }),

+ 0 - 1
operatingCompany/unpackage/dist/dev/mp-weixin/pages/logIn/logIn.js

@@ -224,7 +224,6 @@ var _default =
         code: this.codeValue,
         type: this.roleType },
       'POST').then(function (res) {
-        console.log(res);
 
         uni.setStorage({
           key: 'logInData',

+ 8 - 0
operatingCompany/unpackage/dist/dev/mp-weixin/pages/teamStore/teamStore.js

@@ -318,6 +318,14 @@ var _default =
 
       this.$http(url, params, 'GET').then(function (res) {
         var list = res.data;
+        // 处理 undefined和null转为空白字符串
+        list.forEach(function (item, index) {
+          for (var key in item) {
+            item[key] = _this2.$praseStrEmpty(item[key]);
+          }
+        });
+
+
         if (list.length < 10) {
           _this2.noMoreShow = true;
         }

+ 33 - 5
operatingCompany/unpackage/dist/dev/mp-weixin/project.config.json

@@ -4,7 +4,39 @@
     "ignore": []
   },
   "setting": {
-    "urlCheck": false
+    "urlCheck": false,
+    "es6": true,
+    "enhance": true,
+    "postcss": true,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "newFeature": false,
+    "coverView": true,
+    "nodeModules": false,
+    "autoAudits": false,
+    "showShadowRootInWxmlPanel": true,
+    "scopeDataCheck": false,
+    "uglifyFileName": false,
+    "checkInvalidKey": true,
+    "checkSiteMap": true,
+    "uploadWithSourceMap": true,
+    "compileHotReLoad": false,
+    "lazyloadPlaceholderEnable": false,
+    "useMultiFrameRuntime": true,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "enableEngineNative": false,
+    "useIsolateContext": true,
+    "userConfirmedBundleSwitch": false,
+    "packNpmManually": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true,
+    "showES6CompileOption": false
   },
   "compileType": "miniprogram",
   "libVersion": "",
@@ -12,19 +44,15 @@
   "projectname": "operatingCompany",
   "condition": {
     "search": {
-      "current": -1,
       "list": []
     },
     "conversation": {
-      "current": -1,
       "list": []
     },
     "game": {
-      "current": -1,
       "list": []
     },
     "miniprogram": {
-      "current": -1,
       "list": []
     }
   }