From e56b91970cced3efeb86ab5742649f30f566a89c Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Wed, 14 Oct 2026 09:03:36 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=B3=E8=AF=B7=E9=A1=B5=E7=8A=B6?=
=?UTF-8?q?=E6=80=81=E6=9D=A1(Q7=20=E9=97=AD=E7=8E=AF=E5=89=8D=E7=AB=AF)?=
=?UTF-8?q?=E2=80=94=20=E5=B7=B2=E6=9C=89=E5=90=8D=E7=89=87/=E5=AE=A1?=
=?UTF-8?q?=E6=A0=B8=E4=B8=AD=E9=9A=90=E8=97=8F=E8=A1=A8=E5=8D=95,=20?=
=?UTF-8?q?=E8=A2=AB=E6=8B=92=E5=8F=AF=E9=87=8D=E6=96=B0=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
配合商家后台 2.4.0 申请闭环:
- onShow 回查 /card/api/apply/status: 已有名片或申请审核中 → 状态条替代表单
- 被拒 → 显示未通过原因 + 「重新申请」入口, 表单恢复可编辑
- 状态未回来前不渲染表单, 避免闪一下再消失
本地配置 .local.config.js 不入库(按约定排除)。
---
pages_tool/card/apply.vue | 83 +++++++++++++++++++++++++++++++--------
1 file changed, 67 insertions(+), 16 deletions(-)
diff --git a/pages_tool/card/apply.vue b/pages_tool/card/apply.vue
index 8714f33..f3f5764 100644
--- a/pages_tool/card/apply.vue
+++ b/pages_tool/card/apply.vue
@@ -1,24 +1,32 @@
-
- 向商家申请一张数字名片
- 提交后商家会收到通知,同意后名片自动出现在你的名片夹
+
+
+ {{ statusTip }}
+ {{ statusSub }}
-
-
- *姓名
- form.name = e.detail.value" />
+
+
+ 向商家申请一张数字名片
+ 提交后商家会收到通知,同意后名片自动出现在你的名片夹
-
- *手机号
- form.mobile = e.detail.value" />
-
-
-
+
+
+ *姓名
+ form.name = e.detail.value" />
+
+
+ *手机号
+ form.mobile = e.detail.value" />
+
+
+
+
+
@@ -29,13 +37,56 @@ export default {
data() {
return {
form: { name: '', mobile: '' },
- submitting: false
+ submitting: false,
+ // 状态回查: null=未加载, 否则 { apply, has_card }
+ applyStatus: null,
+ statusLoaded: false
};
},
+ computed: {
+ // 已有名片 / 申请待审 → 隐藏表单只显示状态; 被拒/无记录 → 允许(重新)提交
+ formEditable() {
+ const s = this.applyStatus;
+ if (!s) return true;
+ if (s.has_card) return false;
+ if (s.apply && s.apply.status === 0) return false; // 待审核
+ return true;
+ },
+ statusTip() {
+ const s = this.applyStatus;
+ if (!s) return '';
+ if (s.has_card) return '您已拥有名片,去名片夹查看吧';
+ if (s.apply && s.apply.status === 0) return '申请审核中,商家同意后名片会自动出现';
+ if (s.apply && s.apply.status === 2) return '上次申请未通过,可修改后重新提交';
+ return '';
+ },
+ statusSub() {
+ const s = this.applyStatus;
+ if (!s || !s.apply) return '';
+ if (s.apply.status === 2) return '提交于 ' + (s.apply.create_time_txt || '');
+ return s.apply.create_time_txt ? ('提交于 ' + s.apply.create_time_txt) : '';
+ }
+ },
onLoad() {
uni.setNavigationBarTitle({ title: '申请名片' });
+ this.loadStatus();
},
methods: {
+ loadStatus() {
+ this.$api.sendRequest({
+ url: '/card/api/apply/status',
+ success: res => {
+ if (res.code == 0 && res.data) {
+ this.applyStatus = res.data;
+ }
+ this.statusLoaded = true;
+ },
+ fail: () => {
+ // 回查失败不阻塞表单
+ this.statusLoaded = true;
+ }
+ });
+ },
submit() {
if (this.submitting) return;
const name = String(this.form.name || '').trim();