This commit is contained in:
Putoo
2026-07-07 18:43:01 +08:00
parent 7f29fd46b8
commit 037e845622
37 changed files with 854 additions and 106 deletions

View File

@@ -8,6 +8,9 @@
<div class="common">
<Abar href="/map">继续</Abar>
</div>
<div class="common" v-if="isCopy == 1">
[<Abutton @click="onHook">立即挂机</Abutton>]
</div>
<div class="common">
你体力:{{ blood }}/{{ upBlood }}
</div>
@@ -38,6 +41,7 @@ const blood = ref(0);
const upBlood = ref(0);
const fight = ref<any>({});
const AwardTips = ref('');
const isCopy = ref(0);
let fightId = PageExtend.QueryString("f");
onMounted(async () => {
@@ -57,6 +61,7 @@ const BindData = async (): Promise<void> => {
blood.value = result.data.blood;
upBlood.value = result.data.upBlood;
fight.value = result.data.fight;
isCopy.value = result.data.isCopy;
if (fight.value.award != '') {
AwardTips.value = awardTipsStr(JSON.parse(fight.value.award))
}
@@ -89,4 +94,18 @@ const awardTipsStr = (data: any) => {
return result;
}
/**挂机 */
const onHook = async () => {
MessageExtend.LoadingToast("正在进行挂机...");
let result = await FightService.OnHook(fightId);
MessageExtend.LoadingClose();
if (result.code == 0) {
isCopy.value = 0;
MessageExtend.Notify("挂机成功!", "success");
}
else {
MessageExtend.Notify(result.msg, "danger");
}
}
</script>