feat:车辆管理

This commit is contained in:
dzc committed 2025-10-29 16:40:42 +08:00
1 parent 8f5e1d0641
commit 4fef25486b
4 files changed
+613 -13

No files matched your search

+11 -1
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import PlateNum from '@/components/tongtong-plate/plate-number.vue';
import { hooks, router } from "@@/index"
import { userCarApi } from "@@/api"
@@ -9,6 +10,7 @@ import { serviceEnum } from "@/sheep/constant"
const { carTypeEnum } = serviceEnum
const applyFormRef = ref<any>(null)
const plateNumRef = ref<any>(null)
const visitorReasonList = ref<Array<{ title: string; id: string }>>(Object.keys(carTypeEnum).map((key) => ({
title: carTypeEnum[key],
@@ -49,6 +51,14 @@ const carNumberPickerConfirm = (e) => {
}
const doSubmit = async () => {
// 车牌号
const carNumber = plateNumRef.value.getPlate()
if (!carNumber) {
uni.showToast({ title: "请输入车牌号", icon: "none" })
return
}
applyForm.carNumber = carNumber
// 校验
applyFormRef.value.submit()
const { isPass } = applyFormRef.value.validate()
if (!isPass) return
@@ -81,7 +91,7 @@ const doSubmit = async () => {
</tm-picker>
</tm-form-item>
<tm-form-item name="carNumber" label="车牌号" :showBottom="false">
<tm-input v-model="applyForm.carNumber" placeholder="请输入" show-char-count></tm-input>
<PlateNum ref="plateNumRef" />
</tm-form-item>
</tm-form>
</view>
+13 -12
View File
@@ -2,13 +2,10 @@
<crud-layout mainIsScroll bg="/static/page/blue-bg.png">
<template #main-top>
<view class="flex items-center py-3 px-5">
<image
v-if="state.userInfo?.sysUser?.avatar"
class="size-100rpx rounded-full"
:src="filePath(state.userInfo.sysUser.avatar)"
mode="aspectFill"
/>
<image v-else class="w-100rpx h-100rpx rounded-full" src="/static/icon/default-avatar.png" mode="aspectFill" />
<image v-if="state.userInfo?.sysUser?.avatar" class="size-100rpx rounded-full"
:src="filePath(state.userInfo.sysUser.avatar)" mode="aspectFill" />
<image v-else class="w-100rpx h-100rpx rounded-full" src="/static/icon/default-avatar.png"
mode="aspectFill" />
<view class="ml-30rpx" v-if="state.userInfo?.sysUser?.userId">
<view class="sub-text-30">{{ state.userInfo?.sysUser?.name }}</view>
<view class="sub-text-26">ID {{ state.userInfo?.sysUser?.userId }}</view>
@@ -21,7 +18,8 @@
</template>
<view class="mt-10rpx rounded-20rpx shadow-main p-30rpx pb-40rpx bg-white">
<view class="service_item flex items-center justify-between" v-for="(v, i) in state.menuList" :key="i" @tap="onTabMenu(v)">
<view class="service_item flex items-center justify-between" v-for="(v, i) in state.menuList" :key="i"
@tap="onTabMenu(v)">
<view class="flex-row-center">
<image class="size-40rpx" :src="v.icon" mode="aspectFill" />
<text class="sub-text-28 m-l-20rpx">{{ v.text }}</text>
@@ -31,13 +29,15 @@
</view>
<view v-if="isDevEnv()" class="flex-col-center mt-40rpx mx-30rpx">
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff" @tap="doLogout">
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff"
@tap="doLogout">
退出登录
</view>
</view>
<view class="h-30rpx" />
<view v-if="state.appInfo == APPENV.SH" class="flex-col-center mt-40rpx mx-30rpx">
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff" @tap="doChangeRole">
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff"
@tap="doChangeRole">
切换角色
</view>
</view>
@@ -50,7 +50,8 @@
</view>
</crud-layout>
<tm-modal :show="state.actModalShow" :showCancel="false" title="核销活动兑换券" zIndex="999" @confirm="" @cancel="" @close="">
<tm-modal :show="state.actModalShow" :showCancel="false" title="核销活动兑换券" zIndex="999" @confirm="" @cancel=""
@close="">
<view class="text-center text-28">是否核销该活动兑换券?</view>
<view class="text-center text-28">确认核销将会对用户的 消费钱包 扣除 1元 钱</view>
<template #footer>
@@ -80,7 +81,7 @@ const state = reactive<any>({
{ text: "扫一扫", icon: "/static/icon/scan.png", path: "" },
{ text: "我的钱包", icon: "/static/icon/service_3.png", path: "/pages/wallet/list" },
{ text: "我的人脸", icon: "/static/icon/service_5.png", path: "/pages/human-face/list" },
// { text: "车辆管理", icon: "/static/icon/service_6.png", path: "/pages/car/userCar/list" },
{ text: "车辆管理", icon: "/static/icon/service_6.png", path: "/pages/car/userCar/list" },
{ text: "清除缓存", icon: "/static/icon/clear-storage.png", path: "" },
],
appInfo: "",