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();