chore:名片样式第一个背景

This commit is contained in:
2026-10-15 10:18:04 +08:00
parent e8fc1aca06
commit 5a009130e6
3 changed files with 123 additions and 7 deletions

View File

@@ -401,6 +401,31 @@ export default {
});
// #endif
},
/**
* 契约 §4(2026-10-15): 同意后跳对方公开名片页。
* wap_url 原样使用(后端已带 ?site_id=..&card_id=..), 前端唯一允许的改动是追加
* &back_url=encodeURIComponent(我方名片页完整地址); wap_url 为空(对方刚删卡等)
* 则交给调用方: 人脉已互建, 不跳转只 toast 成功。
*/
jumpToOtherPublic(wapUrl) {
if (!wapUrl) return;
let url = wapUrl;
const back = this.myPageFullUrl();
if (back) {
url += (wapUrl.indexOf('?') >= 0 ? '&' : '?') + 'back_url=' + encodeURIComponent(back);
}
this.gotoPublic(url);
},
// 我方名片页完整地址: H5 运行时取 window.location.href(禁止写死域名, 部署/测试环境不同);
// 非 H5(小程序/App) 无等价 H5 地址, 返回 '' 由 share.vue 中转页原生返回。
myPageFullUrl() {
// #ifdef H5
return window.location.href;
// #endif
// #ifndef H5
return '';
// #endif
},
/**
* 详情接口非 0(未登录/非本人名下/卡片不存在): 后端报错信封照样返回 wap_url,
* 据此匿名落地到公开页(可看、可提交交换请求), 不出现死路。
@@ -506,8 +531,11 @@ export default {
const txt = d.receiver_created === 0 ? '已交换(人脉已存在)' : '已交换,人脉已互加';
uni.showToast({ title: txt, icon: 'none' });
this.loadExchange();
// 参考图: 同意后展示对方的公开名片页(含「企业介绍 / 收下名片」面板)
this.openPublicCard(item.from_card_id);
// 契约 §4(2026-10-15): 同意后用响应里的 wap_url 跳对方公开名片页,
// 仅追加 &back_url=(encodeURIComponent 我方名片页完整地址); wap_url 为空不跳转
if (d.wap_url) {
this.jumpToOtherPublic(d.wap_url);
}
} else if (res.message) {
// 请求已被处理/不存在/对方名片失效: 直接提示后端文案, 不二次弹「没有待处理请求」
uni.showToast({ title: res.message, icon: 'none' });