generated from JX3BOX/jx3box-vue-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
97 changed files
with
1,953 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
}); | ||
} |
Oops, something went wrong.