gjy 2 years ago
parent
commit
0c02632b5a

+ 20 - 4
pages/order/confirmLoading.vue

@@ -141,10 +141,13 @@
 			}
 		},
 		onLoad(options) {
-			this.id = JSON.parse(decodeURIComponent(options.obj)).id
-			this.detailData.hyCarrierInfo.id = JSON.parse(decodeURIComponent(options.obj)).carrierId
-			this.cyId = JSON.parse(decodeURIComponent(options.obj)).carrierId
-			this.getInfo()
+			if(!uni.getStorageSync('contractdata')){
+				this.id = JSON.parse(decodeURIComponent(options.obj)).id
+				this.detailData.hyCarrierInfo.id = JSON.parse(decodeURIComponent(options.obj)).carrierId
+				this.cyId = JSON.parse(decodeURIComponent(options.obj)).carrierId
+				this.getInfo()
+			}
+			
 			
 			console.log(options)
 			
@@ -153,6 +156,18 @@
 			// console.log(this.detailData)
 			// CYHT20220317000001
 		},
+		onHide() {
+			uni.removeStorageSync(
+				"contractdata")
+		},
+		onShow(){
+			if(uni.getStorageSync('contractdata')){
+				this.id = uni.getStorageSync('contractdata').id
+				this.detailData.hyCarrierInfo.id = uni.getStorageSync('contractdata').carrierId
+				this.cyId = uni.getStorageSync('contractdata').carrierId
+				this.getInfo()
+			}
+		},
 		methods: {
 			//确认装车提交成功后,开启实时定位,
 			// 调接口5分钟一次发送轨迹,[
@@ -558,6 +573,7 @@
 				}
 			},
 			confirmClick() {
+				uni.removeStorageSync('contractdata')
 				var that=this
 				this.isShowAlert = false
 				//1暂存

+ 21 - 1
pages/order/confirmUnloading.vue

@@ -87,7 +87,7 @@
 		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
 			:showCancelButton='true' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
 			@cancel="cancelClick"></u-modal>
-		<u-picker :show="isShowValidity" ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
+		<u-picker :show="isShowValidity" :defaultIndex='defaultIndex' ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
 			:closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
 		</u-picker>
 		<u-toast ref="uToast"></u-toast>
@@ -112,6 +112,7 @@
 					hyCarrierInfo:{},
 					totalFreight:''
 				},
+				defaultIndex:[],
 				action: this.$helper.ossUploadUrl,
 				maxSize: 50 * 1024 * 1024, //限制文件大小 50M
 				isAdd: true,
@@ -188,6 +189,25 @@
 				month = month + 1;
 				month = month.toString().padStart(2, "0");
 				date = date.toString().padStart(2, "0");
+				this.defaultIndex=[]
+				console.log(this.validityPeriod)
+				for(var i=0;i<this.validityPeriod[0].length;i++){
+					if(this.validityPeriod[0][i]==year){
+						console.log(this.validityPeriod[0][i])
+						this.defaultIndex.push(i)
+					}
+				}
+				for(var i=0;i<this.validityPeriod[1].length;i++){
+					if(this.validityPeriod[1][i]==month){
+						this.defaultIndex.push(i)
+					}
+				}
+				for(var i=0;i<this.validityPeriod[2].length;i++){
+					if(this.validityPeriod[2][i]==date){
+						this.defaultIndex.push(i)
+					}
+				}
+				console.log(this.defaultIndex)
 				let defaultDate = `${year}-${month}-${date}`
 				this.detailData.carrierInfo.unloadingDate = defaultDate
 				// this.$forceUpdate()

+ 4 - 1
pages/order/orderDetails.vue

@@ -201,9 +201,12 @@
 				<view class=" gray">运费尾款</view>
 				<view class="">{{freightInfo.freightBalance?freightInfo.freightBalance:'未支付'}}</view>
 			</view>
