This commit is contained in:
xiaoaojiao
2025-12-25 15:48:43 +08:00
parent 75897f8ff7
commit f48082a5f9
4 changed files with 43 additions and 47 deletions

View File

@@ -31,6 +31,34 @@ const lotteryShow = ref(false)
const lotteryType = ref("draw")
const lotteryNoticeData = ref(null)
//分享进来
const fromShare = async () => {
const fromId = getParam("fromid")
if (!fromId) {
return
}
const userinfos = Storage.get("userinfos")
if (fromId === userinfos.invite_code) {
weui.alert("不能接受自己的邀请哦~")
return
}
const inviteInfos = await Request("invite/info", { invite_code: fromId, type: "mapai" }, "GET")
if (inviteInfos.res.status == 200) {
const isHelp = inviteInfos.json.helps.find(v => v.id === inviteInfos.json.id)
console.log(isHelp)
if (!isHelp) {
const result = await Request("invite/help", { invite_code: fromId, type: "mapai" })
if (result.res.status == 200) {
weui.alert("受邀成功!")
}
} else {
weui.alert("您已接受过其他好友邀请,每人只能受邀一次哦~")
}
}
}
// 初始化全局音频实例
const initGlobalAudio = () => {
if (!globalStore.globalAudio) {
@@ -289,20 +317,20 @@ const initUserGameInfos = async (refresh_official, refresh_cap_scan) => {
globalToastEvent.emit(ToastType.MOUNTED)
}
}
const getNotice = async () => {
const result = await Request('notice/latest', {}, "GET")
if (result?.json?.notification) {
lotteryType.value = 'notice'
lotteryNoticeData.value = result.json.notification
lotteryShow.value = true
}
}
// const getNotice = async () => {
// const result = await Request('notice/latest', {}, "GET")
// if (result?.json?.notification) {
// lotteryType.value = 'notice'
// lotteryNoticeData.value = result.json.notification
// lotteryShow.value = true
// }
// }
const handleLoginSuccess = async () => {
console.log("已登录")
loginShow.value = false
await fromShare()
// await initUserGameInfos(true, true)
await getNotice()
// await getNotice()
}
if (isLogin()) {
@@ -347,10 +375,6 @@ globalToastEvent.on(ToastType.SHOW_SWIPER, () => {
})
const ruleShow = ref(false)
globalToastEvent.on(ToastType.SHOW_RULE, () => {
ruleShow.value = true
@@ -367,6 +391,9 @@ const getUserLottery = async () => {
const result = await Request("lottery", { pool: "all" }, "GET")
if (result.res.status === 200) {
prizelist.value = result.json.lottery_logs.length > 0 ? result.json.lottery_logs : []
if(prizelist.value.length===0){
weui.alert("您还没有中奖")
}
}
//TODO 上线换成上面的
// prizelist.value = [