111
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
srcDir: 'src/',
|
||||
|
||||
components: {
|
||||
dirs: [
|
||||
// 自动递归 components 下所有子文件夹
|
||||
{ path: '~/components', pathPrefix: false }
|
||||
]
|
||||
},
|
||||
future: {
|
||||
compatibilityVersion: 4,
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<button class="but" @click="handleClick">
|
||||
<button class="kx-link-button" @click="handleClick">
|
||||
<slot></slot>
|
||||
</button>
|
||||
</template>
|
||||
@@ -15,7 +15,7 @@ const handleClick = (): any => {
|
||||
|
||||
|
||||
<style>
|
||||
.but {
|
||||
.kx-link-button {
|
||||
/* text-decoration: underline; */
|
||||
color: #1e5494;
|
||||
font-size: 18px;
|
||||
@@ -23,7 +23,7 @@ const handleClick = (): any => {
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
.but:hover{
|
||||
.kx-link-button:hover{
|
||||
color: #FFFFFF;
|
||||
background: #1e5494;
|
||||
}
|
||||
26
Web/src/components/Base/Acheak.vue
Normal file
26
Web/src/components/Base/Acheak.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<Abutton @click="handleClick" v-if="onValue != onCheak">
|
||||
<slot></slot>
|
||||
</Abutton>
|
||||
|
||||
<span v-if="onValue == onCheak">
|
||||
<slot></slot>
|
||||
</span>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// 1. 定义接收父组件传来的参数 props
|
||||
const props = defineProps({
|
||||
// 字段名、类型、默认值
|
||||
href: String,
|
||||
onValue: String,
|
||||
onCheak: String
|
||||
|
||||
})
|
||||
|
||||
const emit = defineEmits(['click'])
|
||||
// 定义 click 事件
|
||||
const handleClick = (): any => {
|
||||
emit('click')
|
||||
}
|
||||
|
||||
</script>
|
||||
23
Web/src/components/Page/Footer.vue
Normal file
23
Web/src/components/Page/Footer.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<div class="clear"></div>
|
||||
<div class="foot">
|
||||
<div class="common">
|
||||
<Abar href="/">首页</Abar>-
|
||||
<Abar href="/">挂机</Abar>-
|
||||
<a target="_blank" href="https://work.weixin.qq.com/kfid/kfc86bc348120aea3e7">反馈</a>
|
||||
</div>
|
||||
|
||||
<div class="timeService">
|
||||
小G报时({{ timeTips }})
|
||||
</div>
|
||||
<p style="font-weight:bold;font-size:14px">官方QQ群:931835791</p>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
const timeTips = ref(TimeExtend.Now("HH:mm"));
|
||||
onMounted(() => {
|
||||
setInterval(() => {
|
||||
timeTips.value = TimeExtend.Now("HH:mm");
|
||||
}, 1000)
|
||||
})
|
||||
</script>
|
||||
17
Web/src/components/Page/MapMenu.vue
Normal file
17
Web/src/components/Page/MapMenu.vue
Normal file
@@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<div class="common">
|
||||
<Abar href="/">状态</Abar>.
|
||||
<Abar href="/">物品</Abar>.
|
||||
<Abar href="/chat">聊天</Abar>
|
||||
</div>
|
||||
<div class="common">
|
||||
<Abar href="/">好友</Abar>.
|
||||
<Abar href="/">宠物</Abar>.
|
||||
<Abar href="/">队伍</Abar>
|
||||
</div>
|
||||
<div class="common">
|
||||
<Abar href="/">商城</Abar>.
|
||||
<Abar href="/">活动</Abar>.
|
||||
<Abar href="/">排行</Abar>
|
||||
</div>
|
||||
</template>
|
||||
@@ -30,8 +30,7 @@ export class ApiService {
|
||||
return typeof error === "object" && error !== null && "handled" in error && error.handled === true;
|
||||
}
|
||||
|
||||
private static redirectToLogin() {
|
||||
this.userStore.offOnline();
|
||||
private static redirectToLogin() {
|
||||
window.location.href = "/";
|
||||
}
|
||||
|
||||
|
||||
72
Web/src/extends/TimeExtend.ts
Normal file
72
Web/src/extends/TimeExtend.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
export class TimeExtend {
|
||||
/**
|
||||
* 格式化日期
|
||||
* @param date 日期对象/时间戳/日期字符串
|
||||
* @param format 格式化模板
|
||||
* 示例:yyyy-MM-dd、yyyy-MM-dd HH:mm:ss、HH:mm:ss、yyyy年MM月dd日
|
||||
*/
|
||||
public static Format(date: Date | string | number, format = 'yyyy-MM-dd HH:mm:ss'): string {
|
||||
let targetDate: Date
|
||||
if (typeof date === 'number') {
|
||||
targetDate = date.toString().length === 10 ? new Date(date * 1000) : new Date(date)
|
||||
} else {
|
||||
targetDate = new Date(date)
|
||||
}
|
||||
|
||||
if (isNaN(targetDate.getTime())) return ''
|
||||
|
||||
const year = targetDate.getFullYear()
|
||||
const month = targetDate.getMonth() + 1
|
||||
const day = targetDate.getDate()
|
||||
const hours = targetDate.getHours()
|
||||
const minutes = targetDate.getMinutes()
|
||||
const seconds = targetDate.getSeconds()
|
||||
|
||||
const pad = (num: number) => num.toString().padStart(2, '0')
|
||||
|
||||
return format
|
||||
.replace('yyyy', String(year))
|
||||
.replace('MM', pad(month))
|
||||
.replace('dd', pad(day))
|
||||
.replace('HH', pad(hours))
|
||||
.replace('hh', pad(hours > 12 ? hours - 12 : hours))
|
||||
.replace('mm', pad(minutes))
|
||||
.replace('ss', pad(seconds))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时间格式化字符串
|
||||
* @param format 格式
|
||||
*/
|
||||
public static Now(format = 'yyyy-MM-dd HH:mm:ss'): string {
|
||||
return this.Format(new Date(), format)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前毫秒时间戳
|
||||
*/
|
||||
public static GetTimeStamp(): number {
|
||||
return Date.now()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前秒级时间戳
|
||||
*/
|
||||
public static GetSecondStamp(): number {
|
||||
return Math.floor(Date.now() / 1000)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期 yyyy-MM-dd
|
||||
*/
|
||||
public static GetDateStr(): string {
|
||||
return this.Now('yyyy-MM-dd')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时分秒 HH:mm:ss
|
||||
*/
|
||||
public static GetTimeStr(): string {
|
||||
return this.Now('HH:mm:ss')
|
||||
}
|
||||
}
|
||||
@@ -6,19 +6,7 @@
|
||||
<button class="btn btn-ret" @click="GoBack">返回</button><br />
|
||||
<Abar href="/map">返回游戏</Abar>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div class="foot">
|
||||
<div class="common">
|
||||
<Abar href="/">首页</Abar>-
|
||||
<Abar href="/">挂机</Abar>-
|
||||
<a target="_blank" href="https://work.weixin.qq.com/kfid/kfc86bc348120aea3e7">反馈</a>
|
||||
</div>
|
||||
|
||||
<div class="timeService">
|
||||
小G报时({{ TimeExtend.Now("HH:mm") }})
|
||||
</div>
|
||||
<p style="font-weight:bold;font-size:14px">官方QQ群:931835791</p>
|
||||
</div>
|
||||
<Footer></Footer>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
51
Web/src/pages/chat/index.vue
Normal file
51
Web/src/pages/chat/index.vue
Normal file
@@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<div class="contet">
|
||||
【聊天频道】. <Abutton @click="Refresh">刷新</Abutton><br />
|
||||
<Abar href="/news">*更新内容早知道</Abar>
|
||||
</div>
|
||||
<div class="title">
|
||||
<Acheak @click="BindData('')" :on-value="type" on-cheak="">公共</Acheak>.
|
||||
<Acheak @click="BindData('1')" :on-value="type" on-cheak="1">队伍</Acheak>.
|
||||
<Acheak @click="BindData('2')" :on-value="type" on-cheak="2">帮派</Acheak>.
|
||||
<Acheak @click="BindData('3')" :on-value="type" on-cheak="3">全区</Acheak>.
|
||||
<Acheak @click="BindData('4')" :on-value="type" on-cheak="4">系统</Acheak>.
|
||||
<Acheak @click="BindData('5')" :on-value="type" on-cheak="5">全服</Acheak>
|
||||
</div>
|
||||
<div class="chat">
|
||||
<div class="item">
|
||||
暂无发言.
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
|
||||
const type = ref('');
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData(type.value);
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const BindData = async (typeid: string): Promise<void> => {
|
||||
if (type.value != typeid) {
|
||||
type.value = typeid;
|
||||
}
|
||||
};
|
||||
|
||||
/**刷新 */
|
||||
const Refresh = async (): Promise<void> => {
|
||||
MessageExtend.LoadingToast("刷新中...");
|
||||
await BindData(type.value);
|
||||
MessageExtend.LoadingClose();
|
||||
MessageExtend.Notify("刷新成功!", "success");
|
||||
PageExtend.ScrollToTop();
|
||||
}
|
||||
</script>
|
||||
@@ -69,7 +69,7 @@
|
||||
</div>
|
||||
<div class="foot">
|
||||
<div class="timeService">
|
||||
小G报时(18:33)
|
||||
小G报时({{ TimeExtend.Now("HH:mm") }})
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -3,24 +3,22 @@
|
||||
<span>[在线奖励]:3分钟后可领取.</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
威尼斯·广场
|
||||
{{ cityInfo.cityName }}·{{ mapInfo.mapName }}
|
||||
<Abutton @click="Refresh">刷新</Abutton>
|
||||
<a class="a-nomargin"
|
||||
href="/Task/Index/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">任务</a><a class=""
|
||||
href="/Message/Index/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">消息</a>
|
||||
<Abar href="">任务</Abar>
|
||||
<Abar href="">消息</Abar>
|
||||
</div>
|
||||
<div class="content" style="font-size:14px;font-weight:bold;color:dodgerblue">
|
||||
|
||||
</div>
|
||||
<div class="notification">
|
||||
<div class="chat">
|
||||
<div class="item">
|
||||
[公共]
|
||||
<span><img src='http://gree.pccsh.com/res/badge/9001.gif' class='user-head' alt='头像' /><a class='a-nodec'
|
||||
href='/User/Index/Home/250822?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo'><span
|
||||
class='Nick-Gold'> 航海百曉生 </span></a><img src='http://gree.pccsh.com/res/badge/9001.gif' alt='vip'
|
||||
class='vip' /> <span class='icon-cry'><i class='icon-crystal liangHao'></i></span><img
|
||||
src='http://gree.pccsh.com/res/badge/9001.gif' alt='心愿星河' class='badge' /> </span>
|
||||
<span><img src='http://gree.pccsh.com/res/badge/9001.gif' class='user-head' alt='头像' /><a
|
||||
class='a-nodec' href='/User/Index/Home/250822?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo'><span
|
||||
class='Nick-Gold'> 航海百曉生 </span></a><img src='http://gree.pccsh.com/res/badge/9001.gif'
|
||||
alt='vip' class='vip' /> <span class='icon-cry'><i
|
||||
class='icon-crystal liangHao'></i></span><img src='http://gree.pccsh.com/res/badge/9001.gif'
|
||||
alt='心愿星河' class='badge' /> </span>
|
||||
:
|
||||
<span class=''>出身上天魔套15,复仇8,白副手10块,白四象5块,4级审判20,一套5级房子材料20</span>
|
||||
</div>
|
||||
@@ -39,65 +37,46 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="item"><a href='/Task/Npc/Index?npc=1101006&sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo'>巴萨尼奥</a></div>
|
||||
<div class="item"><a href='/Map/Npc/Index?npc=1101016&sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo'>海精灵(福利)</a></div>
|
||||
<div class="item"><a href='/Map/Npc/Index?npc=1101061&sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo'>战场指挥官(攻城)</a></div>
|
||||
<div class="item"><a href='/Map/Npc/Index?npc=1101064&sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo'>欧若拉(主神)</a></div>
|
||||
<div class="item" v-for="item in npcData">
|
||||
<Abar href="">{{item.npcName}}{{item.tips}}</Abar>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
</div>
|
||||
<div class="content">
|
||||
请选择出口:<br />
|
||||
<span v-if="mapDong.mapId != ''">东:<Abutton @click="BindData(mapDong.mapId)">{{ mapDong.name }}</Abutton></span>
|
||||
<span v-if="mapXi.mapId != ''">西:<Abutton @click="BindData(mapXi.mapId)">{{ mapXi.name }}</Abutton></span>
|
||||
<br v-if="mapDong.mapId != '' || mapXi.mapId != ''">
|
||||
<span v-if="mapNan.mapId != ''">南:<Abutton @click="BindData(mapNan.mapId)">{{ mapNan.name }}</Abutton></span>
|
||||
<span v-if="mapBei.mapId != ''">北:<Abutton @click="BindData(mapBei.mapId)">{{ mapBei.name }}</Abutton></span>
|
||||
</div>
|
||||
<div class="content">请选择出口:<br />东:<a
|
||||
href='/Map/17_27?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo&_r=YA9mrXPxwRpy'>市场</a> 西:<a
|
||||
href='/Map/15_27?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo&_r=YA9mrXPxwRpy'>教堂</a> <br />南:<a
|
||||
href='/Map/16_28?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo&_r=YA9mrXPxwRpy'>银行</a> 北:<a
|
||||
href='/Map/16_26?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo&_r=YA9mrXPxwRpy'>珠宝店</a> </div>
|
||||
|
||||
<div class="content">
|
||||
【<a class="" href="/Map/Index/MapCity/16_27?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">城内地图</a>】.<a class=""
|
||||
href="/Business/Help/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">帮助</a>.<a class=""
|
||||
href="/Privilege/Purdiam/MapTo?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">传送</a><br />
|
||||
<div style="font-size:16px;line-height:16px;">
|
||||
➢当前坐标:X-16 Y-27
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
每逢节假日,来找海精灵,有惊喜~
|
||||
{{ mapInfo.tips }}
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="common">
|
||||
<a class="" href="/User/Index/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">状态</a>. <a class=""
|
||||
href="/Bag/Index/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">物品</a>. <a class=""
|
||||
href="/Chat/Index/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">聊天</a>
|
||||
</div>
|
||||
<div class="common">
|
||||
<a class="" href="/Friend/Index/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">好友</a>. <a class=""
|
||||
href="/Pet/Index/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">宠物</a>. <a class=""
|
||||
href="/Team/Index/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">队伍</a>
|
||||
</div>
|
||||
<div class="common">
|
||||
<a class="" href="/Mall/Index/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">商城</a>. <a class=""
|
||||
href="/Bus/Proffer/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">神殿</a>. <a class=""
|
||||
href="/Business/Market/Act?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">活动</a>
|
||||
</div>
|
||||
<div class="common">
|
||||
<a class="" href="/Act/Kill/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">天榜</a>. <a class=""
|
||||
href="/Act/Sky/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">赛事</a>. <a class=""
|
||||
href="/Rank/Index/Index?sid=W6Wg8iH9gY7wIBNSEdtFcQ3KbI5YiKDo">排行</a>
|
||||
</div>
|
||||
<MapMenu></MapMenu>
|
||||
</div>
|
||||
<Footer></Footer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
layout: layout.empty,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
|
||||
|
||||
const mapInfo = ref<any>({});
|
||||
const cityInfo = ref<any>({});
|
||||
const npcData = ref<Array<any>>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
await BindData("");
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
@@ -105,20 +84,40 @@ onMounted(async () => {
|
||||
})
|
||||
|
||||
/**加载方法 */
|
||||
const BindData = async (): Promise<void> => {
|
||||
const BindData = async (map: string): Promise<void> => {
|
||||
let result = await MapService.GetMapData(map);
|
||||
if (result.code == 0) {
|
||||
mapInfo.value = result.data.mapInfo;
|
||||
cityInfo.value = result.data.cityInfo;
|
||||
npcData.value = result.data.npcData;
|
||||
MapVent(result.data.mapInfo.near);
|
||||
console.log(result.data);
|
||||
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("异常错误", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
/**刷新 */
|
||||
const Refresh = async (): Promise<void> => {
|
||||
MessageExtend.LoadingToast("刷新中...");
|
||||
await BindData();
|
||||
window.setTimeout(() => {
|
||||
MessageExtend.LoadingClose();
|
||||
MessageExtend.Notify("刷新成功!", "success");
|
||||
}, 1000)
|
||||
|
||||
await BindData("");
|
||||
MessageExtend.LoadingClose();
|
||||
MessageExtend.Notify("刷新成功!", "success");
|
||||
|
||||
}
|
||||
|
||||
/**渲染出口 */
|
||||
const mapDong = ref<any>({});
|
||||
const mapXi = ref<any>({});
|
||||
const mapNan = ref<any>({});
|
||||
const mapBei = ref<any>({});
|
||||
const MapVent = (near: Array<any>): void => {
|
||||
mapDong.value = near.find(item => item.positition == "东");
|
||||
mapXi.value = near.find(item => item.positition == '西');
|
||||
mapNan.value = near.find(item => item.positition == '南');
|
||||
mapBei.value = near.find(item => item.positition == '北');
|
||||
}
|
||||
|
||||
</script>
|
||||
9
Web/src/services/map/MapService.ts
Normal file
9
Web/src/services/map/MapService.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class MapService {
|
||||
/**
|
||||
* 获取地图主页信息
|
||||
* GET /Map/Map/GetMapData
|
||||
*/
|
||||
static async GetMapData(map: string) {
|
||||
return await ApiService.Request("get", "/Map/Map/GetMapData", { map });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user