浏览代码

修改扫码不提示

caojunjie 4 年之前
父节点
当前提交
97b7e41b4e

+ 0 - 7
pages.json

@@ -221,13 +221,6 @@
 			},
 			//查询结果
 			{
-				"path": "scancodequery/scan",
-				"style": {
-					"navigationBarTitleText": "胎号查询"
-				}
-			},
-			//查询结果
-			{
 				"path": "scancodequery/result",
 				"style": {
 					"navigationBarTitleText": "查询结果"

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

@@ -64,7 +64,7 @@
 			</view>
 		</view>
 		<u-toast ref="repeat" position="bottom" />
-		<view class="tail" @click="Submit">
+		<view class="tail" @click="location">
 			扫码确认
 		</view>
 	</view>
@@ -90,7 +90,6 @@
 				longitude:'',  //经度
 				latitude:'',   //纬度
 				address: ''	   //中文地址
-				
 			}
 		},
 		created() {
@@ -102,7 +101,6 @@
 					type:'redirectTo',
 					url: 'pages/me/Warehousing-details/index'
 				})
-
 			},
 			getDatalist() {
 				uni.$on('update', data => {
@@ -117,7 +115,6 @@
 						}
 					}).then(res => {
 						this.dalist = res.data.data
-
 						for (let i = 0; i < this.dalist.length; i++) {
 							this.total += parseInt(this.dalist[i].rewardMoney)
 						}
@@ -130,15 +127,17 @@
 					})
 				})
 			},
-			Submit() {
+			location(){
+				let this_s = this
 				uni.getLocation({
 					type: 'wgs84', // 返回国测局坐标
 					geocode: true,
 					success: function(res) {
 						console.log(res);
-						this.longitude = res.longitude
-						this.latitude = res.latitude
-						this.address = res.address.country + res.address.province + res.address.city + res.address.district + res.address.street
+						this_s.longitude = res.longitude
+						this_s.latitude = res.latitude
+						this_s.address = res.address.city + res.address.district + res.address.poiName
+						this_s.Submit()
 					},
 					fail: function(e) {
 						uni.showToast({
@@ -147,6 +146,8 @@
 						})
 					}
 				})
+			},
+			Submit() {
 				this.show = true;
 				request({
 					url: '/storeScan/storeScanTyres',
@@ -154,12 +155,16 @@
 					data: {
 						storeId:this.$store.state.storeInfo.storeId,
 						userId:this.$store.state.storeInfo.userId,
-						scanAddress: this.address,
-						longitude: this.longitude,
-						latitude: this.latitude,
-						materialList: this.datalist
+						// scanAddress: '青岛市市北区橡胶谷-B栋',		//地址
+						// longitude: 120.3898355082192,		//纬度
+						// latitude: 36.14788760436011,		//经度
+						scanAddress: this.address,		//地址
+						longitude: this.longitude,		//纬度
+						latitude: this.latitude,		//经度
+						materialList: this.datalist		//轮胎参数
 					}
 				}).then(res => {
+					console.log(res)
 					console.log(res.data.msg)
 					if (res.data.code == 500) {
 						this.$refs.repeat.show({
@@ -180,6 +185,7 @@
 				}).finally(() => {
 					// Loading.close()
 				})
+				
 			}
 		},
 	}

+ 9 - 5
pages/home/Scan-code-out/index.vue

@@ -49,7 +49,7 @@
 			</view>
 		</view>
 		<u-toast ref="repeat" position="bottom" />
-		<view class="tail" @click="Submit">
+		<view class="tail" @click="location">
 			扫码确认
 		</view>
 	</view>
@@ -88,15 +88,17 @@
 				})
 
 			},
-			Submit() {
+			location(){
+				let this_s = this
 				uni.getLocation({
 					type: 'wgs84', // 返回国测局坐标
 					geocode: true,
 					success: function(res) {
 						console.log(res);
-						this.longitude = res.longitude
-						this.latitude = res.latitude
-						this.address = res.address.country + res.address.province + res.address.city + res.address.district + res.address.street
+						this_s.longitude = res.longitude
+						this_s.latitude = res.latitude
+						this_s.address = res.address.city + res.address.district + res.address.poiName
+						this_s.Submit()
 					},
 					fail: function(e) {
 						uni.showToast({
@@ -105,6 +107,8 @@
 						})
 					}
 				})
+			},
+			Submit() {
 				this.show = true;
 				request({
 					url: '/storeScan/storeScanOutTyres',

+ 3 - 4
pages/me/index.vue

@@ -279,10 +279,9 @@
 				})
 			},
 			inresult() {
-				this.$u.toast('轮号查询暂不开放');
-				// this.$u.route({
-				// 	url: 'pages/me/scancodequery/scan',
-				// })
+				this.$u.route({
+					url: 'pages/me/scancodequery/result',
+				})
 			},
 			inorder() {
 				this.$u.toast('门店订单暂不开放');

+ 20 - 0
pages/me/scancodequery/result.vue

@@ -28,6 +28,26 @@
 </template>
 
 <script>
+	export default {
+		data() {
+			return {
+				
+			};
+		},
+		created() {
+			this.add()
+		},
+		methods: {
+			add(){
+				uni.scanCode({
+				    success: function (res) {
+				        console.log('条码类型:' + res.scanType);
+				        console.log('条码内容:' + res.result);
+				    }
+				})
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>

+ 0 - 30
pages/me/scancodequery/scan.vue

@@ -1,30 +0,0 @@
-<template>
-	<view class="">
-		<view class="" @click="inResult">
-			扫码
-		</view>
-
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-			}
-		},
-		onLoad() {
-
-		},
-		methods: {
-			inResult(){
-				this.$u.route({
-					url: 'pages/me/scancodequery/result',
-				})
-			}
-		},
-	}
-</script>
-
-<style>
-</style>