| 
					
				 | 
			
			
				@@ -25,6 +25,8 @@ Page({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         domain: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         uploadURL: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         saveimage:false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        checked:false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        address:'', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -164,6 +166,9 @@ Page({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Comment.set('images', this.data.fileLists); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Comment.set('content', this.data.inputValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(this.data.checked){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Comment.set('location', this.data.address); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if(this.data.fileList.length==0&& !this.data.inputValue){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 console.log('新数据保存失败'); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -190,11 +195,68 @@ Page({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     async goback(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(!this.data.saveimage){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let pages = getCurrentPages(); //页面对象 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            console.log(pages); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let prevpage = pages[pages.length - 2]; //上一个页面对象 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            console.log(prevpage); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             await prevpage.updateCom() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         wx.navigateBack({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             delta: 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //选择展示当前位置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    onChange(event) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.setData({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          checked: event.detail, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        console.log(this.data.checked); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.Getlocation() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      //获取当前位置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      Getlocation() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 获取当前位置信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        wx.getLocation({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            type: 'wgs84', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            success: (res) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                const { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    latitude, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    longitude 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } = res; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //调用api解析地址 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wx.request({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    url: 'https://api.map.baidu.com/reverse_geocoding/v3/?ak=sHZTomd7grslfP7sPKB8tRgT49FK9TEu&output=json&coordtype=gcj02&location=' + latitude + ',' + longitude, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    data: {}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    header: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        'Content-Type': 'application/json' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    success: (ops) => { // 使用箭头函数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        console.log(ops); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // const address = ops.data.result.formatted_address;//详细地址 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        const address = ops.data.result.formatted_address; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        this.setData({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            address: address, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        console.log(this.data.address); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    fail: function (resq) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        wx.showModal({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            title: '信息提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            content: '请求失败', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            showCancel: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            confirmColor: '#f37938' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    complete: function () {} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            fail: (err) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                console.error(err); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wx.showToast({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    title: '获取位置失败', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    icon: 'none' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }) 
			 |