achao 3 年之前
父节点
当前提交
45fdd1d243

+ 3 - 1
common/helper.js

@@ -1,5 +1,6 @@
 import * as config from '../config'
 import * as config from '../config'
 const rolesList = []
 const rolesList = []
+const gjList=[]
 const ossUploadUrl = 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/';
 const ossUploadUrl = 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/';
 const chooseImage = {
 const chooseImage = {
 	count: '1',
 	count: '1',
@@ -391,5 +392,6 @@ export default {
 	filterUrban,
 	filterUrban,
 	filterArea,
 	filterArea,
 	fUN_AmapLocation,
 	fUN_AmapLocation,
-	changeTime
+	changeTime,
+	gjList
 }
 }

+ 70 - 63
components/ossutil/uploadFile.js

@@ -1,6 +1,6 @@
 const env = require('./config.js'); //配置文件,在这文件里配置你的OSS keyId和KeySecret,timeout:87600;
 const env = require('./config.js'); //配置文件,在这文件里配置你的OSS keyId和KeySecret,timeout:87600;
 
 
-const base64 = require('./base64.js');//Base64,hmac,sha1,crypto相关算法
+const base64 = require('./base64.js'); //Base64,hmac,sha1,crypto相关算法
 require('./hmac.js');
 require('./hmac.js');
 require('./sha1.js');
 require('./sha1.js');
 const Crypto = require('./crypto.js');
 const Crypto = require('./crypto.js');
@@ -11,75 +11,82 @@ const Crypto = require('./crypto.js');
  *@param - dir:表示要传到哪个目录下
  *@param - dir:表示要传到哪个目录下
  *@param - successc:成功回调
  *@param - successc:成功回调
  *@param - failc:失败回调
  *@param - failc:失败回调
- */ 
-const uploadFile = function (filePath, dir, successc, failc) {
-  if (!filePath || filePath.length < 9) {
-    uni.showModal({
-      title: '图片错误',
-      content: '请重试',
-      showCancel: false,
-    })
-    return;
-  }
-  //图片名字 可以自行定义,     这里是采用当前的时间戳 + 150内的随机数来给图片命名的
-  const aliyunFileKey = dir + new Date().getTime() + Math.floor(Math.random() * 150) + '.png';
-  
-  const aliyunServerURL = env.uploadImageUrl;//OSS地址,需要https
-  const accessid = env.OSSAccessKeyId;
-  const policyBase64 = getPolicyBase64();
-  const signature = getSignature(policyBase64);//获取签名
- 
-  uni.uploadFile({
-    url: aliyunServerURL,//开发者服务器 url
-    filePath: filePath,//要上传文件资源的路径
-    name: 'file',//必须填file
-    formData: {
-      'key': aliyunFileKey,
-      'policy': policyBase64,
-      'OSSAccessKeyId': accessid,
-      'signature': signature,
-      'success_action_status': '200',
-    },
-    success: function (res) {
+ */
+const uploadFile = function(type, filePath, dir, successc, failc) {
+	console.log('type', type)
+	if (!filePath || filePath.length < 9) {
+		uni.showModal({
+			title: '图片错误',
+			content: '请重试',
+			showCancel: false,
+		})
+		return;
+	}
+	let aliyunFileKey = ''
+	if (type == 'image') {
+		aliyunFileKey = dir + new Date().getTime() + Math.floor(Math.random() * 150) + '.png';
+	} else {
+		aliyunFileKey = dir + new Date().getTime() + Math.floor(Math.random() * 150) + '.mp4';
+	}
+	//图片名字 可以自行定义,     这里是采用当前的时间戳 + 150内的随机数来给图片命名的
+	// const aliyunFileKey = dir + new Date().getTime() + Math.floor(Math.random() * 150) + '.png';
+
+	const aliyunServerURL = env.uploadImageUrl; //OSS地址,需要https
+	const accessid = env.OSSAccessKeyId;
+	const policyBase64 = getPolicyBase64();
+	const signature = getSignature(policyBase64); //获取签名
+
+	uni.uploadFile({
+		url: aliyunServerURL, //开发者服务器 url
+		filePath: filePath, //要上传文件资源的路径
+		name: 'file', //必须填file
+		formData: {
+			'key': aliyunFileKey,
+			'policy': policyBase64,
+			'OSSAccessKeyId': accessid,
+			'signature': signature,
+			'success_action_status': '200',
+		},
+		success: function(res) {
 			console.log(res);
 			console.log(res);
-      if (res.statusCode != 200) {
-        failc(new Error('上传错误:' + JSON.stringify(res)))
-        return;
-      }
-       successc(aliyunServerURL+"/"+aliyunFileKey);
-    },
-    fail: function (err) {
-      err.wxaddinfo = aliyunServerURL;
-      failc(err);
-    },
-  })
+			if (res.statusCode != 200) {
+				failc(new Error('上传错误:' + JSON.stringify(res)))
+				return;
+			}
+			successc(aliyunServerURL + "/" + aliyunFileKey);
+		},
+		fail: function(err) {
+			err.wxaddinfo = aliyunServerURL;
+			failc(err);
+		},
+	})
 }
 }
 
 
-const getPolicyBase64 = function () {
-  let date = new Date();
-  date.setHours(date.getHours() + env.timeout);
-  let srcT = date.toISOString();
-  const policyText = {
-    "expiration": srcT, //设置该Policy的失效时间,超过这个失效时间之后,就没有办法通过这个policy上传文件了 
-    "conditions": [
-      ["content-length-range", 0, 5 * 1024 * 1024] // 设置上传文件的大小限制,5mb
-    ]
-  };
+const getPolicyBase64 = function() {
+	let date = new Date();
+	date.setHours(date.getHours() + env.timeout);
+	let srcT = date.toISOString();
+	const policyText = {
+		"expiration": srcT, //设置该Policy的失效时间,超过这个失效时间之后,就没有办法通过这个policy上传文件了 
+		"conditions": [
+			["content-length-range", 0, 5 * 1024 * 1024] // 设置上传文件的大小限制,5mb
+		]
+	};
 
 
-  const policyBase64 = base64.encode(JSON.stringify(policyText));
+	const policyBase64 = base64.encode(JSON.stringify(policyText));
 	console.log(policyBase64);
 	console.log(policyBase64);
-  return policyBase64;
+	return policyBase64;
 }
 }
 
 
-const getSignature = function (policyBase64) {
-  const accesskey = env.AccessKeySecret;
+const getSignature = function(policyBase64) {
+	const accesskey = env.AccessKeySecret;
 
 
-  const bytes = Crypto.HMAC(Crypto.SHA1, policyBase64, accesskey, {
-    asBytes: true
-  });
-  const signature = Crypto.util.bytesToBase64(bytes);
-console.log(signature);
-  return signature;
+	const bytes = Crypto.HMAC(Crypto.SHA1, policyBase64, accesskey, {
+		asBytes: true
+	});
+	const signature = Crypto.util.bytesToBase64(bytes);
+	// console.log(signature);
+	return signature;
 }
 }
 
 
-module.exports = uploadFile;
+module.exports = uploadFile;

+ 2 - 2
config/index.js

@@ -1,6 +1,6 @@
 const dev = {
 const dev = {
-	// baseUrlNew: 'https://apitest.eliangeyun.com',
-	baseUrlNew: 'http://192.168.1.114:8099',
+	baseUrlNew: 'https://apitest.eliangeyun.com',
+	// baseUrlNew: 'http://192.168.1.114:8099',
 	// baseUrlNew: 'http://192.168.1.116:8999',
 	// baseUrlNew: 'http://192.168.1.116:8999',
 	h5Appid: 'wxb66b599f7f61b46f',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 	debug: false

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "智运",
     "name" : "智运",
     "appid" : "__UNI__9C76CB6",
     "appid" : "__UNI__9C76CB6",
     "description" : "",
     "description" : "",
-    "versionName" : "1.0.4",
-    "versionCode" : 104,
+    "versionName" : "1.0.5",
+    "versionCode" : 105,
     "transformPx" : false,
     "transformPx" : false,
     /* 5+App特有相关 */
     /* 5+App特有相关 */
     "app-plus" : {
     "app-plus" : {

+ 42 - 14
pages/order/confirmLoading.vue

@@ -100,6 +100,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+	let that;
 	import upload from '@/components/upload.vue';
 	import upload from '@/components/upload.vue';
 	export default {
 	export default {
 		components: {
 		components: {
@@ -123,9 +124,11 @@
 				alertTitle: '',
 				alertTitle: '',
 				keyShow: false,
 				keyShow: false,
 				carNumber: '',
 				carNumber: '',
+				gjList:[]
 			}
 			}
 		},
 		},
 		onLoad(options) {
 		onLoad(options) {
+			that = this
 			debugger
 			debugger
 			// #ifdef APP-PLUS
 			// #ifdef APP-PLUS
 			this.getLngLat();
 			this.getLngLat();
@@ -203,6 +206,7 @@
 					title: '获取定位中',
 					title: '获取定位中',
 					mask: true
 					mask: true
 				})
 				})
+				console.log(123)
 				this.$helper.fUN_AmapLocation.start({
 				this.$helper.fUN_AmapLocation.start({
 						intervalTime: 1000 * 3,
 						intervalTime: 1000 * 3,
 						isReport: false,
 						isReport: false,
@@ -409,23 +413,47 @@
 								_title = '提交成功!'
 								_title = '提交成功!'
 							}
 							}
 							this.$helper.fUN_AmapLocation.start({
 							this.$helper.fUN_AmapLocation.start({
-									intervalTime: 1000 * 60,
-									isReport: true,
+									// intervalTime: 1000 * 60,
+									intervalTime: 5000,
+									// isReport: true,
 									reportInterval: 5,
 									reportInterval: 5,
-									url: 'http://192.168.0.66/fun/open/test_json.do',
-									params: {
-										a: 1,
-										B: '测试',
-										c: true
-									},
-									headers: {
-										a: '123',
-										B: 'abcd'
-									}
+									// url: 'http://192.168.0.66/fun/open/test_json.do',
+									// params: {
+									// 	a: 1,
+									// 	B: '测试',
+									// 	c: true
+									// },
+									// headers: {
+									// 	a: '123',
+									// 	B: 'abcd'
+									// }
 								},
 								},
 								res => {
 								res => {
-									//见下方定位返回示例
-									console.log('====确认装车开启连续定位====', JSON.stringify(res));
+									console.log('====确认装车开启连续定位====');
+									console.log(res)
+									let _data = {
+										orderId:that.id,
+										longitude:res.longitude,
+										 latitude:res.latitude,
+										 province:res.province,
+										 city:res.city,
+										 area:res.district
+									}
+									this.$helper.gjList.push(_data)
+									uni.setStorageSync('mapGJ',this.$helper.gjList);
+									console.log('this.$helper.gjList')
+									console.log(this.$helper.gjList)
+									if(uni.getStorageSync('mapGJ').length>100){
+										console.log(uni.getStorageSync('mapGJ'))
+										this.$request.baseRequest('post', '/vehicleTrajectoryInfo/api/addInfo', {vehicleTrajectoryInfos:uni.getStorageSync('mapGJ')}
+											).then(res => {
+												this.$helper.gjList = []
+													uni.setStorageSync('mapGJ',[]);
+											})
+											.catch(res => {
+											uni.$u.toast( res.message);
+											});
+									}
 									//判断缓存数据条数,超过reportInterval时清空缓存,重新存入缓存
 									//判断缓存数据条数,超过reportInterval时清空缓存,重新存入缓存
 								}
 								}
 							);
 							);

+ 4 - 3
pages/order/orderDetails.vue

@@ -21,7 +21,8 @@
 				</u-button>
 				</u-button>
 				<u-button class="btn" text="终止" @click="stop"  v-if="dataObj.orderStatus=='待货主确认'||dataObj.orderStatus=='未装车'"></u-button>
 				<u-button class="btn" text="终止" @click="stop"  v-if="dataObj.orderStatus=='待货主确认'||dataObj.orderStatus=='未装车'"></u-button>
 				<!-- <u-button class="btn" text="联系客服"  @click="$helper.contactCustomerService"></u-button> -->
 				<!-- <u-button class="btn" text="联系客服"  @click="$helper.contactCustomerService"></u-button> -->
-				<u-button class="btn" text="确认装车" @click="confirmLoading" v-if="dataObj.orderStatus=='未装车'&&dataObj.driverContract=='1'"></u-button>
+				<!-- <u-button class="btn" text="确认装车" @click="confirmLoading" v-if="dataObj.orderStatus=='未装车'&&dataObj.driverContract=='1'"></u-button> -->
+				<u-button class="btn" text="确认装车" @click="confirmLoading"></u-button>
 				<u-button class="btn" text="修改装车信息"  @click="confirmLoading" v-if="dataObj.orderStatus=='货主驳回装车信息'||dataObj.orderStatus=='平台驳回装车信息'"></u-button>
 				<u-button class="btn" text="修改装车信息"  @click="confirmLoading" v-if="dataObj.orderStatus=='货主驳回装车信息'||dataObj.orderStatus=='平台驳回装车信息'"></u-button>
 				<u-button class="btn" text="确认卸车" @click="confirmUnLoading" v-if="dataObj.orderStatus=='运输中'"></u-button>
 				<u-button class="btn" text="确认卸车" @click="confirmUnLoading" v-if="dataObj.orderStatus=='运输中'"></u-button>
 				<u-button class="btn" text="修改卸车信息" @click="confirmUnLoading" v-if="dataObj.orderStatus=='货主驳回卸车信息'||dataObj.orderStatus=='平台驳回卸车信息'"></u-button>
 				<u-button class="btn" text="修改卸车信息" @click="confirmUnLoading" v-if="dataObj.orderStatus=='货主驳回卸车信息'||dataObj.orderStatus=='平台驳回卸车信息'"></u-button>
@@ -278,9 +279,9 @@
 						uni.$u.toast(res.message);
 						uni.$u.toast(res.message);
 					});
 					});
 			},
 			},
