浏览代码

车辆服务

mym 1 年之前
父节点
当前提交
3bae37fa82
共有 1 个文件被更改,包括 129 次插入0 次删除
  1. 129 0
      pages/market/one/car/car.vue

+ 129 - 0
pages/market/one/car/car.vue

@@ -0,0 +1,129 @@
+<template>
+	<view>
+		<view class="tab">
+			<u-tabs :list="tab" :scrollable="false" itemStyle="width:200px;height:50px" lineWidth="60" @click="click"></u-tabs>
+		</view>
+		<view class="goodsList">
+			<view class="item" v-for="(item, index) in driverList" :key="index">
+				<view class="title">{{item.createTime}}</view>
+				<view class="state" v-if="item.driverResult == 0">
+					<text class="icon">&#xe830;</text>
+					<text>待确认</text>
+				</view>
+				<view class="state" v-if="item.driverResult == 1">
+					<text class="icon" style="color: #13ce66">&#xe830;</text>
+					<text>已确认</text>
+				</view>
+				<!-- <image src="../../../../../static/news.jpg" mode="aspectFill" class="pic"></image> -->
+				<view class="con">
+					<view class="productName omit" style="display: flex;">
+					<uni-icons type="location" size="24"></uni-icons>贸易地点:{{ item.tradeAreaName }}</view>
+					<view class="productName omit"  style="display: flex;">
+						<uni-icons type="circle" size="24"></uni-icons>运送货物:{{ item.goodsName }}
+					</view>
+				</view>
+				<view class="clear"></view>
+				<view class="op">
+					<view class="date">2022-12-12:12:12</view>
+					<template v-if="item.driverResult == 0">
+						<view class="an" style="color: #f44336" @click.stop="confirm(item, 2, '确认拒绝?')">拒绝接单</view>
+						<view class="an" style="color: #4581fb" @click.stop="confirm(item, 1, '确认接单?')">确认接单</view>
+					</template>
+				</view>
+			</view>
+			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
+			<u-empty v-if="!loadMore && driverList.length == 0"></u-empty>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				tab: [
+					{ name: '待确认', driverResult: 0},
+					{ name: '已确认', driverResult: 1},
+				],
+				param: { pageNo: 1, pageSize: 10},
+				loadMore: true,
+				driverList: [],
+				user:this.getUser()
+			}
+		},
+		onLoad() {
+			this.getDriverOrderList()
+		},
+		methods: {
+			// 司机查询订单 ?driverResult=
+			getDriverOrderList(){
+				this.http.request({
+					url: '/transport-server/app/TbCarRecord/getAppList',
+					loading: 'false',
+					data: this.param,
+					success: res => {
+						this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
+						if (res.data.data) {
+							this.driverList.push(...res.data.data);
+						}
+
+						this.driverList.map(item => {
+							if(item.createTime == this.util.getDate('day')){
+								item.createTime = '今天'
+							}
+						})
+					}
+				});
+			},
+			//点击tab切换
+			click(e) {
+				this.param.driverResult = e.driverResult;
+				this.getDriverOrderList()
+			},
+			//司机处理
+			confirm(item, type, content){
+				let params = {
+				  carRecordId: 0,
+				  levelOneOrderId: 0,
+				  orderNo: "",
+				  loadingAddress: "",
+				  unloadingAddress: "",
+				  comment: "",
+				  tradeAreaId: item.tradeAreaId,
+				  tradeAreaName: item.tradeAreaName,
+				  driverId: item.driverId,
+				  driverName: user.name,
+				  driverPhone: user.phone,
+				  vehicleId: item.vehicleId,
+				  vehicleName: 0,
+				  vehicleType: 0
+				}
+				uni.showModal({
+					title: '提示',
+					content: content,
+					success: res => {
+						if (res.confirm) {
+							if(type == 1){
+								this.http.request({
+									url: '/transport-server/app/TbVehicle/driverAgree',
+									data: params,
+									method: 'POST',
+									success: resp => {
+										uni.showToast({ title: '操作成功' });
+										this.refresh();
+									}
+								});
+							}else{
+								
+							}
+						}
+					}
+				});
+			}
+		}
+	}
+</script>
+
+<style>
+
+</style>