Commit f3da7bfc by wangzhihui

Merge branch 'release/venus-usedcar-h5/1.0.0' of http://192.168.3.233:8090/monor…

…epo/venus into release/venus-usedcar-h5/1.0.0
2 parents b4bf2230 abd63871
Pipeline #124 for f3da7bfc failed in 0 seconds
...@@ -3,16 +3,16 @@ import { RouterView } from "vue-router"; ...@@ -3,16 +3,16 @@ import { RouterView } from "vue-router";
</script> </script>
<template> <template>
<RouterView /> <RouterView />
</template> </template>
<style lang="scss"> <style lang="scss">
#app { #app {
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
background-color: var(--color-bg-page); font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica,
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "Segoe UI", Arial, Roboto, "PingFang SC", miui, "Hiragino Sans GB",
Segoe UI, Arial, Roboto, "PingFang SC", "miui", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
"Microsoft Yahei", sans-serif; background-color: var(--color-bg-page);
} }
</style> </style>
export * from "./modules/car"; export * from "./modules/car";
export * from "./modules/inspect-report";
export * from "./modules/user"; export * from "./modules/user";
export * from "./modules/work-order"; export * from "./modules/work-order";
export * from "./modules/inspect-report";
...@@ -176,3 +176,7 @@ export interface DetailRes { ...@@ -176,3 +176,7 @@ export interface DetailRes {
export function detail(recordId: number) { export function detail(recordId: number) {
return get<DetailRes>(`/rest/inspectionRecord/${recordId}/detail`); return get<DetailRes>(`/rest/inspectionRecord/${recordId}/detail`);
} }
export function getCarTypeList(csId: number) {
return get<DetailRes>(`/rest/ropApi/getCarTypeList?csId=${csId}`);
}
...@@ -4,7 +4,7 @@ import { computed, ref } from "vue"; ...@@ -4,7 +4,7 @@ import { computed, ref } from "vue";
const props = defineProps({ const props = defineProps({
item: { item: {
type: Object, type: Object,
default: () => { }, default: () => {},
}, },
}); });
const emit = defineEmits(["update"]); const emit = defineEmits(["update"]);
...@@ -22,7 +22,7 @@ function initData() { ...@@ -22,7 +22,7 @@ function initData() {
if (props?.item?.inspectionResultVO) { if (props?.item?.inspectionResultVO) {
const inspectionValueList = props?.item?.inspectionResultVO?.inspectionValueList || []; const inspectionValueList = props?.item?.inspectionResultVO?.inspectionValueList || [];
for (const i of inspectionValueList) { for (const i of inspectionValueList) {
if (i.valueText && i.interactionType == "button_select") { pickerValue.value.push(i.valueKey) } if (i.valueText && i.interactionType == "button_select") { pickerValue.value.push(i.valueKey); }
} }
} }
setupdate(); setupdate();
...@@ -67,20 +67,23 @@ function setupdate() { ...@@ -67,20 +67,23 @@ function setupdate() {
</script> </script>
<template> <template>
<div class="buttonSelect"> <div class="buttonSelect">
<div class="title"> <div class="title">
<span v-if="item.required === 1" class="isRequired">*</span> <span v-if="item.required === 1" class="isRequired">*</span>
<span>{{ item.nodeName }}</span> <span>{{ item.nodeName }}</span>
</div> </div>
<div class="selectList"> <div class="selectList">
<div v-for="(col, index) in columnsList" :key="index" class="selectBut" <div v-for="(col, index) in columnsList"
:class="{ 'pitchOn': pickerValue.includes(col.value) }" @click="handleBut(col)"> :key="index"
{{ col.text }} class="selectBut"
<div v-if="pickerValue.includes(col.value)" class="pitchImg"></div> :class="{ 'pitchOn': pickerValue.includes(col.value) }"
</div> @click="handleBut(col)">
</div> {{ col.text }}
</div> <div v-if="pickerValue.includes(col.value)" class="pitchImg"></div>
</div>
</div>
</div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from "vue";
import { uploadFile } from "@/utils/upload.js"; import { uploadFile } from "@/utils/upload.js";
import { showToast } from "vant"; import { showToast } from "vant";
...@@ -7,7 +8,7 @@ import { showToast } from "vant"; ...@@ -7,7 +8,7 @@ import { showToast } from "vant";
const props = defineProps({ const props = defineProps({
item: { item: {
type: Object, type: Object,
default: () => { }, default: () => {},
}, },
}); });
...@@ -32,7 +33,7 @@ function initData() { ...@@ -32,7 +33,7 @@ function initData() {
if (props?.item?.inspectionResultVO) { if (props?.item?.inspectionResultVO) {
const inspectionValueList = props?.item?.inspectionResultVO?.inspectionValueList || []; const inspectionValueList = props?.item?.inspectionResultVO?.inspectionValueList || [];
for (const i of inspectionValueList) { for (const i of inspectionValueList) {
if (i.valueText && i.interactionType == "image_upload") { pickerValue.value.push(i.valueText) } if (i.valueText && i.interactionType == "image_upload") { pickerValue.value.push(i.valueText); }
} }
} }
updateData(); updateData();
...@@ -79,32 +80,48 @@ function updateData() { ...@@ -79,32 +80,48 @@ function updateData() {
</script> </script>
<template> <template>
<div class="buttonSelect"> <div class="buttonSelect">
<div class="title"> <div class="title">
<div class="titleContent"> <div class="titleContent">
<span class="isRequired">*</span> <span class="isRequired">*</span>
<span>异常图片</span> <span>异常图片</span>
</div> </div>
<div class="titleTip"> <div class="titleTip">
有损伤请拍摄图片,无损伤请忽略 有损伤请拍摄图片,无损伤请忽略
</div> </div>
</div> </div>
<input ref="fileInputRef" accept="image/*" class="hidden-input" type="file" @change="onFileChange"> <input ref="fileInputRef"
<div class="uploadPage"> accept="image/*"
<div v-if="(validationRules.maxCount || 3) > pickerValue.length" class="uploadBox" @click="pickFile"> class="hidden-input"
<van-icon class="plusBox" color="#999999" name="plus" size="24" /> type="file"
<div class="uploadTxt"> @change="onFileChange">
添加照片 <div class="uploadPage">
</div> <div v-if="(validationRules.maxCount || 3) > pickerValue.length"
</div> class="uploadBox"
<div v-for="(url, index) in pickerValue" :key="index" class="uploadBox"> @click="pickFile">
<div class="deleteBox" @click="handleDelete(url)"> <van-icon class="plusBox"
<van-icon color="#999999" name="clear" size="20" /> color="#999999"
</div> name="plus"
<van-image height="96" :src="url" style="border-radius: 8px;" width="96" /> size="24" />
</div> <div class="uploadTxt">
</div> 添加照片
</div> </div>
</div>
<div v-for="(url, index) in pickerValue"
:key="index"
class="uploadBox">
<div class="deleteBox" @click="handleDelete(url)">
<van-icon color="#999999"
name="clear"
size="20" />
</div>
<van-image height="96"
:src="url"
style="border-radius: 8px;"
width="96" />
</div>
</div>
</div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -4,7 +4,11 @@ import { computed, ref } from "vue"; ...@@ -4,7 +4,11 @@ import { computed, ref } from "vue";
const props = defineProps({ const props = defineProps({
item: { item: {
type: Object, type: Object,
default: () => { }, default: () => {},
},
carTypeList: {
type: Array,
default: () => {},
}, },
}); });
...@@ -43,7 +47,6 @@ function initData() { ...@@ -43,7 +47,6 @@ function initData() {
} }
} }
onConfirm(); onConfirm();
console.log('pickerValue.value2222222222222222222', pickerValue.value);
} }
// 计算属性 // 计算属性
...@@ -55,16 +58,15 @@ const columnsList = computed(() => { ...@@ -55,16 +58,15 @@ const columnsList = computed(() => {
value: valueList[0] || "", value: valueList[0] || "",
}; };
}); });
return optionsList; return props.item.nodeName === "车型" ? props.carTypeList : optionsList;
}); });
function onConfirm() { function onConfirm() {
const picker = pickerValue.value && pickerValue.value.length > 0 ? pickerValue.value[0] : ""; const picker = pickerValue.value && pickerValue.value.length > 0 ? pickerValue.value[0] : "";
showPicker.value = false; showPicker.value = false;
const selected = columnsList.value.find((col) => col.value === picker) || {}; const selected = columnsList.value.find((col) => col.value === picker) || {};
props.item.value = selected.value || "";
props.item.valueText = selected.text || "";
props.item.valueKey = selected.value || "";
emit("update", { emit("update", {
value: selected.value || "", value: selected.value || "",
valueText: selected.text || "", valueText: selected.text || "",
...@@ -75,14 +77,26 @@ function onConfirm() { ...@@ -75,14 +77,26 @@ function onConfirm() {
</script> </script>
<template> <template>
<div> <div>
<van-field v-model="displayValueText" clearable is-link :label="item.nodeName" name="datePicker" <van-field v-model="displayValueText"
:placeholder="item.placeholder" readonly :required="item.required === 1" @click="showPicker = true" /> clearable
<van-popup v-model:show="showPicker" destroy-on-close position="bottom"> is-link
<van-picker v-model="pickerValue" :columns="columnsList" :title="item.nodeName" @cancel="showPicker = false" :label="item.nodeName"
@confirm="onConfirm" /> name="datePicker"
</van-popup> :placeholder="item.placeholder"
</div> readonly
:required="item.required === 1"
@click="showPicker = true" />
<van-popup v-model:show="showPicker"
destroy-on-close
position="bottom">
<van-picker v-model="pickerValue"
:columns="columnsList"
:title="item.nodeName"
@cancel="showPicker = false"
@confirm="onConfirm" />
</van-popup>
</div>
</template> </template>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
<!--
* @Author: cen
* @Date: 2026-03-18 18:09:39
* @Description:
* @FilePath: /venus-usedcar-h5/apps/web/venus-usedcar-quality/src/components/PageTop.vue
* @LastEditTime: 2026-03-26 15:33:11
* @LastEditors: cenchengwei@foreverht.com
* 可以输入预定的版权声明、个性签名、空行等
-->
<script setup lang="ts"> <script setup lang="ts">
import PageTitle from "@/components/PageTitle.vue"; import PageTitle from "@/components/PageTitle.vue";
...@@ -15,8 +24,8 @@ defineProps<{ ...@@ -15,8 +24,8 @@ defineProps<{
<style lang="scss" scoped> <style lang="scss" scoped>
.page-top { .page-top {
background: url("@assets/image/top_bg.png") no-repeat top center; // background: url("@assets/image/top_bg.png") no-repeat top center;
background-size: 100% auto; // background-size: 100% auto;
} }
</style> </style>
import { ref } from "vue"; import { ref } from "vue";
import { showToast } from "vant"; import { showToast } from "vant";
interface UseRequestOptions<T> { interface UseRequestOptions<T> {
...@@ -9,37 +10,37 @@ interface UseRequestOptions<T> { ...@@ -9,37 +10,37 @@ interface UseRequestOptions<T> {
} }
export function useRequest<T>( export function useRequest<T>(
requestFn: () => Promise<T>, requestFn: () => Promise<T>,
options: UseRequestOptions<T> = {}, options: UseRequestOptions<T> = {},
) { ) {
const { immediate = false, initialData, onSuccess, onError } = options; const { immediate = false, initialData, onSuccess, onError } = options;
const data = ref<T | undefined>(initialData as T); const data = ref<T | undefined>(initialData as T);
const loading = ref(false); const loading = ref(false);
const error = ref<unknown>(null); const error = ref<unknown>(null);
async function execute() { async function execute() {
loading.value = true; loading.value = true;
error.value = null; error.value = null;
try { try {
const result = await requestFn(); const result = await requestFn();
data.value = result; data.value = result;
onSuccess?.(result); onSuccess?.(result);
return result; return result;
} catch (err) { } catch (error_) {
error.value = err; error.value = error_;
onError?.(err); onError?.(error_);
throw err; throw error_;
} finally { } finally {
loading.value = false; loading.value = false;
} }
} }
if (immediate) { if (immediate) {
execute(); execute();
} }
return { data, loading, error, execute }; return { data, loading, error, execute };
} }
interface UsePaginationOptions<T> { interface UsePaginationOptions<T> {
...@@ -48,57 +49,57 @@ interface UsePaginationOptions<T> { ...@@ -48,57 +49,57 @@ interface UsePaginationOptions<T> {
} }
export function usePagination<T>( export function usePagination<T>(
requestFn: (page: number, pageSize: number) => Promise<{ list: T[]; total: number }>, requestFn: (page: number, pageSize: number) => Promise<{ list: T[]; total: number }>,
options: UsePaginationOptions<T> = {}, options: UsePaginationOptions<T> = {},
) { ) {
const { pageSize = 10, onSuccess } = options; const { pageSize = 10, onSuccess } = options;
const list = ref<T[]>([]) as import("vue").Ref<T[]>; const list = ref<T[]>([]) as import("vue").Ref<T[]>;
const total = ref(0); const total = ref(0);
const page = ref(1); const page = ref(1);
const loading = ref(false); const loading = ref(false);
const finished = ref(false); const finished = ref(false);
const refreshing = ref(false); const refreshing = ref(false);
async function loadMore() { async function loadMore() {
if (loading.value || finished.value) return; if (loading.value || finished.value) return;
loading.value = true; loading.value = true;
try { try {
const res = await requestFn(page.value, pageSize); const res = await requestFn(page.value, pageSize);
list.value.push(...res.list); list.value.push(...res.list);
total.value = res.total; total.value = res.total;
if (list.value.length >= res.total || res.list.length < pageSize) { if (list.value.length >= res.total || res.list.length < pageSize) {
finished.value = true; finished.value = true;
} else { } else {
page.value += 1; page.value += 1;
} }
onSuccess?.(res.list, res.total); onSuccess?.(res.list, res.total);
} catch (err) { } catch (error) {
showToast("加载失败,请重试"); showToast("加载失败,请重试");
throw err; throw error;
} finally { } finally {
loading.value = false; loading.value = false;
refreshing.value = false; refreshing.value = false;
} }
} }
async function refresh() { async function refresh() {
page.value = 1; page.value = 1;
list.value = []; list.value = [];
finished.value = false; finished.value = false;
refreshing.value = true; refreshing.value = true;
await loadMore(); await loadMore();
} }
return { return {
list, list,
total, total,
page, page,
loading, loading,
finished, finished,
refreshing, refreshing,
loadMore, loadMore,
refresh, refresh,
}; };
} }
...@@ -9,10 +9,11 @@ import router from "./router"; ...@@ -9,10 +9,11 @@ import router from "./router";
import { initFlexible } from "./utils/flexible"; import { initFlexible } from "./utils/flexible";
import { initTokenBridge } from "./utils/webviewBridge"; import { initTokenBridge } from "./utils/webviewBridge";
import "vant/es/toast/style";
import "@assets/styles/reset.scss"; import "@assets/styles/reset.scss";
import "@assets/styles/index.scss"; import "@assets/styles/index.scss";
import "@assets/tailwind.css"; import "@assets/tailwind.css";
import "vant/es/toast/style";
async function bootstrap() { async function bootstrap() {
initFlexible(); initFlexible();
......
import { defineStore } from "pinia";
import { ref } from "vue"; import { ref } from "vue";
import { defineStore } from "pinia";
export const useAppStore = defineStore( export const useAppStore = defineStore(
"app", "app",
() => { () => {
const loading = ref(false); const loading = ref(false);
const theme = ref<"light" | "dark">("light"); const theme = ref<"dark" | "light">("light");
function setLoading(val: boolean) { function setLoading(val: boolean) {
loading.value = val; loading.value = val;
} }
function toggleTheme() { function toggleTheme() {
theme.value = theme.value === "light" ? "dark" : "light"; theme.value = theme.value === "light" ? "dark" : "light";
} }
return { return {
loading, loading,
theme, theme,
setLoading, setLoading,
toggleTheme, toggleTheme,
}; };
}, },
{ {
persist: { persist: {
pick: ["theme"], pick: ["theme"],
}, },
}, },
); );
...@@ -19,6 +19,6 @@ export interface PageData<T = unknown> { ...@@ -19,6 +19,6 @@ export interface PageData<T = unknown> {
export interface SelectOption { export interface SelectOption {
label: string; label: string;
value: string | number; value: number | string;
disabled?: boolean; disabled?: boolean;
} }
...@@ -4,76 +4,76 @@ import dayjs from "dayjs"; ...@@ -4,76 +4,76 @@ import dayjs from "dayjs";
* 格式化价格,单位:万元 * 格式化价格,单位:万元
*/ */
export function formatPrice(price: number): string { export function formatPrice(price: number): string {
if (price >= 10000) { if (price >= 10_000) {
return `${(price / 10000).toFixed(1)}万`; return `${(price / 10_000).toFixed(1)}万`;
} }
return `${price}`; return `${price}`;
} }
/** /**
* 格式化里程,单位:公里 * 格式化里程,单位:公里
*/ */
export function formatMileage(mileage: number): string { export function formatMileage(mileage: number): string {
if (mileage >= 10000) { if (mileage >= 10_000) {
return `${(mileage / 10000).toFixed(1)}万公里`; return `${(mileage / 10_000).toFixed(1)}万公里`;
} }
return `${mileage}公里`; return `${mileage}公里`;
} }
/** /**
* 格式化时间 * 格式化时间
*/ */
export function formatDate(date: string | number | Date, format = "YYYY-MM-DD"): string { export function formatDate(date: Date | number | string, format = "YYYY-MM-DD"): string {
return dayjs(date).format(format); return dayjs(date).format(format);
} }
/** /**
* 格式化相对时间 * 格式化相对时间
*/ */
export function formatRelativeTime(date: string | number | Date): string { export function formatRelativeTime(date: Date | number | string): string {
const now = dayjs(); const now = dayjs();
const target = dayjs(date); const target = dayjs(date);
const diffMinutes = now.diff(target, "minute"); const diffMinutes = now.diff(target, "minute");
if (diffMinutes < 1) return "刚刚"; if (diffMinutes < 1) return "刚刚";
if (diffMinutes < 60) return `${diffMinutes}分钟前`; if (diffMinutes < 60) return `${diffMinutes}分钟前`;
const diffHours = now.diff(target, "hour"); const diffHours = now.diff(target, "hour");
if (diffHours < 24) return `${diffHours}小时前`; if (diffHours < 24) return `${diffHours}小时前`;
const diffDays = now.diff(target, "day"); const diffDays = now.diff(target, "day");
if (diffDays < 30) return `${diffDays}天前`; if (diffDays < 30) return `${diffDays}天前`;
return target.format("YYYY-MM-DD"); return target.format("YYYY-MM-DD");
} }
/** /**
* 防抖 * 防抖
*/ */
export function debounce<T extends (...args: unknown[]) => unknown>( export function debounce<T extends (...args: unknown[]) => unknown>(
fn: T, fn: T,
delay = 300, delay = 300,
): (...args: Parameters<T>) => void { ): (...args: Parameters<T>) => void {
let timer: ReturnType<typeof setTimeout> | null = null; let timer: null | ReturnType<typeof setTimeout> = null;
return function (...args: Parameters<T>) { return function (...args: Parameters<T>) {
if (timer) clearTimeout(timer); if (timer) clearTimeout(timer);
timer = setTimeout(() => fn(...args), delay); timer = setTimeout(() => fn(...args), delay);
}; };
} }
/** /**
* 节流 * 节流
*/ */
export function throttle<T extends (...args: unknown[]) => unknown>( export function throttle<T extends (...args: unknown[]) => unknown>(
fn: T, fn: T,
limit = 300, limit = 300,
): (...args: Parameters<T>) => void { ): (...args: Parameters<T>) => void {
let lastTime = 0; let lastTime = 0;
return function (...args: Parameters<T>) { return function (...args: Parameters<T>) {
const now = Date.now(); const now = Date.now();
if (now - lastTime >= limit) { if (now - lastTime >= limit) {
lastTime = now; lastTime = now;
fn(...args); fn(...args);
} }
}; };
} }
...@@ -188,7 +188,8 @@ async function handleResponse<T>( ...@@ -188,7 +188,8 @@ async function handleResponse<T>(
} }
showToast(errMsg); showToast(errMsg);
throw new ApiHandledError(errMsg); // 后端调整后修改放开注释
// throw new ApiHandledError(errMsg);
} }
// 非标准结构,直接返回 data // 非标准结构,直接返回 data
......
import GlOssApi from "glsk-oss-jssdk";
import { OSS_CONFIG } from "@/config/oss.ts"; import { OSS_CONFIG } from "@/config/oss.ts";
import GlOssApi from "glsk-oss-jssdk";
let ossApi = null; let ossApi = null;
......
...@@ -129,7 +129,21 @@ export function useInspectSubmit( ...@@ -129,7 +129,21 @@ export function useInspectSubmit(
} }
} }
function onBack() { async function onBack() {
if (submitting.value) return;
if (modules.activeBigKey.value !== SCORE_BIG_KEY) {
try {
const persisted = await saveCurrentLeafInspectionRecord(false);
if (persisted) {
showToast("已自动保存草稿");
}
} catch (error) {
if (!isRequestFailureAlreadyHandled(error)) {
showToast("草稿保存失败,请稍后重试");
}
return;
}
}
router.back(); router.back();
} }
......
...@@ -283,7 +283,7 @@ void onRefresh(); ...@@ -283,7 +283,7 @@ void onRefresh();
<van-list v-else <van-list v-else
v-model:loading="loading" v-model:loading="loading"
:finished="finished" :finished="finished"
finished-text="到底了" finished-text="到底了~"
:scroller="scroller" :scroller="scroller"
@load="onLoad"> @load="onLoad">
<div v-for="item in displayList" <div v-for="item in displayList"
...@@ -539,8 +539,8 @@ void onRefresh(); ...@@ -539,8 +539,8 @@ void onRefresh();
:deep(.wo-btn) { :deep(.wo-btn) {
height: auto; height: auto;
padding: 10px 12px; padding: 6px 8px;
font-size: 13px; font-size: 12px;
font-weight: 400; font-weight: 400;
line-height: 1; line-height: 1;
border: 0; border: 0;
......
...@@ -376,6 +376,7 @@ onMounted(() => { ...@@ -376,6 +376,7 @@ onMounted(() => {
<div class="vehicle-plate"> <div class="vehicle-plate">
<span>{{ reportData.licensePlate }}</span> <span>{{ reportData.licensePlate }}</span>
<span class="vehicle-vin">{{ reportData.vin }}</span> <span class="vehicle-vin">{{ reportData.vin }}</span>
</div> </div>
<div class="vehicle-tags"> <div class="vehicle-tags">
<img alt="认证标签" <img alt="认证标签"
......
...@@ -4,7 +4,6 @@ import { useLogin } from "./useLogin.ts"; ...@@ -4,7 +4,6 @@ import { useLogin } from "./useLogin.ts";
const { const {
phone, phone,
code, code,
agreed,
sending, sending,
countdown, countdown,
hasSent, hasSent,
...@@ -70,18 +69,6 @@ const { ...@@ -70,18 +69,6 @@ const {
</div> </div>
<div aria-hidden="true" class="min-h-6 flex-1" /> <div aria-hidden="true" class="min-h-6 flex-1" />
<div class="flex shrink-0 justify-center pt-10 text-center text-[12px] text-[#999]">
<van-checkbox v-model="agreed"
checked-color="#4f8cff"
icon-size="14px">
<span class="whitespace-nowrap">
我已阅读并同意
<a class="mx-0.5 text-[#4f8cff] no-underline" href="javascript:;">《用户协议》</a>
<a class="mx-0.5 text-[#4f8cff] no-underline" href="javascript:;">《隐私协议》</a>
</span>
</van-checkbox>
</div>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -4,7 +4,6 @@ import { useLogin } from "./useLogin.ts"; ...@@ -4,7 +4,6 @@ import { useLogin } from "./useLogin.ts";
const { const {
phone, phone,
code, code,
agreed,
sending, sending,
countdown, countdown,
hasSent, hasSent,
...@@ -63,18 +62,6 @@ const { ...@@ -63,18 +62,6 @@ const {
@click="handleLogin"> @click="handleLogin">
登录 登录
</van-button> </van-button>
<div class="mt-4 flex items-center justify-center text-[12px] text-[#999]">
<van-checkbox v-model="agreed"
checked-color="#4f8cff"
icon-size="14px">
<span class="whitespace-nowrap">
我已阅读并同意
<a class="mx-0.5 text-[#4f8cff] no-underline" href="javascript:;">《用户协议》</a>
<a class="mx-0.5 text-[#4f8cff] no-underline" href="javascript:;">《隐私协议》</a>
</span>
</van-checkbox>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -13,7 +13,6 @@ export function useLogin() { ...@@ -13,7 +13,6 @@ export function useLogin() {
const phone = ref(""); const phone = ref("");
const code = ref(""); const code = ref("");
const agreed = ref(false);
/** 仅数字 + 长度上限;配合 Field type=digit,并兜底粘贴等非数字字符 */ /** 仅数字 + 长度上限;配合 Field type=digit,并兜底粘贴等非数字字符 */
watch(phone, (v) => { watch(phone, (v) => {
...@@ -76,10 +75,6 @@ export function useLogin() { ...@@ -76,10 +75,6 @@ export function useLogin() {
showFailToast("请输入验证码"); showFailToast("请输入验证码");
return; return;
} }
if (!agreed.value) {
showFailToast("请先阅读并同意相关协议");
return;
}
try { try {
const res = await login({ const res = await login({
...@@ -112,7 +107,6 @@ export function useLogin() { ...@@ -112,7 +107,6 @@ export function useLogin() {
return { return {
phone, phone,
code, code,
agreed,
sending, sending,
countdown, countdown,
hasSent, hasSent,
......
/// <reference types="vite/client" /> // / <reference types="vite/client" />
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!