|
@@ -179,19 +179,16 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
-import { ref, nextTick, onMounted, reactive } from 'vue'
|
|
|
-import { useAudioManager } from '@/hook/index'
|
|
|
+import { ref, nextTick, onMounted, reactive, getCurrentInstance } from 'vue'
|
|
|
+import { useAudioManager, useSchedulerOnce } from '@/hook/index'
|
|
|
import AbleChart from '../../components/AbleChart.vue'
|
|
|
import { screenShot, createQrcode } from '@/utils/utils'
|
|
|
import { getReportByUser, shareUserReport } from "@/api/learnPlan"
|
|
|
import { useRoute } from 'vue-router'
|
|
|
import { useAppRouter, useAppFunc } from '@/hook/appHook'
|
|
|
-import { Overlay, ActionSheet } from 'vant'
|
|
|
+import { Overlay, ActionSheet, showToast } from 'vant'
|
|
|
import OpenApp from '@/components/OpenApp/index.vue'
|
|
|
import { registerWxopenButton } from '@/utils/utils'
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
export interface QueryParams {
|
|
|
i: string,
|
|
|
u?: string,
|
|
@@ -218,12 +215,6 @@ const [fco, atx] = useAudioManager({
|
|
|
|
|
|
const queryParams = useRoute().query as unknown as QueryParams
|
|
|
|
|
|
-console.log('timeStamp');
|
|
|
-
|
|
|
-
|
|
|
-console.log('queryParams:', queryParams);
|
|
|
-
|
|
|
-
|
|
|
// queryParams.i = "1630466274125459458"
|
|
|
// queryParams.u = "1430026961974345730"
|
|
|
|
|
@@ -296,12 +287,19 @@ const openModal = () => {
|
|
|
createPoster()
|
|
|
}
|
|
|
|
|
|
-const savePoster = () => {
|
|
|
- appFunc.savePoster(posterblob.value)
|
|
|
+const savePoster = async () => {
|
|
|
+ await _shareUserReport()
|
|
|
+ useSchedulerOnce({
|
|
|
+ cb: () => appFunc.savePoster(posterblob.value),
|
|
|
+ delay: 500
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
const _shareUserReport = async () => {
|
|
|
- await shareUserReport({ "itemId": queryParams.i, "userId": queryParams.u! })
|
|
|
+ const { data } = await shareUserReport({ "itemId": queryParams.i, "userId": queryParams.u! })
|
|
|
+ if (data.state !== 0) {
|
|
|
+ showToast(`分享成功, 获得${data.winWisdomCoin}个智慧币`)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const updatePercentage = (e) => {
|
|
@@ -313,9 +311,12 @@ const updatePercentage = (e) => {
|
|
|
}
|
|
|
|
|
|
// 分享海报到微信
|
|
|
-const shareWx = () => {
|
|
|
- appFunc.shareWx(posterblob.value)
|
|
|
- _shareUserReport()
|
|
|
+const shareWx = async () => {
|
|
|
+ await _shareUserReport()
|
|
|
+ useSchedulerOnce({
|
|
|
+ cb: () => appFunc.shareWx(posterblob.value),
|
|
|
+ delay: 500
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 获取用户报告信息
|
|
@@ -352,7 +353,6 @@ const getQrcodeUrl = async () => {
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
-
|
|
|
if (queryParams.u) {
|
|
|
_getReportByUser()
|
|
|
} else {
|