Browse Source

Merge branch 'test' of http://git.echepei.com/sailun/sailun-tbr-web into test

tong 4 years ago
parent
commit
a760375d6d

+ 1 - 7
common/p-scan/scan.vue

@@ -17,7 +17,6 @@
 			};
 		},
 		created() {
-			
 			var statusBarHeight = uni.getSystemInfoSync().statusBarHeight; //状态栏
 			var height = statusBarHeight + 44 + 144 + 'px';
 			var pages = getCurrentPages();
@@ -34,6 +33,7 @@
 				frameColor: '#00A0EA',
 				scanbarColor: '#00A0EA'
 			});
+			
 			this.barcode.onmarked = this.onmarked;
 			
 			// this.barcode.start({vibrate: false}); //振动
@@ -44,7 +44,6 @@
 			if (res.platform == 'android') { //安卓机
 				this.barcode.start();
 			}
-
 			this.barcode.setStyle({
 				background: '#ffffff',
 				frameColor: '#00A0EA',
@@ -52,17 +51,12 @@
 			});
 			// #endif
 		},
-		onUnload() {
-			clearTimeout(this.t);
-		},
 		methods: {
 			onmarked(type, result) {
-				// console.log(type +':'+ result);
 				this.$emit('getCode', result);
 				this.t = setTimeout(() => {
 					this.barcode.start();
 				}, 2000)
-				
 			}
 		}
 	}

+ 2 - 2
components/mi-map/mi-map.vue

