Просмотр исходного кода

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

tong 4 лет назад
Родитель
Сommit
3a5f1f42a5

+ 37 - 15
App.vue

@@ -1,34 +1,54 @@
 <script>
-	import {mapMutations} from 'vuex'
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex'
 	export default {
 		// 此处globalData为了演示其作用,不是uView框架的一部分
+		computed: {
+			...mapState(['hasLogin'])
+		},
 		globalData: {
 			username: '白居易'
 		},
-		methods:{
+		methods: {
 			...mapMutations(['login'])
 		},
+		created() {
+			const storeInfo = uni.getStorageSync("storeInfo") || "";
+			if (storeInfo) {
+				uni.getStorage({
+					key: "storeInfo",
+					success: (res) => {
+						this.login(res.data)
+						this.$u.route({
+							url: 'pages/home/index',
+							type: 'switchTab',
+						})
+					},
+				})
+			} else {
+				this.$u.route({
+					url: "pages/login/index",
+					type:"redirect"
+				})
+			}
+		},
 		onLaunch() {
 			// 1.1.0版本之前关于http拦截器代码,已平滑移动到/common/http.interceptor.js中
 			// 注意,需要在/main.js中实例化Vue之后引入如下(详见文档说明):
 			// import httpInterceptor from '@/common/http.interceptor.js'
 			// Vue.use(httpInterceptor, app)
-			let storeInfo=uni.getStorageSync("storeInfo")||"";
-			if(storeInfo.storeId){
-				uni.getStorage({
-					key:"storeInfo",
-					success:(res)=>{
-						this.login(res.data)
-					}
-				})
-			}
 		},
+		onShow() {
+		}
 	}
 </script>
 
 <style lang="scss">
 	@import "uview-ui/index.scss";
 	@import "common/demo.scss";
+
 	/*每个页面公共css */
 	// uni-page-head
 	//     {
@@ -37,15 +57,17 @@
 	.u-checkbox__label[data-v-54acf820] {
 		color: #B2B2B2 !important;
 	}
+
 	.uni-input-placeholder {
 		color: #B2B2B2 !important;
 	}
-	page{
-		height: 100%;
+
+	page {
 		background-color: #F4F4F4;
 		font-weight: 500;
 	}
-	.u-skeleton{
+
+	.u-skeleton {
 		height: 100%;
 	}
-</style>
+</style>

+ 3 - 2
common/p-scan/scan.vue

@@ -33,7 +33,6 @@
 				background: '#ffffff',
 				frameColor: '#00A0EA',
 				scanbarColor: '#00A0EA'
-
 			});
 			this.barcode.onmarked = this.onmarked;
 			
@@ -47,7 +46,9 @@
 			}
 
 			this.barcode.setStyle({
-
+				background: '#ffffff',
+				frameColor: '#00A0EA',
+				scanbarColor: '#00A0EA'
 			});
 			// #endif
 		},

+ 1 - 0
common/request/request.js

