@@ -46,6 +47,23 @@ const prop = defineProps({
default: null
}
})
+const touchstart = (e) => {
+ if (!state.mobile) return;
+ showTips(e.touches[0]);
+
+}
+const touchend = () => {
+ if (!state.mobile) return;
+ closeTips();
+}
+const mouseover = (e) => {
+ if (state.mobile) return;
+ showTips(e);
+}
+const mouseleave = () => {
+ if (state.mobile) return;
+ closeTips();
+}
const showTips = (e) => {
const x = e.pageX, y = e.pageY, maxH = window.innerHeight, maxW = window.innerWidth;
diff --git a/src/config/i18n/zh.ts b/src/config/i18n/zh.ts
index 3a7553a..a334518 100644
--- a/src/config/i18n/zh.ts
+++ b/src/config/i18n/zh.ts
@@ -119,7 +119,7 @@ export default class Zh {
'强化概率:6级80%,7级65%,8级45%,9级30%,10级以后20%',
];
reforge = '重铸';
- reforgeDesc = ['重铸说明', '花费金币重铸装备所有词条', '重铸时词条颜色与百分比值显示了该词条的等级'];
+ reforgeDesc = ['重铸说明', '点击任意词条花费金币重铸装备所有词条', '重铸时词条颜色与百分比值显示了该词条的等级'];
lock = '锁定';
unlock = '解锁';
sell = '出售';
diff --git a/src/store/action.ts b/src/store/action.ts
index b6115d8..36ef716 100644
--- a/src/store/action.ts
+++ b/src/store/action.ts
@@ -1,11 +1,11 @@
-import { initialWeapon, initialArmor, initialNeck, initialRing, i18n, archive_name, audio_mp3 } from '@/config';
+import { initialWeapon, initialArmor, initialNeck, initialRing, i18n, archive_name } from '@/config';
import { conisOfsell, getAssets } from '@/tool';
import { Base64 } from 'js-base64';
-const backgound = new Audio(audio_mp3.background);
+const backgound = new Audio('/audio/backgound.mp3');
backgound.loop = true;
backgound.volume = 0.2;
-const battle = new Audio(audio_mp3.battle);
+const battle = new Audio('/audio/battle.mp3');
battle.loop = true;
battle.volume = 0.2;
const music = {
@@ -26,6 +26,12 @@ export const play_music = (store, type) => {
});
};
+export const set_music_muted = (store, muted) => {
+ Object.keys(music).forEach((key) => {
+ music[key].muted = muted;
+ });
+};
+
export const set_music_volume = (store, volume) => {
Object.keys(music).forEach((key) => {
music[key].volume = volume;
diff --git a/src/store/mutation.ts b/src/store/mutation.ts
index 0c25d2e..82eeb85 100644
--- a/src/store/mutation.ts
+++ b/src/store/mutation.ts
@@ -1,4 +1,4 @@
-import { callPlayerAttribute, conisOfsell, getArrayEmptyIdx } from '@/tool';
+import { callPlayerAttribute, conisOfsell, getArrayEmptyIdx, callEuqipTipsLocation } from '@/tool';
import { reborn_point_coefficients, reborn_arrts, i18n } from '@/config';
const { t } = i18n;
@@ -37,38 +37,15 @@ export const set_sys_info = (state, data) => {
export const show_equip_tip = (state, data) => {
state.equipTip.equip = data.equip;
state.equipTip.compare = data.compare || false;
- const x = data.e.pageX,
- y = data.e.pageY,
- maxH = window.innerHeight,
- maxW = window.innerWidth;
- const tipsStyle = state.equipTip.tipsStyle;
- const tipsStyle2 = state.equipTip.tipsStyle2;
- if (x < maxW / 2) {
- delete tipsStyle.right;
- tipsStyle.left = x + 'px';
- delete tipsStyle2.right;
- tipsStyle2.left = 'calc(' + x + 'px + 21rem)';
- } else {
- delete tipsStyle.left;
- tipsStyle.right = maxW - x + 'px';
- delete tipsStyle2.left;
- tipsStyle.right2 = 'calc(' + tipsStyle.righ + ' - 21rem)';
- }
- if (y < maxH / 2) {
- delete tipsStyle.bottom;
- tipsStyle.top = y + 'px';
- delete tipsStyle2.bottom;
- tipsStyle2.top = y + 'px';
- } else {
- delete tipsStyle.top;
- tipsStyle.bottom = maxH - y + 'px';
- delete tipsStyle2.top;
- tipsStyle2.bottom = maxH - y + 'px';
- }
+ const styles = callEuqipTipsLocation(data.e, state.mobile);
+ state.equipTip.tipsStyle = styles[0];
+ state.equipTip.tipsStyle2 = styles[1];
state.equipTip.tipsShow = true;
+ console.log('show');
};
export const close_equip_tip = (state) => {
state.equipTip.tipsShow = false;
+ console.log('close');
};
export const clear_sys_info = (state, data) => {
state.sysInfo.splice(1, state.sysInfo.length);
@@ -97,7 +74,7 @@ export const add_bootys = (state, bootys) => {
add_player_coins(state, coins);
set_sys_info(state, { msg: t('autoSell.2') + t('getCoins') + coins, type: 'booty' });
return;
- }else {
+ } else {
state.grid[idx] = equip;
}
});
diff --git a/src/store/state.ts b/src/store/state.ts
index 8a925d2..41a1fb6 100644
--- a/src/store/state.ts
+++ b/src/store/state.ts
@@ -12,10 +12,11 @@ export default {
{ type: 'win', msg: t('welcome.0') },
{ type: 'win', msg: t('welcome.1') },
],
+ mobile: window.innerWidth < 768,
curMenu: null,
equipTip: {
equip: null,
- tipShow: false,
+ tipsShow: false,
compare: false,
tipsStyle: {},
tipsStyle2: {},
diff --git a/src/tool/caller.ts b/src/tool/caller.ts
index 91fabb7..c28c05a 100644
--- a/src/tool/caller.ts
+++ b/src/tool/caller.ts
@@ -155,3 +155,40 @@ export const callBattleResult = (player, monster) => {
}
return { win: curHp > 0, bouts: bouts, takeDmg: tmp - curHp };
};
+
+export const callEuqipTipsLocation = (e, mobile) => {
+ const x = e.pageX,
+ y = e.pageY,
+ maxH = window.innerHeight,
+ maxW = window.innerWidth,
+ tipsStyle: any = {},
+ tipsStyle2: any = {};
+ if (mobile) {
+ tipsStyle.left = '0.3rem';
+ tipsStyle2.left = '13.9rem';
+ const num = 10;
+ if (y < maxH / 2) {
+ tipsStyle.top = y + num + 'px';
+ tipsStyle2.top = y + num + 'px';
+ } else {
+ tipsStyle.bottom = maxH - y - num + 'px';
+ tipsStyle2.bottom = maxH - y - num + 'px';
+ }
+ } else {
+ if (x < maxW / 2) {
+ tipsStyle.left = x + 'px';
+ tipsStyle2.left = 'calc(' + x + 'px + 21rem)';
+ } else {
+ tipsStyle.right = maxW - x + 'px';
+ tipsStyle.right2 = 'calc(' + tipsStyle.righ + ' - 21rem)';
+ }
+ if (y < maxH / 2) {
+ tipsStyle.top = y + 'px';
+ tipsStyle2.top = y + 'px';
+ } else {
+ tipsStyle.bottom = maxH - y + 'px';
+ tipsStyle2.bottom = maxH - y + 'px';
+ }
+ }
+ return [tipsStyle, tipsStyle2];
+};
diff --git a/src/views/archive.vue b/src/views/archive.vue
index 0b2038e..d3b9a69 100644
--- a/src/views/archive.vue
+++ b/src/views/archive.vue
@@ -114,4 +114,22 @@ onMounted(() => { });
align-items: center;
justify-content: center;
}
+
+@media only screen and (max-width: 768px) {
+ .archive {
+ padding: 0.3rem;
+
+ .tip {
+ color: white;
+ font-size: 0.8rem;
+ margin: 0.25rem 0;
+ }
+ }
+
+ .textarea {
+ width: 22rem;
+ height: 20rem;
+ }
+
+}
\ No newline at end of file
diff --git a/src/views/backpack/auto-sell.vue b/src/views/backpack/auto-sell.vue
index 5e77926..8cbcba3 100644
--- a/src/views/backpack/auto-sell.vue
+++ b/src/views/backpack/auto-sell.vue
@@ -89,4 +89,29 @@ watch(() => autoSell.value.length, (n, o) => {
justify-content: space-around;
}
}
+
+
+@media only screen and (max-width: 768px) {
+ .sell-show {
+ height: 3rem;
+ line-height: 3rem;
+
+ .icon-setting {
+ height: 1.5rem;
+ width: 1.5rem;
+ margin-top: 0.7rem;
+ }
+
+ }
+
+ .sell-setting {
+ width: 7rem;
+ line-height: 1.5rem;
+
+ div {
+ line-height: 1.5rem;
+ font-size: 0.8rem;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/views/backpack/equip-menu.vue b/src/views/backpack/equip-menu.vue
index 724fc29..93a08e7 100644
--- a/src/views/backpack/equip-menu.vue
+++ b/src/views/backpack/equip-menu.vue
@@ -9,7 +9,8 @@
]" />
-