feat: 名片夹运营闭环——申请状态条/需修改标/申请角标(配合商家后台 2.4.0)

- list.vue 顶部申请状态条: my_apply 待审(审核中)/被拒(可重新申请), 点按进申请页
- 被打回名片: 「需修改」红标, 点击弹层显示商家修改建议(review_note)
- 申请审批建卡: 头像「申」角标(from_apply)
- 数据源: /card/api/card/lists 增 my_apply + need_fix 派生字段
This commit is contained in:
2026-10-13 19:26:04 +08:00
parent c9a58a5ddf
commit b3f6ff7517

View File

@@ -13,15 +13,30 @@
<view class="claim-btn" @tap="onClaimTap">认领</view>
</view>
<!-- 申请状态条(Q7): 待审/被拒时常驻, 点按可重新申请 -->
<view v-if="applyBanner" class="apply-banner" :class="'apply-banner--' + applyBanner.type"
@tap="onApplyBannerTap">
<text class="apply-banner__ico">{{ applyBanner.type === 'warn' ? '!' : 'i' }}</text>
<view class="apply-banner__txt">
<text class="apply-banner__title">{{ applyBanner.title }}</text>
<text class="apply-banner__sub">{{ applyBanner.sub }}</text>
</view>
<text class="apply-banner__act">{{ applyBanner.action }}</text>
</view>
<!-- 列表 -->
<view class="card-list">
<view v-for="(item, index) in list" :key="item.id || index" class="card-item"
@tap="goDetail(item)">
<view class="card-avatar">
<text>{{ avatarText(item.name) }}</text>
<text v-if="item.from_apply == 1" class="avatar-flag">申</text>
</view>
<view class="card-info">
<view class="card-name line1">{{ item.name || '未命名名片' }}</view>
<view class="card-name line1">
{{ item.name || '未命名名片' }}
<text v-if="item.need_fix == 1" class="fix-flag" @tap.stop="showReviewNote(item)">需修改</text>
</view>
<view class="card-sub line1" v-if="item.job_title || item.company">
{{ [item.job_title, item.company].filter(Boolean).join(' · ') }}
</view>
@@ -55,9 +70,25 @@ export default {
count: 0,
keyword: '',
isLoading: false,
myApply: null,
emptyText: '暂无名片,可「新建」「申请」或「认领」添加'
};
},
computed: {
// Q7: 申请状态条——只在有进行中/被拒的申请时显示(已通过且有卡不打扰)
applyBanner() {
const a = this.myApply;
if (!a) return null;
const st = parseInt(a.status, 10);
if (st === 0) {
return { type: 'info', title: '建卡申请审核中', sub: '商家处理后名片会自动出现在名片夹', action: '查看' };
}
if (st === 2) {
return { type: 'warn', title: '申请未通过', sub: '可修改姓名/手机号后重新提交申请', action: '重新申请' };
}
return null;
}
},
onLoad() {
this.refresh();
},
@@ -96,17 +127,21 @@ export default {
page_size: this.pageSize,
keyword: this.keyword.trim()
},
success: res => {
if (res.code == 0) {
const data = res.data || {};
const rows = data.list || [];
this.pageCount = data.page_count || 1;
this.count = data.count || 0;
this.page = pageNo;
this.list = pageNo === 1 ? rows : this.list.concat(rows);
this.emptyText = this.keyword.trim()
? '未找到匹配的名片'
: '暂无名片,可「新建」「申请」或「认领」添加';
success: res => {
if (res.code == 0) {
const data = res.data || {};
const rows = data.list || [];
this.pageCount = data.page_count || 1;
this.count = data.count || 0;
this.page = pageNo;
this.list = pageNo === 1 ? rows : this.list.concat(rows);
// 申请状态只在首页返回, 分页不覆盖
if (pageNo === 1 && data.my_apply !== undefined) {
this.myApply = data.my_apply;
}
this.emptyText = this.keyword.trim()
? '未找到匹配的名片'
: '暂无名片,可「新建」「申请」或「认领」添加';
} else {
this.handleApiError(res);
}
@@ -137,6 +172,19 @@ export default {
url: '/pages_tool/card/apply'
});
},
// Q7: 申请状态条点按——被拒时去重新申请, 待审时去看进度(申请页自带状态回查)
onApplyBannerTap() {
this.goApply();
},
// Q5: 查看商户打的修改建议
showReviewNote(item) {
uni.showModal({
title: '商家修改建议',
content: (item && item.review_note) || '商家未填写具体建议,请联系发卡商家',
showCancel: false,
confirmText: '知道了'
});
},
onClaimTap() {
uni.showModal({
title: '认领名片',
@@ -233,6 +281,97 @@ export default {
}
}
/* Q7 申请状态条 */
.apply-banner {
display: flex;
align-items: center;
margin: 20rpx 0 8rpx;
padding: 18rpx 22rpx;
border-radius: 16rpx;
background: #eef4ff;
&--warn {
background: #fdf3e7;
}
&__ico {
width: 36rpx;
height: 36rpx;
line-height: 36rpx;
text-align: center;
border-radius: 50%;
background: var(--main-color, #0054a5);
color: #fff;
font-size: 24rpx;
font-weight: 700;
flex: none;
}
&--warn &__ico {
background: #e6a23c;
}
&__txt {
flex: 1;
min-width: 0;
margin-left: 16rpx;
}
&__title {
display: block;
font-size: 26rpx;
font-weight: 600;
color: #1a1f36;
}
&__sub {
display: block;
font-size: 22rpx;
color: #5a6478;
margin-top: 2rpx;
}
&__act {
font-size: 24rpx;
color: var(--main-color, #0054a5);
font-weight: 600;
flex: none;
}
&--warn &__act {
color: #e6a23c;
}
}
/* Q5 需修改标 / Q6 申请角标 */
.fix-flag {
display: inline-block;
vertical-align: middle;
margin-left: 12rpx;
padding: 2rpx 12rpx;
font-size: 20rpx;
line-height: 26rpx;
color: #e34d59;
background: #fdeced;
border-radius: 8rpx;
font-weight: 600;
}
.avatar-flag {
position: absolute;
right: -6rpx;
bottom: -6rpx;
width: 32rpx;
height: 32rpx;
line-height: 32rpx;
text-align: center;
font-size: 18rpx;
color: #fff;
background: #7c5cfc;
border-radius: 50%;
border: 2rpx solid #fff;
}
.claim-btn {
margin-left: 20rpx;
height: 72rpx;
@@ -272,6 +411,7 @@ export default {
}
.card-avatar {
position: relative;
width: 88rpx;
height: 88rpx;
border-radius: 50%;