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 | 63 ++++++++++++++++++++++--------- 1 files changed, 45 insertions(+), 18 deletions(-) diff --git a/apps/taro/src/subpackages/my/promotionQrcode/InnerPage.vue b/apps/taro/src/subpackages/my/promotionQrcode/InnerPage.vue index 371efe9..67bcd46 100644 --- a/apps/taro/src/subpackages/my/promotionQrcode/InnerPage.vue +++ b/apps/taro/src/subpackages/my/promotionQrcode/InnerPage.vue @@ -3,23 +3,27 @@ <div class="promotion-qrcode-content" :style="barStyle"> <div class="promotion-qrcode-content-qrcode" - :style="{ backgroundImage: `url(${OssAssets.common.PromotionQrcodeContentBG})` }" + :style="{ backgroundImage: `url(${OssAssets.common.PromotionQrcodeCodeBG})` }" > - <ShareQrcodeView :channles-num="userChannles[0]?.channlesNum" :size="148" /> + <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 { isWeb } from '@/utils/env'; +import Taro from '@tarojs/taro'; import { useSystemStore } from '@/stores/modules/system'; -import { CSSProperties } from 'vue'; +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%; @@ -68,11 +89,12 @@ } .promotion-qrcode-content-qrcode { - width: 432px; - height: 432px; + width: 440px; + height: 438px; display: flex; flex-direction: column; align-items: center; + justify-content: center; background-size: 100% 100%; background-repeat: no-repeat; position: relative; @@ -103,8 +125,13 @@ } .share-qrcode-view { - margin-top: 60px; + margin-top: -20px; padding: 0; } + + .share-qrcode-view-img { + width: 300px; + height: 300px; + } } </style> -- Gitblit v1.9.1