panhui 2 năm trước cách đây
mục cha
commit
aa99a3ce76

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 3521 - 1231
package-lock.json


BIN
src/assets/share1.png


BIN
src/assets/share2.png


BIN
src/assets/share3.png


BIN
src/assets/share4.png


BIN
src/assets/share5.png


BIN
src/assets/share6.png


BIN
src/assets/share7.png


BIN
src/assets/share8.png


+ 16 - 4
src/components/common/ShareModal.vue

@@ -26,7 +26,7 @@
                 <n-button text v-if="isMobile">长按保存图片</n-button>
                 <n-button text v-else @click="save">保存图片</n-button>
                 <n-button text :loading="loading" @click="changeType">换个样式</n-button>
-                <n-button text>复制邀请链接</n-button>
+                <n-button text @click="copyShare">复制邀请链接</n-button>
             </div>
 
             <!-- <div class="tips" v-if="isMobile">长按保存图片</div>
@@ -40,8 +40,9 @@
 </template>
 
 <script setup lang="ts">
-import { NModal, NButton, NAvatar } from 'naive-ui'
+import { NModal, NButton, NAvatar, useMessage } from 'naive-ui'
 import { ref, watch, computed } from 'vue'
+import { useClipboard } from '@vueuse/core'
 import QrcodeVue from 'qrcode.vue'
 import html2canvas from 'html2canvas'
 import { useUserStore } from '@/store'
@@ -90,6 +91,7 @@ watch(
     () => props.show,
     val => {
         if (val) {
+            shareType.value = Math.floor(Math.random() * 7)
             changeType()
         }
     }
@@ -98,8 +100,7 @@ watch(
 function changeType() {
     loading.value = true
     imgUrl.value = ''
-    let type = Math.floor(Math.random() * 7)
-    shareType.value = type !== shareType.value ? type : (type + 1) % 7
+    shareType.value = (shareType.value + 1) % 7
     setTimeout(() => {
         html2canvas(postRef.value!, {
             useCORS: true,
@@ -129,6 +130,17 @@ function save() {
 }
 
 const { isMobile } = useBasicLayout()
+
+const message = useMessage()
+const { text, copy, copied, isSupported } = useClipboard()
+async function copyShare() {
+    try {
+        await copy('【CHILLGPT——开启人工智能时代】' + shareUrl.value)
+        message.success('复制成功')
+    } catch (e) {
+        console.error(e)
+    }
+}
 </script>
 
 <style lang="less" scoped>

+ 15 - 14
src/components/common/minePannel.vue

@@ -122,20 +122,21 @@ fetchUserBalance().then((res: any) => {
 
 const userMemberStore = useUserMemberStore()
 function shareEvent() {
-    if (userMemberStore.isVip()) {
-        showShareModal.value = true
-    } else {
-        dialog.create({
-            title: '提示',
-            content: '加入会员才能开通分享功能',
-            positiveText: '加入会员',
-            negativeText: '取消',
-            maskClosable: false,
-            onPositiveClick: () => {
-                goVip()
-            }
-        })
-    }
+    showShareModal.value = true
+    // if (userMemberStore.isVip()) {
+    //     showShareModal.value = true
+    // } else {
+    //     dialog.create({
+    //         title: '提示',
+    //         content: '加入会员才能开通分享功能',
+    //         positiveText: '加入会员',
+    //         negativeText: '取消',
+    //         maskClosable: false,
+    //         onPositiveClick: () => {
+    //             goVip()
+    //         }
+    //     })
+    // }
     //
 }
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 154 - 237
yarn.lock


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác