弘大卡友货运司机平台

软件说明书与技术文档 V1.0

一、产品概述

弘大卡友是汕头市弘大物流有限公司开发的货运司机专属平台,为司机提供货源匹配、运输管理、费用结算等一站式服务。

核心功能特点

二、快速入门指南

2.1 下载安装

2.2 注册认证流程

弘大卡友 - 注册界面
步骤1: 输入手机号码
步骤2: 获取短信验证码
步骤3: 设置登录密码(6-20位字符)
步骤4: 完善个人资料与证件上传
步骤5: 提交审核(1-3个工作日)

三、核心功能详解

3.1 首页界面

【司机师傅】您好!
今日可接单时长:8小时
🚚
货源大厅
📋
我的订单
💰
我的钱包
信用评分 ★★★★☆ 85分
本周完成订单:12单

3.2 订单状态流程图

1
待接单
2
已接单
3
运输中
4
已完成

四、费用结算说明

4.1 费用构成公式

总运费 = 基础运费 + 附加费用 - 平台服务费

4.2 费用明细

费用类型 说明 计算方式
基础运费 货物运输基本费用 里程数 × 单价
等待费 装货/卸货超时费用 超时时间 × 等待费率
高速费 高速公路通行费 实际发生金额
平台服务费 平台技术服务费 总运费 × 5%

一、项目源代码结构

弘大卡友_完整源代码/
driver-app/ # 司机端应用
package.json
pages/ # 页面文件(28个)
home/index.vue
order/hall.vue
order/detail.vue
wallet/index.vue
components/ # 组件库(45个)
order-list.vue
driver-card.vue
map-navigator.vue
server/ # 服务器端
src/main/java/com/hongda/
controller/ # 控制器层(32个)
OrderController.java
DriverController.java
service/ # 业务层(28个)
OrderService.java
OrderServiceImpl.java

二、核心业务逻辑代码示例

2.1 订单服务实现类 (OrderServiceImpl.java)

/** * 订单服务实现类 - 核心抢单逻辑 * @copyright 汕头市弘大物流有限公司 * @version 1.0 */ package com.hongda.logistics.service.impl; import com.hongda.logistics.dao.OrderDao; import com.hongda.logistics.dao.DriverDao; import com.hongda.logistics.model.Order; import com.hongda.logistics.model.Driver; import com.hongda.logistics.model.OrderStatus; import com.hongda.logistics.service.OrderService; import com.hongda.logistics.exception.BusinessException; import com.hongda.logistics.vo.OrderVO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.util.Date; @Service @Slf4j public class OrderServiceImpl implements OrderService { @Autowired private OrderDao orderDao; @Autowired private DriverDao driverDao; @Override @Transactional(rollbackFor = Exception.class) public OrderVO grabOrder(Long orderId, Long driverId) { // 1. 验证订单是否存在且可接单 Order order = orderDao.selectById(orderId); if (order == null) { throw new BusinessException("订单不存在"); } if (!OrderStatus.WAITING.equals(order.getStatus())) { throw new BusinessException("订单状态不可接单"); } // 2. 验证司机资质 Driver driver = driverDao.selectById(driverId); validateDriverQualification(driver, order); // 3. 执行抢单逻辑 order.setDriverId(driverId); order.setStatus(OrderStatus.ACCEPTED); order.setAcceptTime(new Date()); order.setUpdateTime(new Date()); // 4. 更新数据库 int result = orderDao.updateById(order); if (result <= 0) { throw new BusinessException("抢单失败,请重试"); } // 5. 返回结果 return convertToVO(order); } private void validateDriverQualification(Driver driver, Order order) { // 检查司机状态 if (driver.getStatus() != 1) { throw new BusinessException("司机账号异常"); } // 检查车辆类型匹配 if (!driver.getVehicleType().equals(order.getRequiredVehicleType())) { throw new BusinessException("车辆类型不匹配"); } // 检查信用分 if (driver.getCreditScore() < order.getMinCreditScore()) { throw new BusinessException("信用分不足"); } } }

2.2 前端订单列表组件 (order-list.vue)

<!-- 订单列表组件 --> <template> <view class="order-list-container"> <!-- 筛选条件 --> <view class="filter-section"> <view class="filter-item" @click="showLocationPicker"> <text>{{ filter.startCity || '出发地' }}</text> <uni-icons type="arrowdown" size="16"></uni-icons> </view> <view class="filter-item" @click="showGoodsTypePicker"> <text>{{ filter.goodsType || '货物类型' }}</text> <uni-icons type="arrowdown" size="16"></uni-icons> </view> </view> <!-- 订单列表 --> <scroll-view class="order-scroll-view" scroll-y @scrolltolower="loadMore"> <view v-for="(item, index) in orderList" :key="item.id" class="order-item" @click="goToDetail(item.id)"> <view class="order-header"> <text class="order-no">订单号: {{ item.orderNo }}</text> <text class="order-status" :class="getStatusClass(item.status)"> {{ formatStatus(item.status) }} </text> </view> <view class="price-info"> <text class="price">¥{{ formatPrice(item.totalFee) }}</text> <text class="distance">{{ item.distance }}公里</text> </view> <view class="action-buttons" v-if="item.status === 'WAITING'"> <button class="btn-grab" @click.stop="grabOrder(item.id)">立即抢单</button> </view>