浏览代码

Merge branch 'master' of http://git.zthymaoyi.com/gongdecai/wangluohuoyun-huozhuapp

achao 2 年之前
父节点
当前提交
a70fbc9e06

+ 2 - 3
components/bert-suggest/suggest.vue

@@ -2,14 +2,13 @@
 	<view>
 		<view style='background:#fff;margin:20px 10px 10px;border-radius:10px;'>
 			<uni-card class="box" :isFull="true" title="反馈意见" >
-				<textarea v-model="data.content" placeholder="您的反馈对我们非常重要,请在此输入."></textarea>
+				<textarea v-model="data.content" placeholder="您的反馈对我们非常重要,请在此输入。"></textarea>
 				<view style='position:absolute;right:22px;bottom:16px;font-size:13px;'>{{data.content.length}}/150个字</view>
 			</uni-card>
 			<uni-card class="box contact" :isFull="true" title="联系方式" >
-				<input v-model="data.contact" placeholder="请输入您的手机号,方便我们联系您" />
+				<input v-model="data.contact" placeholder="请输入您的手机号方便我们联系您" />
 			</uni-card>
 		</view>
-		
 		<button class="submit-btn" @click="submit">提交</button>
 	</view>
 </template>

+ 45 - 0
components/uni-popup/keypress.js

@@ -0,0 +1,45 @@
+// #ifdef H5
+export default {
+  name: 'Keypress',
+  props: {
+    disable: {
+      type: Boolean,
+      default: false
+    }
+  },
+  mounted () {
+    const keyNames = {
+      esc: ['Esc', 'Escape'],
+      tab: 'Tab',
+      enter: 'Enter',
+      space: [' ', 'Spacebar'],
+      up: ['Up', 'ArrowUp'],
+      left: ['Left', 'ArrowLeft'],
+      right: ['Right', 'ArrowRight'],
+      down: ['Down', 'ArrowDown'],
+      delete: ['Backspace', 'Delete', 'Del']
+    }
+    const listener = ($event) => {
+      if (this.disable) {
+        return
+      }
+      const keyName = Object.keys(keyNames).find(key => {
+        const keyName = $event.key
+        const value = keyNames[key]
+        return value === keyName || (Array.isArray(value) && value.includes(keyName))
+      })
+      if (keyName) {
+        // 避免和其他按键事件冲突
+        setTimeout(() => {
+          this.$emit(keyName, {})
+        }, 0)
+      }
+    }
+    document.addEventListener('keyup', listener)
+    this.$once('hook:beforeDestroy', () => {
+      document.removeEventListener('keyup', listener)
+    })
+  },
+	render: () => {}
+}
+// #endif

+ 22 - 0
components/uni-popup/message.js

@@ -0,0 +1,22 @@
+export default {
+	created() {
+		if (this.type === 'message') {
+			// 不显示遮罩
+			this.maskShow = false 
+			// 获取子组件对象
+			this.childrenMsg = null
+		}
+	},
+	methods: {
+		customOpen() {
+			if (this.childrenMsg) {
+				this.childrenMsg.open()
+			}
+		},
+		customClose() {
+			if (this.childrenMsg) {
+				this.childrenMsg.close()
+			}
+		}
+	}
+}

+ 50 - 0
components/uni-popup/popup.js

@@ -0,0 +1,50 @@
+import message from './message.js';
+// 定义 type 类型:弹出类型:top/bottom/center
+const config = {
+	// 顶部弹出
+	top: 'top',
+	// 底部弹出
+	bottom: 'bottom',
+	// 居中弹出
+	center: 'center',
+	// 消息提示
+	message: 'top',
+	// 对话框
+	dialog: 'center',
+	// 分享
+	share: 'bottom',
+}
+
+export default {
+	data() {
+		return {
+			config: config,
+			popupWidth: 0,
+			popupHeight: 0
+		}
+	},
+	mixins: [message],
+	computed: {
+		isDesktop() {
+			return this.popupWidth >= 500 && this.popupHeight >= 500
+		}
+	},
+	mounted() {
+		const fixSize = () => {
+			const {
+				windowWidth,
+				windowHeight,
+				windowTop
+			} = uni.getSystemInfoSync()
+			this.popupWidth = windowWidth
+			this.popupHeight = windowHeight + windowTop
+		}
+		fixSize()
+		// #ifdef H5
+		window.addEventListener('resize', fixSize)
+		this.$once('hook:beforeDestroy', () => {
+			window.removeEventListener('resize', fixSize)
+		})
+		// #endif
+	},
+}

+ 16 - 0
components/uni-popup/share.js

@@ -0,0 +1,16 @@
+export default {
+	created() {
+		if (this.type === 'share') {
+			// 关闭点击
+			this.mkclick = false
+		}
+	},
+	methods: {
+		customOpen() {
+			console.log('share 打开了');
+		},
+		customClose() {
+			console.log('share 关闭了');
+		}
+	}
+}

+ 2 - 2
config/index.js

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

+ 0 - 3
pages/mine/company/editcompany.vue

@@ -687,11 +687,8 @@
 						console.log(JSON.stringify(res.tempFilePaths));
 						uploadImage('image', res.tempFilePaths[0], 'appData/',
 							result => {
-								debugger
 								// 上传成功回调函数
 								switch (_this.uploadType) {
-
-
 									// 身份正面
 									case 1:
 										_this.dataDetails.businessLicenseAddressUrl = result

+ 89 - 36
pages/order/index.vue

@@ -184,19 +184,27 @@
 		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :confirmText='confirmText'
 			:closeOnClickOverlay='true' :showCancelButton='showCancelButton' @confirm="confirmClick"
 			@close="cancelClick" @cancel="cancelClick" class="modal">
-			<view style="margin: 0 auto;">
-				<u-radio-group v-model="radiovalue1" placement="" v-if='isShowTerminationReason'>
-				<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
-					:label="item.name" :name="item.name" @change="radioChange">
-				</u-radio>
-			</u-radio-group>
-			</view>
-			
-			<u--textarea class="row" v-model="value2" placeholder="终止原因描述" count maxlength='50'
-				v-if='isShowTerminationReason'>
-			</u--textarea>
 		</u-modal>
-
+		<u-popup :show="show" mode="bottom" @close="close" @open="open">
+			<view class="">
+				<view ><u-icon @click="closepopup" class='close' name="close" size="20"></u-icon></view>
+				
+				<view style='fon-size:34rpx;margin-bottom:20px;text-align:center;font-weight: 600;'>确认终止订单</view>
+				<view style="margin: 0 auto;">
+		           	<u-radio-group iconPlacement="right" v-model="radiovalue1" placement="" >
+		           	<u-radio  :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
+		           		:label="item.name" :name="item.name" @change="radioChange" >
+		           	</u-radio>
+		           </u-radio-group>
+		           </view>
+				   <view style='border-top:10px solid #F2F4F7;position:absolute;left:0;height:0;width:100%;'></view>
+		           <view style='padding:40rpx 0 30rpx;'>终止原因描述</view>
+		           <u--textarea class="row" v-model="value2" placeholder="终止原因描述" count maxlength='50'>
+		           </u--textarea>
+				   <view class='termination' :class="{'active':value2.length>0}" @click='termination'>终止</view>
+			</view>
+		           
+		</u-popup>
 		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
@@ -206,15 +214,20 @@
 	import {
 		mapState
 	} from 'vuex';
+	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	import {
 		apiGoods
 	} from "@/api/mock.js"
 	export default {
+		components:{
+			uniPopup
+		},
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
 				confirmText: '',
+				show:false,
 				showCancelButton: true,
 				type: null,
 				objData: {},
@@ -484,9 +497,9 @@
 				// } else {
 				// 	this.isShowTerminationReason = true
 				// }
-					this.alertTitle = '确定终止订单?'
+					// this.alertTitle = '确定终止订单?'
 				this.id = item.id
-				this.isShowAlert = true
+				this.show = true
 			},
 			init() {
 
@@ -494,6 +507,42 @@
 			del() {
 				this.isShowAlert = true
 			},
+			termination(){
+				var that=this
+				let _terminationReason = ''
+				if (this.radiovalue1 == '已与货主协商') {
+					_terminationReason = 1
+				} else if (this.radiovalue1 == '货主原因终止') {
+					_terminationReason = 2
+				} else if (this.radiovalue1 == '司机个人原因终止') {
+					_terminationReason = 3
+				} else if (this.radiovalue1 == '其他') {
+					_terminationReason = 4
+				}
+					this.$request.baseRequest('post', '/orderInfo/api/end', {
+							id: this.id,
+							terminator: 2,
+							terminationReason: _terminationReason,
+							terminationReasonDescription: this.value2
+						}).then(res => {
+							if (res.code == 200) {
+								this.show=false
+								this.$refs.uToast.show({
+									type: 'success',
+									message: '终止订单成功',
+								})
+							} else {
+								this.$refs.uToast.show({
+									type: 'success',
+									message: '终止订单失败',
+								})
+							}
+							that.mescroll.resetUpScroll()
+						})
+						.catch(res => {
+							uni.$u.toast(res.message);
+						});
+			},
 			confirmClick() {
 				var that =this
 				// // #ifdef APP-PLUS
@@ -523,6 +572,7 @@
 									type: 'success',
 									message: _title,
 									complete() {
+										that.upCallback({size: 10,num: 1})
 										that.mescroll.resetUpScroll()
 									}
 								})
@@ -536,6 +586,7 @@
 									type: 'success',
 									message: _title,
 									complete() {
+										that.upCallback({size: 10,num: 1})
 										that.mescroll.resetUpScroll()
 									}
 								})
@@ -570,28 +621,7 @@
 						.catch(res => {
 							uni.$u.toast(res.message);
 						});
-				} else {
-					this.$request.baseRequest('post', '/orderInfo/api/end', {
-							id: this.id,
-							terminator: 2,
-						}).then(res => {
-							if (res.code == 200) {
-								this.$refs.uToast.show({
-									type: 'success',
-									message: '终止订单成功',
-								})
-							} else {
-								this.$refs.uToast.show({
-									type: 'success',
-									message: '终止订单失败',
-								})
-							}
-							that.mescroll.resetUpScroll()
-						})
-						.catch(res => {
-							uni.$u.toast(res.message);
-						});
-				}
+				} 
 			},
 			cancelClick() {
 				this.isShowAlert = false
@@ -1037,4 +1067,27 @@
 		padding: 20rpx;
 		border-radius: 20rpx;
 	}
