Browse Source

屎屎屎屎屎屎屎屎屎屎屎屎屎屎屎屎屎屎屎

xiongzhu 2 years ago
parent
commit
2761547567

BIN
src/assets/bg_share_card.png


BIN
src/assets/bg_vip.png


BIN
src/assets/brand.png


BIN
src/assets/png-huiyuan.png


BIN
src/assets/png-yaoqinghaoyou.png


+ 6 - 5
src/components/common/Share/index.vue

@@ -3,7 +3,7 @@
         <div class="share-box">
             <img :src="imgUrl" v-if="imgUrl" alt="" class="shareImgUrl" />
             <div class="share-img" v-else ref="postRef">
-                <img src="@/assets/png-yaoqinghaoyou.png" class="bg" alt="" />
+                <img src="@/assets/bg_share_card.png" class="bg" alt="" />
                 <div class="qrcode">
                     <qrcode-vue :value="shareUrl" :size="124" level="H" />
                 </div>
@@ -15,13 +15,14 @@
     </n-modal>
 </template>
 
-<script setup>
+<script setup lang="ts">
 import { NModal, NButton } from 'naive-ui'
 import { ref, computed } from 'vue'
 import QrcodeVue from 'qrcode.vue'
 import html2canvas from 'html2canvas'
 import resolveUrl from 'resolve-url'
 import { useUserStore } from '@/store'
+import { Ref } from 'vue'
 const showModal = ref(false)
 
 const imgUrl = ref('')
@@ -32,11 +33,11 @@ const shareUrl = computed(() => {
     return resolveUrl(baseURL, '#/login?invitor=' + userStore.userInfo.id)
 })
 
-const postRef = ref(null)
+const postRef: Ref<HTMLElement | null> = ref(null)
 function init() {
     showModal.value = true
     setTimeout(() => {
-        html2canvas(postRef.value, {
+        html2canvas(postRef.value!, {
             useCORS: true,
             allowTaint: true,
             backgroundColor: null,
@@ -58,7 +59,7 @@ function down() {
     document.body.appendChild(tempLink)
     tempLink.click()
     document.body.removeChild(tempLink)
-    window.URL.revokeObjectURL(imgUrl)
+    window.URL.revokeObjectURL(imgUrl.value)
 }
 
 defineExpose({ init })

+ 2 - 2
src/components/common/SvgIcon/index.vue

@@ -3,7 +3,7 @@ import { computed, useAttrs } from 'vue'
 import { Icon } from '@iconify/vue'
 
 interface Props {
-    icon: string
+    icon?: string
 }
 
 defineProps<Props>()
@@ -17,5 +17,5 @@ const bindAttrs = computed<{ class: string; style: string }>(() => ({
 </script>
 
 <template>
-    <Icon :icon="icon" v-bind="bindAttrs" />
+    <Icon :icon="icon || ''" v-bind="bindAttrs" />
 </template>

+ 1 - 1
src/components/common/VipCard/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="vip-card">
-        <img class="vip-bg" src="@/assets/png-huiyuan.png" alt="" />
+        <img class="vip-bg" src="@/assets/bg_vip.png" alt="" />
 
         <div class="vip-text">
             <div class="text1">

+ 1 - 0
src/typings/global.d.ts

@@ -4,3 +4,4 @@ interface Window {
     $message?: import('naive-ui').MessageProviderInst
     $notification?: import('naive-ui').NotificationProviderInst
 }
+declare module 'resolve-url';

+ 1 - 1
src/views/page/Vip.vue

@@ -3,7 +3,7 @@
         <n-page-header title="开通会员" @back="handleBack"> </n-page-header>
 
         <n-card :bordered="false">
-            <vip-card @goVip="goVip" pageType="vip"></vip-card>
+            <vip-card pageType="vip"></vip-card>
         </n-card>
     </div>
 </template>

+ 1 - 1
yarn.lock

@@ -5055,7 +5055,7 @@ qs@^6.11.1:
 
 query-string@^8.1.0:
   version "8.1.0"
-  resolved "https://registry.yarnpkg.com/query-string/-/query-string-8.1.0.tgz#e7f95367737219544cd360a11a4f4ca03836e115"
+  resolved "https://registry.npmmirror.com/query-string/-/query-string-8.1.0.tgz#e7f95367737219544cd360a11a4f4ca03836e115"
   integrity sha512-BFQeWxJOZxZGix7y+SByG3F36dA0AbTy9o6pSmKFcFz7DAj0re9Frkty3saBn3nHo3D0oZJ/+rx3r8H8r8Jbpw==
   dependencies:
     decode-uri-component "^0.4.1"