use Message instead of Toast
This commit is contained in:
@@ -154,7 +154,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Toast, type DropdownValue } from "tdesign-mobile-vue";
|
||||
import type { DropdownValue } from "tdesign-mobile-vue";
|
||||
import { Time, type PageResult, useUserStore } from "timi-web";
|
||||
import CustomerAPI from "@/api/CustomerAPI";
|
||||
import PointAPI from "@/api/PointAPI";
|
||||
@@ -165,6 +165,7 @@ import { useSettingStore } from "@/store/settingStore";
|
||||
import type { Customer } from "@/types/Customer";
|
||||
import type { PointLedger, PointLedgerChangeType, PointLedgerPage } from "@/types/Point";
|
||||
import { getCustomerPhotoURL } from "@/utils/customer";
|
||||
import { Message } from "@/utils/message";
|
||||
import { gaoRoleCodes, permissionCodes } from "@/utils/permission";
|
||||
|
||||
type DateFilter = "all" | "today" | "last7" | "last30" | "custom";
|
||||
@@ -228,14 +229,14 @@ async function loadCustomerByCode(code: string): Promise<void> {
|
||||
try {
|
||||
const matched = await CustomerAPI.findByCode(normalizedCode);
|
||||
if (!matched?.id) {
|
||||
Toast.warning("未找到客户");
|
||||
Message.warning("未找到客户");
|
||||
return;
|
||||
}
|
||||
selectedCustomerId.value = matched.id;
|
||||
customer.value = matched;
|
||||
await reload();
|
||||
} catch {
|
||||
Toast.error("客户信息加载失败");
|
||||
Message.error("客户信息加载失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,7 +354,7 @@ async function load(): Promise<void> {
|
||||
page.index += 1;
|
||||
isNoMore.value = pageResult.list.length >= pageResult.total || list.length < page.size;
|
||||
} catch {
|
||||
Toast.error("积分流水加载失败");
|
||||
Message.error("积分流水加载失败");
|
||||
} finally {
|
||||
if (token === loadToken) {
|
||||
isLoading.value = false;
|
||||
@@ -492,7 +493,7 @@ onMounted(async () => {
|
||||
try {
|
||||
await preparePage();
|
||||
} catch {
|
||||
Toast.error("积分流水页面加载失败");
|
||||
Message.error("积分流水页面加载失败");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user