+			<view class='flex flex-end'>
+				<view class="">{{freightInfo.freightBalanceDate}}</view>
+			</view>
 			<view class='row-between mx ' v-if="freightInfo.freightBalance">
 				<!-- 明细:预付{{freightInfo.prepaidFreight}}元,服务费{{freightInfo.driverServiceCharge}}元,尾款{{freightInfo.freightBalance}}元,合计收款{{freightInfo.totalCollection}}元。 -->
-			明细:预付{{freightInfo.prepaidFreight}}元,工本费{{freightInfo.driverServiceCharge}}元,尾款{{freightInfo.freightBalance}}元,合计收款{{freightInfo.totalCollection}}元。
+			明细:预付{{freightInfo.prepaidFreight}}元,尾款{{freightInfo.freightBalance}}元,合计收款{{freightInfo.totalCollection}}元。
 			</view>
 		</view>
 		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :confirmText='confirmText'

+ 40 - 25
pages/order/signContract.vue

@@ -231,6 +231,7 @@
 		computed: {
 			...mapState(['hasLogin', 'userInfo', 'firstAuthentication']),
 		},
+		
 		onShow() {
 			let payInfo = uni.getStorageSync("payInfo")
 			if (payInfo) {
@@ -251,26 +252,7 @@
 
 				})
 			}
-			this.$request.baseRequest('get', '/commonUser/getSignatureAddress', {
-				phone: this.userInfo.phone,
-				identification: 1
-			}).then(res => {
-				if (res.data) {
-					if (res.data.signImg) {
-						// 获取远程图片,canvas无法直接绘制远程图片
-						this.userInfo.signImg = res.data.signImg
-						uni.getImageInfo({
-							src: res.data.signImg,
-							success(res) {
-								var ctx = uni.createCanvasContext('handWriting')
-								ctx.drawImage(res.path, 0, 0, 330, 244)
-								ctx.save()
-								ctx.draw()
-							}
-						})
-					}
-				}
-			})
+			
 			console.log(this.dataDetails)
 			if (this.dataDetails.carNumber) {
 				this.$set(this.dataDetails.carrierInfo, 'carNo', this.dataDetails.carNumber)
@@ -316,8 +298,37 @@
 						this.canvasHeight = rect.height;
 						/* 将canvas背景设置为 白底,不设置  导出的canvas的背景为透明 */
 						this.setCanvasBg('#fff');
+						this.$request.baseRequest('get', '/commonUser/getSignatureAddress', {
+							phone: this.userInfo.phone,
+							identification: 1
+						}).then(res => {
+							if (res.data) {
+								if (res.data.signImg) {
+									// 获取远程图片,canvas无法直接绘制远程图片
+									this.userInfo.signImg = res.data.signImg
+									uni.getImageInfo({
+										src: res.data.signImg,
+										success(res) {
+											var ctx = uni.createCanvasContext('handWriting')
+											ctx.drawImage(res.path, 0, 0, 330, 244)
+											ctx.save()
+											ctx.draw()
+										},
+										fail(res) {
+											console.log("fail -> res", res)
+											uni.showToast({
+												title: "图片下载异常",
+												duration: 2000,
+												icon: "none"
+											})
+										}
+									})
+								}
+							}
+						})
 					})
 					.exec();
+					
 			});
 			uni.showLoading({
 				title: '加载中'
@@ -551,11 +562,15 @@
 														complete() {
 															uni.removeStorageSync(
 																"payInfo") //如果要有银行卡缓存就删除
-															uni.$u.route(
-															'/pages/order/confirmLoading', {
-																obj: JSON.stringify(that
-																	.dataDetails),
-															});
+															// uni.$u.route(
+															// '/pages/order/confirmLoading', {
+															// 	obj: JSON.stringify(that
+															// 		.dataDetails),
+															// });
+															uni.setStorageSync('contractdata',that.dataDetails)
+															uni.navigateBack({
+																delta:1
+															})
 															// that.upCallback({
 															// 	size: 10,
 															// 	num: 1