@@ -89,7 +89,7 @@
 			getLocation() {
 				let this_ = this
 				uni.getLocation({
-					// type: 'gcj02', // 返回国测局坐标
+					type: 'gcj02', // 返回国测局坐标
 					geocode: true,
 					success: function(res) {
 						this_.initMap(res)
@@ -98,7 +98,7 @@
 					fail: function(e) {
 						uni.showToast({
 							icon: 'none',
-							title: '获取地址失败, 请检查是否开启定位权限~~'
+							title: '获取地址失败, 请检查是否开启定位权限'
 						})
 					}
 				})

+ 10 - 2
manifest.json

@@ -2,7 +2,7 @@
     "name" : "耀灵全钢店管家",
     "appid" : "__UNI__0C3473D",
     "description" : "测试",
-    "versionName" : "0.0.0.0.0.4",
+    "versionName" : "0.0.0.0.0.5",
     "versionCode" : "100",
     "transformPx" : false,
     "app-plus" : {
@@ -55,7 +55,15 @@
                 ],
                 "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
             },
-            "ios" : {},
+            "ios" : {
+                "privacyDescription" : {
+                    "NSPhotoLibraryUsageDescription" : "注册时从相册中选择图片作为执照或者门头照",
+                    "NSPhotoLibraryAddUsageDescription" : "注册时从相册中选择图片作为执照或者门头照",
+                    "NSCameraUsageDescription" : "扫码出入库需要启动摄像头扫描二维码",
+                    "NSLocationWhenInUseUsageDescription" : "注册时需要地区定位,扫码是需要开启电子围栏",
+                    "NSLocationAlwaysAndWhenInUseUsageDescription" : "注册时需要地区定位,扫码是需要开启电子围栏"
+                }
+            },
             "sdkConfigs" : {
                 "ad" : {},
                 "maps" : {

+ 52 - 29
pages/home/Scan-code-in/index.vue

@@ -80,7 +80,9 @@
 		request
 	} from '../../../common/request/request'
 	require("promise.prototype.finally").shim()
-	import {mapMutations} from 'vuex'
+	import {
+		mapMutations
+	} from 'vuex'
 	export default {
 		data() {
 			return {
@@ -92,57 +94,76 @@
 				nonRegularTyreNumbers: [], //非正规胎号
 				alreadyExistsTyreNumbers: [], //库存中已存在轮胎号
 				rewardMoney: '', //奖励金额
-				rewardIntegral: '' ,//奖励积分
-				longitude:'',  //经度
-				latitude:'',   //纬度
-				address: ''	   //中文地址
+				rewardIntegral: '', //奖励积分
+				longitude: '', //经度
+				latitude: '', //纬度
+				address: '' //中文地址
 			}
 		},
 		created() {
 			uni.getNetworkType({
-			    success: function (res) {
+				success: function(res) {
 					let none = res.networkType
-			        console.log(res.networkType);
-					if(none == 'none'){
+					console.log(res.networkType);
+					if (none == 'none') {
 						uni.showToast({
 							icon: 'none',
 							title: '无网络,请连接网络后再试~',
 							position: "bottom"
 						})
 					}
-			    }
+				}
 			});
 			this.getDatalist()
 		},
+		onBackPress(options) {
+			if (options.from == 'backbutton') {
+				this.$u.route({
+					url: 'pages/home/scancode/index'
+				})
+				uni.$emit('data', {
+					lisi: this.datalist
+				})
+				console.log(this.datalist)
+				console.log("到此一游")
+			}
+			return true;
+		},
 		methods: {
 			...mapMutations(["inStore"]),
 			confirm() {
 				this.$u.route({
-					type:'redirectTo',
+					type: 'redirectTo',
 					url: 'pages/me/Warehousing-details/index'
 				})
 			},
 			getDatalist() {
+				uni.showLoading({
+					title: '加载中...'
+				});
+				setTimeout(function() {
+					uni.hideLoading();
+				}, 1000);
 				uni.$on('update', data => {
 					this.datalist = data.materialList
 					request({
 						url: '/storeScan/getTyreReword',
 						method: 'Post',
 						data: {
-							storeId:this.$store.state.storeInfo.storeId,
-							userId:this.$store.state.storeInfo.userId,
+							storeId: this.$store.state.storeInfo.storeId,
+							userId: this.$store.state.storeInfo.userId,
 							materialList: this.datalist
 						}
 					}).then(res => {
 						console.log(res.data.code)
-						if(res.data.code == 0){
+						if (res.data.code == 0) {
 							this.dalist = res.data.data
 							for (let i = 0; i < this.dalist.length; i++) {
 								this.total += parseInt(this.dalist[i].rewardMoney)
 							}
 							this.inStore()
 							return this.total
-						}else{
+						} else {
 							uni.showToast({
 								icon: 'none',
 								title: '出错啦~'
@@ -160,20 +181,20 @@
 					})
 				})
 			},
-			location(){
-				
+			location() {
+
 				uni.getNetworkType({
-				    success: function (res) {
+					success: function(res) {
 						let none = res.networkType
-				        console.log(res.networkType);
-						if(none == 'none'){
+						console.log(res.networkType);
+						if (none == 'none') {
 							uni.showToast({
 								icon: 'none',
 								title: '无网络,请连接网络后再试~',
 								position: "bottom"
 							})
 						}
-				    }
+					}
 				});
 				let this_s = this
 				uni.getLocation({
@@ -183,8 +204,9 @@
 						console.log(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){
+						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: '获取地址失败, 请检查是否开启定位权限~~',
@@ -209,12 +231,12 @@
 					url: '/storeScan/storeScanTyres',
 					method: 'Post',
 					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		//轮胎参数
+						storeId: this.$store.state.storeInfo.storeId,
+						userId: this.$store.state.storeInfo.userId,
+						scanAddress: this.address, //地址
+						longitude: this.longitude, //纬度
+						latitude: this.latitude, //经度
+						materialList: this.datalist //轮胎参数
 					}
 				}).then(res => {
 					console.log(res)
@@ -233,12 +255,13 @@
 					this.rewardMoney = res.data.data.rewardMoney //奖励金额
 					this.rewardIntegral = res.data.data.rewardIntegral //奖励积分
 					console.log(res)
+					this.datalist = ''
 				}).catch(err => {
 					console.log(err.data.msg)
 				}).finally(() => {
 					// Loading.close()
 				})
-				
+
 			}
 		},
 	}

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

@@ -80,6 +80,17 @@
 				return this.datalist
 			})
 		},
+		onBackPress(options) {
+			if (options.from == 'backbutton') {
+				this.$u.route({
+					url: 'pages/home/scancode/scancodeout'
+				})
+				uni.$emit('data', {
+					lisi: this.datalist
+				})
+			}
+			return true;
+		},
 		methods: {
 			confirm() {
 				this.$u.route({
@@ -145,6 +156,7 @@
 					this.nonRegularTyreNumbers = res.data.data.nonRegularTyreNumbers //非正规胎号
 					this.notScanInTyres = res.data.data.notScanInTyres //未入库轮胎号
 					console.log(res)
+					this.datalist = ''
 				}).catch(err => {
 					console.log(err.data.msg)
 				}).finally(() => {

+ 28 - 8
pages/home/scancode/index.vue

@@ -94,9 +94,25 @@
 				show: true,
 				show_s: false,
 				show_d: false,
-				res: ''
+				res: '',
 			}
 		},
+		onBackPress(options) {
+			console.log(options)
+			if (options.from == 'backbutton') {
+				this.$u.route({
+					type: 'switchTab',
+					url: 'pages/home/index'
+				})
+			}
+			return true;
+		},
+		onLaunch(){
+			uni.$on('update', data => {
+				this.lisi = data.lisi
+				console.log(this.lisi)
+			})
+		},
 		created() {
 			uni.getNetworkType({
 				success: function(res) {
@@ -111,6 +127,10 @@
 					}
 				}
 			});
+			uni.$on('data', res => {
+				this.lisi = res.lisi
+				console.log(res.lisi)
+			})
 			const innerAudioContext = uni.createInnerAudioContext();
 			innerAudioContext.autoplay = true;
 			innerAudioContext.src = '../../../static/mp3/startscan.mp3';
@@ -266,11 +286,11 @@
 						}
 						if (res.data.data[0].isRegular == 1) {
 							console.log(res.data.data[0].isRegular)
-							this.$refs.repeat.show({
-								title: '轮胎非正规',
-								type: 'default',
-								position: 'bottom'
-							})
+							// this.$refs.repeat.show({
+							// 	title: '轮胎非正规',
+							// 	type: 'default',
+							// 	position: 'bottom'
+							// })
 							this.show_d = true
 							return
 						}
@@ -304,7 +324,7 @@
 				this.number_s = ''
 				console.log("我成功啦")
 				console.log(this.res_s)
-				
+
 				this.lisi.push({
 					specs: this.res_s.data.data[0].specs,
 					flagRegular: this.res_s.data.data[0].isRegular,
@@ -319,6 +339,7 @@
 					plyRating: this.res_s.data.data[0].plyRating,
 					scanWay: '1'
 				})
+				console.log(this.lisi)
 				const innerAudioContext = uni.createInnerAudioContext();
 				innerAudioContext.autoplay = true;
 				innerAudioContext.src = '../../../static/mp3/scansuccess.mp3';
@@ -354,7 +375,6 @@
 					uni.$emit('update', {
 						materialList: this.lisi
 					})
-					this.lisi = []
 				}
 			},
 			repeated() {

+ 176 - 98
pages/home/scancode/scancodeout.vue

@@ -1,8 +1,8 @@
-<!-- 库扫码 -->
+<!-- 库扫码 -->
 <template>
 	<view class="content">
 		<view class="text-area">
-			<scan @getCode="getScanCode"/>
+			<scan @getCode="getScanCode" />
 		</view>
 		<view class="stripe"></view>
 		<view class="roll">
@@ -32,7 +32,7 @@
 						<u-th class="u-th">规格</u-th>
 						<u-th class="u-th" width="15%">操作</u-th>
 					</u-tr>
-					<u-tr class="u-tr" :key="index" v-for="(item, index) in lisi">
+					<u-tr class="u-tr" v-for="(item, index) in lisi" :key="index">
 						<u-td class="u-td" width="30%">{{item.tireNumber}}</u-td>
 						<u-td class="u-td">{{item.maktx}}</u-td>
 						<u-td class="u-td" width="15%"><text @click="confirm(index)" style="color: #FA3534;">删除</text></u-td>
@@ -47,6 +47,17 @@
 		<view>
 		</view>
 		<u-toast ref="repeat" position="bottom" />
+		<u-popup mode="bottom" v-model="show_s" :mask-close-able="false" :safe-area-inset-bottom="true">
+			<view class="confrim-btn">
+				<u-button @click="show_s = false;" style="float: left;border: none;" :hair-line="false" :plain="false">取消</u-button>
+				<u-button @click="container" style="float: right;border: none;" :hair-line="false" :plain="false">确定</u-button>
+			</view>
+			<view class="content_s">
+				<scroll-view scroll-y="true" style="height: 200rpx;">
+					{{regular}}
+				</scroll-view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -64,36 +75,60 @@
 				content: '请输入轮胎胎号',
 				number_s: '',
 				number_a: '',
+				regular: '轮胎非正规是否出库',
 				lisi: [],
 				background: {
 					backgroundColor: '#0094fe',
 				},
 				show: true,
+				show_s: false,
+				show_d: false,
+				res: '',
+			}
+		},
+		onBackPress(options) {
+			console.log(options)
+			if (options.from == 'backbutton') {
+				this.$u.route({
+					type: 'switchTab',
+					url: 'pages/home/index'
+				})
 			}
+			return true;
+		},
+		onLaunch(){
+			uni.$on('update', data => {
+				this.lisi = data.lisi
+				console.log(this.lisi)
+			})
 		},
 		created() {
 			uni.getNetworkType({
-			    success: function (res) {
+				success: function(res) {
 					let none = res.networkType
-			        console.log(res.networkType);
-					if(none == 'none'){
+					console.log(res.networkType);
+					if (none == 'none') {
 						uni.showToast({
 							icon: 'none',
 							title: '无网络,请连接网络后再试~',
 							position: "bottom"
 						})
 					}
-			    }
+				}
 			});
+			uni.$on('data', res => {
+				this.lisi = res.lisi
+				console.log(res.lisi)
+			})
 			const innerAudioContext = uni.createInnerAudioContext();
 			innerAudioContext.autoplay = true;
 			innerAudioContext.src = '../../../static/mp3/startscan.mp3';
 			innerAudioContext.onPlay(() => {
-			  console.log('开始播放');
+				console.log('开始播放');
 			});
 			innerAudioContext.onError((res) => {
-			  console.log(res.errMsg);
-			  console.log(res.errCode);
+				console.log(res.errMsg);
+				console.log(res.errCode);
 			});
 		},
 		methods: {
@@ -103,11 +138,22 @@
 						url: '/storeScan/storeScanGetTyre',
 						method: 'Post',
 						data: {
-							storeId:this.$store.state.storeInfo.storeId,
-							userId:this.$store.state.storeInfo.userId,
+							storeId: this.$store.state.storeInfo.storeId,
+							userId: this.$store.state.storeInfo.userId,
 							tyreNum: this.number_a
 						}
 					}).then(res => {
+						console.log(res.data.code)
+						if (res.data.code == 500) {
+							this.$refs.repeat.show({
+								title: '请扫描或输入正确的胎号',
+								type: 'default',
+								position: 'bottom'
+							})
+							return
+						}
+						this.res = res
+						console.log(res.data.data[0].isRegular)
 						for (let i = 0; i < this.lisi.length; i++) {
 							if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {
 								this.$refs.repeat.show({
@@ -118,40 +164,20 @@
 								return
 							}
 						}
-
-						this.$refs.repeat.show({
-							title: '录入成功',
-							type: 'success',
-							position: 'bottom'
-						})
-						if (res.data.code == 500){
+						if (res.data.data[0].isRegular == 1) {
+							console.log(res.data.data[0].isRegular)
 							this.$refs.repeat.show({
-								title: res.data.msg,
+								title: '轮胎非正规',
 								type: 'default',
 								position: 'bottom'
 							})
 							return
 						}
-						this.number_a = ""
-						console.log("我成功啦")
-						this.lisi.push({
-							specs: res.data.data[0].specs,
-							flagRegular: res.data.data[0].isRegular,
-							diameter: res.data.data[0].diameter,
-							maktx: res.data.data[0].maktx,
-							pattern: res.data.data[0].pattern,
-							soldToPartyKunnr: res.data.data[0].soldToPartyKunnr,
-							matnr: res.data.data[0].matnr,
-							tireNumber: res.data.data[0].tirenumber,
-							brand: res.data.data[0].brand,
-							shippedDate: res.data.data[0].shippedDate,
-							plyRating: res.data.data[0].plyRating,
-							scanWay: '0'
-						})
+						this.container()
 						console.log(this.lisi)
 					}).catch(err => {
 						this.$refs.repeat.show({
-							title: "请重新录入",
+							title: "无网络,请连接网络后再试~",
 							type: 'default',
 							position: 'bottom'
 						})
@@ -161,34 +187,61 @@
 						// Loading.close()
 					})
 			},
+			container() {
+				this.$refs.repeat.show({
+					title: '录入成功',
+					type: 'success',
+					position: 'bottom'
+				})
+				console.log(this.res.data.data[0].specs)
+				this.show_s = false
+				console.log(this.show_s)
+				this.number_a = ''
+				console.log("我成功啦.")
+				this.lisi.push({
+					specs: this.res.data.data[0].specs,
+					flagRegular: this.res.data.data[0].isRegular,
+					diameter: this.res.data.data[0].diameter,
+					maktx: this.res.data.data[0].maktx,
+					pattern: this.res.data.data[0].pattern,
+					soldToPartyKunnr: this.res.data.data[0].soldToPartyKunnr,
+					matnr: this.res.data.data[0].matnr,
+					tireNumber: this.res.data.data[0].tirenumber,
+					brand: this.res.data.data[0].brand,
+					shippedDate: this.res.data.data[0].shippedDate,
+					plyRating: this.res.data.data[0].plyRating,
+					scanWay: '0'
+				})
+				console.log(this.lisi)
+			},
 			//获取扫码控件
 			getScanCode(val) {
-				console.log(val)
-				this.number = val
-				this.number_s = val
 				uni.getNetworkType({
-				    success: function (res) {
+					success: function(res) {
 						let none = res.networkType
-				        console.log(res.networkType);
-						if(none == 'none'){
+						console.log(res.networkType);
+						if (none == 'none') {
 							uni.showToast({
 								icon: 'none',
 								title: '无网络,请连接网络后再试~',
 								position: "bottom"
 							})
 						}
-				    }
+					}
 				});
+				console.log(val)
+				this.number = val
+				this.number_s = val
 				request({
 						url: '/storeScan/storeScanGetTyre',
 						method: 'Post',
 						data: {
-							storeId:this.$store.state.storeInfo.storeId,
-							userId:this.$store.state.storeInfo.userId,
+							storeId: this.$store.state.storeInfo.storeId,
+							userId: this.$store.state.storeInfo.userId,
 							tyreNum: this.number_s
 						}
 					}).then(res => {
-						console.log(res)
+						this.res_s = res
 						this.tips = "胎号"
 						for (let i = 0; i < this.lisi.length; i++) {
 							if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {
@@ -197,22 +250,13 @@
 									type: 'default',
 									position: 'bottom'
 								})
-								const innerAudioContext = uni.createInnerAudioContext();
-								innerAudioContext.autoplay = true;
-								innerAudioContext.src = '../../../static/mp3/rescan.mp3';
-								innerAudioContext.onPlay(() => {
-								  console.log('开始播放');
-								});
-								innerAudioContext.onError((res) => {
-								  console.log(res.errMsg);
-								  console.log(res.errCode);
-								});
+								this.repeated()
 								return
 							}
 						}
-						if (res.data.code == 500){
+						if (res.data.code == 500) {
 							this.$refs.repeat.show({
-								title: res.data.msg,
+								title: '请扫描或输入正确的胎号',
 								type: 'default',
 								position: 'bottom'
 							})
@@ -220,46 +264,24 @@
 							innerAudioContext.autoplay = true;
 							innerAudioContext.src = '../../../static/mp3/scanfailed.mp3';
 							innerAudioContext.onPlay(() => {
-							  console.log('开始播放');
+								console.log('开始播放');
 							});
 							innerAudioContext.onError((res) => {
-							  console.log(res.errMsg);
-							  console.log(res.errCode);
+								console.log(res.errMsg);
+								console.log(res.errCode);
 							});
 							return
 						}
-						this.number_s = ""
-						console.log("我成功啦")
-						console.log(res)
-						this.lisi.push({
-							specs: res.data.data[0].specs,
-							flagRegular: res.data.data[0].isRegular,
-							diameter: res.data.data[0].diameter,
-							maktx: res.data.data[0].maktx,
-							pattern: res.data.data[0].pattern,
-							soldToPartyKunnr: res.data.data[0].soldToPartyKunnr,
-							matnr: res.data.data[0].matnr,
-							tireNumber: res.data.data[0].tirenumber,
-							brand: res.data.data[0].brand,
-							shippedDate: res.data.data[0].shippedDate,
-							plyRating: res.data.data[0].plyRating,
-							scanWay: '1'
-						})
-						const innerAudioContext = uni.createInnerAudioContext();
-						innerAudioContext.autoplay = true;
-						innerAudioContext.src = '../../../static/mp3/scansuccess.mp3';
-						innerAudioContext.onPlay(() => {
-						  console.log('开始播放');
-						});
-						innerAudioContext.onError((res) => {
-						  console.log(res.errMsg);
-						  console.log(res.errCode);
-						});
-						this.$refs.repeat.show({
-							title: '扫码成功',
-							type: 'success',
-							position: 'bottom'
-						})
+						if (res.data.data[0].isRegular == 1) {
+							console.log(res.data.data[0].isRegular)
+							this.$refs.repeat.show({
+								title: '轮胎非正规',
+								type: 'default',
+								position: 'bottom'
+							})
+							return
+						}
+						this.container_s()
 						console.log(this.lisi)
 					}).catch(err => {
 						if (code == 400) {
@@ -274,6 +296,7 @@
 								type: 'default',
 								position: 'bottom'
 							})
+							this.repeated()
 						}
 						console.log(err)
 					})
@@ -281,6 +304,45 @@
 						// Loading.close()
 					})
 			},
+			container_s() {
+				this.show_d = false
+				console.log(this.show_s)
+				console.log("什么????")
+				this.number_s = ''
+				console.log("我成功啦")
+				console.log(this.res_s)
+
+				this.lisi.push({
+					specs: this.res_s.data.data[0].specs,
+					flagRegular: this.res_s.data.data[0].isRegular,
+					diameter: this.res_s.data.data[0].diameter,
+					maktx: this.res_s.data.data[0].maktx,
+					pattern: this.res_s.data.data[0].pattern,
+					soldToPartyKunnr: this.res_s.data.data[0].soldToPartyKunnr,
+					matnr: this.res_s.data.data[0].matnr,
+					tireNumber: this.res_s.data.data[0].tirenumber,
+					brand: this.res_s.data.data[0].brand,
+					shippedDate: this.res_s.data.data[0].shippedDate,
+					plyRating: this.res_s.data.data[0].plyRating,
+					scanWay: '1'
+				})
+				console.log(this.lisi)
+				const innerAudioContext = uni.createInnerAudioContext();
+				innerAudioContext.autoplay = true;
+				innerAudioContext.src = '../../../static/mp3/scansuccess.mp3';
+				innerAudioContext.onPlay(() => {
+					console.log('开始播放');
+				});
+				innerAudioContext.onError((res) => {
+					console.log(res.errMsg);
+					console.log(res.errCode);
+				});
+				this.$refs.repeat.show({
+					title: '扫码成功',
+					type: 'success',
+					position: 'bottom'
+				})
+			},
 			confirm(index) {
 				console.log(index + "什么情况")
 				this.lisi.splice(index, 1)
@@ -288,20 +350,31 @@
 			scancodein() {
 				if (this.lisi == '') {
 					this.$refs.repeat.show({
-						title: '请扫码或录入后再点击',
+						title: '请扫码或录入后再点击!',
 						type: 'default',
 						position: 'bottom'
 					})
 				} else {
 					this.$u.route({
-						type:'redirectTo',
-						url: 'pages/home/Scan-code-out/index',
+						type: 'redirectTo',
+						url: 'pages/home/Scan-code-out/index'
 					})
 					uni.$emit('update', {
 						materialList: this.lisi
 					})
-					this.lisi = []
 				}
+			},
+			repeated() {
+				const innerAudioContext = uni.createInnerAudioContext();
+				innerAudioContext.autoplay = true;
+				innerAudioContext.src = '../../../static/mp3/rescan.mp3';
+				innerAudioContext.onPlay(() => {
+					console.log('开始播放');
+				});
+				innerAudioContext.onError((res) => {
+					console.log(res.errMsg);
+					console.log(res.errCode);
+				});
 			}
 		}
 	}
@@ -339,6 +412,11 @@
 		padding-top: 400px;
 	}
 
