use Message instead of Toast

This commit is contained in:
Timi
2026-08-22 01:08:23 +08:00
parent 94c17e6d81
commit e2af521996
46 changed files with 291 additions and 289 deletions
@@ -94,7 +94,7 @@
import type { EventValueUnit } from "@/types/EventItem";
import type { PointAction, PointRuleTierForm } from "@/types/Point";
import { formatTierBoundaryValue, getTierMinText, getTierMinValue, isLastTier, resolveNonNegativeInteger, resolveTierBoundaryValue } from "@/utils/pointRule";
import { Toast } from "tdesign-mobile-vue";
import { Message } from "@/utils/message";
defineOptions({
name: "PointRuleTierEditor"
@@ -173,20 +173,20 @@ function confirmTierEditor(): void {
: getTierMinValue(tiers.value, index, valueUnit.value);
const pointValue = resolveNonNegativeInteger(tierEditorDraft.pointValueText);
if (min === undefined) {
Toast.warning(index < 1
Message.warning(index < 1
? valueUnit.value === "CENT" ? "首档最小值必须是非负且最多两位小数" : "首档最小值必须是非负整数"
: "请先修正上一档的最大值");
return;
}
if (pointValue === undefined) {
Toast.warning("积分数量必须是大于等于 0 的整数,允许填写 0");
Message.warning("积分数量必须是大于等于 0 的整数,允许填写 0");
return;
}
const shouldAddTier = tierEditorAdding.value && isLastTier(tiers.value, index);
if (!isLastTier(tiers.value, index) || shouldAddTier) {
const max = resolveTierBoundaryValue(tierEditorDraft.maxText, valueUnit.value);
if (max === undefined || max < min) {
Toast.warning(valueUnit.value === "CENT" ? "当前档最大值必须是不小于最小值且最多两位小数" : "当前档最大值必须是不小于最小值的整数");
Message.warning(valueUnit.value === "CENT" ? "当前档最大值必须是不小于最小值且最多两位小数" : "当前档最大值必须是不小于最小值的整数");
return;
}
tier.maxText = formatTierBoundaryValue(max, valueUnit.value);
@@ -206,7 +206,7 @@ function confirmTierEditor(): void {
function addTier(): void {
if (!(tiers.value.length < 100)) {
Toast.warning("最多配置 100 档");
Message.warning("最多配置 100 档");
return;
}
const lastTierIndex = tiers.value.length - 1;