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

@@ -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);