+	.content_s {
+		padding: 24rpx;
+		text-align: center;
+	}
+
 	.logo {
 		height: 200rpx;
 		width: 200rpx;

+ 52 - 24
pages/login/index.vue

@@ -46,7 +46,11 @@
 </template>
 
 <script>
-	import {mapState,mapMutations} from 'vuex'
+	import permision from "@/js_sdk/wa-permission/permission.js"
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex'
 	import {
 		request
 	} from '../../common/request/request'
@@ -59,9 +63,9 @@
 				codeText: '',
 				pact: false,
 				loading: false,
-				codeLoading:false,
-				SystemInfo:'',
-				networkType:''
+				codeLoading: false,
+				SystemInfo: '',
+				networkType: ''
 			}
 		},
 		computed: {
@@ -69,26 +73,50 @@
 		},
 		created() {
 			uni.getSystemInfo({
-			    success:(res)=>{
-					this.SystemInfo=res
-			    }
+				success: (res) => {
+					this.SystemInfo = res
+				}
 			});
 			uni.getNetworkType({
-			    success:(res)=>{
-			        this.networkType=res.networkType
-			    }
+				success: (res) => {
+					this.networkType = res.networkType
+				}
 			});
+			if(this.SystemInfo.platform=="ios"){
+				this.judgeIosPermission()
+			}else{
+				this.requestAndroidPermission()
+			}			
 		},
 		methods: {
 			...mapMutations(['login']),
-			toUser(provider){
+			judgeIosPermission() {
+				let result = permision.judgeIosPermission('location')
+				if (!result) {
+					uni.showModal({
+						title: "温馨提示",
+						content: "为了更好地服务,请开启定位权限,是否同意?",
+						cancelText: "不同意",
+						confirmText: "同意",
+						success: res => {
+							if (res.confirm) {
+								plus.runtime.openURL("app-settings://");
+							}
+						}
+					})
+				}
+			},
+			async requestAndroidPermission() {
+				let result = await permision.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION')
+			},
+			toUser(provider) {
 				this.login(provider);
-				if(this.hasLogin){
+				if (this.hasLogin) {
 					this.$u.route({
 						url: 'pages/home/index',
 						type: 'switchTab',
 					})
-				}else{
+				} else {
 					uni.navigateBack();
 				}
 			},
@@ -104,12 +132,12 @@
 							"mobileCode": this.code,
 							"password": "",
 							"phoneNumber": this.tel,
-							"osType":this.SystemInfo.platform,
-							"osVersion":this.SystemInfo.system,
-							"phoneBrand":this.SystemInfo.brand,
-							"phoneModel":this.SystemInfo.model,
-							"appVersion":"1.00",
-							"networkType":this.networkType,
+							"osType": this.SystemInfo.platform,
+							"osVersion": this.SystemInfo.system,
+							"phoneBrand": this.SystemInfo.brand,
+							"phoneModel": this.SystemInfo.model,
+							"appVersion": "1.00",
+							"networkType": this.networkType,
 						}
 					}).then(res => {
 						if (res.data.code == 0) {
@@ -118,7 +146,7 @@
 								msg: '登录成功'
 							})
 
-						}else {
+						} else {
 							this.$u.toast(res.data.msg);
 						}
 					}).catch(err => {
@@ -139,13 +167,13 @@
 			},
 			getCode() {
 				if (this.tel) {
-					this.codeLoading=true
+					this.codeLoading = true
 					request({
 						url: '/sailun/appStoreBasicInfo/sendCode',
 						method: 'post',
 						data: {
 							"phoneNumber": this.tel,
-							"opreaType":"1"
+							"opreaType": "1"
 						},
 					}).then(res => {
 						console.log(res)
@@ -162,12 +190,12 @@
 					}).catch(err => {
 						console.log(err)
 					}).finally(() => {
-						this.codeLoading=false
+						this.codeLoading = false
 					})
 				} else {
 					this.$u.toast('请输入手机号');
 				}
-			
+
 			},
 		}
 	};

