From e47c70d32e6fa7c9cb16ca19a79338ea36a83e94 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期二, 10 六月 2025 16:38:37 +0800 Subject: [PATCH] fix: v1.4 --- apps/taro/src/subpackages/my/promotionQrcode/InnerPage.vue | 50 ++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 38 insertions(+), 12 deletions(-) diff --git a/apps/taro/src/subpackages/my/promotionQrcode/InnerPage.vue b/apps/taro/src/subpackages/my/promotionQrcode/InnerPage.vue index 0d69e69..67bcd46 100644 --- a/apps/taro/src/subpackages/my/promotionQrcode/InnerPage.vue +++ b/apps/taro/src/subpackages/my/promotionQrcode/InnerPage.vue @@ -5,21 +5,25 @@ class="promotion-qrcode-content-qrcode" :style="{ backgroundImage: `url(${OssAssets.common.PromotionQrcodeCodeBG})` }" > - <ShareQrcodeView :channles-num="userChannles[0]?.channlesNum" :size="150" /> + <div class="share-qrcode-view"> + <img v-if="link" :src="link" class="share-qrcode-view-img" /> + </div> <div class="promotion-qrcode-content-qrcode-tips">闀挎寜浜岀淮鐮佸垎浜ソ鍙�</div> </div> - <div class="promotion-qrcode-content-btn">鐐瑰嚮涓嬭浇浜岀淮鐮�</div> + <div class="promotion-qrcode-content-btn" @click="downloadQrcode">鐐瑰嚮涓嬭浇浜岀淮鐮�</div> </div> </ContentView> </template> <script setup lang="ts"> -import { ShareQrcodeView, ResultWithoutBG } from '@life-payment/components'; import { useLifeRechargeContext } from '@life-payment/core-vue'; import Taro from '@tarojs/taro'; import { useSystemStore } from '@/stores/modules/system'; import { CSSProperties, useTemplateRef } from 'vue'; import { OssAssets } from '@/constants'; +import { createQrCodeImg } from '@/components/Qrcode/utils/qrcode'; +import { downloadBase64File, Message } from '@/utils'; +import { isInAlipay } from '@/utils/env'; defineOptions({ name: 'InnerPage', @@ -28,16 +32,21 @@ // const { virtualUserInfo } = useUser(); const { blLifeRecharge } = useLifeRechargeContext(); -const userChannles = computed(() => - (blLifeRecharge.accountModel.userChannles ?? []).filter( - (x) => x.switchType !== blLifeRecharge.constants.LifePaySwitchTypeEnum.寰俊灏忕▼搴� - ) -); +const qrcodeRef = ref(); -const channlesType = ref(userChannles.value[0]?.channlesNum ?? ''); +const router = Taro.useRouter(); -watch(userChannles, (val) => { - channlesType.value = val?.[0]?.channlesNum ?? ''; +const promoterIdNumber = router.params?.promoterIdNumber ?? ''; + +// const link = computed( +// () => +// `${CLIENT_ORIGIN}/subpackages/my/AgentRecruitment/AgentRecruitment?promoterIdNumber=${promoterIdNumber}` +// ); +const link = computed(() => { + const url = `${CLIENT_ORIGIN}/subpackages/my/AgentRecruitment/AgentRecruitment?promoterIdNumber=${promoterIdNumber}`; + return createQrCodeImg(url, { + size: 300, + }); }); const systemStore = useSystemStore(); @@ -49,6 +58,18 @@ backgroundImage: `url(${OssAssets.common.PromotionQrcodeContentBG})`, } as CSSProperties) ); + +function downloadQrcode() { + // Taro.saveImageToPhotosAlbum({ + // filePath: link.value, + // }); + if (isInAlipay) { + Message.warning('鍙湪娴忚鍣ㄦ墦寮�姝ょ綉椤典笅杞芥枃浠躲��'); + } else { + // TODO 杩橀渶瑕佸仛灏忕▼搴忎笅杞界殑鍏煎 + downloadBase64File(link.value, '鎺ㄥ箍浜岀淮鐮�'); + } +} </script> <style lang="scss"> @@ -56,7 +77,7 @@ .promotion-qrcode-page-wrapper { .promotion-qrcode-content { - margin-top: 480px; + margin-top: 400px; width: 100%; height: 788px; background-size: 100% 100%; @@ -107,5 +128,10 @@ margin-top: -20px; padding: 0; } + + .share-qrcode-view-img { + width: 300px; + height: 300px; + } } </style> -- Gitblit v1.9.1