13 Commits

Author SHA1 Message Date
ee8fdb16c4 task#6524 添加刷新按钮 2025-06-20 11:44:51 +08:00
7ff13628b5 task#6524 滚动测试 2025-06-20 10:36:02 +08:00
eae60d1000 task#6524 修改地址 2025-06-20 10:20:57 +08:00
3a1e4a6ae2 task#6524 滚动问题 2025-06-20 10:19:45 +08:00
5bd9db3165 task#6524 颜色兼容 2025-06-20 10:10:21 +08:00
fbce498e94 task#6524 头部颜色兼容 2025-06-20 09:49:18 +08:00
6ab2e0b1d7 task#6524 头部兼容 2025-06-20 09:41:40 +08:00
001683f215 task#6524 下拉刷新 2025-06-19 20:32:16 +08:00
bb13a6e34e task#6524 获取定位城市,时间默认当前 2025-06-19 19:55:32 +08:00
16d4425e07 task#6524 有订单才访问 2025-06-19 18:00:36 +08:00
a73434fd4d task#6524 textarea修改 2025-06-18 14:15:02 +08:00
75d20beb77 task#6524 http兼容司机app 2025-06-18 13:42:10 +08:00
9a21834741 task#6524 报备防重复点击 2025-06-18 11:09:51 +08:00
4 changed files with 253 additions and 169 deletions

View File