+ 70 - 128
pages/login/register_2.vue

@@ -42,7 +42,7 @@
 							<u-button size="mini" type="primary" @click="getCode" shape="circle" :loading="codeLoading">{{codeText}}</u-button>
 						</view>
 					</u-form-item>
-<!-- 					<u-form-item prop="region">
+					<!-- 					<u-form-item prop="region">
 						<view style="margin-right: 10rpx;">
 							<u-icon name="map" size="36"></u-icon>
 						</view>
@@ -83,7 +83,6 @@
 </template>
 
 <script>
-	import permision from "@/js_sdk/wa-permission/permission.js"
 	import {
 		request
 	} from '../../common/request/request'
@@ -110,20 +109,20 @@
 				},
 				rules: {
 					store: [{
-						required: true,
-						message: '请输入门店名称',
-						trigger: 'blur,change'
-					},
-					{
-						// 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
-						validator: (rule, value, callback) => {
-							// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
-							return this.$u.test.chinese(value);
+							required: true,
+							message: '请输入门店名称',
+							trigger: 'blur,change'
+						},
+						{
+							pattern: /^[\u4e00-\u9fa5_a-zA-Z()()]+$/g,
+							// 正则检验前先将值转为字符串
+							transform(value) {
+								return String(value);
+							},
+							message: '门店名称必须为中文或英语',
+							// 触发器可以同时用blur和change,二者之间用英文逗号隔开
+							trigger: ['change', 'blur'],
 						},
-						message: '门店名称必须为中文',
-						// 触发器可以同时用blur和change,二者之间用英文逗号隔开
-						trigger: ['change','blur'],
-					},
 					],
 					company: [{
 						required: true,
@@ -131,55 +130,58 @@
 						trigger: 'blur,change'
 					}],
 					name: [{
-						required: true,
-						message: '请输入联系人',
-						trigger: 'blur,change'
-					},{
-						min: 2,
-						max: 10,
-						message: '姓名长度在2到10个字符',
-						trigger: ['change','blur'],
-					},
-					{
-						// 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
-						validator: (rule, value, callback) => {
-							// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
-							return this.$u.test.chinese(value);
+							required: true,
+							message: '请输入联系人',
+							trigger: 'blur,change'
+						}, {
+							min: 2,
+							max: 10,
+							message: '姓名长度在2到10个字符',
+							trigger: ['change', 'blur'],
 						},
-						message: '姓名必须为中文',
-						// 触发器可以同时用blur和change,二者之间用英文逗号隔开
-						trigger: ['change','blur'],
-					}],
+						{
+							// 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
+							validator: (rule, value, callback) => {
+								// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
+								return this.$u.test.chinese(value);
+							},
+							message: '姓名必须为中文',
+							// 触发器可以同时用blur和change,二者之间用英文逗号隔开
+							trigger: ['change', 'blur'],
+						}
+					],
 					phone: [{
-						required: true,
-						message: '请输入联系电话',
-						trigger: 'blur,change'
-					},
-					{
-						validator: (rule, value, callback) => {
-							// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
-							return this.$u.test.mobile(value);
+							required: true,
+							message: '请输入联系电话',
+							trigger: 'blur,change'
 						},
-						message: '手机号码不正确',
-						// 触发器可以同时用blur和change,二者之间用英文逗号隔开
-						trigger: ['change','blur'],
-					}],
+						{
+							validator: (rule, value, callback) => {
+								// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
+								return this.$u.test.mobile(value);
+							},
+							message: '手机号码不正确',
+							// 触发器可以同时用blur和change,二者之间用英文逗号隔开
+							trigger: ['change', 'blur'],
+						}
+					],
 					code: [{
-						required: true,
-						message: '请输入验证码',
-						trigger: 'blur,change'
-					},
-					{
-						min: 6,
-						max: 6,
-						message: '验证码为6位数',
-						trigger: 'change',
-					},
-					{
-						type: 'number',
-						message: '验证码只能为数字',
-						trigger: ['change','blur'],
-					}],
+							required: true,
+							message: '请输入验证码',
+							trigger: 'blur,change'
+						},
+						{
+							min: 6,
+							max: 6,
+							message: '验证码为6位数',
+							trigger: 'change',
+						},
+						{
+							type: 'number',
+							message: '验证码只能为数字',
+							trigger: ['change', 'blur'],
+						}
+					],
 					region: [{
 						required: true,
 						message: '请选择地区',
@@ -199,24 +201,24 @@
 		},
 		created() {
 			uni.$on('licenseData', (data) => {
-				if(data.company.words!="无"){
+				if (data.company.words != "无") {
 					this.form.store = data.company.words
 				}
 				this.form.company = data.company.words
-				if(data.person.words!="无"){
+				if (data.person.words != "无") {
 					this.form.name = data.person.words
 				}
-				
+
 			})
 			uni.$on('addressData', (data) => {
 				this.form.latitude = data.latitude
 				this.form.longitude = data.longitude
-				this.address=data.address
-				this.form.region=this.address.province+"-"+this.address.city+"-"+this.address.district
-				this.form.addressInfo =this.address.addressInfo
+				this.address = data.address
+				this.form.region = this.address.province + "-" + this.address.city + "-" + this.address.district
+				this.form.addressInfo = this.address.addressInfo
 				this.form.province = this.address.province;
-				this.form.city =this.address.city;
-				this.form.district =this.address.district;
+				this.form.city = this.address.city;
+				this.form.district = this.address.district;
 			})
 			uni.$on('dataUrl', (data) => {
 				this.dataUrl = data
@@ -239,68 +241,8 @@
 				this.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION')
 				this.modelshow = true
 			}
-		this.judgeIosPermission()
-		this.requestAndroidPermission()
 		},
 		methods: {
-			judgeIosPermission(permisionID) {
-				let result = permision.judgeIosPermission(permisionID)
-				if (!result) {
-					uni.getLocation({
-					    type: 'wgs84',
-					    success: res=>{
-					        console.log("获取到定位");
-					    },
-						fail:err=>{
-							console.log("没获取到定位")
-						}
-					});
-				} else {
-					uni.getLocation({
-					    type: 'wgs84',
-					    success: res=>{
-					        console.log("获取到定位");
-					    },
-						fail:err=>{
-							console.log("没获取到定位")
-						}
-					});
-				}
-			},
-			async requestAndroidPermission(permisionID) {
-				let result = await permision.requestAndroidPermission(permisionID)
-				if (result == 1) {
-					uni.getLocation({
-					    type: 'wgs84',
-					    success: res=>{
-					        console.log("获取到定位");
-					    },
-						fail:err=>{
-							console.log("没获取到定位")
-						}
-					});
-				} else if (result == 0) {
-					uni.getLocation({
-					    type: 'wgs84',
-					    success: res=>{
-					        console.log("获取到定位");
-					    },
-						fail:err=>{
-							console.log("没获取到定位")
-						}
-					});
-				} else {
-					uni.getLocation({
-					    type: 'wgs84',
-					    success: res=>{
-					        console.log("获取到定位");
-					    },
-						fail:err=>{
-							console.log("没获取到定位")
-						}
-					});
-				}
-			},
 			nextStep() {
 				this.$refs.uForm.validate(valid => {
 					if (valid) {

+ 98 - 47
pages/login/register_3.vue

@@ -33,10 +33,11 @@
 				<view class="content">
 					<scroll-view scroll-y="true" style="height: 300rpx;">
 						<view class="u-flex u-row-center">
-							<u-checkbox-group :wrap="true" @change="checkboxGroupChange" style="display: flex;justify-content: center">
-								<u-checkbox v-model="item.checked" v-for="(item, index) in brandList" :key="index" :name="item.brand" shape="circle">
+							
+							<u-checkbox-group :wrap="true" @change="checkboxGroupChange" style="display: flex;justify-content: left">
+								<u-checkbox v-model="item.checked" v-for="(item, index) in allbrandList" :key="index" :name="item.brandCode" shape="circle">
 									<view class="u-flex u-row-left" style="width: 150rpx;">
-										{{item.brand}}
+										{{item.brandCode}}
 									</view>
 								</u-checkbox>
 							</u-checkbox-group>
@@ -44,7 +45,8 @@
 					</scroll-view>
 				</view>
 			</u-popup>
-			<u-card v-if="querybrandList.length" :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
+			<u-card v-if="this.form.cooperation.length" :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)"
+			 border-radius="20" :show-foot="false">
 				<view slot="head">
 					<view class="u-flex">
 						<view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
@@ -60,10 +62,15 @@
 			<u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false"
 			 v-for="(item, index) in checkedAgentlist" :key="index">
 				<view slot="head">
+					<view class="u-flex u-row-between">
 					<view class="u-flex">
 						<view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
 						{{item.brand}}合作品牌签约任务
 					</view>
+						<view @click="delAgent(index)">
+							<u-icon name="close" color="#666666" size="36"></u-icon>
+				</view>
+					</view>
 				</view>
 				<view slot="body">
 					<u-form-item>
@@ -79,7 +86,7 @@
 							<u-icon name="order" size="36"></u-icon>
 						</view>
 						<u-radio-group v-model="item.taskNum" :disabled="item.disabledGroup" @change="changeRadiogroup(item)">
-							<u-radio v-for="(i, index) in tasknameList" :key="index" :name="i.signLv">
+							<u-radio @click.native.prevent="clickitem(item,i.signLv)" :label-disabled="i.labelDisabled" v-for="(i, index2) in tasknameList" :key="index2" :name="i.signLv">
 								{{i.signLv}}
 							</u-radio>
 						</u-radio-group>
@@ -87,6 +94,18 @@
 				</view>
 
 			</u-card>
+			<u-card v-if="checkedAgentlist.length==0&&this.form.cooperation.length" :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)"
+			 border-radius="20" :show-foot="false">
+				<view slot="head">
+					<view class="u-flex">
+						<view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
+						温馨提示
+					</view>
+				</view>
+				<view slot="body" style="display:flex;width:100%;flex-flow: wrap;justify-content: space-around;align-items: center;">
+					此地区暂无此品牌的经销商
+				</view>
+			</u-card>
 			<u-form-item :border-bottom="false">
 				<view style="margin:0 30rpx;">
 					<u-checkbox-group>
@@ -130,8 +149,9 @@
 					}]
 				},
 				protocol: false,
-				querybrandList:[],
-				brandList:[]
+				querybrandList: [],
+				brandList: [],
+				allbrandList:[]
 			}
 		},
 		created() {
@@ -141,19 +161,19 @@
 			})
 		},
 		mounted() {
-			uni.showLoading({
-				title: '加载中...'
-			});
 			this.getAgentArea()
 			this.getTasknum()
+			this.getAllbrandlist()
 		},
 		methods: {
 			getAgentArea() {
-				console.log(this.formData)
+				uni.showLoading({
+					title: '加载中...'
+				});
 				request({
 					url: '/sailun/appStoreBasicInfo/getAgentArea',
 					method: 'post',
-					data:{
+					data: {
 						"area": this.formData.district,
 						"city": this.formData.city,
 						"province": this.formData.province,
@@ -176,16 +196,19 @@
 									kunnr: item.kunnr,
 									agent_id: item.kunnr,
 									taskNum: "",
-									disabledGroup:false,
+									disabledGroup: false,
+									checked:false,
 								})
 							}
 							return res;
 						}, []);
-						this.brandList=[...new Set(this.agentList.reduce((res, item, index, array) => {
+						this.brandList = [...new Set(this.agentList.reduce((res, item, index, array) => {
 							res.push(item.brand)
 							return res;
 						}, []))].reduce((res, item, index, array) => {
-							res.push({brand:item})
+							res.push({
+								brand: item
+							})
 							return res;
 						}, []);
 					}
@@ -199,14 +222,32 @@
 					uni.hideLoading()
 				})
 			},
-			getQuerybrand(){
+			getAllbrandlist() {
 				request({
 					url: '/sailun/appStoreBasicInfo/queryBrand',
 					method: 'get',
 					data: {},
 				}).then(res => {
 					if (res.data.code == 0) {
-					this.querybrandList=res.data.data
+						this.allbrandList = res.data.data
+					}
+					if (res.data.code == 500) {
+						this.$u.toast(res.data.msg);
+					}
+				}).catch(err => {
+					console.log(err)
+				}).finally(() => {
+			
+				})
+			},
+			getQuerybrand() {
+				request({
+					url: '/sailun/appStoreBasicInfo/queryBrand',
+					method: 'get',
+					data: {},
+				}).then(res => {
+					if (res.data.code == 0) {
+						this.querybrandList = res.data.data
 					this.querybrandList = this.querybrandList.filter(item => this.cooperations.indexOf(item.brandCode) > -1)
 					}
 					if (res.data.code == 500) {
@@ -225,14 +266,10 @@
 					data: {},
 				}).then(res => {
 					if (res.data.code == 0) {
-						this.tasknameList = res.data.data
-						this.tasknameList.push({
-							brand: null,
-							brandCode: null,
-							mainId:null,
-							numTask:null,
-							signLv: "无"
+						res.data.data.map(function(item, index) {
+							item.checked = false;
 						})
+						this.tasknameList = res.data.data
 					}
 					if (res.data.code == 500) {
 						this.$u.toast(res.data.msg);
@@ -246,11 +283,21 @@
 			checkboxGroupChange(e) {
 				this.cooperations = e
 			},
-			changeRadiogroup(item){
-				if(item.taskNum=="无"){
-					this.checkedAgentlist.filter(e=>(e.brand===item.brand&&e.agent_id!=item.agent_id)).forEach(e=>e.disabledGroup=false)
+			changeRadiogroup(item) {
+				if (item.checked==true) {
+					this.checkedAgentlist.filter(e => (e.brand === item.brand && e.agent_id != item.agent_id)).forEach(e => e.disabledGroup =
+						false)
+				} else {
+					this.checkedAgentlist.filter(e => (e.brand === item.brand && e.agent_id != item.agent_id)).forEach(e => e.disabledGroup =
+						true)
+				}
+			},
+			clickitem (item,e) {
+				if(item.checked==false){
+					item.checked=true
 				}else{
-					this.checkedAgentlist.filter(e=>(e.brand===item.brand&&e.agent_id!=item.agent_id)).forEach(e=>e.disabledGroup=true)
+					item.checked=false
+					item.taskNum=""
 				}
 			},
 			getCooperation() {
@@ -267,21 +314,27 @@
 			getTaskconfirm(e) {
 				this.form.tasklist = e[0].label;
 			},
+			delAgent(index){
+				this.checkedAgentlist.splice(index,1)
+			},
 			submit() {
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
-						if(!this.protocol)return this.$u.toast('请勾选协议');
+						this.brandAgentLvQueryList=this.checkedAgentlist.filter(item => (item.disabledGroup!=true))
+						let checkenLength=this.checkedAgentlist.filter(item => (item.checked==true))
+						if(checkenLength.length<this.brandAgentLvQueryList.length) return this.$u.toast('请完善任务条数');
+						if (!this.protocol) return this.$u.toast('请勾选协议');
 						this.setData()
 					} else {
 						console.log('验证失败');
 					}
 				});
 			},
-			setData(){
-				this.brandAgentLvQueryList = this.checkedAgentlist.reduce((res, item) => {
+			setData() {
+				this.brandAgentLvQueryList = this.brandAgentLvQueryList.reduce((res, item) => {
 					res.push({
 						agent_id: item.agent_id,
-						agent_name:item.name,
+						agent_name: item.name,
 						brand: item.brand,
 						brandCode: item.brandCode,
 						kunnr: item.kunnr,
@@ -294,27 +347,25 @@
 					return res;
 				}, []);
 				let data = {
-					"brandAgentLvQueryList":this.brandAgentLvQueryList,
-					"city":this.formData.city,
-					"contactName":this.formData.name,
-					"district":this.formData.district,
-					"jd":this.formData.longitude,
-					"licenseUrl":this.dataUrl.licenseUrl,
-					"mobileCode":this.formData.code,
-					"province":this.formData.province,
-					"storeImageUrl":this.dataUrl.storeUrl,
-					"storeName":this.formData.store,
-					"storePhone":this.formData.phone,
-					"version":1.00,
-					"wd":this.formData.latitude,
+					"brandAgentLvQueryList": this.brandAgentLvQueryList,
+					"city": this.formData.city,
+					"contactName": this.formData.name,
+					"district": this.formData.district,
+					"jd": this.formData.longitude,
+					"licenseUrl": this.dataUrl.licenseUrl,
+					"mobileCode": this.formData.code,
+					"province": this.formData.province,
+					"storeImageUrl": this.dataUrl.storeUrl,
+					"storeName": this.formData.store,
+					"storePhone": this.formData.phone,
+					"version": 1.00,
+					"wd": this.formData.latitude,
 				}
-				console.log(data)
 				request({
 					url: '/sailun/appStoreBasicInfo/storeReg',
 					method: 'post',
 					data: data
 				}).then(res => {
-					console.log(res)
 					if (res.data.code == 0) {
 						this.loading = true
 						this.$u.toast(res.data.msg);

+ 10 - 0
pages/me/Delivery-details/index.vue

@@ -125,6 +125,16 @@
 				length: ''
 			}
 		},
+		onBackPress(options) {
+			console.log(options)
+			if (options.from == 'backbutton') {
+				this.$u.route({
+					type: 'switchTab',
+					url: 'pages/me/index'
+				})
+			}
+			return true;
+		},
 		onReachBottom() {
 			this.status = 'loading';
 			this.page++

+ 10 - 0
pages/me/Warehousing-details/index.vue

@@ -138,6 +138,16 @@
 			this.page = 1
 			this.whole()
 		},
+		onBackPress(options) {
+			console.log(options)
+			if (options.from == 'backbutton') {
+				this.$u.route({
+					type: 'switchTab',
+					url: 'pages/me/index'
+				})
+			}
+			return true;
+		},
 		methods: {
 			content_s() {
 				console.log(this.keyword)

+ 4 - 2
pages/me/scancodequery/result.vue

@@ -9,7 +9,7 @@
 			</view>
 			<view class="stripe"></view>
 			<view class="roll">
-				<view>查询失败</view>
+				<view>{{text}}</view>
 				<view>
 					<view></view>
 					<view></view>
@@ -62,7 +62,8 @@
 				mouldType: '未查询',
 				brand: '未查询',
 				specification: '未查询',
-				createTime: '未查询'
+				createTime: '未查询',
+				text:'查询失败'
 			}
 		},
 		onReady() {
@@ -117,6 +118,7 @@
 							position: "bottom"
 						})
 					}
+					this.text = res.data.msg
 				}).catch(err => {
 					console.log(err)
 					uni.showToast({

BIN
unpackage/debug/android_debug.apk