This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user