dev #2

Merged
yrk merged 4 commits from dev into main 2026-02-28 07:44:48 +00:00
4 changed files with 390 additions and 5 deletions
Showing only changes of commit 951528dada - Show all commits

View File

@ -8,3 +8,21 @@ import { http } from '@/http/http'
export function getOrderManageListApi(query: { pageNum: number, pageSize: number }) {
return http.get<any>('/operations/statistics/getDiffOperatorOrderList', query)
}
/**
* @description
* @param data
* @returns
*/
export function changePriceApi(data: { bikeCode: string, price: number }) {
return http.post<any>('/operations/statistics/updateOrderAmount', data)
}
/**
* @description
* @param data
* @returns
*/
export function lockBikeApi(data: { bikeCode: string }) {
return http.post<any>('/operations/statistics/closeOrder', data)
}

View File

@ -0,0 +1,168 @@
<template>
<z-paging>
<template #top>
<view class="custom_navbar" :style="{ height: `${systemInfo.statusBarHeight + 44}px` }">
<view class="back_bar">
<uv-icon name="arrow-left" color="white" size="24" @click="handleBack" />
<text class="text">工单管理-修改价格</text>
</view>
</view>
</template>
<view class="container">
<view class="map_container">
<map-exhibition
:map-location="{
latitude: routeQuery.startLocation?.latitude,
longitude: routeQuery.startLocation?.longitude,
}"
/>
</view>
<uni-card>
<uv-form ref="form" label-position="left" :model="formData" :rules="rules" :label-width="90" :label-style="labelStyle">
<uv-form-item label="车辆编号:" border-bottom>
{{ routeQuery.bikeCode }}
</uv-form-item>
<uv-form-item label="订单编号:" border-bottom>
{{ routeQuery.orderId }}
</uv-form-item>
<uv-form-item label="实付金额:" border-bottom>
{{ routeQuery.actualAmount }}
</uv-form-item>
<uv-form-item label="修改金额:" prop="price" border-bottom>
<uv-input
v-model="formData.price"
type="number"
placeholder="请输入修改金额"
/>
</uv-form-item>
</uv-form>
</uni-card>
</view>
<template #bottom>
<view class="bottom-button-zaping">
<uv-button
type="primary"
:text="btnConfig.btnText"
:loading="btnConfig.btnLoading"
:loading-text="btnConfig.btnLoadingText"
:custom-style="{
backgroundImage: `linear-gradient(135deg, #1089FF 0%, #0F5BFF 100%)`,
borderRadius: '28rpx',
height: '100rpx',
}"
:custom-text-style="{
fontSize: '32rpx',
marginLeft: '8rpx',
}"
@click="submitForm"
/>
</view>
</template>
</z-paging>
</template>
<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app'
import { changePriceApi } from '@/api/order-manage'
import MapExhibition from '@/components/mapExhibition/mapExhibition.vue'
import { systemInfo } from '@/utils/systemInfo'
definePage({
style: {
navigationStyle: 'custom',
},
})
//
function handleBack() {
uni.navigateBack()
}
const formData = reactive({
bikeCode: '',
price: null,
})
const rules = {
price: {
type: 'number',
required: true,
message: '请输入修改金额',
trigger: 'blur',
},
}
const labelStyle = {
padding: '0 5px 0 0',
color: '#7c7c7c',
fontSize: '14px',
fontWeight: 'normal',
lineHeight: '32px',
}
const btnConfig = reactive({
btnText: '提交',
btnLoading: false,
btnLoadingText: '正在提交',
})
const routeQuery = ref<any>({})
onLoad((options) => {
const data = JSON.parse(decodeURIComponent(options.data))
routeQuery.value = data
formData.bikeCode = data.bikeCode
})
const form = ref<any>(null)
async function submitForm() {
await form.value.validate()
try {
await changePriceApi(formData)
uni.showToast({
title: '提交成功',
icon: 'success',
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
}
catch (e) {
uni.showToast({
title: e.message || '提交失败',
icon: 'none',
})
}
finally {
btnConfig.btnLoading = false
}
}
</script>
<style lang="scss" scoped>
.custom_navbar {
width: 100%;
position: relative;
background-color: #0f74ff;
.back_bar {
display: flex;
align-items: center;
position: absolute;
bottom: 25rpx;
left: 30rpx;
.text {
font-family: SourceHanSansCN-Medium;
font-size: 34rpx;
color: white;
letter-spacing: 0;
font-weight: 500;
}
}
}
.container {
width: 100%;
.map_container {
position: relative;
width: 100%;
height: 40vh;
}
}
</style>

View File

@ -15,12 +15,16 @@ function handleBack() {
const paging = ref<any>(null)
const orderList = ref([])
const query = ref({
bikeCode: '',
})
async function queryOrderList(pageNum: number, pageSize: number) {
try {
uni.showLoading({
title: '加载中',
})
const { records } = await getOrderManageListApi({
...query.value,
pageNum,
pageSize,
})
@ -33,11 +37,29 @@ async function queryOrderList(pageNum: number, pageSize: number) {
}
}
function handleSearch() {
paging.value.reload()
}
const operatorStore = useOperatorStore()
const operatorAllList = ref<any>([])
onMounted(async () => {
operatorAllList.value = await operatorStore.getOperatorList()
})
function changePrice(row) {
uni.navigateTo({
url: `/pages-sub/order-manage/change-price?data=${encodeURIComponent(JSON.stringify(row))}`,
})
}
function lockBike(row) {
uni.navigateTo({
url: `/pages-sub/order-manage/remove-locking?data=${encodeURIComponent(JSON.stringify(row))}`,
})
}
onShow(() => {
handleSearch()
})
</script>
<template>
@ -57,6 +79,15 @@ onMounted(async () => {
<text class="text">工单管理</text>
</view>
</view>
<view class="search_bar">
<uv-search
v-model="query.bikeCode"
:show-action="false"
bg-color="white"
placeholder="请输入车辆编号"
@search="handleSearch"
/>
</view>
</template>
<view class="container">
<view class="list-panel">
@ -65,12 +96,12 @@ onMounted(async () => {
:key="item.orderId"
>
<view class="card">
<view class="body">
<view class="row">
<view class="text">
<view>车辆编号{{ item.bikeCode }}</view>
</view>
<view class="header">
<view class="title">
<view>{{ item.bikeCode }}</view>
</view>
</view>
<view class="body">
<view class="row">
<view class="text">
<view>订单编号{{ item.orderId }}</view>
@ -101,6 +132,7 @@ onMounted(async () => {
marginLeft: '8rpx',
}"
text="修改价格"
@click="changePrice(item)"
/>
<uv-button
type="primary"
@ -115,6 +147,7 @@ onMounted(async () => {
marginLeft: '8rpx',
}"
text="远程锁车"
@click="lockBike(item)"
/>
</view>
</view>
@ -156,6 +189,17 @@ onMounted(async () => {
border-radius: 26rpx;
background-color: #fff;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.04);
& .header {
margin-bottom: 30rpx;
.title {
font-family: PingFangSC-Semibold;
font-size: 30rpx;
color: #333333;
letter-spacing: 0;
font-weight: 600;
margin: 0 25rpx 0 10rpx;
}
}
& .body {
& .row {
width: 100%;
@ -192,4 +236,12 @@ onMounted(async () => {
}
}
}
.search_bar {
width: calc(100% - 40rpx);
padding: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #0f73ff;
}
</style>

View File

@ -0,0 +1,147 @@
<template>
<z-paging>
<template #top>
<view class="custom_navbar" :style="{ height: `${systemInfo.statusBarHeight + 44}px` }">
<view class="back_bar">
<uv-icon name="arrow-left" color="white" size="24" @click="handleBack" />
<text class="text">工单管理-远程锁车</text>
</view>
</view>
</template>
<view class="container">
<view class="map_container">
<map-exhibition
:map-location="{
latitude: routeQuery.startLocation?.latitude,
longitude: routeQuery.startLocation?.longitude,
}"
/>
</view>
<uni-card>
<uv-form ref="form" label-position="left" :label-width="90" :label-style="labelStyle">
<uv-form-item label="车辆编号:" border-bottom>
{{ routeQuery.bikeCode }}
</uv-form-item>
<uv-form-item label="订单编号:" border-bottom>
{{ routeQuery.orderId }}
</uv-form-item>
</uv-form>
</uni-card>
</view>
<template #bottom>
<view class="bottom-button-zaping">
<uv-button
type="primary"
:text="btnConfig.btnText"
:loading="btnConfig.btnLoading"
:loading-text="btnConfig.btnLoadingText"
:custom-style="{
backgroundImage: `linear-gradient(135deg, #1089FF 0%, #0F5BFF 100%)`,
borderRadius: '28rpx',
height: '100rpx',
}"
:custom-text-style="{
fontSize: '32rpx',
marginLeft: '8rpx',
}"
@click="submitForm"
/>
</view>
</template>
</z-paging>
</template>
<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app'
import { lockBikeApi } from '@/api/order-manage'
import MapExhibition from '@/components/mapExhibition/mapExhibition.vue'
import { systemInfo } from '@/utils/systemInfo'
definePage({
style: {
navigationStyle: 'custom',
},
})
//
function handleBack() {
uni.navigateBack()
}
const labelStyle = {
padding: '0 5px 0 0',
color: '#7c7c7c',
fontSize: '14px',
fontWeight: 'normal',
lineHeight: '32px',
}
const btnConfig = reactive({
btnText: '确认锁车',
btnLoading: false,
btnLoadingText: '正在锁车中...',
})
const routeQuery = ref<any>({})
onLoad((options) => {
const data = JSON.parse(decodeURIComponent(options.data))
routeQuery.value = data
})
const form = ref<any>(null)
async function submitForm() {
await form.value.validate()
try {
await lockBikeApi({
bikeCode: routeQuery.value.bikeCode,
})
uni.showToast({
title: '提交成功',
icon: 'success',
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
}
catch (e) {
uni.showToast({
title: e.message || '提交失败',
icon: 'none',
})
}
finally {
btnConfig.btnLoading = false
}
}
</script>
<style lang="scss" scoped>
.custom_navbar {
width: 100%;
position: relative;
background-color: #0f74ff;
.back_bar {
display: flex;
align-items: center;
position: absolute;
bottom: 25rpx;
left: 30rpx;
.text {
font-family: SourceHanSansCN-Medium;
font-size: 34rpx;
color: white;
letter-spacing: 0;
font-weight: 500;
}
}
}
.container {
width: 100%;
.map_container {
position: relative;
width: 100%;
height: 60vh;
}
}
</style>