optimize: make page share reward

This commit is contained in:
zzc
2026-01-27 19:35:47 +08:00
parent eb37c2d295
commit 115562de53
3 changed files with 19 additions and 3 deletions

View File

@@ -113,6 +113,7 @@ import { ref, onMounted } from "vue";
import { getBavBarHeight } from "@/utils/system";
import { onLoad } from "@dcloudio/uni-app";
import { getPageDetail } from "@/api/system.js";
import { saveViewRequest } from "@/utils/common.js";
const navBarHeight = ref(44);
const statusBarHeight = ref(20);
@@ -125,6 +126,7 @@ onLoad(async (options) => {
const card = await getPageDetail(options.shareToken);
cardId.value = card.id;
cardDetail.value = card;
saveViewRequest(options.shareToken, "card_generate", card.id);
}
});

View File

@@ -56,7 +56,7 @@
<uni-icons type="cloud-download" size="20" color="#888"></uni-icons>
<view>保存</view>
</button>
<button open-type="share" class="btn primary" @tap="shareOrSave">
<button open-type="share" class="btn primary">
<uni-icons
type="paperplane-filled"
size="20"
@@ -590,12 +590,16 @@ const preview = async () => {
return;
}
const tempPath = await saveByCanvas(true);
saveRecordRequest(tempPath, cardId.value || "", "card_generate");
id = createCard();
shareOrSave(id);
saveRecordRequest(tempPath, id, "card_generate");
// uni.showToast({ title: '已保存到相册', icon: 'checkmarkempty' })
};
const shareOrSave = async (id) => {
if (!id) id = createCard();
const tempPath = await saveByCanvas(false);
const imageUrl = await uploadImage(tempPath);