feat: 分销码
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 1m6s

This commit is contained in:
luo
2026-10-08 12:26:39 +08:00
parent 2b4fd6fff8
commit b2ed8b5df4
5 changed files with 57 additions and 2 deletions

View File

@@ -30,7 +30,7 @@
/>
</view>
<text class="mt-4 text-13px text-[#7a8590]">
扫描二维码获取分销信息
扫描二维码进入代理注册
</text>
</view>
</view>
@@ -51,6 +51,11 @@ const loading = ref(true);
const distributionCode = ref('');
const errorMessage = ref('');
function getRegistrationUrl(code: string) {
const apiBaseUrl = import.meta.env.VITE_API_BASE_URL.replace(/\/+$/, '');
return `${apiBaseUrl}/agent-registration?distribution_code=${encodeURIComponent(code)}`;
}
function drawQrCode(value: string) {
const qrCode = qrcodeGenerator(0, 'M');
qrCode.addData(value);
@@ -106,7 +111,7 @@ async function loadDistributionCode() {
distributionCode.value = code;
await nextTick();
drawQrCode(code);
drawQrCode(getRegistrationUrl(code));
}
catch (error) {
console.error('加载分销码失败:', error);