|
|
@ -66,7 +66,7 @@ const menu = usePopoverMenu(); |
|
|
|
const { show, top, left, index, open, close } = menu; |
|
|
|
const { show, top, left, index, open, close } = menu; |
|
|
|
|
|
|
|
|
|
|
|
const confirm = ref(); |
|
|
|
const confirm = ref(); |
|
|
|
const confirmFlag = ref(false); |
|
|
|
const confirmFlag = ref(true); |
|
|
|
let confirmRefresh; |
|
|
|
let confirmRefresh; |
|
|
|
let interval = 0; |
|
|
|
let interval = 0; |
|
|
|
|
|
|
|
|
|
|
@ -83,28 +83,43 @@ const refreshItems = () => { |
|
|
|
commit('set_shop', shop); |
|
|
|
commit('set_shop', shop); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const checkConfirm = () => { |
|
|
|
|
|
|
|
for (let i = 0; i < itemNum; i++) { |
|
|
|
|
|
|
|
const item = shop.value.item[i] |
|
|
|
|
|
|
|
if (item && item.quality.quality == qualitys[4]) { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const refreshByCoins = (e) => { |
|
|
|
const refreshByCoins = (e) => { |
|
|
|
if (e && confirmFlag.value) { |
|
|
|
if (confirmFlag.value) { |
|
|
|
confirm.value.open(0, e); |
|
|
|
if (e && checkConfirm()) { |
|
|
|
confirmRefresh = refreshByCoins; |
|
|
|
confirm.value.open(0, e); |
|
|
|
return; |
|
|
|
confirmRefresh = refreshByCoins; |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!coins.value || coins.value < refreshCoins) { |
|
|
|
if (!coins.value || coins.value < refreshCoins) { |
|
|
|
commit("set_sys_info", { msg: t('noCoinsRefresh'), type: "warning", }); |
|
|
|
commit("set_sys_info", { msg: t('noCoinsRefresh'), type: "warning", }); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
refreshItems(); |
|
|
|
refreshItems(); |
|
|
|
|
|
|
|
confirmFlag.value = true; |
|
|
|
commit('add_player_coins', refreshCoins * -1); |
|
|
|
commit('add_player_coins', refreshCoins * -1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
const refreshForFree = (e) => { |
|
|
|
const refreshForFree = (e) => { |
|
|
|
if (e && confirmFlag.value) { |
|
|
|
if (confirmFlag.value) { |
|
|
|
confirm.value.open(0, e); |
|
|
|
if (e && checkConfirm()) { |
|
|
|
confirmRefresh = refreshForFree; |
|
|
|
confirm.value.open(0, e); |
|
|
|
return; |
|
|
|
confirmRefresh = refreshByCoins; |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (shop.value.freeTimes > 0) { |
|
|
|
if (shop.value.freeTimes > 0) { |
|
|
|
refreshItems(); |
|
|
|
refreshItems(); |
|
|
|
|
|
|
|
confirmFlag.value = true; |
|
|
|
shop.value.freeTimes--; |
|
|
|
shop.value.freeTimes--; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
commit("set_sys_info", { msg: t('noRefreshTimes'), type: "warning", }); |
|
|
|
commit("set_sys_info", { msg: t('noRefreshTimes'), type: "warning", }); |
|
|
@ -127,6 +142,9 @@ const buyEquip = (idx) => { |
|
|
|
commit("set_backpack", grid); |
|
|
|
commit("set_backpack", grid); |
|
|
|
shopItems.value[idx] = null; |
|
|
|
shopItems.value[idx] = null; |
|
|
|
close(); |
|
|
|
close(); |
|
|
|
|
|
|
|
if(equip.quality.quality == qualitys[4]){ |
|
|
|
|
|
|
|
confirmFlag.value = false; |
|
|
|
|
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
commit("set_sys_info", { msg: t('noSpace'), type: "warning", }); |
|
|
|
commit("set_sys_info", { msg: t('noSpace'), type: "warning", }); |
|
|
|