+	/deep/.u-popup__content{
+		border-radius: 10px;
+		padding:20px;
+	}
+	/deep/.u-radio{
+		margin:40rpx 0;
+	}
+	.close{
+		position:absolute;
+		right:20px;
+	}
+	.termination{
+		background:#F1F3F6;
+		color:#C5CAD4;
+		padding:10px;
+		border-radius:30px;
+		text-align: center;
+		margin-top:30rpx;
+	}
+	.termination.active{
+		background: #2772FB;
+		color: white;
+	}
 </style>

+ 13 - 5
pages/order/map.nvue

@@ -3,7 +3,7 @@
 		<map v-if="polyline[0].points.length > 0" id="myMap" :markers="markers" :polyline="polyline"
 			:latitude="polyline[0].points[0].latitude" :longitude="polyline[0].points[0].longitude"
 			style="width: 100%; height: 2000rpx" @updated="test" />
-		<view class="hcp-bottom">
+		<view v-if="polyline[0].points.length > 0" class="hcp-bottom">
 			<button v-if="startMove" @click="handleStopMove()">暂停移动</button>
 			<button v-else @click="handleStartMove()">开始移动</button>
 		</view>
@@ -65,11 +65,19 @@
 						'content-type': 'application/json' //'application/x-www-form-urlencoded; charset=UTF-8',
 					},
 					success: (res) => {
-						console.log(res.data.data,11111111)
+						console.log(res.data,11111111)
 						if(res.data.code==200){
-							if(res.data.data.longitudeLatitude){
-								console.log(JSON.parse(res.data.data.longitudeLatitude));
-								this.polyline[0].points =JSON.parse(res.data.data.longitudeLatitude)
+							if(res.data.data){
+								if(res.data.data.longitudeLatitude){
+									console.log(JSON.parse(res.data.data.longitudeLatitude));
+									this.polyline[0].points =JSON.parse(res.data.data.longitudeLatitude)
+								}
+							}else{
+								uni.showToast({
+									title: '暂无运输轨迹',
+									icon: 'none',
+									duration: 2000
+								})
 							}
 						}
 					}

+ 0 - 1
pages/order/map.vue

@@ -54,7 +54,6 @@ export default {
 		}
 	},
 	onLoad(option) {
-		debugger
 		this.id = option.id
 		this.getTrack()		//获取轨迹信息(只做演示,未进行远程请求)
 	},

+ 67 - 4
pages/order/orderDetails.vue

@@ -22,7 +22,7 @@
 				</u-button>
 				<u-button class="btn" text="接受" @click="accept(1)" v-if="dataObj.cargoOwnerStatus=='待接单'">
 				</u-button>
-				<u-button class="btn" text="终止" @click="stop()" v-if="dataObj.cargoOwnerStatus=='未装车'">
+				<u-button class="btn" text="终止" @click="clickstop()" v-if="dataObj.cargoOwnerStatus=='未装车'">
 				</u-button>
 				<u-button class="btn" text="查看合同" @click="lookContract" v-if="dataObj.cargoOwnerContract=='1'">
 				</u-button>
@@ -262,6 +262,26 @@
 				v-if='isShowTerminationReason'>
 			</u--textarea>
 		</u-modal>