@ -11,7 +11,11 @@ const service = axios.create({
})
const urlParams = new URLSearchParams(window.location.search);
let token = urlParams.get('token');
if( token ) {
localStorage.setItem('token', token);
} else {
localStorage.setItem('token', '');
}
service.interceptors.request.use(
config => {
let reqUrl=config.url
@ -21,12 +25,14 @@ service.interceptors.request.use(
}
config.headers['Content-Type'] = config.contentType || 'application/x-www-form-urlencoded'
let token = localStorage.getItem('token');
// let token='4099761587129c46b03c9316c9e866c9'
// let token='eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBTkNIQU5HIiwidXNlcklkIjo0NTY3MSwibmFtZSI6IuWuieeVhSIsInVzZXJOYW1lIjoiQU5DSEFORyIsInN1cHBsaWVySWQiOjExMjgsImlzWmQiOjAsImV4cCI6MTc1MjEzNDc2M30.q1O7C8thZzEMVKYDhBQ-N_14Fh9Bqejj7j11EKLF5Aw'
// let token='eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJTSEhQWEIiLCJ1c2VySWQiOjU0NzI2LCJuYW1lIjoiI-a1i-ivleWwj-eZveeZvSIsInVzZXJOYW1lIjoiU0hIUFhCIiwic3VwcGxpZXJJZCI6MTAwMDE2NSwiZXhwIjoxNzQ0NTEwNzkwfQ.JPk0OA7slYJN3FIi_uhW4Y0CiWRvl6R1dK8MRTbyhD8'
if(!(reqUrl=='/supplier/supplierTraining/trainingTask' || reqUrl=='/supplier/supplierTraining/normalList' || reqUrl=='/supplier/supplierTraining/trainingList')){
if(token) {
config.headers['Authorization'] = `${token}`;
config.headers['token'] = `${token}`;
}
}
return config
},
error => {

View File

@ -21,7 +21,7 @@
</template>
<script>
import { searchFun } from '@/utils/map'
import { searchFun, getLocal, getAddress } from '@/utils/map'
export default {
name: "addressMap",
data() {
@ -31,6 +31,7 @@
activeIndex: '',
map: '',
marker: null,
cityCode: ''
}
},
watch: {
@ -43,16 +44,22 @@
await this.initMap()
},
methods: {
initMap() { // 初始化地图
async initMap() { // 初始化地图
this.map = new AMap.Map('mapId', {
viewMode: '2D', // 默认使用 2D 模式
zoom:11, //初始化地图层级
})
let res = await getLocal(this.map);
let lnglat = new AMap.LngLat(res?.lng, res?.lat);
let location = await getAddress(this.map, lnglat)
this.cityCode = location?.regeocode.addressComponent.adcode
//location?.regeocode?.addressComponent?.city || location?.regeocode?.addressComponent?.province
console.log('location', location);
},
async searchHandler() {
this.activeIndex = null
if( this.keyword ) {
this.addressList = await searchFun(this.map, '', this.keyword)
this.addressList = await searchFun(this.map, this.cityCode, this.keyword,)
this.addressList = this.addressList.filter(item => !!item.location)
} else {
this.addressList = []

View File

@ -2,7 +2,10 @@
<div class="wrap">
<div class="service_title">
<span class="name">{{orderInfo?.serviceName}}</span>
<span class="status">{{orderInfo?.orderStatusString}}</span>
<span class="status">
{{orderInfo?.orderStatusString}}
<span class="refresh_btn" @click="refreshHandler">刷新</span>
</span>
</div>
<!-- <img class="report_line" src="@/assets/report/report_line.png" alt="">-->
<div class="service_content">
@ -25,6 +28,11 @@
export default {
name: "service-item",
props: ['orderInfo'],
methods: {
refreshHandler() {
this.$emit('refresh')
}
}
}
</script>
@ -58,6 +66,13 @@
font-size: 13px;
color: #F19028;
}
.refresh_btn {
background-color: #267EF0;
color: #fff;
padding: 6px 12px;
margin-left: 5px;
border-radius: 3px;
}
}
.service_content {
padding: 11px 16px 18px;

View File

@ -1,10 +1,11 @@
<template>
<!-- <van-pull-refresh v-model="isLoading" class="custom-pull-refresh safe-pull-refresh" @refresh="onRefresh">-->
<div class="main_wrap">
<div class="top_bg">
<div class="title">报备中心</div>
<div class="top_bg" :class="{'dispatch' : type == 1 , 'driver' : type != 1}">
<!-- <div class="title">报备中心</div>-->
</div>
<div class="service_wrap">
<service-item :order-info="orderInfo"></service-item>
<service-item :order-info="orderInfo" @refresh="onRefreshHandler"></service-item>
</div>
<div class="chat_list" ref="chatList" >
<!--ai对话框 s -->
@ -55,9 +56,7 @@
</template>
</div>
</div>
<report-list-item :report-list.sync="reportList" @getReport="getReportHandler" />
<van-popup ref="addReportModal" v-model="addReportShow" :close-on-click-overlay="false" closeable duration="0" round position="bottom">
<div class="dialog_wrap">
<img class="add_report_bg" src="@/assets/report/add_report_bg.png" alt="">
@ -81,7 +80,7 @@
<!--修改地址报备 s -->
<div class="report_title">
<img class="dot" src="@/assets/report/add_report_dot.png" alt="">
<span>修改事发</span>
<span>修改地</span>
</div>
<div class="report_time_content" @click="goPage('addressMap')">
<div class="report_time_left">
@ -97,10 +96,11 @@
<span>补充报备内容</span>
</div>
<div class="report_common_content">
<van-field
v-model="remark"
class="report_textarea"
placeholder="点击这里输入补充报备内容" />
<textarea class="report_textarea" id="text-input" rows="4" placeholder="点击这里输入补充报备内容" v-model.trim="remark"></textarea>
<!-- <van-field-->
<!-- v-model="remark"-->
<!-- class="report_textarea"-->
<!-- placeholder="点击这里输入补充报备内容" />-->
</div>
</div>
<div class="report_btn" @click="saveHandler">
@ -115,11 +115,13 @@
v-if="showDatetime"
v-model="appointTime"
type="datetime"
:min-date="minDate"
@confirm="onConfirm"
@cancel="showDatetime = false"
/>
</van-popup>
</div>
<!-- </van-pull-refresh>-->
</template>
<script>
@ -139,6 +141,7 @@
remark: '',
showDatetime: false,
appointTime: '',
minDate: new Date(),
address: '',
lat: '',
lng: '',
@ -150,6 +153,8 @@
userOrderId: '',
userOrderCode: '',
driverId: '',
clickFlag: true,
isLoading: false,
}
},
async mounted() {
@ -174,6 +179,19 @@
}
},
methods: {
onRefreshHandler() {
setTimeout(async () => {
try {
this.recordList = [];
await this.getReportList();
await this.getDetail();
await this.getRecordList();
await this.scrollToBottom();
} finally {
this.isLoading = false; // 结束加载状态
}
}, 100)
},
// 添加滚动方法
scrollToBottom() {
this.$nextTick(() => {
@ -191,6 +209,7 @@
this.recordList = recordList.data;
},
async saveHandler() {
if( this.clickFlag ) {
let data = {
source: Number(this.type),
reportContent: this.remark,
@ -223,6 +242,8 @@
Toast('备注内容不能为空')
return
}
this.clickFlag = false;
try {
await newOrderReporting(data)
Dialog.alert({
title: '提示',
@ -232,7 +253,12 @@
this.addReportShow = false
this.scrollToBottom();
this.initDialogData();
this.clickFlag = true
});
} finally {
this.clickFlag = true
}
}
},
initDialogData() {
this.appointTime = '';
@ -253,11 +279,16 @@
this.scrollToBottom();
},
async getDetail(){ // 订单详情
if(this.userOrderId) {
let result = await getOrderInfo({
userOrderId: this.userOrderId,
userOrderCode: this.userOrderCode
})
this.orderInfo = result.data
} else {
this.orderInfo = {}
}
},
async getReportList() { // 报备大类
let res = await getReportListByOrder({
@ -272,37 +303,60 @@
}
}
</script>
<style lang="scss">
.custom-pull-refresh {
height: 100% !important;
}
</style>
<style lang="scss" scoped>
#app {
background: #F9FCFF !important;
height: 100%;
}
.main_wrap {
width: 100%;
height: 100%;
background: #F9FCFF !important;
display: flex;
flex-direction: column;
// 添加以下样式确保正确的高度计算
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.top_bg {
width: 100%;
height: 162px;
background: #334885;
.title {
height: 87px;
/*.title {
color: #fff;
text-align: center;
padding-top: 52px;
font-size: 17px;
line-height: 24px;
}*/
}
.dispatch { // 调度app头部背景色
background: #354683;
}
.driver { // 司机app头部背景色
background: #334885;
}
.service_wrap {
margin-top: -75px;
margin-bottom: 20px;
/*margin-bottom: 20px;*/
}
.chat_list {
flex: 1;
overflow: auto;
/*overflow: auto;*/
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch; // 为了iOS平滑滚动
padding-top: 10px;
/* 修复 iOS 滚动问题 */
transform: translateZ(0);
.top_tip_wrap {
color: #7C8698;
text-align: center;
@ -490,6 +544,8 @@
border-radius: 6px;
min-height: 95px;
border: 1px solid #E2EAF6;
padding: 10px;
font-size: 13px;
}
}
}