diff --git a/apps/shop-admin/locales-extra.ts b/apps/shop-admin/locales-extra.ts
index 0d9f7aa..d3f6b50 100644
--- a/apps/shop-admin/locales-extra.ts
+++ b/apps/shop-admin/locales-extra.ts
@@ -4,6 +4,9 @@ export const enExtra = {
auth: {
shopRoleError: "This account is not authorized for the merchant console.",
},
+ nav: {
+ coupons: "Coupons",
+ },
shop: {
dashboardTitle: "Merchant dashboard",
profile: "Shop profile",
@@ -59,6 +62,29 @@ export const enExtra = {
issueInvoice: "Issue invoice",
taxNo: "Tax number",
kind: "Type",
+ couponList: "Coupons",
+ newCoupon: "New coupon",
+ editCoupon: "Edit coupon",
+ couponTitleEn: "Title (English)",
+ couponTitleZh: "Title (中文)",
+ couponAmount: "Discount (minor units)",
+ couponThreshold: "Minimum spend (minor units)",
+ couponCurrency: "Currency",
+ couponStock: "Claim stock",
+ couponEnabled: "Enabled",
+ couponStartsAt: "Starts at",
+ couponEndsAt: "Ends at",
+ createCoupon: "Create coupon",
+ updateCoupon: "Update coupon",
+ couponSaved: "Coupon saved.",
+ couponDeleted: "Coupon deleted.",
+ couponTitleRequired: "Both language titles are required.",
+ couponAmountInvalid: "Discount must be a positive integer.",
+ couponThresholdInvalid: "Minimum spend cannot be negative.",
+ couponStockInvalid: "Claim stock cannot be negative.",
+ couponWindowInvalid: "End must not precede start.",
+ enabledOn: "Enabled",
+ enabledOff: "Disabled",
},
} as Record
;
@@ -66,6 +92,9 @@ export const zhExtra = {
auth: {
shopRoleError: "此账号无权访问商家控制台。",
},
+ nav: {
+ coupons: "优惠券",
+ },
shop: {
dashboardTitle: "商家仪表盘",
profile: "店铺信息",
@@ -121,5 +150,28 @@ export const zhExtra = {
issueInvoice: "开具发票",
taxNo: "税号",
kind: "类型",
+ couponList: "优惠券",
+ newCoupon: "新建优惠券",
+ editCoupon: "编辑优惠券",
+ couponTitleEn: "标题(英文)",
+ couponTitleZh: "标题(中文)",
+ couponAmount: "优惠金额(最小单位)",
+ couponThreshold: "使用门槛(最小单位)",
+ couponCurrency: "币种",
+ couponStock: "可领取库存",
+ couponEnabled: "启用",
+ couponStartsAt: "开始时间",
+ couponEndsAt: "结束时间",
+ createCoupon: "创建优惠券",
+ updateCoupon: "更新优惠券",
+ couponSaved: "优惠券已保存。",
+ couponDeleted: "优惠券已删除。",
+ couponTitleRequired: "中英文标题均为必填项。",
+ couponAmountInvalid: "优惠金额必须为正整数。",
+ couponThresholdInvalid: "使用门槛不能为负数。",
+ couponStockInvalid: "可领取库存不能为负数。",
+ couponWindowInvalid: "结束时间不能早于开始时间。",
+ enabledOn: "已启用",
+ enabledOff: "已停用",
},
} as Record;
diff --git a/apps/shop-admin/pages/coupons.vue b/apps/shop-admin/pages/coupons.vue
new file mode 100644
index 0000000..ccd0147
--- /dev/null
+++ b/apps/shop-admin/pages/coupons.vue
@@ -0,0 +1,316 @@
+
+
+
+
+
{{ $t("shop.couponList") }}
+
{{ error }}
+
{{ message }}
+
+
+
+
{{ $t("common.loading") }}
+
{{ $t("common.empty") }}
+
+
+
+
+ | {{ $t("shop.couponTitleEn") }} |
+ {{ $t("shop.couponAmount") }} |
+ {{ $t("shop.couponThreshold") }} |
+ {{ $t("shop.couponStock") }} |
+ {{ $t("shop.couponStartsAt") }} |
+ {{ $t("shop.couponEndsAt") }} |
+ {{ $t("common.status") }} |
+ {{ $t("common.actions") }} |
+
+
+
+
+ | {{ template.title[locale] ?? template.title.en }} |
+ {{ fmt(template.amount_minor, template.currency) }} |
+ {{ fmt(template.threshold_minor, template.currency) }} |
+ {{ template.stock }} |
+ {{ template.starts_at.slice(0, 10) }} |
+ {{ template.ends_at.slice(0, 10) }} |
+
+
+ {{ template.enabled ? $t("shop.enabledOn") : $t("shop.enabledOff") }}
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+