Browse Source

修改扫码出入库确认不准问题

caojunjie 4 năm trước cách đây
mục cha
commit
ea739cc996

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
     "name" : "耀灵掌上通",
     "appid" : "__UNI__0C3473D",
     "description" : "测试",
-    "versionName" : "0.0.5",
+    "versionName" : "0.0.6",
     "versionCode" : "100",
     "transformPx" : false,
     "app-plus" : {

+ 12 - 36
pages/home/Scan-code-in/index.vue

@@ -60,7 +60,7 @@
 				</view>
 			</view>
 			<view class="content-four">
-				注:请完善请完善请完善请完善请完善请完善请完善
+				注:所有的奖励均在达到签约任务后给予兑现。
 			</view>
 		</view>
 		<u-toast ref="repeat" position="bottom" />
@@ -97,7 +97,7 @@
 				rewardIntegral: '', //奖励积分
 				longitude: '', //经度
 				latitude: '', //纬度
-				address: '' //中文地址
+				whole:''
 			}
 		},
 		created() {
@@ -122,7 +122,8 @@
 					url: 'pages/home/scancode/index'
 				})
 				uni.$emit('data', {
-					lisi: this.datalist
+					lisi: this.datalist,
+					
 				})
 				
 				
@@ -146,6 +147,7 @@
 				}, 1000);
 				uni.$on('update', data => {
 					this.datalist = data.materialList
+					this.whole = data
 					request({
 						url: '/storeScan/getTyreReword',
 						method: 'Post',
@@ -155,7 +157,7 @@
 							materialList: this.datalist
 						}
 					}).then(res => {
-						
+						console.log(res)
 						if (res.data.code == 0) {
 							this.dalist = res.data.data
 							for (let i = 0; i < this.dalist.length; i++) {
@@ -182,7 +184,7 @@
 				})
 			},
 			location() {
-
+				console.log(this.whole)
 				uni.getNetworkType({
 					success: function(res) {
 						let none = res.networkType
@@ -197,33 +199,7 @@
 					}
 				});
 				let this_s = this
-				uni.getLocation({
-					type: 'wgs84', // 返回国测局坐标
-					geocode: true,
-					success: function(res) {
-						
-						this_s.longitude = res.longitude
-						this_s.latitude = res.latitude
-						this_s.address = res.address.country + res.address.province + res.address.city + res.address.district + res.address
-							.street
-						if (res.address.length == 0) {
-							uni.showToast({
-								icon: 'none',
-								title: '获取地址失败, 请检查是否开启定位权限~~',
-								position: "bottom"
-							})
-							
-							return
-						}
-						this_s.Submit()
-					},
-					fail: function(e) {
-						uni.showToast({
-							icon: 'none',
-							title: '获取地址失败, 请检查是否开启定位权限~~'
-						})
-					}
-				})
+				this_s.Submit()
 			},
 			Submit() {
 				this.show = true;
@@ -233,13 +209,13 @@
 					data: {
 						storeId: this.$store.state.storeInfo.storeId,
 						userId: this.$store.state.storeInfo.userId,
-						scanAddress: this.address, //地址
-						longitude: this.longitude, //纬度
-						latitude: this.latitude, //经度
+						scanAddress: this.whole.address, //地址
+						longitude: this.whole.degree.x,
+						latitude: this.whole.degree.y,
 						materialList: this.datalist //轮胎参数
 					}
 				}).then(res => {
-					
+					console.log(res)
 					
 					if (res.data.code == 500) {
 						this.$refs.repeat.show({

+ 12 - 32
pages/home/Scan-code-out/index.vue

@@ -71,12 +71,17 @@
 				nonRegularTyreNumbers: [], //非正规胎号
 				notScanInTyres: [], //未入库胎号
 				longitude:'',  //经度
-				latitude:''    //纬度
+				latitude:''    ,//纬度
+				degree:'',
+				address_s:'',
+				whole:''
 			}
 		},
 		created() {
 			uni.$on('update', data => {
 				this.datalist = data.materialList
+				console.log(data)
+				this.whole = data
 				return this.datalist
 			})
 		},
@@ -101,33 +106,8 @@
 			},
 			location(){
 				let this_s = this
-				uni.getLocation({
-					type: 'wgs84', // 返回国测局坐标
-					geocode: true,
-					success: function(res) {
-						
-						this_s.longitude = res.longitude
-						this_s.latitude = res.latitude
-						this_s.address = res.address.country + res.address.province + res.address.city + res.address.district + res.address.street
-						if(res.address.length == 0){
-							uni.showToast({
-								icon: 'none',
-								title: '获取地址失败, 请检查是否开启定位权限~~',
-								position: "bottom"
-							})
-							
-							return
-						}
-						this_s.Submit()
-					},
-					fail: function(e) {
-						uni.showToast({
-							icon: 'none',
-							title: '获取地址失败, 请检查是否开启定位权限~~'
-						})
-						this.location()
-					}
-				})
+				console.log(this.whole)
+				this_s.Submit()
 			},
 			Submit() {
 				this.show = true;
@@ -137,13 +117,13 @@
 					data: {
 						storeId:this.$store.state.storeInfo.storeId,
 						userId:this.$store.state.storeInfo.userId,
-						scanAddress: this.address,
-						longitude: this.longitude,
-						latitude: this.latitude,
+						scanAddress: this.whole.address, //地址
+						longitude: this.whole.degree.x,
+						latitude: this.whole.degree.y,
 						materialList: this.datalist
 					}
 				}).then(res => {
-					
+					console.log(res)
 					if (res.data.code == 500) {
 						this.$refs.repeat.show({
 							title: res.data.msg,

+ 3 - 2
pages/home/scancode/index.vue

@@ -97,7 +97,6 @@
 		onLaunch() {
 			uni.$on('update', data => {
 				this.lisi = data.lisi
-				
 			})
 		},
 		created() {
@@ -558,7 +557,9 @@
 						url: 'pages/home/Scan-code-in/index'
 					})
 					uni.$emit('update', {
-						materialList: this.lisi
+						materialList: this.lisi,
+						address: this.address,
+						degree: this.degree
 					})
 				}
 			},

+ 10 - 1
pages/home/scancode/scancodeout.vue

@@ -248,6 +248,7 @@
 									scanAddress: this.address
 								}
 							}).then(res => {
+								console.log(res)
 								if (res.data.code == 513) {
 									let name = 'regular'
 									this.tipss(res, name)
@@ -289,6 +290,12 @@
 									this.tipss(res, name)
 									return
 								}
+								if (res.data.code == 520) {
+									
+									let name = 'notallow'
+									this.tipss(res, name)
+									return
+								}
 								if (res.data.code == 500) {
 									let name = 'error'
 									this.tipss(res, name)
@@ -585,7 +592,9 @@
 						url: 'pages/home/Scan-code-out/index'
 					})
 					uni.$emit('update', {
-						materialList: this.lisi
+						materialList: this.lisi,
+						address: this.address,
+						degree: this.degree
 					})
 				}
 			},