17 Commits

Author SHA1 Message Date
dee9cd779a 二手拖车,进入详情页调保存信息记录接口,注释打印代码 2025-07-03 17:56:57 +08:00
0b0749f04a 二手拖车,进入详情页调保存信息记录接口,获取id,关闭页面,id传入接口 2025-07-03 17:56:34 +08:00
61da53bfe0 二手拖车,进入详情页调保存信息记录接口,获取id,关闭页面,id传入接口 2025-07-03 17:56:32 +08:00
d1d246d871 二手拖车,进入详情页调保存信息记录接口,获取id,关闭页面,id传入接口 2025-07-03 17:56:30 +08:00
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
6 changed files with 264 additions and 172 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
<div class="headerWrap"> <div class="headerWrap">
<div v-if="isWebFunc()" style="opacity: 0;" class="back"></div> <div v-if="isWebFunc()" style="opacity: 0;" class="back"></div>
<img v-else class="back" @click="h5GoBack" src="@/assets/secondHandCar/back.png" /> <img v-else class="back" @click="h5GoBack" src="@/assets/secondHandCar/back.png" />
<span>{{detailInfo.status.code !== 6 ? '在售' : '已售出'}}</span> <span>{{detailInfo?.status?.code !== 6 ? '在售' : '已售出'}}</span>
<div style="opacity: 0;" class="back"></div> <div style="opacity: 0;" class="back"></div>
</div> </div>
<van-loading v-show="!detailInfo" class="loadingWrap" type="spinner" color="#1989fa" /> <van-loading v-show="!detailInfo" class="loadingWrap" type="spinner" color="#1989fa" />
@ -136,6 +136,7 @@ export default {
startTime: null, // 记录进入时间 startTime: null, // 记录进入时间
recordType:1, recordType:1,
isList:false,//是否是首页列表跳转过来的 isList:false,//是否是首页列表跳转过来的
recordResponseId:'',//信息记录获取的id用于关闭界面掉接口所需参数
} }
}, },
async mounted() { async mounted() {
@ -157,6 +158,7 @@ export default {
queryType:this.queryType , queryType:this.queryType ,
}) })
this.detailInfo=res?.data this.detailInfo=res?.data
// console.log("this.detailInfo",this.detailInfo)
const municipalities = ['北京市', '天津市', '上海市', '重庆市']; const municipalities = ['北京市', '天津市', '上海市', '重庆市'];
const isMunicipality = municipalities.some(city => res.data.areaName.includes(city)); const isMunicipality = municipalities.some(city => res.data.areaName.includes(city));
this.detailInfo.areaName= isMunicipality ? res.data.areaName?.substring(0, 3) : res.data.areaName; this.detailInfo.areaName= isMunicipality ? res.data.areaName?.substring(0, 3) : res.data.areaName;
@ -167,6 +169,9 @@ export default {
this.imgSrcList.unshift(res?.data?.vehicleRearPhoto) this.imgSrcList.unshift(res?.data?.vehicleRearPhoto)
} }
this.imgSrcList.unshift(res?.data?.vehicleAnglePhoto) this.imgSrcList.unshift(res?.data?.vehicleAnglePhoto)
let result=await saveRecord({type: 1, carInfoId: this.id, duration:'',id:''});
// console.log('resultresult',result)
this.recordResponseId=result?.data?.id
} }
}, },
destroyed() { destroyed() {
@ -197,7 +202,7 @@ export default {
this.saveRecord(duration,type); this.saveRecord(duration,type);
}, },
async saveRecord(duration,type){ async saveRecord(duration,type){
await saveRecord({type: type, carInfoId: this.id, duration}) await saveRecord({type: type, carInfoId: this.id, duration,id:this.recordResponseId || ''})
}, },
handle(){ handle(){
this.getDuration(2) this.getDuration(2)

View File

@ -72,6 +72,7 @@ export default {
duration:'', duration:'',
startTime: null, // 记录进入时间 startTime: null, // 记录进入时间
isList:false, isList:false,
recordResponseId:'',//信息记录获取的id用于关闭界面掉接口所需参数
} }
}, },
async mounted() { async mounted() {
@ -92,6 +93,8 @@ export default {
queryType: this.queryType, queryType: this.queryType,
}) })
this.detailInfo = res?.data this.detailInfo = res?.data
let result=await saveRecord({type: 1, carInfoId: this.id, duration:'',id:''});
this.recordResponseId=result?.data?.id
} }
}, },
destroyed() { destroyed() {
@ -104,7 +107,7 @@ export default {
this.saveRecord(duration,type); this.saveRecord(duration,type);
}, },
async saveRecord(duration,type){ async saveRecord(duration,type){
await saveRecord({type:type,carInfoId:this.id,duration}) await saveRecord({type:type,carInfoId:this.id,duration,id:this.recordResponseId || ''})
}, },
handle(){ handle(){
this.getDuration(2) this.getDuration(2)