Skip to content

Commit

Permalink
ci:merge
Browse files Browse the repository at this point in the history
  • Loading branch information
iRuxu committed May 10, 2024
2 parents a52e6eb + 26d5a3a commit 343c29c
Show file tree
Hide file tree
Showing 97 changed files with 1,953 additions and 0 deletions.
Empty file.
572 changes: 572 additions & 0 deletions src/assets/css/treasure/landscape.less

Large diffs are not rendered by default.

480 changes: 480 additions & 0 deletions src/assets/css/treasure/portrait.less

Large diffs are not rendered by default.

Binary file added src/assets/img/treasure/content_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/landscape/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/landscape/left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/landscape/no_qy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/landscape/pet_qy_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/landscape/pt_qy_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/landscape/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/landscape/title_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/landscape/world_qy_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/pet_img_border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/portrait/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/portrait/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/portrait/no_qy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/portrait/pet_qy_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/portrait/pt_qy_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/portrait/title_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/portrait/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/portrait/world_qy_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/producer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/pt/text_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/pt/乱世舞姬S.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/pt/凌云梯S.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/pt/劝学记S.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/pt/天涯无归S.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/pt/寻猫记S.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/treasure/pt/少年行S.png
Binary file added src/assets/img/treasure/pt/平生心愿S.png
Binary file added src/assets/img/treasure/pt/庆舞良宵S.png
Binary file added src/assets/img/treasure/pt/度人心S.png
Binary file added src/assets/img/treasure/pt/惜往日S.png
Binary file added src/assets/img/treasure/pt/扶摇九天S.png
Binary file added src/assets/img/treasure/pt/护佑苍生S.png
Binary file added src/assets/img/treasure/pt/拜春擂S.png
Binary file added src/assets/img/treasure/pt/故园风雨S.png
Binary file added src/assets/img/treasure/pt/旧宴承欢S.png
Binary file added src/assets/img/treasure/pt/泛天河S.png
Binary file added src/assets/img/treasure/pt/清风捕王S.png
Binary file added src/assets/img/treasure/pt/炼狱厨神S.png
Binary file added src/assets/img/treasure/pt/生死判S.png
Binary file added src/assets/img/treasure/pt/白日梦S.png
Binary file added src/assets/img/treasure/pt/空谷回音S.png
Binary file added src/assets/img/treasure/pt/红尘不渡S.png
Binary file added src/assets/img/treasure/pt/舞众生S.png
Binary file added src/assets/img/treasure/pt/茶馆奇缘S.png
Binary file added src/assets/img/treasure/pt/莫负初心S.png
Binary file added src/assets/img/treasure/pt/虎啸山林S.png
Binary file added src/assets/img/treasure/pt/赴九幽S.png
Binary file added src/assets/img/treasure/pt/镜中琴音S.png
Binary file added src/assets/img/treasure/pt/雪山恩仇S.png
Binary file added src/assets/img/treasure/pt/韶华故S.png
Binary file added src/assets/img/treasure/pt/黑白路S.png
Binary file added src/assets/img/treasure/world/text_bg.png
Binary file added src/assets/img/treasure/world/text_bg_act.png
46 changes: 46 additions & 0 deletions src/assets/img/treasure/world/world_bg.svg
99 changes: 99 additions & 0 deletions src/assets/js/treasure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import { getRoleGameAchievements, getAdventures } from "@/service/treasure.js";

const perfectAchievement = {
111: { hasClass: "zhg", zIndex: 9 },
3: { hasClass: "yylj", zIndex: 10 },
88: { hasClass: "xxjt", zIndex: 14 },
83: { hasClass: "zzwg", zIndex: 16 },
104: { hasClass: "wldg", zIndex: 20 },
78: { hasClass: "tjh", zIndex: 17 },
1: { hasClass: "sssh", zIndex: 7 },
2: { hasClass: "scqf", zIndex: 18 },
126: { hasClass: "swxf", zIndex: 12 },
21: { hasClass: "swbj", zIndex: 11 },
121: { hasClass: "rjg", zIndex: 19 },
106: { hasClass: "qqj", zIndex: 13 },
90: { hasClass: "lnrh", zIndex: 8 },
66: { hasClass: "jcs", zIndex: 15 },
};