+		<u-popup :show="show" mode="bottom" @close="close" @open="open">
+			<view class="">
+				<view ><u-icon @click="closepopup" class='close' name="close" size="20"></u-icon></view>
+				
+				<view style='fon-size:34rpx;margin-bottom:20px;text-align:center;font-weight: 600;'>确认终止订单</view>
+				<view style="margin: 0 auto;">
+		           	<u-radio-group iconPlacement="right" v-model="radiovalue1" placement="" >
+		           	<u-radio  :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
+		           		:label="item.name" :name="item.name" @change="radioChange" >
+		           	</u-radio>
+		           </u-radio-group>
+		           </view>
+				   <view style='border-top:10px solid #F2F4F7;position:absolute;left:0;height:0;width:100%;'></view>
+		           <view style='padding:40rpx 0 30rpx;'>终止原因描述</view>
+		           <u--textarea class="row" v-model="value2" placeholder="终止原因描述" count maxlength='50'>
+		           </u--textarea>
+				   <view class='termination' :class="{'active':value2.length>0}" @click='termination'>终止</view>
+			</view>
+		           
+		</u-popup>
 		<u-toast ref="uToast"></u-toast>
 		<!-- 		<view v-if="lookAlert" class="look-contract" @click="lookAlert==false">
 			<u-button class="btn" text="查看合同" @click="lookContract"></u-button>
@@ -293,8 +313,12 @@
 
 <script>
 	var that;
