Browse Source

fix:bug-bug list from "excel"

yf_zhb 2 years ago
parent
commit
72580ed7e7

+ 16 - 0
.gitignore

@@ -0,0 +1,16 @@
+.DS_Store
+node_modules/
+/dist/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+
+unpackage/*

+ 2 - 1
manifest.json

@@ -29,7 +29,8 @@
             "Maps" : {},
             "VideoPlayer" : {},
             "LivePusher" : {},
-            "Geolocation" : {}
+            "Geolocation" : {},
+            "Camera" : {}
         },
         /* 应用发布信息 */
         "distribute" : {

+ 21 - 6
pages/fourBase/addbase.vue

@@ -125,8 +125,15 @@
 				uni.navigateTo({
 					url:"./index"
 				})
-				localStorage.removeItem("typeid")
-				localStorage.removeItem("location")
+				// localStorage.removeItem("typeid")
+				// localStorage.removeItem("location")
+				uni.removeStorage({
+					key:'typeid'
+				})
+				
+				uni.removeStorage({
+					key:'location'
+				})
 			},
 			binding(){
 				var str = ''
@@ -151,6 +158,7 @@
 				})
 			},
 			tijiao(){
+				console.log(this.baseinfo,'submit base four')
 				if(this.baseinfo.base_img==''){
 					uni.showToast({
 					    title: '请选择基地图片', 
@@ -188,7 +196,7 @@
 					    duration: 2000,
 						icon:"none"
 					});
-				}else if(this.baseinfo.base_id==''){
+				}else if(!this.baseobj.length && !this.base_id.length){
 					uni.showToast({
 					    title: '请绑定基地设备', 
 					    duration: 2000,
@@ -212,8 +220,15 @@
 						}
 						console.log(this.baseinfo)
 						this.addbase()
-						localStorage.removeItem("typeid")
-						localStorage.removeItem("location")
+						// localStorage.removeItem("typeid")
+						// localStorage.removeItem("location")
+						uni.removeStorage({
+							key:'typeid'
+						})
+						
+						uni.removeStorage({
+							key:'location'
+						})
 					}
 				}
 			},
@@ -285,7 +300,7 @@
 							arr.push(obj)
 						}
 					}
-					console.log(arr)
+					console.log(arr,'get storage typeid')
 					this.baseobj = arr
 			    }
 			});

+ 2 - 0
pages/fourBase/city.vue

@@ -19,6 +19,7 @@
 			getCity({
 				city
 			}){
+				console.log('get city -------------- 1211414413212')
 				//city 城市名称
 				//name 定位名称
 				if(city.city == undefined){
@@ -27,6 +28,7 @@
 					var add = city.city
 				}
 				let pages = getCurrentPages()
+				console.log(pages.length,' get city pages length')
 				let nowpage = pages[pages.length - 1]
 				let prevpage = pages[pages.length - 2]
 				prevpage.$vm.city = add

+ 16 - 5
pages/fourBase/index.vue

@@ -85,6 +85,7 @@
 					url: '/api/api_gateway?method=base.bases.base_list',
 					data: this.data
 				})
+				console.log(res,'get four base')
 				this.baselist = this.baselist.concat(res.data)
 				if(this.baselist.length==0){
 					this.base_none = true
@@ -99,6 +100,8 @@
 					console.log(arr)
 					this.baselist[i].num = arr.length
 				}
+				
+				console.log(this.baselist,'------------------------- base list')
 			},
 			async delbase() { //基地列表
 				const res = await this.$myRequest({
@@ -114,6 +117,9 @@
 						duration: 2000,
 						icon:"none"
 					});
+					
+					this.baselist = []
+					this.data.page = 1
 					this.getFourbase()
 				}
 			},