@@ -36,6 +36,7 @@ export function request(config) {
 
 //在uni-app中使用对app有效果,h5不需要
 axios.defaults.adapter = function (config) {
+	config.headers.Authorization = uni.getStorageSync('token');
     return new Promise((resolve, reject) => {
         var settle = require('axios/lib/core/settle');
         var buildURL = require('axios/lib/helpers/buildURL');

+ 272 - 0
js_sdk/wa-permission/permission.js

@@ -0,0 +1,272 @@
+/**
+ * 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
+ */
+
+var isIos
+// #ifdef APP-PLUS
+isIos = (plus.os.name == "iOS")
+// #endif
+
+// 判断推送权限是否开启
+function judgeIosPermissionPush() {
+	var result = false;
+	var UIApplication = plus.ios.import("UIApplication");
+	var app = UIApplication.sharedApplication();
+	var enabledTypes = 0;
+	if (app.currentUserNotificationSettings) {
+		var settings = app.currentUserNotificationSettings();
+		enabledTypes = settings.plusGetAttribute("types");
+		console.log("enabledTypes1:" + enabledTypes);
+		if (enabledTypes == 0) {
+			console.log("推送权限没有开启");
+		} else {
+			result = true;
+			console.log("已经开启推送功能!")
+		}
+		plus.ios.deleteObject(settings);
+	} else {
+		enabledTypes = app.enabledRemoteNotificationTypes();
+		if (enabledTypes == 0) {
+			console.log("推送权限没有开启!");
+		} else {
+			result = true;
+			console.log("已经开启推送功能!")
+		}
+		console.log("enabledTypes2:" + enabledTypes);
+	}
+	plus.ios.deleteObject(app);
+	plus.ios.deleteObject(UIApplication);
+	return result;
+}
+
+// 判断定位权限是否开启
+function judgeIosPermissionLocation() {
+	var result = false;
+	var cllocationManger = plus.ios.import("CLLocationManager");
+	var status = cllocationManger.authorizationStatus();
+	result = (status != 2)
+	console.log("定位权限开启:" + result);
+	// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
+	/* var enable = cllocationManger.locationServicesEnabled();
+	var status = cllocationManger.authorizationStatus();
+	console.log("enable:" + enable);
+	console.log("status:" + status);
+	if (enable && status != 2) {
+		result = true;
+		console.log("手机定位服务已开启且已授予定位权限");
+	} else {
+		console.log("手机系统的定位没有打开或未给予定位权限");
+	} */
+	plus.ios.deleteObject(cllocationManger);
+	return result;
+}
+
+// 判断麦克风权限是否开启
+function judgeIosPermissionRecord() {
+	var result = false;
+	var avaudiosession = plus.ios.import("AVAudioSession");
+	var avaudio = avaudiosession.sharedInstance();
+	var permissionStatus = avaudio.recordPermission();
+	console.log("permissionStatus:" + permissionStatus);
+	if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
+		console.log("麦克风权限没有开启");
+	} else {
+		result = true;
+		console.log("麦克风权限已经开启");
+	}
+	plus.ios.deleteObject(avaudiosession);
+	return result;
+}
+
+// 判断相机权限是否开启
+function judgeIosPermissionCamera() {
+	var result = false;
+	var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
+	var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
+	console.log("authStatus:" + authStatus);
+	if (authStatus == 3) {
+		result = true;
+		console.log("相机权限已经开启");
+	} else {
+		console.log("相机权限没有开启");
+	}
+	plus.ios.deleteObject(AVCaptureDevice);
+	return result;
+}
+
+// 判断相册权限是否开启
+function judgeIosPermissionPhotoLibrary() {
+	var result = false;
+	var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
+	var authStatus = PHPhotoLibrary.authorizationStatus();
+	console.log("authStatus:" + authStatus);
+	if (authStatus == 3) {
+		result = true;
+		console.log("相册权限已经开启");
+	} else {
+		console.log("相册权限没有开启");
+	}
+	plus.ios.deleteObject(PHPhotoLibrary);
+	return result;
+}
+
+// 判断通讯录权限是否开启
+function judgeIosPermissionContact() {
+	var result = false;
+	var CNContactStore = plus.ios.import("CNContactStore");
+	var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
+	if (cnAuthStatus == 3) {
+		result = true;
+		console.log("通讯录权限已经开启");
+	} else {
+		console.log("通讯录权限没有开启");
+	}
+	plus.ios.deleteObject(CNContactStore);
+	return result;
+}
+
+// 判断日历权限是否开启
+function judgeIosPermissionCalendar() {
+	var result = false;
+	var EKEventStore = plus.ios.import("EKEventStore");
+	var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
+	if (ekAuthStatus == 3) {
+		result = true;
+		console.log("日历权限已经开启");
+	} else {
+		console.log("日历权限没有开启");
+	}
+	plus.ios.deleteObject(EKEventStore);
+	return result;
+}
+
+// 判断备忘录权限是否开启
+function judgeIosPermissionMemo() {
+	var result = false;
+	var EKEventStore = plus.ios.import("EKEventStore");
+	var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
+	if (ekAuthStatus == 3) {
+		result = true;
+		console.log("备忘录权限已经开启");
+	} else {
+		console.log("备忘录权限没有开启");
+	}
+	plus.ios.deleteObject(EKEventStore);
+	return result;
+}
+
+// Android权限查询
+function requestAndroidPermission(permissionID) {
+	return new Promise((resolve, reject) => {
+		plus.android.requestPermissions(
+			[permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
+			function(resultObj) {
+				var result = 0;
+				for (var i = 0; i < resultObj.granted.length; i++) {
+					var grantedPermission = resultObj.granted[i];
+					console.log('已获取的权限:' + grantedPermission);
+					result = 1
+				}
+				for (var i = 0; i < resultObj.deniedPresent.length; i++) {
+					var deniedPresentPermission = resultObj.deniedPresent[i];
+					console.log('拒绝本次申请的权限:' + deniedPresentPermission);
+					result = 0
+				}
+				for (var i = 0; i < resultObj.deniedAlways.length; i++) {
+					var deniedAlwaysPermission = resultObj.deniedAlways[i];
+					console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
+					result = -1
+				}
+				resolve(result);
+				// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
+				// if (result != 1) {
+				// gotoAppPermissionSetting()
+				// }
+			},
+			function(error) {
+				console.log('申请权限错误:' + error.code + " = " + error.message);
+				resolve({
+					code: error.code,
+					message: error.message
+				});
+			}
+		);
+	});
+}
+
+// 使用一个方法,根据参数判断权限
+function judgeIosPermission(permissionID) {
+	if (permissionID == "location") {
+		return judgeIosPermissionLocation()
+	} else if (permissionID == "camera") {
+		return judgeIosPermissionCamera()
+	} else if (permissionID == "photoLibrary") {
+		return judgeIosPermissionPhotoLibrary()
+	} else if (permissionID == "record") {
+		return judgeIosPermissionRecord()
+	} else if (permissionID == "push") {
+		return judgeIosPermissionPush()
+	} else if (permissionID == "contact") {
+		return judgeIosPermissionContact()
+	} else if (permissionID == "calendar") {
+		return judgeIosPermissionCalendar()
+	} else if (permissionID == "memo") {
+		return judgeIosPermissionMemo()
+	}
+	return false;
+}
+
+// 跳转到**应用**的权限页面
+function gotoAppPermissionSetting() {
+	if (isIos) {
+		var UIApplication = plus.ios.import("UIApplication");
+		var application2 = UIApplication.sharedApplication();
+		var NSURL2 = plus.ios.import("NSURL");
+		// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");		
+		var setting2 = NSURL2.URLWithString("app-settings:");
+		application2.openURL(setting2);
+
+		plus.ios.deleteObject(setting2);
+		plus.ios.deleteObject(NSURL2);
+		plus.ios.deleteObject(application2);
+	} else {
+		// console.log(plus.device.vendor);
+		var Intent = plus.android.importClass("android.content.Intent");
+		var Settings = plus.android.importClass("android.provider.Settings");
+		var Uri = plus.android.importClass("android.net.Uri");
+		var mainActivity = plus.android.runtimeMainActivity();
+		var intent = new Intent();
+		intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
+		var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
+		intent.setData(uri);
+		mainActivity.startActivity(intent);
+	}
+}
+
+// 检查系统的设备服务是否开启
+// var checkSystemEnableLocation = async function () {
+function checkSystemEnableLocation() {
+	if (isIos) {
+		var result = false;
+		var cllocationManger = plus.ios.import("CLLocationManager");
+		var result = cllocationManger.locationServicesEnabled();
+		console.log("系统定位开启:" + result);
+		plus.ios.deleteObject(cllocationManger);
+		return result;
+	} else {
+		var context = plus.android.importClass("android.content.Context");
+		var locationManager = plus.android.importClass("android.location.LocationManager");
+		var main = plus.android.runtimeMainActivity();
+		var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
+		var result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
+		console.log("系统定位开启:" + result);
+		return result
+	}
+}
+
+module.exports = {
+	judgeIosPermission: judgeIosPermission,
+	requestAndroidPermission: requestAndroidPermission,
+	checkSystemEnableLocation: checkSystemEnableLocation,
+	gotoAppPermissionSetting: gotoAppPermissionSetting
+}

+ 1 - 1
manifest.json

@@ -16,7 +16,7 @@
             }
         },
         "splashscreen" : {
-            "alwaysShowBeforeRender" : true,
+            "alwaysShowBeforeRender" : false,
             "waiting" : true,
             "autoclose" : true,
             "delay" : 0

+ 11 - 8
pages.json

@@ -11,6 +11,16 @@
 	// 	}]
 	// },
 	"pages": [
+		{
+		    "path" : "pages/index",
+		    "style" :                                                                                    
+		    {
+		       "app-plus": {
+		       	"titleNView": false
+		       }
+		    }
+		    
+		},
 		// 首页
 		{
 			"path": "pages/home/index",
@@ -50,7 +60,7 @@
 				}
 			}
 		}
-	],
+    ],
 	"subPackages": [{
 		"root": "pages/home",
 		"pages": [{
@@ -221,13 +231,6 @@
 			},
 			//查询结果
 			{
-				"path": "scancodequery/scan",
-				"style": {
-					"navigationBarTitleText": "胎号查询"
-				}
-			},
-			//查询结果
-			{
 				"path": "scancodequery/result",
 				"style": {
 					"navigationBarTitleText": "查询结果"

+ 77 - 21
pages/home/Scan-code-in/index.vue

@@ -5,7 +5,7 @@
 			<view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">成功信息</view>
 			<u-table border-color="#f2f2f2">
 				<u-tr class="u-tr">
-					<u-td class="u-td" style="font-size: 24rpx;">{{successCount}}</u-td>
+					<u-td class="u-td">{{successCount}}</u-td>
 					<u-td class="u-td">成功入库轮胎</u-td>
 				</u-tr>
 			</u-table>
@@ -16,15 +16,15 @@
 					<u-th class="u-th">失败原因</u-th>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in notBelongStoreBrandTyreNumbers" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">非门店经营品牌</u-td>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in nonRegularTyreNumbers" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">非正规胎号</u-td>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in alreadyExistsTyreNumbers" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">库存中已存在</u-td>
 				</u-tr>
 
@@ -64,13 +64,18 @@
 			</view>
 		</view>
 		<u-toast ref="repeat" position="bottom" />
-		<view class="tail" @click="Submit">
+		<view class="tail" @click="location">
 			扫码确认
 		</view>
 	</view>
 </template>
 
 <script>
+	const app = getApp()
+	var QQMapWX = require('../../../components/mi-map/qqmap-wx-jssdk.min.js')
+	var qqmapsdk = new QQMapWX({
+		key: 'LXCBZ-NNIKD-UZ64F-H6AFI-UNJLH-OCFGE'
+	})
 	import {
 		request
 	} from '../../../common/request/request'
@@ -88,10 +93,24 @@
 				rewardMoney: '', //奖励金额
 				rewardIntegral: '' ,//奖励积分
 				longitude:'',  //经度
-				latitude:''    //纬度
+				latitude:'',   //纬度
+				address: ''	   //中文地址
 			}
 		},
 		created() {
+			uni.getNetworkType({
+			    success: function (res) {
+					let none = res.networkType
+			        console.log(res.networkType);
+					if(none == 'none'){
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~',
+							position: "bottom"
+						})
+					}
+			    }
+			});
 			this.getDatalist()
 		},
 		methods: {
@@ -100,7 +119,6 @@
 					type:'redirectTo',
 					url: 'pages/me/Warehousing-details/index'
 				})