-			signContract() {
+			signContract() {debugger
 				// this.lookAlert = true
 				// this.lookAlert = true
-				uni.$u.route('/pages/order/signContract', this.dataObj
+				uni.$u.route('/pages/order/signContract',{obj:JSON.stringify(this.dataObj)} 
 				);
 				);
 				
 				
 			},
 			},

+ 2 - 2
pages/order/signContract.vue

@@ -108,10 +108,10 @@
 				],
 				],
 			};
 			};
 		},
 		},
-		onLoad(options) {
+		onLoad(options) {debugger
 			that = this
 			that = this
 			console.log(options)
 			console.log(options)
-			this.dataDetails = options
+			this.dataDetails =JSON.parse(options.obj) 
 			this.dataDetails.advanceFreightService = '平台垫付运费'
 			this.dataDetails.advanceFreightService = '平台垫付运费'
 			this.ctx = uni.createCanvasContext("handWriting");
 			this.ctx = uni.createCanvasContext("handWriting");
 			this.$nextTick(() => {
 			this.$nextTick(() => {

+ 38 - 13
pages/public/login.vue

@@ -39,6 +39,7 @@
 				<view @click='gocode' style='flex:1;text-align:center;' class="Regular">验证码登录</view>
 				<view @click='gocode' style='flex:1;text-align:center;' class="Regular">验证码登录</view>
 			</view>
 			</view>
 		</view>
 		</view>
+		 <u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' confirmText='退出登录' :showCancelButton='true' confirmColor='#2772FB'  @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal>
 	</view>
 	</view>
 	</view>
 	</view>
 </template>
 </template>
@@ -65,6 +66,8 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
+				isShowAlert:false,
+				alertTitle:'当前账号已禁用',
 				isShowPassword: 'password',
 				isShowPassword: 'password',
 				inputContent: null,
 				inputContent: null,
 				loginType: "wechat",
 				loginType: "wechat",
@@ -131,6 +134,17 @@
 					this.isShowPassword = 'password'
 					this.isShowPassword = 'password'
 				}
 				}
 			},
 			},
+			cancelClick(){
+				this.isShowAlert = false
+			},
+			confirmClick(){
+				
+				if (uni.getSystemInfoSync().platform == 'ios'){
+				    plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
+				} else if (uni.getSystemInfoSync().platform == 'android'){
+				    plus.runtime.quit();
+				}
+			},
 			passlogin(e) {
 			passlogin(e) {
 				var that = this
 				var that = this
 				uni.showLoading({
 				uni.showLoading({
@@ -146,6 +160,12 @@
 						if (res.code == 200) {
 						if (res.code == 200) {
 							console.log("userInfo", res.data)
 							console.log("userInfo", res.data)
 							uni.setStorageSync('userInfo', res.data)
 							uni.setStorageSync('userInfo', res.data)
+							// if(res.data.statusFlag=='已禁用'){
+							// 	this.isShowAlert = true
+							// 	uni.hideLoading()
+							// 	return
+							// }
+							
 							that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
 							that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
 								reCommonId: this.userInfo.id,
 								reCommonId: this.userInfo.id,
 							}).then(res3 => {
 							}).then(res3 => {
@@ -172,11 +192,28 @@
 							that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
 							that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
 								driverPhone: this.phone,
 								driverPhone: this.phone,
 							}).then(res2 => {
 							}).then(res2 => {
+								if(res.data.statusFlag=='已禁用'){
+									this.isShowAlert = true
+									uni.hideLoading()
+									return
+								}
+								
 								uni.setStorageSync('pcuserInfo', res.data)
 								uni.setStorageSync('pcuserInfo', res.data)
 								uni.setStorageSync('userInfo', res.data)
 								uni.setStorageSync('userInfo', res.data)
 								uni.setStorageSync('firstAuthentication', res2.data)
 								uni.setStorageSync('firstAuthentication', res2.data)
 								helper.getListByUserId()
 								helper.getListByUserId()
 								that.$store.commit('login', res.data)
 								that.$store.commit('login', res.data)
+								var name = 'userInfo';
+								var value = res.data;
+								that.$store.commit('$uStore', {
+									name,
+									value
+								});
+								
+								uni.switchTab({
+									url: '/pages/goodSource/index'
+								});
+								uni.hideLoading()
 								// that.liangxinLogin()
 								// that.liangxinLogin()
 								uni.switchTab({
 								uni.switchTab({
 									url: '/pages/goodSource/index'
 									url: '/pages/goodSource/index'
@@ -252,19 +289,7 @@
 							// 	}
 							// 	}
 
 
 							// })
 							// })
-							that.$store.commit('login', res.data)
-							var name = 'userInfo';
-							var value = res.data;
-							that.$store.commit('$uStore', {
-								name,
-								value
-							});
-							// that.liangxinLogin()
-
-							uni.switchTab({
-								url: '/pages/goodSource/index'
-							});
-							uni.hideLoading()
+				
 						} else {
 						} else {
 							uni.hideLoading()
 							uni.hideLoading()
 							uni.showToast({
 							uni.showToast({