From e4f4f7b83e84a3ec6072be5e8bc3eaf21985f4a7 Mon Sep 17 00:00:00 2001 From: xuan Date: Mon, 16 Oct 2023 02:10:05 +0800 Subject: [PATCH] fix: client --- src/components/gonggao/Daily.vue | 64 ++++++++++--------- src/components/gonggao/daily/SimpleServer.vue | 8 ++- src/views/price/overview/index.vue | 47 ++++++++------ 3 files changed, 67 insertions(+), 52 deletions(-) diff --git a/src/components/gonggao/Daily.vue b/src/components/gonggao/Daily.vue index 4f24a26aa..547cdf7a9 100644 --- a/src/components/gonggao/Daily.vue +++ b/src/components/gonggao/Daily.vue @@ -35,19 +35,19 @@ @@ -115,31 +115,33 @@ export default { server() { return this.$store.state.server; }, - isOrigin() { - return location.href.includes("origin") ? "origin" : "std"; + isOrigin() { + return location.href.includes("origin"); }, }, methods: { getFurniture() { - const params = { - subtypes: "category,property,next_match", - start: dayjs.tz().startOf("isoWeek").format("YYYY-MM-DD"), - end: dayjs.tz().endOf("isoWeek").format("YYYY-MM-DD"), - }; - getFurniture(params).then((res) => { - const list = res.data?.data; - this.currentFurniture = { - property: list.find((item) => item.subtype === "property")?.content || "", - category: list.find((item) => item.subtype === "category")?.content || "", - }; - const nextContent = list.find((item) => item.subtype === "next_match")?.content || ""; - const reg = nextContent.indexOf(":") > -1 ? /.*:/g : /.*:/g; - const nextArr = nextContent ? nextContent.replace(reg, "").split("\n") : []; - this.nextFurniture = { - property: nextArr[0] || "", - category: nextArr[1] || "", + if (!this.isOrigin) { + const params = { + subtypes: "category,property,next_match", + start: dayjs.tz().startOf("isoWeek").format("YYYY-MM-DD"), + end: dayjs.tz().endOf("isoWeek").format("YYYY-MM-DD"), }; - }); + getFurniture(params).then((res) => { + const list = res.data?.data; + this.currentFurniture = { + property: list.find((item) => item.subtype === "property")?.content || "", + category: list.find((item) => item.subtype === "category")?.content || "", + }; + const nextContent = list.find((item) => item.subtype === "next_match")?.content || ""; + const reg = nextContent.indexOf(":") > -1 ? /.*:/g : /.*:/g; + const nextArr = nextContent ? nextContent.replace(reg, "").split("\n") : []; + this.nextFurniture = { + property: nextArr[0] || "", + category: nextArr[1] || "", + }; + }); + } }, }, mounted() { diff --git a/src/components/gonggao/daily/SimpleServer.vue b/src/components/gonggao/daily/SimpleServer.vue index b35d9d001..93d7b73f4 100644 --- a/src/components/gonggao/daily/SimpleServer.vue +++ b/src/components/gonggao/daily/SimpleServer.vue @@ -38,6 +38,9 @@ export default { uid() { return this.$store.state.uid; }, + isOrigin() { + return location.href.includes("origin"); + }, myServer() { // 当前服务器 if (this.uid) { @@ -52,7 +55,10 @@ export default { let list = []; if (this.serverList.length) { const favList = this.favList.filter((item) => item.main_server !== this.$store.state.server); - const serverList = this.serverList.filter((item) => item.main_server !== this.myServer?.main_server); + const clientServerList = this.isOrigin + ? this.serverList.filter((item) => item.zone_name == "缘起大区") + : this.serverList.filter((item) => item.main_server !== this.$store.state.server); + const serverList = clientServerList.filter((item) => item.main_server !== this.myServer?.main_server); if (this.uid && favList.length > 3) { list = favList.splice(0, 3); } else { diff --git a/src/views/price/overview/index.vue b/src/views/price/overview/index.vue index a34f33956..6e26e4ce6 100644 --- a/src/views/price/overview/index.vue +++ b/src/views/price/overview/index.vue @@ -1,23 +1,23 @@ - \ No newline at end of file +