-
 			},
 			getDatalist() {
 				uni.$on('update', data => {
@@ -114,8 +132,8 @@
 							materialList: this.datalist
 						}
 					}).then(res => {
+						console.log(res)
 						this.dalist = res.data.data
-
 						for (let i = 0; i < this.dalist.length; i++) {
 							this.total += parseInt(this.dalist[i].rewardMoney)
 						}
@@ -123,23 +141,59 @@
 
 					}).catch(err => {
 						console.log(err)
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~'
+						})
 					}).finally(() => {
 						// Loading.close()
 					})
 				})
 			},
-			Submit() {
+			location(){
+				
+				uni.getNetworkType({
+				    success: function (res) {
+						let none = res.networkType
+				        console.log(res.networkType);
+						if(none == 'none'){
+							uni.showToast({
+								icon: 'none',
+								title: '无网络,请连接网络后再试~',
+								position: "bottom"
+							})
+						}
+				    }
+				});
+				let this_s = this
 				uni.getLocation({
-					type: 'wgs84',
-					geocode:true,
+					type: 'wgs84', // 返回国测局坐标
+					geocode: true,
 					success: function(res) {
-						console.log(res, "当前位置");
-						console.log(res.longitude);
-						console.log(res.latitude);
-						this.longitude = res.longitude
-						this.latitude = res.latitude
+						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){
+							uni.showToast({
+								icon: 'none',
+								title: '获取地址失败, 请检查是否开启定位权限~~',
+								position: "bottom"
+							})
+							console.log("定位失败出去啦")
+							return
+						}
+						this_s.Submit()
 					},
-				});
+					fail: function(e) {
+						uni.showToast({
+							icon: 'none',
+							title: '获取地址失败, 请检查是否开启定位权限~~'
+						})
+					}
+				})
+			},
+			Submit() {
 				this.show = true;
 				request({
 					url: '/storeScan/storeScanTyres',
@@ -147,12 +201,13 @@
 					data: {
 						storeId:this.$store.state.storeInfo.storeId,
 						userId:this.$store.state.storeInfo.userId,
-						scanAddress: '中国',
-						longitude: this.longitude,
-						latitude: this.latitude,
-						materialList: this.datalist
+						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({
@@ -173,6 +228,7 @@
 				}).finally(() => {
 					// Loading.close()
 				})
+				
 			}
 		},
 	}

+ 34 - 15
pages/home/Scan-code-out/index.vue

@@ -5,7 +5,7 @@
 			<view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">成功信息</view>
 			<u-table border-color="#f2f2f2">
 				<u-tr class="u-tr">
-					<u-td class="u-td" style="font-size: 24rpx;">{{successCount}}</u-td>
+					<u-td class="u-td">{{successCount}}</u-td>
 					<u-td class="u-td">成功出库轮胎</u-td>
 				</u-tr>
 			</u-table>
@@ -16,15 +16,15 @@
 					<u-th class="u-th">失败原因</u-th>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in notBelongStoreBrandTyreNumbers" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">非门店经营品牌</u-td>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in nonRegularTyreNumbers" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">非正规胎号</u-td>
 				</u-tr>
 				<u-tr class="u-tr" v-for="(item,index) in notScanInTyres" :key="index">
-					<u-td class="u-td" style="font-size: 24rpx;">{{item}}</u-td>
+					<u-td class="u-td">{{item}}</u-td>
 					<u-td class="u-td">未入库轮胎</u-td>
 				</u-tr>
 			</u-table>
@@ -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,18 +88,37 @@
 				})
 
 			},
