Browse Source

Signed-off-by: zhaobao <528046418@qq.com>

zhaobao 1 year ago
parent
commit
cdd4583967
5 changed files with 27 additions and 15 deletions
  1. 4 2
      config/index.js
  2. 1 1
      manifest.json
  3. 5 0
      pages.json
  4. 13 1
      pages/app_views/checkList/form/form.vue
  5. 4 11
      pages/app_views/clockIn/index.vue

+ 4 - 2
config/index.js

@@ -2,8 +2,10 @@ export default {
     base: {
       // dev: 'https://api.xazhyc.com',
 	  // dev: 'http://1.15.92.205:6001',
-	  dev: 'http://192.168.3.253:7001',
-      pro: 'https://api.xazhyc.com'
+	  // dev: 'http://192.168.3.253:7001',
+	  dev:"http://36.137.171.123:7001",
+      // pro: 'https://api.xazhyc.com',
+	   pro: 'http://36.137.171.123:7001'
     },
 	appID: '10007',
 	appKey: '82a8bf439373e311',

+ 1 - 1
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "scanApp",
+    "name" : "扫码处理业务",
     "appid" : "__UNI__5A8FAA2",
     "description" : "扫码",
     "versionName" : "1.0.0",

+ 5 - 0
pages.json

@@ -248,5 +248,10 @@
 		"navigationBarBackgroundColor": "#F8F8F8",
 		"backgroundColor": "#F8F8F8"
 	},
+	"permission": {
+			"scope.userLocation": {
+			  "desc": "你的位置信息将用于打卡签到定位" // 打卡签到定位
+			}
+	},
 	"uniIdRouter": {}
 }

+ 13 - 1
pages/app_views/checkList/form/form.vue

@@ -52,12 +52,24 @@
 				let point=uni.getStorageSync('point');
 				this.point=point;
 			},
+			getLocation(){
+				const self=this;
+				uni.getLocation({
+					type: 'wgs84',
+					success: function (res) {
+						self.formData.dutyLongitude=res.longitude
+						self.formData.dutyLatitude=res.latitude
+					}
+				});		
+			},
 			async onSubmit() {
 				let point=uni.getStorageSync('point')
 				let attachList=[]
 				for(let i=0;i<this.formData.attachList.length;i++){
 					let filePath=this.formData.attachList[i].url
-					let fileresq=await upload({filePath})
+					fileresq=await upload({filePath,formData:{
+						additions: `经度:${this.formData.dutyLongitude};纬度:${this.formData.dutyLatitude}`
+					}})
 					fileresq=JSON.parse(fileresq)
 					attachList.push(fileresq.data)
 				}

+ 4 - 11
pages/app_views/clockIn/index.vue

@@ -105,19 +105,13 @@
 					success: function (res) {
 						self.formData.dutyLongitude=res.longitude
 						self.formData.dutyLatitude=res.latitude
-					},
-					fail(res) {
-						// console.log(res)
-						// uni.showToast({
-						// 	icon:"none",
-						// 	title:"获取位置失败"
-						// })
 					}
 				});		
 			},			
 			creatDuty(){	
 				const self=this;
 				uni.chooseImage({
+					sourceType: ['camera'],
 					success(res) {
 						self.onsubmit(res)
 					},
@@ -128,13 +122,12 @@
 						})
 					}
 				})
-				// let filePath=e.tempFiles[0].url
-				// let fileresq=await upload({filePath})
-
 			},
 			async onsubmit(res){
 				let filePath=res.tempFiles[0].path
-				let fileResq=await upload({filePath})
+				let fileResq=await upload({filePath,formData:{
+					additions: `经度:${this.formData.dutyLongitude};纬度:${this.formData.dutyLatitude}`
+				}})
 				let file=JSON.parse(fileResq).data
 				creatDuty({
 					dutyLocation:this.formData.dutyLocation,