This commit is contained in:
Putoo
2026-05-15 17:08:04 +08:00
parent 52ad7e79ec
commit 78759387f7
13 changed files with 511 additions and 632 deletions

View File

@@ -15,13 +15,12 @@ const { on, emit } = useEventBus()
//连接signlar
const ConnectSignlar = (clientId: string) => {
console.log(`客户端:${clientId}`);
console.log(`客户端:${clientId}`);
}
// 初始化应用配置
onMounted(() => {
userStore.setToken("5555","111","222");
// 初始化屏幕尺寸
if (typeof window !== 'undefined') {
appStore.updateScreenSize(window.innerWidth, window.innerHeight)

View File

@@ -1,4 +1,13 @@
body, div, p, a, table, textarea, form, img, ul, li {
body,
div,
p,
a,
table,
textarea,
form,
img,
ul,
li {
margin: 0;
padding: 0;
border: 0;
@@ -10,87 +19,61 @@ body {
font-size: 18px;
}
.game_nav {
background: #302828;
color: white;
font-size: 15px;
padding: 2px 0px 2px 3px;
color: white;
font-style: italic;
padding-left: 10px;
}
.main {
}
.main {}
div {
margin: 5px 2px;
}
div img {
margin-right: 2px;
vertical-align: middle;
}
div img {
margin-right: 2px;
vertical-align: middle;
}
div img {
max-width: 100%;
width: exPRession(document.body.clientWidth>250?"250px":"auto");
overflow: hidden;
}
div img {
max-width: 100%;
}
.logo {
max-height: 120px;
}
.step-logo {
max-height: 120px;
}
.head {}
.head {
}
.title {}
.title {
}
.content {}
.content {
}
.item {
}
.item {}
.border {
border-bottom: 1px dashed #9f8d8d;
}
.tips {
}
.menu {
}
.clear {
height: 5px;
}
.foot {
}
.foot {}
body a {
a {
color: #1e5494;
margin: 0 5px;
text-decoration: underline;
}
a:link {
color: #1e5494;
/*display: inline-block;*/
margin: 3px 4px 3px 4px;
}
a:link {
color: #1e5494;
/*display: inline-block;*/
margin: 3px 4px 3px 4px;
}
a:hover, a:active, a:focus {
color: #FFFFFF;
background: #1e5494;
}
a:hover,
a:active,
a:focus {
color: #FFFFFF;
background: #1e5494;
}
.a-nomargin {
margin: 0;
@@ -104,530 +87,13 @@ body a {
color: red;
}
.text-red a {
color: red;
}
.page-msg {
.text-red a {
color: red;
}
.common {
}
.common {}
.common img {
margin-right: 2px;
vertical-align: middle;
}
.PageTips {
font-size: 15px;
font-weight: bold;
}
.algin-center {
text-align: center
}
.input {
line-height: 30px;
}
.ipt {
width: 60%;
display: block;
padding: 6px 12px;
font-size: 14px;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%);
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
.btn {
display: inline-block;
margin-bottom: 0;
font-size: 14px;
font-weight: 400;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.btn-danger {
color: #fff;
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-waring {
color: #fff;
background-color: #FE5E08;
border-color: #FE5E08;
}
.btn-ret {
border-color: #d2d2d2;
background: 0 0;
color: #666;
}
.chat {
word-wrap: break-word;
}
.chat img {
margin-right: 2px;
vertical-align: middle;
}
.em {
height: 22px;
width: 22px;
}
.ftbtn {
margin-top: 15px;
}
.equImg-min {
width: 18px;
height: 18px;
}
.user-head {
max-height: 25px;
max-width: 25px;
}
/******装备样式******/
.equImg {
max-width: 130px;
max-height: 230px;
}
.tq {
background-image: url('/images/site/equ/tq.png');
background-repeat: no-repeat;
display: inline-block;
width: 15px;
height: 15px;
background-size: 15px; /*设置图片大小*/
}
.ty {
background-image: url('/images/site/equ/ty.png');
background-repeat: no-repeat;
display: inline-block;
width: 15px;
height: 15px;
background-size: 15px; /*设置图片大小*/
}
.ms {
background-image: url('/images/site/equ/ms.png');
background-repeat: no-repeat;
display: inline-block;
width: 15px;
height: 15px;
background-size: 15px; /*设置图片大小*/
}
.zx {
background-image: url('/images/site/equ/zx.png');
background-repeat: no-repeat;
display: inline-block;
width: 15px;
height: 15px;
background-size: 15px; /*设置图片大小*/
}
.sy {
background-image: url('/images/site/equ/sy.png');
background-repeat: no-repeat;
display: inline-block;
width: 15px;
height: 15px;
background-size: 15px; /*设置图片大小*/
}
.gw {
background-image: url('/images/site/equ/gw.png');
background-repeat: no-repeat;
display: inline-block;
width: 15px;
height: 15px;
background-size: 15px; /*设置图片大小*/
}
.ly {
background-image: url('/images/site/equ/ly.gif');
background-repeat: no-repeat;
display: inline-block;
width: 15px;
height: 15px;
background-size: 15px; /*设置图片大小*/
}
.hm {
background-image: url('/images/site/equ/hm.gif');
background-repeat: no-repeat;
display: inline-block;
width: 15px;
height: 15px;
background-size: 15px; /*设置图片大小*/
}
.j_r {
background-image: url('/images/site/equ/r.gif');
background-repeat: no-repeat;
display: inline-block;
width: 15px;
height: 15px;
background-size: 15px; /*设置图片大小*/
}
.j_l {
background-image: url('/images/site/equ/l.gif');
background-repeat: no-repeat;
display: inline-block;
width: 15px;
height: 15px;
background-size: 15px; /*设置图片大小*/
}
/**********End*******/
/***副本***/
.dup {
background-image: url('/images/site/dup/dup.gif');
background-repeat: no-repeat;
display: inline-block;
width: 18px;
height: 18px;
background-size: 18px; /*设置图片大小*/
}
/***任务***/
.task-ret {
background-image: url('/images/site/tr.gif');
background-repeat: no-repeat;
display: inline-block;
width: 18px;
height: 18px;
background-size: 18px; /*设置图片大小*/
}
.task-get {
background-image: url('/images/site/tg.gif');
background-repeat: no-repeat;
display: inline-block;
width: 18px;
height: 18px;
background-size: 18px; /*设置图片大小*/
}
/*九宫图片*/
.gray {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
}
/*九宫样式*/
.wrapper {
display: grid;
grid-template-columns: 51px 51px 51px;
grid-template-rows: 51px 51px 51px;
margin-left: 10px;
}
.list {
background: #eee;
margin-right: 1px;
margin-bottom: 1px;
}
.list img {
width: 50px;
height: 50px;
}
/********其他*******/
.mounthImg {
width: 120px;
height: 120px;
}
/***广播***/
.broad {
font-size: 15px;
}
.broad-gift {
background-image: url('/images/site/broad/gift.gif');
background-repeat: no-repeat;
display: inline-block;
width: 18px;
height: 18px;
background-size: 18px; /*设置图片大小*/
.common img {
margin-right: 2px;
vertical-align: middle;
border: 0;
}
.broad-system {
background-image: url('/images/site/broad/system.gif');
background-repeat: no-repeat;
display: inline-block;
width: 18px;
height: 18px;
background-size: 18px; /*设置图片大小*/
margin-right: 2px;
vertical-align: middle;
}
.broad-award {
background-image: url('/images/site/broad/award.gif');
background-repeat: no-repeat;
display: inline-block;
width: 18px;
height: 18px;
background-size: 18px; /*设置图片大小*/
margin-right: 2px;
vertical-align: middle;
}
.broad-remind {
background-image: url('/images/site/broad/remind.gif');
background-repeat: no-repeat;
display: inline-block;
width: 18px;
height: 18px;
background-size: 18px; /*设置图片大小*/
margin-right: 2px;
vertical-align: middle;
}
.broad-promote {
background-image: url('/images/site/broad/promote.gif');
background-repeat: no-repeat;
display: inline-block;
width: 18px;
height: 18px;
background-size: 18px; /*设置图片大小*/
margin-right: 2px;
vertical-align: middle;
}
.broad-hot1 {
background-image: url('/images/site/broad/hot1.gif');
background-repeat: no-repeat;
display: inline-block;
width: 18px;
height: 18px;
background-size: 18px; /*设置图片大小*/
margin-right: 2px;
vertical-align: middle;
}
/****礼物***/
.gift {
width: 20px;
height: 20px;
}
.attire {
height: 200px;
width: 125px;
}
/****限时活动****/
.act_item {
margin-bottom: 10px;
border: 1px solid #9f8d8d;
border-radius: 16px;
padding: 5px;
}
.act_menu a {
font-size: 14px;
font-weight: bold;
}
.act_content {
font-size: 14px;
}
.act_header {
text-align: center;
}
.m_act_head {
text-align: center;
}
.m_act_head {
text-align: center;
}
.m_act_item {
border-bottom: 1px dashed #9f8d8d;
}
.m_act_title {
font-weight: bold;
font-size: 16px;
}
.m_act_con {
font-size: 15px;
padding: 3px;
text-indent: 2em;
}
.m_act_con a {
font-size: 15px;
}
.badge {
max-height: 25px;
max-width: 25px;
}
.maxname {
max-height: 150px;
max-width: 250px;
}
/* ========== 自定义通知队列 ========== */
#custom-notify-container {
position: fixed;
top: 10px;
left: 50%;
transform: translateX(-50%);
z-index: 9999;
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
pointer-events: none;
}
.custom-notify-item {
box-sizing: border-box;
max-width: 90%;
padding: 8px 16px;
margin-bottom: 8px;
border-radius: 8px;
color: #fff;
font-size: 12px;
line-height: 1.5;
text-align: center;
word-wrap: break-word;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
pointer-events: auto;
cursor: pointer;
opacity: 0;
transform: translateY(-20px);
animation: notify-slide-in 300ms ease-out forwards;
}
.custom-notify-item.leaving {
animation: notify-fade-out 200ms ease-in forwards;
}
@keyframes notify-slide-in {
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes notify-fade-out {
to {
opacity: 0;
transform: translateY(-10px);
}
}
/* ========== 顶部通告栏 ========== */
.custom-notice-bar {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 40px;
display: flex;
align-items: center;
padding: 0 16px;
box-sizing: border-box;
z-index: 9998;
font-size: 14px;
line-height: 24px;
}
.custom-notice-bar .notice-icon {
flex-shrink: 0;
margin-right: 8px;
font-size: 16px;
position: relative;
z-index: 1;
}
.custom-notice-bar .notice-wrap {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
align-items: center;
padding: 0 40px;
box-sizing: border-box;
}
.custom-notice-bar .notice-text {
display: inline-block;
white-space: nowrap;
padding-right: 50px;
flex-shrink: 0;
}
.custom-notice-bar .notice-wrap.scrolling {
animation: notice-scroll var(--scroll-duration, 10s) linear infinite;
}
@keyframes notice-scroll {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-50%);
}
}
.custom-notice-bar .notice-close {
flex-shrink: 0;
margin-left: 8px;
font-size: 18px;
cursor: pointer;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
line-height: 1;
position: relative;
z-index: 1;
}

View File

@@ -64,25 +64,37 @@ export class ApiService {
}
const result = response.data;
if (result.code === 401) {
//401刷新token
console.log(result.data);
} else if (result.code === 40101) {
this.redirectToLogin();
throw {
handled: true,
redirectTo: "/login/login",
redirectTo: "/",//跳转回首页
message: result.msg || "登录已失效"
} satisfies HandledRedirectError;
} else if (result.code === 500) {
// 跳转错误页面
throw {
handled: true,
redirectTo: "/",//跳转回首页
message: result.msg || "登录已失效"
} satisfies HandledRedirectError;
} else if (result.code === 404) {
// 跳转不存在页面
throw {
handled: true,
redirectTo: "/",//跳转回首页
message: result.msg || "登录已失效"
} satisfies HandledRedirectError;
}
return response;
},
onRejected: (error) => {
if (error && typeof error === "object" && "status" in error) {
// console.log("接口错误:", error);
// console.log("接口错误:", error);
}
return error;

View File

@@ -25,5 +25,12 @@ export class StateHelper {
{
this.userStore.offOnline();
}
static get IsAccLogin(){
return this.userStore.isLoginAccount;
}
static get IsLogin(){
return this.userStore.isLogin;
}
}

View File

@@ -4,42 +4,21 @@
<Abar href="/">首页</Abar>&gt;客服
</div>
<div class="content">
微信客服<a href="https://work.weixin.qq.com/kfid/kfc86bc348120aea3e7"
target="_blank">点击咨询</a><br />客服QQ531493955<br />官方QQ群238938639<br />客服邮箱531493955@qq.com<br />
微信客服<a href="https://work.weixin.qq.com/kfid/kfc86bc348120aea3e7" target="_blank">点击咨询</a><br />
客服QQ290555931<br />
官方QQ群931835791<br />
客服邮箱tanwan@kexunkeji.cn<br />
</div>
<Abar href="/">返回游戏首页</Abar>
<!-- 分页组件示例 -->
<div class="content" style="margin-top: 10px;">
<Pagination :currentPage="currentPage" :totalPages="totalPages" @pageChange="data" />
</div>
</div>
</template>
<script setup lang="ts">
let a = 1
definePageMeta({
layout: layout.empty,
middleware: 'page-loading'
middleware: middleware.loading
})
const currentPage = ref<number>(1);
const totalPages = ref<number>(95);
const handlePageChange = (page: number): void => {
currentPage.value = page;
console.log('跳转到第', page, '页');
};
const data = (data: any) => {
console.log('子组件传的值', data);
}
onMounted(() => {
PageLoading.Close();
})

View File

@@ -56,7 +56,7 @@
<div class="item" v-for="(item, index) in noticeData" :key="index">
{{ index + 1 }}.<Abar :href='"/login/register?id=" + item.noticeId'>{{ item.title }}</Abar>
</div>
<span v-if="noticeData.length == 0">暂无公告.</span>
<span v-if="noticeData.length == 0">暂无公告.</span>
</div>
</div>
<div class="title">
@@ -75,6 +75,7 @@
</template>
<script setup lang="ts">
definePageMeta({
layout: layout.empty,
middleware: middleware.loading
@@ -100,23 +101,43 @@ const Initialize = async (): Promise<void> => {
};
//退出登录
const offOnline = () => {
MessageExtend.ShowConfirmDialog("退出游戏", "您确定要退出游戏吗?", () => {
StateHelper.OffOnline();
isOnline.value = false;
MessageExtend.ShowToast("退出成功!", "success");
const offOnline = async () => {
MessageExtend.ShowConfirmDialog("退出游戏", "您确定要退出游戏吗?", async () => {
var result = await PubService.GetMain(StateHelper.Sid);
if (result.code == 0) {
StateHelper.OffOnline();
isOnline.value = false;
MessageExtend.ShowToast("退出成功!", "success");
}
else {
MessageExtend.ShowToast(result.msg, "fail");
}
});
}
onMounted(async () => {
//默认设置身份,正式环境删除
StateHelper.SetSid("kUVjj2cBUemcdokUEIBEKh0qhKkkSkui0x");
//StateHelper.SetSid('');
try {
const login = async (code: string): Promise<void> => {
var result = await LoginService.TwLogin(code);
console.log(result);
if (result.code == 0) {
StateHelper.SetSid(result.data.token);
await Initialize();
}
else {
MessageExtend.ShowToast(result.msg, "default");
}
}
onMounted(async () => {
try {
const code = PageExtend.QueryString("code");
if (code != '' && StateHelper.IsAccLogin == false) {
//执行登录
await login(code);
}
else {
await Initialize();
}
}
finally {
PageLoading.Close();

View File

@@ -0,0 +1,29 @@
export class LoginService {
/**
* 登录接口
* POST /Login/Login
* 请求体: 登录请求参数
* @param name 登录名/手机号
* @param pwd 密码
* @param code 验证码
*/
static async Login(name: string, pwd: string, code: string) {
return await ApiService.Request("post", "/Login/Login", { name, pwd, code });
}
/**
* 探玩自动登录
* GET /Login/TwLogin
*/
static async TwLogin(code: string) {
return await ApiService.Request("get", "/Login/TwLogin", { code });
}
/**
* 退出登录
* GET /Login/LoginOut
*/
static async LoginOut(sid: string) {
return await ApiService.Request("get", "/Login/LoginOut", { sid });
}
}