-			Submit() {
+			location(){
+				let this_s = this
 				uni.getLocation({
-					type: 'wgs84',
-					geocode:true,
+					type: 'wgs84', // 返回国测局坐标
+					geocode: true,
 					success: function(res) {
-						console.log(res, "当前位置");
-						console.log(res.longitude);
-						console.log(res.latitude);
-						this.longitude = res.longitude
-						this.latitude = res.latitude
+						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){
+							uni.showToast({
+								icon: 'none',
+								title: '获取地址失败, 请检查是否开启定位权限~~',
+								position: "bottom"
+							})
+							console.log("定位失败出去啦")
+							return
+						}
+						this_s.Submit()
 					},
-				});
+					fail: function(e) {
+						uni.showToast({
+							icon: 'none',
+							title: '获取地址失败, 请检查是否开启定位权限~~'
+						})
+						this.location()
+					}
+				})
+			},
+			Submit() {
 				this.show = true;
 				request({
 					url: '/storeScan/storeScanOutTyres',
@@ -107,7 +126,7 @@
 					data: {
 						storeId:this.$store.state.storeInfo.storeId,
 						userId:this.$store.state.storeInfo.userId,
-						scanAddress: '中国',
+						scanAddress: this.address,
 						longitude: this.longitude,
 						latitude: this.latitude,
 						materialList: this.datalist

+ 21 - 25
pages/home/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view style="background-color: #FFFFFF;height: 100%;" class="u-skeleton">
+	<view style="background-color: #FFFFFF;height: 100vh;" class="u-skeleton">
 		<view class="status_bar">
 			<!-- 这里是状态栏 -->
 		</view>
@@ -71,12 +71,6 @@
 			uni.$on('login', (data) => {
 				this.loginStatus = data.msg
 			})
-			if (!this.hasLogin) {
-				this.$u.route({
-					url: "pages/login/index",
-					type: "reLaunch"
-				})
-			}
 		},
 		onReady() {
 			if (this.loginStatus == "登录成功") {
@@ -86,22 +80,23 @@
 			}
 		},
 		created() {
-			uni.showLoading({
-				title: '加载中...'
-			});
-			axios.all([this.getBanners(), this.getTiceList()])
-				.then(axios.spread((one, two) => {
-					this.bannersList = one.data.data.map(t => t.imgPath)
-					console.log(this.bannersList)
-					this.noticebarList = two.data.data.map(t => t.msgContent)
-				}))
-				.catch(err => {
-					console.log(err)
-				})
-				.finally(() => {
-					this.loading = false;
-					uni.hideLoading();
+			if (this.hasLogin) {
+				uni.showLoading({
+					title: '加载中...'
+				});
+				axios.all([this.getBanners(), this.getTiceList()])
+					.then(axios.spread((one, two) => {
+						this.bannersList = one.data.data.map(t => t.imgPath)
+						this.noticebarList = two.data.data.map(t => t.msgContent)
+					}))
+					.catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						this.loading = false;
+						uni.hideLoading();
 				})
+			}
 		},
 		computed: {
 			...mapState(['hasLogin'])
@@ -156,9 +151,10 @@
 				// })
 			},
 			inIntegral() {
-				this.$u.route({
-					url: 'pages/home/integral-mall/integral_mall',
-				})
+				this.$u.toast('积分商城暂不开放');
+				// this.$u.route({
+				// 	url: 'pages/home/integral-mall/integral_mall',
+				// })
 			}
 		},
 	}

+ 60 - 30
pages/home/scancode/index.vue

@@ -72,15 +72,28 @@
 			}
 		},
 		created() {
+			uni.getNetworkType({
+			    success: function (res) {
+					let none = res.networkType
+			        console.log(res.networkType);
+					if(none == 'none'){
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~',
+							position: "bottom"
+						})
+					}
+			    }
+			});
 			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: {
@@ -90,8 +103,8 @@
 						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 => {
@@ -113,7 +126,7 @@
 								return
 							}
 						}