let formatDateTime = (dateTimeString) => {
const dateTime = new Date(dateTimeString);
const year = dateTime.getFullYear();
const month = dateTime.getMonth() + 1; // 月份从0开始,需要加1
const date = dateTime.getDate();
const hours = dateTime.getHours();
const minutes = dateTime.getMinutes();
const seconds = dateTime.getSeconds();

const formattedDateTime = `${year}${month}${date}${hours}:${minutes}:${seconds}`;
return formattedDateTime;
};

let getData = (userJx3Id) => {
return new Promise((resolve, reject) => {
var returnData = {
pet: [],
normal: [],
perfect: [],
};

getRoleGameAchievements(userJx3Id).then((res) => {
const achievements = res.data?.data?.achievements || "";
const list = achievements.split(",");
if (res.data?.data?.updated_at) {
returnData.updated_at = formatDateTime(res.data?.data?.updated_at);
} else {
returnData.updated_at = "暂无记录";
}
// 定义奇遇类型数组
const adventureTypes = ["pet", "normal", "perfect"];
// 创建 Promise 数组来存储所有奇遇数据的 Promise
const adventurePromises = adventureTypes.map((type) => {
return getAdventures({
type,
_no_page: 1,
}).then((res) => {
const achievementsList = [];
let actNum = 0;
res.data.list.forEach((item) => {
if (type == "perfect") {
item.isAct = false;
if (list.includes(String(item.dwID))) {
item.isAct = true;
actNum++;
}
achievementsList.push({
...item,
...perfectAchievement[item.dwID],
});
} else {
if (list.includes(String(item.dwID))) {
achievementsList.push(item);
actNum++;
}
}
});
returnData[`${type}AllNum`] = res.data.list.length;
returnData[`${type}NowNum`] = actNum;
returnData[type] = achievementsList;
});
});

// 所有奇遇数据的 Promise 执行完成后,调用 inspectionResult
Promise.all(adventurePromises)
.then(() => {
returnData.progress =
(returnData.petNowNum + returnData.normalNowNum + returnData.perfectNowNum) /
(returnData.petAllNum + returnData.normalAllNum + returnData.perfectAllNum);
returnData.progress = (returnData.progress * 100).toFixed(2);
resolve(returnData);
})
.catch((error) => {
reject(error); // 处理错误
});
});
});
};

export default getData;
26 changes: 26 additions & 0 deletions src/pages/treasure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Vue.config.productionTip = false;

// 第三方UI组件
import Vue from "vue";
import ElementUI from "element-ui";
Vue.use(ElementUI);

// 通用UI模块
import JX3BOX_UI from "@jx3box/jx3box-common-ui";
import "@jx3box/jx3box-common/css/element.css";
import "@jx3box/jx3box-common/css/normalize.css";
Vue.use(JX3BOX_UI);

import reporter from "@jx3box/jx3box-common/js/reporter";
reporter.install(Vue);

// 数据与路由
import router from "@/router/treasure";
import store from "../store";

import App from "@/views/treasure/Index.vue";
new Vue({
router,
store,
render: (h) => h(App),
}).$mount("#app");
42 changes: 42 additions & 0 deletions src/router/treasure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const Index = () => import("@/views/treasure/Index.vue");
const landscape = () => import("@/views/treasure/landscape.vue");
const portrait = () => import("@/views/treasure/portrait.vue");

const routes = [
{
name: "index",
path: "/",
component: Index,
redirect: {
name: "landscape",
},
},
{
name: "landscape",
path: "/landscape",
component: landscape,
meta: {
name: "横屏",
},
},
{
name: "portrait",
path: "/portrait",
component: portrait,
meta: {
name: "竖屏",
},
},
];

const router = new VueRouter({
mode: "history",
base: "/treasure",
routes,
});

export default router;
36 changes: 36 additions & 0 deletions src/service/treasure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { $cms, $team, $next, $node } from "@jx3box/jx3box-common/js/https";

const client = location.href.includes("origin") ? "origin" : "std";

// 获取用户信息
export function getUserInfo() {
return $cms().get(`api/cms/user/my/info`, {
params: {
client,
},
});
}

// 获取用户角色
export function getUserRoles() {
return $team().get(`api/team/my-game-roles?nopage`);
}

// 获取角色的成就状态
export function getRoleGameAchievements(jx3id) {
return $next().get(`/api/next2/user-achievements`, {
params: {
jx3id,
},
});
}

// 获取奇遇列表
export function getAdventures(params) {
return $node().get(`/serendipities`, {
params: {
...params,
client,
},
});
}
Loading

0 comments on commit 343c29c

Please sign in to comment.