+	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import uploadImage from '@/components/ossutil/uploadFile.js';
 	export default {
+		components:{
+			uniPopup
+		},
 		data() {
 			return {
 				cyinfoStatus: '未装车',
@@ -309,6 +333,7 @@
 				status2: false,
 				status3: false,
 				id: '',
+				show:false,
 				value2: '',
 				radiolist1: [{
 						name: '已与货主协商',
@@ -600,7 +625,10 @@
 						.catch(res => {
 							uni.$u.toast(res.message);
 						});
-				} else {
+				} 
+			},
+			termination(){
+				var that=this
 					if (this.radiovalue1 == '其他' && !this.value2) {
 						this.$refs.uToast.show({
 							type: 'error',
@@ -621,8 +649,11 @@
 					this.$request.baseRequest('post', '/orderInfo/api/end', {
 							id: this.id,
 							terminator: 2,
+							terminationReason: _terminationReason,
+							terminationReasonDescription: this.value2
 						}).then(res => {
 							if (res.code == 200) {
+								that.show=false
 								this.$refs.uToast.show({
 									type: 'success',
 									message: '终止订单成功',
@@ -633,12 +664,10 @@
 									message: '终止订单失败',
 								})
 							}
-							that.mescroll.resetUpScroll()
 						})
 						.catch(res => {
 							uni.$u.toast(res.message);
 						});
-				}
 			},
 			cancelClick() {
 				this.isShowAlert = false
@@ -654,6 +683,17 @@
 				this.id = item.id
 				this.isShowAlert = true
 			},
+			clickstop(){
+				let item = this.dataObj
+				// 货主接单
+				if (item.cargoOwnerStatusKey == 1) {
+					this.isShowTerminationReason = false
+				} else {
+					this.isShowTerminationReason = true
+				}
+				this.id = item.id
+				this.show = true
+			},
 			toPhone() {
 				var that=this
 				uni.makePhoneCall({
@@ -1066,4 +1106,27 @@
 		top: 120rpx;
 		left: 10rpx;
 	}
+	/deep/.u-popup__content{
+		border-radius: 10px;
+		padding:20px;
+	}
+	/deep/.u-radio{
+		margin:40rpx 0;
+	}
+	.close{
+		position:absolute;
+		right:20px;
+	}
+	.termination{
+		background:#F1F3F6;
+		color:#C5CAD4;
+		padding:10px;
+		border-radius:30px;
+		text-align: center;
+		margin-top:30rpx;
+	}
+	.termination.active{
+		background: #2772FB;
+		color: white;
+	}
 </style>

+ 44 - 0
pages/release/release.vue

@@ -20,6 +20,7 @@
 		</view> -->
 		<view class="content1">
 			<view class="row" @click="selectCargoOwner">
+
 				<view class="left select-sf" :class='dataObj.cargoOwner?"":"select-sf1"'>{{dataObj.cargoOwner?dataObj.cargoOwner:'选择货主身份'}}</view>
 				<view class="right"><image src="../../static/right.png" style="width: 22rpx;height: 22rpx;margin-top:14rpx;"></image></view>
 			</view>
@@ -73,6 +74,10 @@
 				{{dataObj.distance }}
 				km
 			</view>
+			<view class="row">
+				<view class="left">货物类别</view>
+				<view class="right" @click="goodstypeChange">{{dataObj.goodsType?dataObj.goodsType:"请选择货物类别"}}</view>
+			</view>
 			<view class="row">
 				<view class="left">货名</view>
 				<view class="right"><input type="text" class="input" value="" placeholder="输入货物名称"
@@ -229,6 +234,10 @@
 		<u-picker :show="isShowValidity" ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
 			:closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
 		</u-picker>
+		<!-- //货物类别 -->
+		<u-picker :show="isGoodsType" ref="uPicker" :columns="goodsList" keyName="constValue" @confirm="goodsSubmit"
+			:closeOnClickOverlay='true' @close='isGoodsType=false' @cancel='isGoodsType=false'>
+		</u-picker>
 		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='false'
 			:showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
 			@cancel="cancelClick"></u-modal>
@@ -334,6 +343,9 @@
 					},
 
 				],
+				// 货物类别
+				isGoodsType:false,
+				goodsList:[]
 			}
 		},
 		onNavigationBarButtonTap(e) {
@@ -374,6 +386,7 @@
 						title: '身份信息审核中',
 						icon: 'none'
 					})
+
 				} else if (_obj.authenticationStatus == '已过期') {
 					this.alertTitle = '身份信息已过期!'
 					this.showCancelButton = false
@@ -425,8 +438,17 @@
 			this.dataObj.loadingDateEnd = '随时'
 			this.dataObj.taskValidity = '长期'
 			this.getSFList()
+			
 		},
 		async onLoad() {
+			//货物类别(默认上一次)
+			this.queryGoodsList() // 查询货物类别
+			let goods = uni.getStorageSync("goodsType")
+			if(goods){
+				this.dataObj.goodsType = goods.name
+				this.dataObj.goodsTypeKey = goods.key
+			}
+			
 
 			// _this = this
 			// // #ifdef APP-PLUS
@@ -452,6 +474,27 @@
 			...mapState(['hasLogin', 'userInfo']),
 		},
 		methods: {
+			queryGoodsList(){
+				this.$request.baseRequest('get', '/commonSysParameter/getInfo', {
+						constId: "CON1"
+					}).then(res => {
+						this.goodsList.push(res.data)
+						console.log(this.goodsList)
+					})
+			},
+			goodstypeChange(){
+				this.isGoodsType = true
+			},
+			goodsSubmit(e){
+				this.dataObj.goodsType = e.value[0].constValue
+				this.dataObj.goodsTypeKey = e.value[0].constKey
+				let _obj={
+					name:e.value[0].constValue,
+					key:e.value[0].constKey
+				}
+				uni.setStorageSync("goodsType",_obj)
+				this.isGoodsType = false
+			},
 			getSFList() {
 				this.dataObj.commonId = this.userInfo.id
 				this.$request.baseRequest('get', '/cargoOwnerCompInfo/cargoOwnerList', {
@@ -778,6 +821,7 @@
 								// uni.$u.route("/pages/release/record")
 							}
 						})
+						this.isShowAlert = false
 
 					})
 					.catch(res => {

+ 18 - 7
util/request.js

@@ -21,15 +21,26 @@ const baseRequest = (method, url, data,header) => {
 			uni.request(baseDefaultOpts).then(
 				(res) => {
 					// console.log(JSON.stringify(res[1].data))
-					if(res[1].data.code == '200' || res[1].data.code == 200){
-						// 后端返回的状态码100为成功状态,成功则返回请求结果,在app调试时可以通过console.log(JSON.stringify(res[1].data))来查看返回值(以项目实际情况为准)
-						resolve(res[1].data)
+					// if(res[1].data.code == '200' || res[1].data.code == 200){
+					// 	// 后端返回的状态码100为成功状态,成功则返回请求结果,在app调试时可以通过console.log(JSON.stringify(res[1].data))来查看返回值(以项目实际情况为准)
+					// 	resolve(res[1].data)
+					// }else{
+					// 	uni.showToast({
+					// 		icon:'none',
+					// 	    title: res[1].data.message,
+					// 	    duration: 2000 
+					// 	}); 
+					// }
+					if(res[1]){
+						if(res[1].data.code == '200' || res[1].data.code == 200){
+							resolve(res[1].data)
+						}
 					}else{
 						uni.showToast({
-							icon:'none',
-						    title: res[1].data.message,
-						    duration: 2000 
-						}); 
+								icon:'none',
+							    title: '网络异常,请检查网络状况',
+							    duration: 2000 
+							}); 
 					}
 					// // 登录失败
 					// if(res[1].data.code == '11006' || res[1].data.code == 11006){