@@ -166,9 +172,9 @@
 						success: (res) => {
 							if (res.confirm) {
 								this.delbase()
-								this.baselist = []
-								this.data.page = 1
-								this.getFourbase()
+								// this.baselist = []
+								// this.data.page = 1
+								// this.getFourbase()
 							} else if (res.cancel) {
 								console.log('用户点击取消');
 							}
@@ -196,8 +202,9 @@
 			}
 		},
 		onLoad() {
+			console.warn('onload  four base')
 			// this.getFourbase()
-			this.getFourbase()
+			
 			uni.getStorage({
 				key:"jurisdiction",
 				success:(res)=>{
@@ -219,11 +226,15 @@
 			})
 		},
 		onReachBottom() { //滑动到底部加载
+			console.log('on each bottom 2')
 			this.data.page++
 			this.getFourbase()
 		},
 		onShow() {
-			
+			console.warn('onshow  four base')
+			this.data.page = 1
+			this.baselist = []
+			this.getFourbase()
 			this.$forceUpdate()
 		},
 		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替

+ 24 - 8
pages/fourBase/modification.vue

@@ -133,8 +133,16 @@
 				uni.navigateTo({
 					url: "./index"
 				})
-				localStorage.removeItem("typeid")
-				localStorage.removeItem("location")
+				// localStorage.removeItem("typeid")
+				// localStorage.removeItem("location")
+				
+				uni.removeStorage({
+					key:'typeid'
+				})
+				
+				uni.removeStorage({
+					key:'location'
+				})
 			},
 			binding() {
 				uni.navigateTo({
@@ -194,7 +202,7 @@
 						duration: 2000,
 						icon: "none"
 					});
-				} else if (this.baseinfo.base_id == '') {
+				} else if (!this.baseobj.length && !this.base_id.length) {
 					uni.showToast({
 						title: '请绑定基地设备',
 						duration: 2000,
@@ -217,8 +225,15 @@
 						}
 						console.log(this.baseinfo)
 						this.addbase()
-						localStorage.removeItem("typeid")
-						localStorage.removeItem("location")
+						// localStorage.removeItem("typeid")
+						// localStorage.removeItem("location")
+						uni.removeStorage({
+							key:'typeid'
+						})
+						
+						uni.removeStorage({
+							key:'location'
+						})
 					}
 				}
 			},
@@ -254,7 +269,7 @@
 			}
 		},
 		onLoad(option) {
-			console.log(JSON.parse(option.id))
+			console.log(JSON.parse(option.id),'on load ')
 			this.baseinfo = JSON.parse(option.id)
 			this.baseinfo.base_id = JSON.parse(option.id).id
 			this.baseinfo.ret = "modify"
@@ -263,10 +278,11 @@
 			this.ybase()
 		},
 		onShow() {
+			console.warn('on show modification -------------')
 			uni.getStorage({
 				key: "location",
 				success: (res) => {
-					console.log(res.data)
+					console.log(res.data,'get storage location')
 					this.selectaddress(res.data[1], res.data[0])
 					this.baseinfo.lat = res.data[1]
 					this.baseinfo.lng = res.data[0]
@@ -276,7 +292,7 @@
 				key: 'typeid',
 				success: (res) => {
 					this.baseobjtf = false
-					console.log(JSON.parse(res.data))
+					console.log(JSON.parse(res.data),'get storage type id')
 					var arr = []
 					for (var key in JSON.parse(res.data)) {
 						console.log(key)

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/app-plus/__uniappopenlocation.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/app-plus/__uniapppicker.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/app-plus/__uniappscan.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/app-plus/app-config-service.js


File diff suppressed because it is too large
+ 19699 - 19388
unpackage/dist/dev/app-plus/app-service.js


File diff suppressed because it is too large
+ 21002 - 19471
unpackage/dist/dev/app-plus/app-view.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/app-plus/manifest.json


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/app-plus/view.css


File diff suppressed because it is too large
+ 3 - 3
unpackage/dist/dev/app-plus/view.umd.min.js


+ 3 - 2
util/api.js

@@ -2,9 +2,10 @@
 // let BASE_URL = 'http://192.168.1.112:8002'
 export const myRequest = (options) => {
 	let BASE_URL = uni.getStorageSync('http')
+	console.log(BASE_URL,'my request',process.env.NODE_ENV)
 	if (BASE_URL == '') {
-		BASE_URL = 'http://8.136.98.49:8002'//线上
-		// BASE_URL = 'http://114.115.147.140:8002'//线下
+		// BASE_URL = 'http://8.136.98.49:8002'//线上
+		BASE_URL = process.env.NODE_ENV === 'development' ? "http://114.115.147.140:8002" : "http://8.136.98.49:8002"
 		// BASE_URL = 'http://192.168.1.77:8002'
 	}
 	// BASE_URL = 'http://192.168.1.52:8003'