-						if (res.data.code == 500){
+						if (res.data.code == 500) {
 							this.$refs.repeat.show({
 								title: res.data.msg,
 								type: 'default',
@@ -121,7 +134,7 @@
 							})
 							return
 						}
-						
+
 						this.$refs.repeat.show({
 							title: '录入成功',
 							type: 'success',
@@ -146,7 +159,7 @@
 						console.log(this.lisi)
 					}).catch(err => {
 						this.$refs.repeat.show({
-							title: "网络连接失败",
+							title: "无网络,请连接网络后再试~",
 							type: 'default',
 							position: 'bottom'
 						})
@@ -158,6 +171,19 @@
 			},
 			//获取扫码控件
 			getScanCode(val) {
+				uni.getNetworkType({
+				    success: function (res) {
+						let none = res.networkType
+				        console.log(res.networkType);
+						if(none == 'none'){
+							uni.showToast({
+								icon: 'none',
+								title: '无网络,请连接网络后再试~',
+								position: "bottom"
+							})
+						}
+				    }
+				});
 				console.log(val)
 				this.number = val
 				this.number_s = val
@@ -165,8 +191,8 @@
 						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 => {
@@ -178,20 +204,11 @@
 									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,
 								type: 'default',
@@ -201,18 +218,18 @@
 							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,
@@ -231,11 +248,11 @@
 						innerAudioContext.autoplay = true;
 						innerAudioContext.src = '../../../static/mp3/scansuccess.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);
 						});
 						this.$refs.repeat.show({
 							title: '扫码成功',
@@ -256,6 +273,7 @@
 								type: 'default',
 								position: 'bottom'
 							})
+							this.repeated()
 						}
 						console.log(err)
 					})
@@ -270,13 +288,13 @@
 			scancodein() {
 				if (this.lisi == '') {
 					this.$refs.repeat.show({
-						title: '请扫码或录入后再点击',
+						title: '请扫码或录入后再点击!',
 						type: 'default',
 						position: 'bottom'
 					})
 				} else {
 					this.$u.route({
-						type:'redirectTo',
+						type: 'redirectTo',
 						url: 'pages/home/Scan-code-in/index'
 					})
 					uni.$emit('update', {
@@ -284,6 +302,18 @@
 					})
 					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);
+				});
 			}
 		}
 	}

+ 27 - 0
pages/home/scancode/scancodeout.vue

@@ -72,6 +72,19 @@
 			}
 		},
 		created() {
+			uni.getNetworkType({
+			    success: function (res) {
+					let none = res.networkType
+			        console.log(res.networkType);
+					if(none == 'none'){
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~',
+							position: "bottom"
+						})
+					}
+			    }
+			});
 			const innerAudioContext = uni.createInnerAudioContext();
 			innerAudioContext.autoplay = true;
 			innerAudioContext.src = '../../../static/mp3/startscan.mp3';
@@ -152,6 +165,19 @@
 				console.log(val)
 				this.number = val
 				this.number_s = val
