Browse Source

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

zhongtianhaoyuan 3 years ago
parent
commit
63410c2506

+ 1 - 1
components/ossutil/uploadFile.js

@@ -12,7 +12,7 @@ const Crypto = require('./crypto.js');
  *@param - successc:成功回调
  *@param - failc:失败回调
  */
-const uploadFile = function(type, filePath, dir, successc, failc) {debugger
+const uploadFile = function(type, filePath, dir, successc, failc) {
 	console.log('type', type)
 	if (!filePath || filePath.length < 9) {
 		uni.showModal({

+ 2 - 2
config/index.js

@@ -1,6 +1,6 @@
 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',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 6 - 0
pages/news/index.vue

@@ -137,6 +137,9 @@
 				}
 				// #endif
 			},
+			cancelClick(){
+				this.isShowAlert = false
+			},
 			rightClick() {
 				uni.showLoading({
 					title: '加载中',
@@ -230,6 +233,9 @@
 						pageSize: page.size,
 						currentPage: page.num,
 					}).then(res => {
+						if(page.num == 1){
+							this.news = []; //追加新数据
+						}
 						this.news = this.news.concat(res.data.records); //追加新数据
 						this.mescroll.endBySize(res.data.records.length, res.data.total);
 					})

+ 2 - 2
pages/order/index.vue

@@ -103,7 +103,7 @@
 						</view>
 						<view class="flex align-center">
 							<view style="margin-right: 20rpx;">运距 {{good.distance}}km</view>
-							<view class="car">{{good.freight}}{{good.illingMethod==0?'元/吨':'元/车'}}</view>
+							<view class="car">{{good.freightInfo.freight}}{{good.illingMethod==0?'元/吨':'元/车'}}</view>
 						</view>
 						<!-- 		<view class="right">
 							<view class="flex fontsize-26 row">
@@ -147,7 +147,7 @@
 						<view class="normal" @click.stop="stop(good)"
 							v-if="good.cargoOwnerStatus=='待还款'||good.cargoOwnerStatus=='已还款'">还款</view>
 
-						<view class="start normal" @click.stop="addevaluation(good)">评价</view>
+						<view class="start normal" @click.stop="addevaluation(good)"  v-if="good.cargoOwnerStatus=='已完结'">评价</view>
 					</view>
 				</view>
 			</view>

+ 23 - 36
pages/order/orderDetails.vue

@@ -24,7 +24,7 @@
 				</u-button>
 				<u-button class="btn" text="终止" @click="stop()" v-if="dataObj.cargoOwnerStatus=='未装车'">
 				</u-button>
-				<u-button class="btn" text="查看合同" @click="lookContract"></u-button>
+				<u-button class="btn" text="查看合同" @click="lookContract" v-if="dataObj.cargoOwnerContract=='1'"></u-button>
 				<u-button class="btn" text="签订合同" @click="signContract"
 					v-if="dataObj.cargoOwnerStatus=='待确认装车'&&dataObj.cargoOwnerContract!='1'">
 				</u-button>
@@ -34,7 +34,7 @@
 		<!-- 		<u-button class="btn" text="确认装车" @click="confirmLoading(3)"
 					v-if="dataObj.cargoOwnerStatus=='待确认装车'&&dataObj.cargoOwnerContract=='1'">
 				</u-button> -->
-				<u-button class="btn" text="确认装车" @click="confirmLoading(3)">
+				<u-button class="btn" text="确认装车" @click="confirmLoading(3)" v-if="dataObj.cargoOwnerStatus=='待确认装车'">
 				</u-button>
 				
 				<u-button class="btn" text="驳回卸车信息" @click="confirmUnLoading" v-if="dataObj.cargoOwnerStatus=='待收货'">
@@ -352,43 +352,23 @@
 				});
 			},
 			lookContract() {
-				this.$request.baseRequest('get', '/orderInfo/setPdf', {}).then(res => {
-						if (res.code == 200) {
-							debugger
-							this.contractSrc = res.data
-							uni.downloadFile({
-								url: res.data,
-								success: function(res) {
-									var filePath = res.tempFilePath;
-									uni.openDocument({
-							 		filePath: filePath,
-							  	showMenu: true,
-							  	success: function(res) {
-							  		console.log('打开文档成功');
-										}
-									});
-								}
-							});
-							// this.$refs.uToast.show({
-							// 	type: 'success',
-							// 	message: "提交成功",
-							// 	complete() {
-							// 		that.upCallback({
-							// 			size: 10,
-							// 			num: 1
-							// 		})
-							// 	}
-							// })
-
-						}
-					})
-					.catch(res => {
-						uni.$u.toast(res.message);
-					});
+				uni.downloadFile({
+					url: this.dataObj.ownerContractUrl,
+					success: function(res) {
+						var filePath = res.tempFilePath;
+						uni.openDocument({
+				 		filePath: filePath,
+				  	showMenu: true,
+				  	success: function(res) {
+				  		console.log('打开文档成功');
+							}
+						});
+					}
+				});
 			},
 			signContract() {
 				// this.lookAlert = true
-				uni.$u.route('/pages/order/signContract', this.dataObj);
+				uni.$u.route('/pages/order/signContract',{obj:JSON.stringify(this.dataObj)});
 
 			},
 			// 完结
@@ -432,6 +412,13 @@
 			},
 			confirmLoading(type) {
 				debugger
+				if(this.dataObj.cargoOwnerContract!='1'){
+					uni.showToast({
+						title:'请先签订合同',
+						icon:'none'
+					})
+					return
+				}
 				this.type = type
 				if (type == 3) {
 					this.alertTitle = '确认装车?'

+ 48 - 39
pages/order/signContract.vue

@@ -1,20 +1,20 @@
 <template>
 	<view class="content">
-		<view class="content1">
-			<view style='width:70px'>付款方式</view>
+		<!-- <view class="content1"> -->
+		<!-- 	<view style='width:70px'>付款方式</view>
 			<u-radio-group v-model="dataDetails.advanceFreightService" placement="row">
 				<u-radio :customStyle="radioCustomStyle" v-for="(item, index) in radiolist1" :key="index"
 					:label="item.name" :name="item.name" @change="radioChange">
 				</u-radio>
-			</u-radio-group>
-			<!-- 		<view class="left">
+			</u-radio-group> -->
+		<!-- 		<view class="left">
 				付款方式
 			</view>
 			<view class="right">
 				<view class="left-text">平台垫付运费</view>
 					<u-switch @change="change" v-model="value" inactiveColor='#ABB0BB' size="20" ></u-switch>
 			</view> -->
-		</view>
+		<!-- </view> -->
 		<view class="content2">
 			<view class="title">
 				合同摘要
@@ -45,7 +45,7 @@
 			</view>
 			<view class='row-between'>
 				<view class="gray">运费</view>
-				<view class="">{{dataDetails.freight}}{{dataDetails.illingMethod==0?'元/吨':'元/车'}}</view>
+				<view class="">{{dataDetails.freightInfo.freight}}{{dataDetails.illingMethod==0?'元/吨':'元/车'}}</view>
 				<!-- 				<view class="flex"><input type="text" placeholder="请输入运费" v-model="dataDetails.freight"
 						class="text-align-right yf-input">{{dataDetails.freight}}元/车</view> -->
 			</view>
@@ -117,8 +117,8 @@
 		onLoad(options) {
 			that = this
 			console.log(options)
-			this.dataDetails = options
-			this.dataDetails.advanceFreightService = '平台垫付运费'
+			this.dataDetails = JSON.parse(decodeURIComponent(options.obj))
+			// this.dataDetails.advanceFreightService = '平台垫付运费'
 			this.ctx = uni.createCanvasContext("handWriting");
 			this.$nextTick(() => {
 				uni.createSelectorQuery().select('.handCenter').boundingClientRect(rect => {
@@ -163,37 +163,46 @@
 									title: '加载中',
 									mask: true
 								})
-
-								that.$request.baseRequest('get', '/orderInfo/setPdf', that.dataDetails).then(res => {
-										if (res.code == 200) {
-											debugger
-											// that.contractSrc = res.data
-											// uni.downloadFile({
-											// 	url: res.data,
-											// 	success: function(res) {
-											// 		var filePath = res.tempFilePath;
-											// 		uni.openDocument({
-								   //  		filePath: filePath,
-											// 			showMenu: true,
-								   // 			success: function(res) {
-											// 				console.log('打开文档成功');
-											// 			}
-											// 		});
-											// 	}
-											// });
-											// this.$refs.uToast.show({
-											// 	type: 'success',
-											// 	message: "提交成功",
-											// 	complete() {
-											// 		that.upCallback({
-											// 			size: 10,
-											// 			num: 1
-											// 		})
-											// 	}
-											// })
-
-										}
-									})
+								let _obj = {}
+								_obj.id = that.dataDetails.id
+								_obj.typeFlag = 1
+								_obj.cargoOwnerAutograph = that.dataDetails.cargoOwnerAutograph
+								debugger
+								that.$request.baseRequest('get', '/orderInfo/setPdf', _obj).then(
+										res => {
+											uni.hideLoading()
+											uni.navigateBack({
+												delta:1
+											})
+											if (res.code == 200) {
+												debugger
+												// that.contractSrc = res.data
+												// uni.downloadFile({
+												// 	url: res.data,
+												// 	success: function(res) {
+												// 		var filePath = res.tempFilePath;
+												// 		uni.openDocument({
+												//  		filePath: filePath,
+												// 			showMenu: true,
+												// 			success: function(res) {
+												// 				console.log('打开文档成功');
+												// 			}
+												// 		});
+												// 	}
+												// });
+												// this.$refs.uToast.show({
+												// 	type: 'success',
+												// 	message: "提交成功",
+												// 	complete() {
+												// 		that.upCallback({
+												// 			size: 10,
+												// 			num: 1
+												// 		})
+												// 	}
+												// })
+
+											}
+										})
 									.catch(res => {
 										uni.$u.toast(res.message);
 									});

+ 4 - 1
pages/release/addAddress.vue

@@ -86,7 +86,10 @@
 									type: 'success',
 									message: "提交成功",
 									complete() {
-										uni.$u.route('/pages/release/selectAddress');
+										// uni.$u.route('/pages/release/selectAddress');
+										uni.navigateBack({
+											delta:1
+										})
 									}
 								})
 

+ 4 - 1
pages/release/editAddress.vue

@@ -86,7 +86,10 @@
 									type: 'success',
 									message: "提交成功",
 									complete() {
-										uni.$u.route('/pages/release/selectAddress');
+										// uni.$u.route('/pages/release/selectAddress');
+										uni.navigateBack({
+											delta:1
+										})
 									}
 								})
 

+ 47 - 32
pages/release/release.vue

@@ -1,6 +1,13 @@
 <template>
 	<view class="content">
-		<view class="fixed1"></view>
+		<u-navbar  title="发布" :placeholder="true" rightText="记录" @rightClick="goToRecord" @leftClick="back()">
+			<!-- view class="u-nav-slot" slot="left">
+				<u-icon name="arrow-left" size="19"></u-icon>
+				<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
+				<u-icon name="home" size="20"></u-icon>
+			</view> -->
+		</u-navbar>
+		<!-- <view class="fixed1"></view>
 		<view class='title top-title flex'>
 			<u-icon class="back" name="arrow-left" color="" size="20" @click="back"></u-icon>
 			<view class="nav-title">发布</view>
@@ -10,7 +17,7 @@
 					记录
 				</view>
 			</view>
-		</view>
+		</view> -->
 		<view class="content1">
 			<view class="row" @click="selectCargoOwner">
 				<view class="left select-sf">{{dataObj.cargoOwner?dataObj.cargoOwner:'选择货主身份'}}</view>
@@ -27,7 +34,7 @@
 			<view class="row1">
 				<view class="left">
 					<view class="top" @click="selectAddress(0)">
-						<view class="send"></view>
+						<view class="send"></view>
 						<view class="title">
 							{{dataObj.sendArea?(dataObj.sendPrivate + dataObj.sendCity+dataObj.sendArea):'选择发货地区'}}
 						</view>
@@ -220,7 +227,7 @@
 	export default {
 		data() {
 			return {
-				showCancelButton:true,
+				showCancelButton: true,
 				qyList: [],
 				isShowAlert: false,
 				alertTitle: '确定发布运输任务?',
@@ -341,7 +348,7 @@
 				this.isShowAlert = true
 				this.alertTitle = '账号审核中'
 				this.confirmText = '退出APP'
-				this.showCancelButton=false
+				this.showCancelButton = false
 				return
 			} else {
 				console.log(1231233212332312312213)
@@ -352,7 +359,7 @@
 			let _faddress = uni.getStorageSync('storage_faddress');
 			let _saddress = uni.getStorageSync('storage_saddress');
 			if (_faddress) {
-			
+
 				this.dataObj.sendCity = _faddress.city
 				this.dataObj.sendArea = _faddress.area
 				this.dataObj.sendPrivate = _faddress.province
@@ -378,20 +385,22 @@
 			}
 			if (this.dataObj.sendLatitude && this.dataObj.sendLongitude && this.dataObj.unsendLatitude && this.dataObj
 				.unsendLongitude) {
-				this.dataObj.distance = this.$helper.getDistance(this.dataObj.unsendLatitude, this.dataObj.unsendLongitude,
+				this.dataObj.distance = this.$helper.getDistance(this.dataObj.unsendLatitude, this.dataObj
+					.unsendLongitude,
 					this.dataObj.sendLatitude, this.dataObj.sendLongitude)
 			}
 			this.dataObj.loadingDateStart = '随时'
 			this.dataObj.loadingDateEnd = '随时'
 			this.dataObj.taskValidity = '长期'
-			
-			
+
+
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo']),
 		},
 		methods: {
-			getSFList() {debugger
+			getSFList() {
+				debugger
 				this.dataObj.commonId = this.userInfo.id
 				this.$request.baseRequest('get', '/cargoOwnerCompInfo/cargoOwnerList', {
 						commonId: this.userInfo.id
@@ -405,7 +414,7 @@
 						let _self = res.data.companyInfoList
 						//代理货主
 						let _dlhz = res.data.cargoOwnerCompInfoList
-						if(!_dlhz) _dlhz=[]
+						if (!_dlhz) _dlhz = []
 						for (let i = 0; i < _self.length; i++) {
 							if (_self[i].status == '已认证') {
 								this.qyList.push(_self[i])
@@ -575,18 +584,18 @@
 
 			},
 			confirmClick() {
-							// #ifdef APP-PLUS
-								if (this.alertTitle == '账号审核中') {
-									if (uni.getSystemInfoSync().platform == 'ios') {
-										plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
-									} else if (uni.getSystemInfoSync().platform == 'android') {
-										plus.runtime.quit();
-									}
-									return
-								}
-								// #endif
+				// #ifdef APP-PLUS
+				if (this.alertTitle == '账号审核中') {
+					if (uni.getSystemInfoSync().platform == 'ios') {
+						plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
+					} else if (uni.getSystemInfoSync().platform == 'android') {
+						plus.runtime.quit();
+					}
+					return
+				}
+				// #endif
 				this.isShowAlert = false
-				
+
 				if (this.dataObj.billingMethod == '元/吨') {
 					this.dataObj.billingMethod = 0
 				} else {
@@ -617,7 +626,7 @@
 							type: 'success',
 							message: "发布成功",
 							complete() {
-								
+
 								_this.dataObj = {
 									commonId: '',
 									cargoOwner: '',
@@ -688,6 +697,8 @@
 								this.dataObj.sendDetailedAddress = res.data[i].detailedAddress
 								this.dataObj.sendLongitude = res.data[i].longitude
 								this.dataObj.sendLatitude = res.data[i].latitude
+								this.dataObj.sender = res.data[i].contacts
+								this.dataObj.senderPhone = res.data[i].contactPhone
 							}
 							if (res.data[i].defaultReceipt == 1 && type == 1) {
 								this.dataObj.unloadDetailedAddress = res.data[i].detailedAddress
@@ -696,6 +707,8 @@
 								this.dataObj.unloadPrivate = res.data[i].province
 								this.dataObj.unsendLongitude = res.data[i].longitude
 								this.dataObj.unsendLatitude = res.data[i].latitude
+								this.dataObj.receiver = res.data[i].contacts
+								this.dataObj.receiverPhone = res.data[i].contactPhone
 							}
 						}
 						if (this.dataObj.sendLatitude && this.dataObj.sendLongitude && this.dataObj.unsendLatitude &&
@@ -845,8 +858,8 @@
 			submit() {
 				if (this.validate()) return
 				this.isShowAlert = true;
-				
-				
+
+
 			},
 		}
 	}
@@ -893,7 +906,7 @@
 
 	.content1 {
 		background: white;
-		margin: 100rpx 20rpx 0 20rpx;
+		margin: 40rpx 20rpx 0 20rpx;
 		border-radius: 20rpx;
 		padding: 40rpx;
 
@@ -935,15 +948,17 @@
 		display: flex;
 		justify-content: flex-end;
 	}
-	.top-title{
-		background:#fff;
-		padding:20rpx;
+
+	.top-title {
+		background: #fff;
+		padding: 20rpx;
 		position: fixed;
-		z-index:100;
-		top:0;
+		z-index: 100;
+		top: 0;
 		box-sizing: border-box;
-		width:100%;
+		width: 100%;
 	}
+
 	.content2 {
 		padding: 40rpx;
 

+ 7 - 5
pages/release/selectAddress.vue

@@ -68,8 +68,10 @@
 				radiovalue: '',
 				dataList: [],
 				searchKeyWord: '',
-				radiolist1: [{
-						name: '默认收货',
+				radiolist1: [
+					
+					{
+						name: '默认装货',
 						disabled: false
 					},
 					{
@@ -113,10 +115,10 @@
 							this.dataList = res.data.records
 							for (let i = 0; i < this.dataList.length; i++) {
 								if (this.dataList[i].defaultShipment == 1) {
-									this.dataList[i].radiovalue = '默认货'
+									this.dataList[i].radiovalue = '默认货'
 								}
 								if (this.dataList[i].defaultReceipt == 1) {
-									this.dataList[i].radiovalue = '默认货'
+									this.dataList[i].radiovalue = '默认货'
 								}
 							}
 							uni.hideLoading()
@@ -135,7 +137,7 @@
 				console.log('radioChange', n);
 				console.log('radioChange', val);
 				let _flag;
-				if (n == '默认货') {
+				if (n == '默认货') {
 					_flag = 2
 				} else {
 					_flag = 1