+				uni.getNetworkType({
+				    success: function (res) {
+						let none = res.networkType
+				        console.log(res.networkType);
+						if(none == 'none'){
+							uni.showToast({
+								icon: 'none',
+								title: '无网络,请连接网络后再试~',
+								position: "bottom"
+							})
+						}
+				    }
+				});
 				request({
 						url: '/storeScan/storeScanGetTyre',
 						method: 'Post',
@@ -161,6 +187,7 @@
 							tyreNum: this.number_s
 						}
 					}).then(res => {
+						console.log(res)
 						this.tips = "胎号"
 						for (let i = 0; i < this.lisi.length; i++) {
 							if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {

+ 19 - 0
pages/index.vue

@@ -0,0 +1,19 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 1 - 10
pages/login/index.vue

@@ -67,7 +67,7 @@
 		computed: {
 			...mapState(['hasLogin'])
 		},
-		onLoad() {
+		created() {
 			uni.getSystemInfo({
 			    success:(res)=>{
 					this.SystemInfo=res
@@ -78,14 +78,6 @@
 			        this.networkType=res.networkType
 			    }
 			});
-			if(this.hasLogin){
-				this.$u.route({
-					url: 'pages/home/index',
-					type: 'switchTab',
-				})
-			}
-		},
-		created() {
 		},
 		methods: {
 			...mapMutations(['login']),
@@ -121,7 +113,6 @@
 						}
 					}).then(res => {
 						if (res.data.code == 0) {
-							console.log(res.data.data)
 							this.toUser(res.data.data)
 							uni.$emit('login', {
 								msg: '登录成功'

+ 13 - 5
pages/login/register.vue

@@ -32,9 +32,10 @@
 			注:上传完营业执照请确认和营业执照一致。
 		</view>
 		<view style="margin: 30rpx;">
-			<!-- <u-button type="primary" @click="nextStep" v-if="showLicense&&showStore">下一步</u-button> -->
-						<u-button type="primary" @click="nextStep">下一步</u-button>
+			<u-button type="primary" @click="nextStep" v-if="showLicense&&showStore">下一步</u-button>
+						<!-- <u-button type="primary" @click="nextStep">下一步</u-button> -->
 		</view>
+		<u-modal v-model="modalShow" :content="storecontent" :show-cancel-button="true" confirm-text="同意" cancel-text="不同意" @cancel="cancelModal"></u-modal>
 	</view>
 </template>
 
@@ -55,8 +56,13 @@
 				},
 				showLicense:false,
 				showStore:false,
+				modalShow:false,
+				storecontent:"此操作需要上传正规的营业执照照片,并确保系统识别出来的信息与营业执照一致,是否同意?"
 			};
 		},
+		mounted() {
+			this.modalShow=true
+		},
 		methods: {
 			nextStep() {
 				this.$u.route({
@@ -85,9 +91,7 @@
 							this.showLicense=true
 						}
 						if (res.data.code == 500) {
-							this.$refs.uToast.show({
-								title: res.data.msg,
-							})
+							this.$u.toast(res.data.msg);
 						}
 					}).catch(err => {
 						this.$u.toast('识别失败');
@@ -100,6 +104,10 @@
 					this.storeUrl = JSON.parse(res.data).data
 					this.showStore=true
 				}
+			},
+			cancelModal(){
+				uni.navigateBack({
+				})
 			}
 		},
 	}

+ 77 - 41
pages/login/register_2.vue

@@ -69,10 +69,12 @@
 		<view style="margin: 30rpx;">
 			<u-button @click="nextStep" type="primary">下一步</u-button>
 		</view>
+		<u-modal v-model="modelshow" :content="modelcontent" title="温馨提示"></u-modal>
 	</view>
 </template>
 
 <script>
+	import permision from "@/js_sdk/wa-permission/permission.js"
 	import {
 		request
 	} from '../../common/request/request'
@@ -135,7 +137,9 @@
 					}],
 				},
 				dataUrl: "",
-				codeLoading:false
+				codeLoading:false,
+				modelshow:false,
+				modelcontent:"如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照"
 			};
 		},
 		created() {
@@ -153,49 +157,81 @@
 			uni.$on('dataUrl', (data) => {
 				this.dataUrl = data
 			})
-			let that = this
-			uni.getLocation({
-				type: 'wgs84',
-				geocode: true,
-				success: function(res) {
-					switch (res.address.province) {
-						case "北京市":
-							{
-								that.city = "直辖市"
-								break;
-							}
-						case "天津市":
-							{
-								that.city = "直辖市"
-								break;
-							}
-						case "上海市":
-							{
-								that.city = "直辖市"
-								break;
-							}
-						case "重庆市":
-							{
-								that.city = "直辖市"
-								break;
-							}
-						default:
-							{
-								that.city = "不是直辖市"
-								break;
-							}
-					}
-					if (that.city == "直辖市") {
-						let RegionData = res.address.province + "," + that.city + "," + res.address.district
-						that.defaultRegion = RegionData.split(",");
-					} else {
-						let RegionData = res.address.province + "," + res.address.city + "," + res.address.district
-						that.defaultRegion = RegionData.split(",");
-					}
-				}
+			uni.getSystemInfo({
+			    success:res=>{
+					this.SystemInfo=res
+					console.log(res)
+			    }
 			});
+			if(this.SystemInfo.platform=='ios'){
+				this.judgeIosPermission('location')
+			}else{
+				this.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION')
+			}
+			this.modelshow=true
 		},
 		methods: {
+			judgeIosPermission(permisionID) {
+				let result = permision.judgeIosPermission(permisionID)
+				if(!result){
+					this.getLocation()
+				}else{
+					this.getLocation()
+				}
+			},
+			async requestAndroidPermission(permisionID) {
+			    let result = await permision.requestAndroidPermission(permisionID)
+				if (result == 1) {
+				    this.getLocation()
+				} else if (result == 0) {
+				    this.getLocation()
+				} else {
+				    this.getLocation()
+				}
+			},
+			getLocation(){
+				let that = this
+				uni.getLocation({
+					type: 'wgs84',
+					geocode: true,
+					success: function(res) {
+						switch (res.address.province) {
+							case "北京市":
+								{
+									that.city = "直辖市"
+									break;
+								}
+							case "天津市":
+								{
+									that.city = "直辖市"
+									break;
+								}
+							case "上海市":
+								{
+									that.city = "直辖市"
+									break;
+								}
+							case "重庆市":
+								{
+									that.city = "直辖市"
+									break;
+								}
+							default:
+								{
+									that.city = "不是直辖市"
+									break;
+								}
+						}
+						if (that.city == "直辖市") {
+							let RegionData = res.address.province + "," + that.city + "," + res.address.district
+							that.defaultRegion = RegionData.split(",");
+						} else {
+							let RegionData = res.address.province + "," + res.address.city + "," + res.address.district
+							that.defaultRegion = RegionData.split(",");
+						}
+					}
+				});
+			},
 			nextStep() {
 				this.$refs.uForm.validate(valid => {
 					if (valid) {

+ 2 - 1
pages/login/register_3.vue

@@ -227,6 +227,7 @@
 				this.brandAgentLvQueryList = this.checkedAgentlist.reduce((res, item) => {
 					res.push({
 						agent_id: item.agent_id,
+						agent_name:item.name,
 						brand: item.brand,
 						brandCode: item.brandCode,
 						kunnr: item.kunnr,
@@ -262,7 +263,7 @@
 					console.log(res)
 					if (res.data.code == 0) {
 						this.loading = true
-						this.$u.toast("注册成功");
+						this.$u.toast(res.data.msg);
 						setTimeout(() => {
 							this.$u.route({
 								url: 'pages/login/index',

+ 5 - 4
pages/me/index.vue

@@ -280,13 +280,14 @@
 			},
 			inresult() {
 				this.$u.route({
-					url: 'pages/me/scancodequery/scan',
+					url: 'pages/me/scancodequery/result',
 				})
 			},
 			inorder() {
-				this.$u.route({
-					url: 'pages/me/my-order/my-order',
-				})
+				this.$u.toast('门店订单暂不开放');
+				// this.$u.route({
+				// 	url: 'pages/me/my-order/my-order',
+				// })
 			},
 			inCoupon() {
 				this.$u.toast('我的优惠券暂不开放');

+ 125 - 9
pages/me/scancodequery/result.vue

@@ -1,33 +1,146 @@
 <!-- 胎号查询成功页面 -->
 <template>
 	<view>
-		<view class="head">
+		<view class="head" v-if="empty == true">
+			<view class="tips">
+				<br>
+				<br>
+				<u-empty icon-color="#FFFFFF" color="#FFFFFF" text="查询失败" mode="data"></u-empty>
+			</view>
+			<view class="stripe"></view>
+			<view class="roll">
+				<view>查询失败</view>
+				<view>
+					<view></view>
+					<view></view>
+					<u-line color="#f4f4f4" border-style="dashed" :hair-line="true" length="94%" style="margin: 0 auto;padding-top: 30rpx;" />
+				</view>
+				<view class="Exhibition">
+					<u-empty text="查询失败" mode="list"></u-empty>
+				</view>
+			</view>
+			<u-button type="primary" shape="circle" class="button" @click="scanning">立即查询</u-button>
+		</view>
+		
+		<view class="head" v-else>
 			<view class="tips">
 				<image src="../../../static/sailun/successful.png" mode=""></image>
 				<view>查询成功</view>
 			</view>
 			<view class="stripe"></view>
 			<view class="roll">
-				<view>232654561651</view>
+				<view>{{tireNumber}}</view>
 				<view>
 					<view></view>
 					<view></view>
 					<u-line color="#f4f4f4" border-style="dashed" :hair-line="true" length="94%" style="margin: 0 auto;padding-top: 30rpx;" />
 				</view>
 				<view class="Exhibition">
-					<view><text>轮胎胎号</text><text>232654561651</text></view>
-					<view><text>轮胎类型</text><text>扫码出库</text></view>
-					<view><text>轮胎品牌</text><text>赛轮轮胎</text></view>
-					<view><text>轮胎规格</text><text>12R22.5</text></view>
-					<view><text>创建时间</text><text>2020-02-22 10:22:23</text></view>
+					<view><text>轮胎胎号</text><text>{{tireNumber}}</text></view>
+					<view><text>轮胎类型</text><text>{{mouldType}}</text></view>
+					<view><text>轮胎品牌</text><text>{{brand}}</text></view>
+					<view><text>轮胎规格</text><text>{{specification}}</text></view>
+					<view><text>创建时间</text><text>{{createTime}}</text></view>
 				</view>
 			</view>
-			<u-button type="primary" shape="circle" class="button">继续查询</u-button>
+			<u-button type="primary" shape="circle" class="button" @click="scanning">继续查询</u-button>
 		</view>
 	</view>
 </template>
 
 <script>
+	import {
+		request
+	} from '../../../common/request/request'
+	require("promise.prototype.finally").shim()
+	export default {
+		data() {
+			return {
+				datalist: '',
+				empty: true,
+				tireNumber: "未查询",
+				mouldType: '未查询',
+				brand: '未查询',
+				specification: '未查询',
+				createTime: '未查询'
+			}
+		},
+		onReady() {
+			uni.getNetworkType({
+				success: function(res) {
+					let none = res.networkType
+					console.log(res.networkType);
+					if (none == 'none') {
+						uni.showToast({
+							icon: 'none',
+							title: '无网络,请连接网络后再试~',
+							position: "bottom"
+						})
+					}
+				}
+			});
+			setTimeout(() => {
+				this.scanning()
+			}, 100)
+
+		},
+		methods: {
+			rendering() {
+				console.log(this.datalist)
+				request({
+					url: '/myapp/mouldSelect',
+					method: 'Post',
+					data: {
+						storeId: this.$store.state.storeInfo.storeId,
+						userId: this.$store.state.storeInfo.userId,
+						tireNumber: this.datalist,
+					}
+				}).then(res => {
+					console.log(res.data)
+					if(res.data.code == 0){
+						uni.showToast({
+							icon: 'none',
+							title: '查询成功',
+							position: "bottom"
+						})
+						this.empty = false
+						this.tireNumber = res.data.data.tireNumber
+						this.mouldType = res.data.data.mouldType
+						this.brand = res.data.data.brand
+						this.specification = res.data.data.specification
+						this.createTime = res.data.data.createTime
+					}else if (res.data.code == 500) {
+						this.empty = true
+						uni.showToast({
+							icon: 'none',
+							title: res.data.msg,
+							position: "bottom"
+						})
+					}
+				}).catch(err => {
+					console.log(err)
+					uni.showToast({
+						icon: 'none',
+						title: '出错了请联系管理员~',
+						position: "bottom"
+					})
+				}).finally(() => {
+					// Loading.close()
+				})
+			},
+			scanning() {
+				let this_ = this
+				uni.scanCode({
+					success: function(res) {
+						console.log('条码类型:' + res.scanType);
+						console.log('条码内容:' + res.result);
+						this_.datalist = res.result
+						this_.rendering()
+					}
+				})
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
@@ -102,6 +215,7 @@
 				margin-top: 60rpx;
 				width: 106rpx;
 				height: 112rpx;
+				margin-left: 10rpx;
 			}
 
 			view {
@@ -118,9 +232,11 @@
 		margin: 0 auto;
 		margin-top: 25rpx;
 	}
-	.Exhibition>view{
+
+	.Exhibition>view {
 		margin-bottom: 10rpx;
 	}
+
 	.Exhibition>view>text:nth-child(2) {
 		float: right;
 	}

+ 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>

+ 1 - 1
pages/me/setting/setting.vue

@@ -49,7 +49,7 @@
       <view slot="body">
         <template>
           <u-cell-group :border="false">
-            <u-cell-item title="收地址管理" @click="tishi">
+            <u-cell-item title="收地址管理" @click="tishi">
               <u-icon
                 slot="icon"
                 size="42"

+ 20 - 3
pages/me/suppliers.vue

@@ -4,6 +4,9 @@
 		<view class="head">
 			<view class="behind"></view>
 			<view class="below">
+				<view class="nothing" v-if="judge==true">
+					<u-empty mode="page" text="出错了!请联系管理员"></u-empty>
+				</view>
 				<view class="content" v-for="(item, index) in supplier_s" :key="index">
 					<view class="content_s">
 						<view class="title">
@@ -28,9 +31,7 @@
 	export default {
 			data() {
 				return {
-					mobile: '经销商名称',
-					code: '张三',
-					code_s: '13412336446',
+					judge: true,
 					supplier_s: []		//经销商信息
 				}
 			},
@@ -50,9 +51,16 @@
 						console.log(res.data.data)
 						console.log(res)
 						this.supplier_s = res.data.data
+						console.log(this.supplier_s)
+						if(this.supplier_s.length != 0){
+							this.judge = false
+						}
 						console.log(res.data.data[1].brandList[1])
 					}).catch(err => {
 						console.log(err)
+						if(this.supplier_s.length != 0){
+							this.judge = false
+						}
 					}).finally(() => {
 						// Loading.close()
 					})
@@ -75,6 +83,15 @@
 	.below{
 		margin-top: -270rpx;
 	}
+	.nothing {
+		width: 96%;
+		height: 800rpx;
+		background-color: #FFFFFF;
+		margin: 0 auto;
+		margin-top: 20rpx;
+		border-radius: 20rpx;
+		box-shadow: 0 0 24rpx 0 rgba(101, 176, 249, 0.41);
+	}
 	.content {
 		width: 667rpx;
 		height: auto;

BIN
static/sailun/88reward.png


+ 8 - 2
store/index.js

@@ -65,7 +65,7 @@ const store = new Vuex.Store({
 		//显示提示消息相关配置
 		showToastDuration : 4000,
 		showServerErrorMsg: '连接服务器异常!',
-		hasLogin:false ,//用户是否登录
+		hasLogin:false,//用户是否登录
 		storeInfo:{}//存放用户账号数据
 		
 	},
@@ -97,7 +97,10 @@ const store = new Vuex.Store({
 				key:"storeInfo",
 				data:provider
 			})
-			console.log(state.storeInfo)
+			uni.setStorage({
+			    key: 'token',
+			    data: provider.token,
+			});
 		},
 		logout(state){
 			state.hasLogin=false;
@@ -105,6 +108,9 @@ const store = new Vuex.Store({
 			uni.removeStorage({
 				key:"storeInfo"
 			})
+			uni.removeStorage({
+				key:"token"
+			})
 		}
 	}
 })