@jx3box/jx3box-ui 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.js +22 -13
- package/.storybook/storybookMocks.js +191 -0
- package/README.md +6 -19
- package/assets/css/bread/admin.less +20 -2
- package/assets/css/bread/breadcrumb.less +5 -2
- package/assets/css/comment/quick-reply.less +1 -1
- package/assets/css/common/left-sidebar.less +1 -1
- package/assets/css/interact/like2.less +5 -2
- package/assets/css/single/author.less +15 -10
- package/assets/css/single/cms-single.less +1 -0
- package/assets/css/single/thx.less +34 -11
- package/assets/data/nav.json +344 -10
- package/assets/img/comment/comment.svg +1 -1
- package/assets/img/comment/heart_1.svg +1 -1
- package/assets/img/comment/hide.svg +1 -1
- package/assets/img/leftsidebar/medal.svg +1 -1
- package/assets/img/leftsidebar/post.svg +27 -46
- package/i18n/messages/en-US.js +357 -22
- package/i18n/messages/vi.js +350 -22
- package/i18n/messages/zh-CN.js +469 -20
- package/i18n/messages/zh-TW.js +350 -22
- package/index.js +19 -7
- package/package.json +8 -5
- package/service/cms.js +22 -0
- package/service/commit-history.js +18 -0
- package/service/community.js +60 -0
- package/service/fav.js +5 -6
- package/src/App.vue +154 -80
- package/src/Breadcrumb.vue +24 -11
- package/src/CommonFooter.vue +2 -2
- package/src/Footer.vue +13 -5
- package/src/LeftSideToggle.vue +10 -3
- package/src/LeftSidebar.vue +19 -5
- package/src/Main.vue +9 -2
- package/src/RightSidebar.vue +12 -3
- package/src/SuspendCommon.vue +52 -38
- package/src/author/AuthorFans.vue +7 -5
- package/src/author/AuthorFollow.vue +14 -7
- package/src/author/AuthorGift.vue +25 -17
- package/src/author/AuthorInfo.vue +46 -19
- package/src/author/AuthorLink.vue +3 -1
- package/src/author/AuthorMedals.vue +5 -2
- package/src/author/AuthorPosts.vue +31 -13
- package/src/author/AuthorRss.vue +7 -3
- package/src/author/AuthorTeams.vue +3 -1
- package/src/author/UserPop.vue +29 -17
- package/src/bread/Admin.vue +55 -32
- package/src/bread/AdminDirectMessage.vue +15 -8
- package/src/bread/AdminDrop.vue +124 -45
- package/src/bread/CommunityAdmin.vue +527 -0
- package/src/bread/DesignTask.vue +30 -26
- package/src/bread/ListAdmin.vue +199 -0
- package/src/bread/MigrateCommunity.vue +192 -0
- package/src/bread/MoveToCommunityDialog.vue +234 -0
- package/src/comment/Avatar.vue +18 -24
- package/src/comment/CommentContent.vue +57 -37
- package/src/comment/CommentContentSimple.vue +61 -63
- package/src/comment/CommentInputForm.vue +45 -34
- package/src/comment/CommentWithReply.vue +9 -6
- package/src/comment/QuickReply.vue +5 -1
- package/src/comment/ReplyForReply.vue +6 -4
- package/src/comment/ReplyList.vue +28 -18
- package/src/comment/Upload.vue +24 -6
- package/src/filters/clientBy.vue +10 -8
- package/src/filters/markBy.vue +35 -31
- package/src/filters/menuBy.vue +20 -22
- package/src/filters/orderBy.vue +17 -11
- package/src/filters/tagBy.vue +4 -2
- package/src/filters/topicBy.vue +12 -10
- package/src/filters/versionBy.vue +5 -3
- package/src/filters/zlpBy.vue +29 -25
- package/src/footer/copyright.vue +5 -5
- package/src/footer/links.vue +2 -2
- package/src/footer/official.vue +1 -1
- package/src/footer/resource.vue +6 -6
- package/src/header/alternate.vue +35 -18
- package/src/header/asset.vue +9 -19
- package/src/header/box.vue +20 -8
- package/src/header/box2.vue +16 -9
- package/src/header/client.vue +7 -7
- package/src/header/lang.vue +41 -6
- package/src/header/logo.vue +2 -3
- package/src/header/manage.vue +2 -2
- package/src/header/message.vue +3 -3
- package/src/header/nav.vue +26 -23
- package/src/header/publish.vue +2 -2
- package/src/header/search.vue +2 -2
- package/src/header/shop.vue +2 -2
- package/src/header/user.vue +4 -4
- package/src/header/userInfo.vue +22 -24
- package/src/header/vip.vue +2 -2
- package/src/interact/BoxcoinAdmin.vue +30 -16
- package/src/interact/BoxcoinRecords.vue +28 -11
- package/src/interact/BoxcoinUser.vue +33 -17
- package/src/interact/Fav.vue +5 -1
- package/src/interact/Homework.vue +318 -0
- package/src/interact/Like.vue +4 -2
- package/src/interact/Rss.vue +10 -4
- package/src/interact/Share.vue +18 -19
- package/src/interact/WatchLater.vue +5 -1
- package/src/main.js +1 -0
- package/src/single/Author.vue +5 -1
- package/src/single/CmsSingle.vue +29 -15
- package/src/single/Collection.vue +36 -26
- package/src/single/Comment.vue +19 -13
- package/src/single/Creators.vue +5 -3
- package/src/single/PostCollection.vue +158 -0
- package/src/single/PostDirectory.vue +0 -126
- package/src/single/PostGuide.vue +93 -0
- package/src/single/PostHeader.vue +39 -17
- package/src/single/PostTopic.vue +3 -3
- package/src/single/PostVersion.vue +219 -0
- package/src/single/RightAffix.vue +160 -0
- package/src/single/SimpleThx.vue +4 -2
- package/src/single/Thx.vue +14 -2
- package/src/single/VersionDialog.vue +238 -0
- package/src/stories/components/StoryPropsTable.vue +137 -0
- package/src/stories/filters/FilterGallery.stories.js +110 -0
- package/src/stories/filters/clientBy.stories.js +24 -0
- package/src/stories/filters/markBy.stories.js +6 -0
- package/src/stories/filters/menuBy.stories.js +6 -0
- package/src/stories/filters/orderBy.stories.js +6 -0
- package/src/stories/filters/tagBy.stories.js +6 -0
- package/src/stories/filters/topicBy.stories.js +6 -0
- package/src/stories/filters/versionBy.stories.js +6 -0
- package/src/stories/filters/zlpBy.stories.js +6 -0
- package/src/stories/layout/BaseShell.stories.js +38 -0
- package/src/stories/layout/Breadcrumb.stories.js +40 -0
- package/src/stories/layout/CommonFooter.stories.js +1 -1
- package/src/stories/layout/CommonHeader.stories.js +1 -1
- package/src/stories/layout/LeftSideToggle.stories.js +78 -0
- package/src/stories/layout/LeftSidebar.stories.js +40 -0
- package/src/stories/layout/Main.stories.js +41 -0
- package/src/stories/layout/RightSidebar.stories.js +36 -0
- package/src/stories/layout/StorybookShell.vue +271 -0
- package/src/stories/layout/SuspendCommon.stories.js +67 -0
- package/src/stories/layout/SuspendCommonStage.vue +143 -0
- package/src/stories/mockData.js +275 -0
- package/src/stories/other/UserPop.stories.js +51 -0
- package/src/stories/single/Author.stories.js +19 -0
- package/src/stories/single/AuthorStoryStage.vue +103 -0
- package/src/stories/single/CmsSingle.stories.js +19 -0
- package/src/stories/single/CmsSingleStoryStage.vue +118 -0
- package/src/stories/single/Collection.stories.js +34 -0
- package/src/stories/single/Comment.stories.js +36 -0
- package/src/stories/single/Creators.stories.js +34 -0
- package/src/stories/single/PostCollection.stories.js +34 -0
- package/src/stories/single/PostDirectory.stories.js +31 -0
- package/src/stories/single/PostGuide.stories.js +47 -0
- package/src/stories/single/PostHeader.stories.js +39 -0
- package/src/stories/single/PostVersion.stories.js +41 -0
- package/src/stories/single/RightAffix.stories.js +84 -0
- package/src/stories/single/SimpleThx.stories.js +39 -0
- package/src/stories/single/SingleGallery.stories.js +207 -0
- package/src/stories/single/Thx.stories.js +38 -0
- package/vue.config.js +2 -12
- package/assets/css/common/bottom.less +0 -25
- package/assets/css/editor/article.less +0 -36
- package/assets/css/editor/combo.less +0 -362
- package/assets/css/editor/resource.less +0 -399
- package/assets/css/editor/tinymce.less +0 -100
- package/assets/css/editor/upload.less +0 -136
- package/assets/css/module/author.less +0 -231
- package/assets/css/module/buff.less +0 -88
- package/assets/css/module/directory.less +0 -165
- package/assets/css/module/icon.less +0 -25
- package/assets/css/module/item.less +0 -279
- package/assets/css/module/item_simple.less +0 -58
- package/assets/css/module/jx3_element.less +0 -5
- package/assets/css/module/macro.less +0 -89
- package/assets/css/module/npc.less +0 -265
- package/assets/css/module/resource.less +0 -93
- package/assets/css/module/skill.less +0 -74
- package/assets/css/module/talent.less +0 -495
- package/assets/js/a.js +0 -46
- package/assets/js/code.js +0 -13
- package/assets/js/combo.js +0 -40
- package/assets/js/directory.js +0 -114
- package/assets/js/filter2.js +0 -186
- package/assets/js/fold.js +0 -11
- package/assets/js/gallery.js +0 -14
- package/assets/js/hljs_languages.js +0 -177
- package/assets/js/iframe.js +0 -38
- package/assets/js/img.js +0 -23
- package/assets/js/item/attribute_percent.js +0 -88
- package/assets/js/item/bind.js +0 -18
- package/assets/js/item/border.js +0 -19
- package/assets/js/item/border_quest.js +0 -12
- package/assets/js/item/color.js +0 -25
- package/assets/js/item/hljs_languages.js +0 -177
- package/assets/js/item/icon_url.js +0 -15
- package/assets/js/item/second_format.js +0 -19
- package/assets/js/jx3_element.js +0 -73
- package/assets/js/katex.js +0 -181
- package/assets/js/macro.js +0 -16
- package/assets/js/nextpage.js +0 -4
- package/assets/js/pswp.js +0 -67
- package/assets/js/pswp_template.js +0 -66
- package/assets/js/pz_iframe.js +0 -30
- package/assets/js/qixue.js +0 -28
- package/assets/js/renderImgPreview.js +0 -18
- package/assets/js/script.js +0 -6
- package/assets/js/stat.js +0 -107
- package/assets/js/talent2.js +0 -21
- package/assets/js/tex-mml-chtml.js +0 -36310
- package/assets/js/voice.js +0 -238
- package/assets/js/xss.js +0 -130
- package/src/editor/Article.vue +0 -230
- package/src/editor/BoxResource.vue +0 -441
- package/src/editor/Resource.vue +0 -623
- package/src/editor/Tinymce.vue +0 -204
- package/src/editor/Upload.vue +0 -277
- package/src/editor/UploadAlum.vue +0 -176
- package/src/editor/UploadBanner.vue +0 -156
- package/src/editor/components/Author.vue +0 -322
- package/src/editor/components/Avatar.vue +0 -95
- package/src/editor/components/Buff.vue +0 -80
- package/src/editor/components/Combo.vue +0 -259
- package/src/editor/components/Equip.vue +0 -299
- package/src/editor/components/GameText.vue +0 -242
- package/src/editor/components/Item.vue +0 -325
- package/src/editor/components/ItemSimple.vue +0 -134
- package/src/editor/components/Medal.vue +0 -43
- package/src/editor/components/Npc.vue +0 -215
- package/src/editor/components/PostAuthor.vue +0 -102
- package/src/editor/components/Skill.vue +0 -71
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: X3ZvaWQ
|
|
3
|
-
* @Date: 2022-08-20 20:23:57
|
|
4
|
-
* @LastEditors: X3ZvaWQ
|
|
5
|
-
* @LastEditTime: 2022-08-24 22:32:56
|
|
6
|
-
* @Description: 用于渲染游戏内Text标签的文本
|
|
7
|
-
-->
|
|
8
|
-
<template>
|
|
9
|
-
<span v-html="html"></span>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
import { extractTextContent, getLink, iconLink } from "@jx3box/jx3box-common/js/utils";
|
|
14
|
-
import { getResource as getResourceFromNode } from "../../../service/resource";
|
|
15
|
-
import { escape } from "lodash";
|
|
16
|
-
|
|
17
|
-
export default {
|
|
18
|
-
name: "GameText",
|
|
19
|
-
props: {
|
|
20
|
-
text: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: "",
|
|
23
|
-
},
|
|
24
|
-
ignoreColor: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false,
|
|
27
|
-
},
|
|
28
|
-
client: {
|
|
29
|
-
type: String,
|
|
30
|
-
default: "std",
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
data: function () {
|
|
34
|
-
return {
|
|
35
|
-
html: "",
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
methods: {
|
|
39
|
-
/**
|
|
40
|
-
* 渲染某一个单独的Text标签成Span或链接
|
|
41
|
-
* @param {*} school_id
|
|
42
|
-
* @returns
|
|
43
|
-
*/
|
|
44
|
-
renderItemHtml: function (item) {
|
|
45
|
-
let content = item.text;
|
|
46
|
-
let style = ``;
|
|
47
|
-
let link = null;
|
|
48
|
-
content = content.replace(/\\n/g, "<br />").replace(/\\/g, "");
|
|
49
|
-
if ([item.r, item.g, item.b].every((v) => v != undefined && v > 0)) {
|
|
50
|
-
style = `color: rgb(${item.r}, ${item.g}, ${item.b});`;
|
|
51
|
-
} else if (item.font != undefined && item.font != 100) {
|
|
52
|
-
const fonts = require("../../../assets/data/game_font.json");
|
|
53
|
-
for (let color in fonts) {
|
|
54
|
-
if (fonts[color].includes(item.font)) {
|
|
55
|
-
style = `color: ${color};`;
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (item.name == "iteminfolink" && item.script) {
|
|
61
|
-
let item_type = item.script?.match(/this\.dwTabType=(\d+)/i)?.[1];
|
|
62
|
-
let item_index = item.script?.match(/this\.dwIndex=(\d+)/i)?.[1];
|
|
63
|
-
if (item_type && item_index) {
|
|
64
|
-
let item_id = `${item_type}_${item_index}`;
|
|
65
|
-
link = getLink("item", item_id);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (this.ignoreColor) {
|
|
69
|
-
style = "";
|
|
70
|
-
}
|
|
71
|
-
if (link) {
|
|
72
|
-
return `<a style="${style} text-decoration: none;" target="_blank" href="${link}">${content}</a>`;
|
|
73
|
-
} else {
|
|
74
|
-
return `<span style="${style}">${content}</span>`;
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
/**
|
|
78
|
-
* 将image标签转换为HTML标签
|
|
79
|
-
*/
|
|
80
|
-
renderImageHtml: function (Text) {
|
|
81
|
-
// <image>path="fromiconid" frame=1241 w=29 h=29 </image>
|
|
82
|
-
let matches = Text.match(/<image>(.*?)<\/image>/gims);
|
|
83
|
-
if (!matches) return Text;
|
|
84
|
-
for (let match of matches) {
|
|
85
|
-
let icon_id = match.match(/frame=(\d+)/i)?.[1];
|
|
86
|
-
let w = parseInt(match.match(/w=(\d+)/i)?.[1]) / 1.12;
|
|
87
|
-
let h = parseInt(match.match(/h=(\d+)/i)?.[1]) / 1.12;
|
|
88
|
-
let src = iconLink(icon_id, this.client);
|
|
89
|
-
let html = `<img src="${src}" style="width: ${w}px; height: ${h}px; margin-bottom: -5px" />`;
|
|
90
|
-
Text = Text.replace(match, html);
|
|
91
|
-
}
|
|
92
|
-
return Text;
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* 将一段游戏内文本转换为Html
|
|
96
|
-
* @param {Object[]} texts 标签对象
|
|
97
|
-
*/
|
|
98
|
-
renderTextHtml: function (Text) {
|
|
99
|
-
let result = Text;
|
|
100
|
-
result = this.renderImageHtml(result);
|
|
101
|
-
const matches = Text.match(/<Text>(.*?)<\/text>/gims);
|
|
102
|
-
if (!matches) return Text;
|
|
103
|
-
for (let match of matches) {
|
|
104
|
-
let text = extractTextContent(match);
|
|
105
|
-
let html = this.renderItemHtml(text[0]);
|
|
106
|
-
result = result.replace(match, html);
|
|
107
|
-
}
|
|
108
|
-
return result;
|
|
109
|
-
},
|
|
110
|
-
/**
|
|
111
|
-
* 获取形如<BUFF 110 1 desc>, <ENCHANT 100>的资源字段并转换
|
|
112
|
-
*/
|
|
113
|
-
renderBuffResource: async function () {
|
|
114
|
-
const matches = this.html?.match(/<BUFF (\d+) (\d+) (.*?)>/gim);
|
|
115
|
-
if (!matches) return;
|
|
116
|
-
let resourceKeys = [];
|
|
117
|
-
let replaceMap = {};
|
|
118
|
-
//先统计需要的资源,减少请求数量
|
|
119
|
-
for (let match of matches) {
|
|
120
|
-
let [token, id, level, type] = match.match(/<BUFF (\d+) (\d+) (.*?)>/i);
|
|
121
|
-
resourceKeys.push(`${id}_${level}`);
|
|
122
|
-
if (level != 0) resourceKeys.push(`${id}_0`);
|
|
123
|
-
replaceMap[token] = [id, level, type];
|
|
124
|
-
}
|
|
125
|
-
await this.getAllResources("buff", resourceKeys, this.client);
|
|
126
|
-
for (let replace in replaceMap) {
|
|
127
|
-
let [id, level, type] = replaceMap[replace];
|
|
128
|
-
// 持续时间
|
|
129
|
-
if (type === "time") {
|
|
130
|
-
let interval;
|
|
131
|
-
let buff = this.getResource("buff", id, level);
|
|
132
|
-
if (buff["Interval"]) interval = buff["Interval"];
|
|
133
|
-
else interval = this.getResource("buff", id, 0)["Interval"];
|
|
134
|
-
if (!interval) {
|
|
135
|
-
console.log(replace, escape(replace));
|
|
136
|
-
this.html = this.html.replace(replace, escape(replace));
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
let time = interval / 16;
|
|
140
|
-
if (time > 60) {
|
|
141
|
-
time = Math.floor(time / 60) + "分钟";
|
|
142
|
-
} else {
|
|
143
|
-
time = time + "秒";
|
|
144
|
-
}
|
|
145
|
-
this.html = this.html.replace(replace, escape(time));
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
// buff描述
|
|
149
|
-
if (type === "desc") {
|
|
150
|
-
let buff = this.getResource("buff", id, level);
|
|
151
|
-
let desc = buff["Desc"];
|
|
152
|
-
if (!desc) desc = this.getResource("buff", id, 0)["Desc"];
|
|
153
|
-
if (!desc) {
|
|
154
|
-
this.html = this.html.replace(replace, escape(replace));
|
|
155
|
-
continue;
|
|
156
|
-
}
|
|
157
|
-
// buff的描述里面可能会混着一些buff的属性啥的
|
|
158
|
-
let _matches = desc.match(/<BUFF ([0-9a-zA-Z]+)>/gi);
|
|
159
|
-
if (_matches) {
|
|
160
|
-
for (let _m of _matches) {
|
|
161
|
-
// eslint-disable-next-line no-unused-vars
|
|
162
|
-
let [_, _attr] = _m.match(/<BUFF ([0-9a-zA-Z]+)>/i);
|
|
163
|
-
for (let i = 1; i < 15; i++) {
|
|
164
|
-
if (buff[`BeginAttrib${i}`] == _attr) {
|
|
165
|
-
desc = desc.replace(_m, buff[`BeginValue${i}A`]);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
this.html = this.html.replace(replace, desc);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
renderEnchantResource: async function () {
|
|
175
|
-
const matches = this.html.match(/<ENCHANT (\d+)>/gim);
|
|
176
|
-
if (!matches) return;
|
|
177
|
-
let resourceKeys = [];
|
|
178
|
-
let replaceMap = {};
|
|
179
|
-
for (let match of matches) {
|
|
180
|
-
let enchant_id = match.match(/<ENCHANT (\d+)>/i)[1];
|
|
181
|
-
resourceKeys.push(enchant_id);
|
|
182
|
-
replaceMap[match] = enchant_id;
|
|
183
|
-
}
|
|
184
|
-
await this.getAllResources("enchant", resourceKeys, this.client);
|
|
185
|
-
for (let replace in replaceMap) {
|
|
186
|
-
try {
|
|
187
|
-
let enchant_id = replaceMap[replace];
|
|
188
|
-
let enchant = this.getResource("enchant", enchant_id);
|
|
189
|
-
let time = enchant.Time;
|
|
190
|
-
if (time) time = `,持续${parseInt(time) / 60}分钟。`;
|
|
191
|
-
let result = `${enchant.AttriName}${time ? time : ""}`;
|
|
192
|
-
this.html = this.html.replace(replace, result);
|
|
193
|
-
} catch (e) {
|
|
194
|
-
console.log(e);
|
|
195
|
-
this.html = this.html.replace(replace, escape(replace));
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
renderResource: function () {
|
|
200
|
-
this.renderBuffResource();
|
|
201
|
-
this.renderEnchantResource();
|
|
202
|
-
},
|
|
203
|
-
getAllResources: async function (type, ids) {
|
|
204
|
-
let resources = await getResourceFromNode(type, ids, this.client);
|
|
205
|
-
let data = resources.data;
|
|
206
|
-
if (data.length === undefined) data = [data];
|
|
207
|
-
if (type == "buff") {
|
|
208
|
-
for (let item of data) {
|
|
209
|
-
let buff_token = `${item.BuffID}_${item.Level}`;
|
|
210
|
-
sessionStorage.setItem(`buff-${this.client}-${buff_token}`, JSON.stringify(item));
|
|
211
|
-
}
|
|
212
|
-
} else if (type == "enchant") {
|
|
213
|
-
for (let item of data) {
|
|
214
|
-
let enchant_token = `${item.ID}`;
|
|
215
|
-
sessionStorage.setItem(`enchant-${this.client}-${enchant_token}`, JSON.stringify(item));
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
getResource: function (type, id, level) {
|
|
220
|
-
let token = `${id}`;
|
|
221
|
-
if (type == "buff") {
|
|
222
|
-
token = `${id}_${level}`;
|
|
223
|
-
}
|
|
224
|
-
let resource = sessionStorage.getItem(`${type}-${this.client}-${token}`);
|
|
225
|
-
if (resource) return JSON.parse(resource);
|
|
226
|
-
return null;
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
watch: {
|
|
230
|
-
text: {
|
|
231
|
-
immediate: true,
|
|
232
|
-
handler: function (val) {
|
|
233
|
-
if (!val) return;
|
|
234
|
-
this.html = this.renderTextHtml(val);
|
|
235
|
-
this.renderResource();
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
};
|
|
240
|
-
</script>
|
|
241
|
-
|
|
242
|
-
<style></style>
|
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-if="source"
|
|
4
|
-
class="c-item"
|
|
5
|
-
:class="{
|
|
6
|
-
'c-item-equipment': source.AucGenre >= 1 && source.AucGenre <= 4,
|
|
7
|
-
'c-item-furniture': source.AucGenre == 21,
|
|
8
|
-
}"
|
|
9
|
-
>
|
|
10
|
-
<div class="c-item-wrapper">
|
|
11
|
-
<!-- 精炼等级 -->
|
|
12
|
-
<div v-if="source.MaxStrengthLevel" class="u-max-strength-level">
|
|
13
|
-
<span v-text="`精炼等级:0 / ${source.MaxStrengthLevel}`"></span>
|
|
14
|
-
</div>
|
|
15
|
-
<!-- 物品名称 -->
|
|
16
|
-
<div class="u-title" :style="{ color: color(source.Quality) }" v-text="source.Name"></div>
|
|
17
|
-
<!-- 绑定状态 -->
|
|
18
|
-
<div v-if="source.BindType > 1" class="u-bind" v-text="bind(source.BindType)"></div>
|
|
19
|
-
<!-- 唯一 -->
|
|
20
|
-
<div v-if="parseInt(source.MaxExistAmount) === 1" class="unique" v-text="'唯一'"></div>
|
|
21
|
-
<!-- 存在时间 -->
|
|
22
|
-
<div
|
|
23
|
-
v-if="parseInt(source.MaxExistTime) > 0"
|
|
24
|
-
class="u-max-exist-time"
|
|
25
|
-
v-text="'限时时间:' + showDuration(source.MaxExistTime)"
|
|
26
|
-
></div>
|
|
27
|
-
<!-- 最大拥有数 -->
|
|
28
|
-
<div
|
|
29
|
-
v-if="parseInt(source.MaxExistAmount) > 1"
|
|
30
|
-
class="u-max-exist-amount"
|
|
31
|
-
v-text="'最大拥有数:' + source.MaxExistAmount"
|
|
32
|
-
></div>
|
|
33
|
-
<!-- 武器类别 -->
|
|
34
|
-
<div v-if="source.AucGenre == 1" class="u-weapon-type-label">近身武器</div>
|
|
35
|
-
<div v-if="source.AucGenre == 2" class="u-weapon-type-label">远程武器</div>
|
|
36
|
-
<!-- 物品类型文案 -->
|
|
37
|
-
<div v-if="source.TypeLabel" class="u-type-label" v-text="source.TypeLabel"></div>
|
|
38
|
-
<!-- 装备属性 -->
|
|
39
|
-
<div class="u-attributes" v-if="source.attributes && source.attributes.length">
|
|
40
|
-
<div
|
|
41
|
-
v-for="(attribute, key) in source.attributes"
|
|
42
|
-
:key="key"
|
|
43
|
-
class="u-field"
|
|
44
|
-
:class="[`u-${attribute.color}`]"
|
|
45
|
-
>
|
|
46
|
-
<span
|
|
47
|
-
v-if="
|
|
48
|
-
attribute.type == 'atMeleeWeaponAttackSpeedBase' ||
|
|
49
|
-
attribute.type == 'atRangeWeaponAttackSpeedBase'
|
|
50
|
-
"
|
|
51
|
-
class="u-value u-speed"
|
|
52
|
-
v-text="attribute.label"
|
|
53
|
-
></span>
|
|
54
|
-
<span v-else-if="attribute.type == 'atHorseAttribute'" class="u-value u-horse-attribute">
|
|
55
|
-
<img v-if="attribute.icon_id > 0" class="u-horse-icon" :src="iconLink(attribute.icon_id)" />
|
|
56
|
-
<div class="u-horse-desc" v-html="attribute.label"></div>
|
|
57
|
-
</span>
|
|
58
|
-
<span v-else class="u-value">
|
|
59
|
-
<game-text :text="attribute.label"></game-text>
|
|
60
|
-
<!-- <span
|
|
61
|
-
class="u-yellow"
|
|
62
|
-
v-text="
|
|
63
|
-
attribute_percent(
|
|
64
|
-
attribute.type,
|
|
65
|
-
attribute.value
|
|
66
|
-
)
|
|
67
|
-
"
|
|
68
|
-
></span>-->
|
|
69
|
-
</span>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
<!-- 家具属性 -->
|
|
73
|
-
<div class="u-furniture-attributes" v-if="source.furniture_attributes">
|
|
74
|
-
<div class="u-field u-green" v-if="source.furniture_attributes.view">
|
|
75
|
-
<span class="u-value" v-text="`观赏提高${source.furniture_attributes.view}`"></span>
|
|
76
|
-
</div>
|
|
77
|
-
<div class="u-field u-green" v-if="source.furniture_attributes.practical">
|
|
78
|
-
<span class="u-value" v-text="`实用提高${source.furniture_attributes.practical}`"></span>
|
|
79
|
-
</div>
|
|
80
|
-
<div class="u-field u-green" v-if="source.furniture_attributes.hard">
|
|
81
|
-
<span class="u-value" v-text="`坚固提高${source.furniture_attributes.hard}`"></span>
|
|
82
|
-
</div>
|
|
83
|
-
<div class="u-field u-green" v-if="source.furniture_attributes.geomantic">
|
|
84
|
-
<span class="u-value" v-text="`风水提高${source.furniture_attributes.geomantic}`"></span>
|
|
85
|
-
</div>
|
|
86
|
-
<div class="u-field u-green" v-if="source.furniture_attributes.interesting">
|
|
87
|
-
<span class="u-value" v-text="`趣味提高${source.furniture_attributes.interesting}`"></span>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
<!-- 镶嵌 -->
|
|
91
|
-
<ul v-if="source.Diamonds" class="u-diamonds u-gray">
|
|
92
|
-
<!-- 五行石 -->
|
|
93
|
-
<li class="u-diamond" v-for="(label, key) in source.Diamonds" :key="key">
|
|
94
|
-
<span class="u-square"></span>
|
|
95
|
-
<span class="u-text" v-text="`镶嵌孔:${label}`"></span>
|
|
96
|
-
</li>
|
|
97
|
-
<!-- 五彩石 -->
|
|
98
|
-
<li v-if="source.AucGenre == 1" class="u-diamond">
|
|
99
|
-
<span class="u-square"></span>
|
|
100
|
-
<span class="u-text"><只能镶嵌五彩石></span>
|
|
101
|
-
</li>
|
|
102
|
-
</ul>
|
|
103
|
-
<!-- 仅性别可穿戴 -->
|
|
104
|
-
<div v-if="source.Requires && source.Requires[7]" class="u-require-sex" v-text="source.Requires[7]"></div>
|
|
105
|
-
<!-- 需要门派 -->
|
|
106
|
-
<div
|
|
107
|
-
v-if="source.Requires && source.Requires[6]"
|
|
108
|
-
class="u-require-school"
|
|
109
|
-
v-text="source.Requires[6]"
|
|
110
|
-
></div>
|
|
111
|
-
<!-- 需要等级 -->
|
|
112
|
-
<div v-if="source.Requires && source.Requires[5]" class="u-require-level" v-text="source.Requires[5]"></div>
|
|
113
|
-
<!-- 需要阵营 -->
|
|
114
|
-
<div
|
|
115
|
-
v-if="source.Requires && source.Requires[100]"
|
|
116
|
-
class="u-require-camp"
|
|
117
|
-
v-text="source.Requires[100]"
|
|
118
|
-
></div>
|
|
119
|
-
<!-- 需求宅邸等级 -->
|
|
120
|
-
<div
|
|
121
|
-
v-if="source.Requires && source.Requires[101]"
|
|
122
|
-
class="u-require-homeland-level"
|
|
123
|
-
v-text="source.Requires[101]"
|
|
124
|
-
></div>
|
|
125
|
-
<!-- 最大耐久度 -->
|
|
126
|
-
<div
|
|
127
|
-
v-if="source.AucGenre >= 1 && source.AucGenre <= 3"
|
|
128
|
-
class="u-max-durability"
|
|
129
|
-
v-text="'最大耐久度' + source.MaxDurability"
|
|
130
|
-
></div>
|
|
131
|
-
<!-- 套装信息 -->
|
|
132
|
-
<div v-if="source.Set" class="u-set">
|
|
133
|
-
<br />
|
|
134
|
-
<div class="u-yellow" v-text="`${source.Set.name}(1/${source.Set.siblings.length})`"></div>
|
|
135
|
-
<ul class="u-set-siblings u-gray">
|
|
136
|
-
<li
|
|
137
|
-
v-for="(sibling, key) in source.Set.siblings"
|
|
138
|
-
:key="key"
|
|
139
|
-
v-text="sibling"
|
|
140
|
-
:class="{ 'u-yellow': sibling == source.Name }"
|
|
141
|
-
></li>
|
|
142
|
-
</ul>
|
|
143
|
-
<br />
|
|
144
|
-
<ul class="u-set-attributes u-gray">
|
|
145
|
-
<li v-for="(attribute, key) in source.Set.attributes" :key="key">
|
|
146
|
-
<span>{{ `[${key}]` }}</span>
|
|
147
|
-
<game-text :client="client" :text="attribute" :ignore-color="true"></game-text>
|
|
148
|
-
</li>
|
|
149
|
-
</ul>
|
|
150
|
-
<br />
|
|
151
|
-
</div>
|
|
152
|
-
<!-- 图片 -->
|
|
153
|
-
<div class="u-image-url" v-if="source.ImageUrl">
|
|
154
|
-
<img :src="source.ImageUrl" @error.once="source.ImageUrl = null" />
|
|
155
|
-
</div>
|
|
156
|
-
<!-- 描述 -->
|
|
157
|
-
<p v-if="source.Desc" class="u-desc u-yellow">
|
|
158
|
-
<game-text :client="client" :text="source.Desc"></game-text>
|
|
159
|
-
</p>
|
|
160
|
-
<!-- 五彩石属性 -->
|
|
161
|
-
<p v-if="source.WuCaiHtml" class="u-desc" v-html="source.WuCaiHtml"></p>
|
|
162
|
-
<!-- 品质等级 -->
|
|
163
|
-
<div v-if="source.Level" class="u-level u-yellow" v-text="'品质等级' + source.Level"></div>
|
|
164
|
-
<!-- 装备分数 -->
|
|
165
|
-
<div
|
|
166
|
-
v-if="source.EquipmentRating"
|
|
167
|
-
class="u-equipment-rating u-orange"
|
|
168
|
-
v-text="'装备分数' + source.EquipmentRating"
|
|
169
|
-
></div>
|
|
170
|
-
<!-- 推荐门派心法 -->
|
|
171
|
-
<div v-if="source.Recommend" class="u-equipment-recommend" v-text="'推荐门派:' + source.Recommend"></div>
|
|
172
|
-
<!-- 冷却时间 -->
|
|
173
|
-
<div
|
|
174
|
-
v-if="source.CoolDown"
|
|
175
|
-
class="u-equipment-recommend"
|
|
176
|
-
v-text="'使用间隔' + second_format(source.CoolDown)"
|
|
177
|
-
></div>
|
|
178
|
-
<!-- 外观名称 -->
|
|
179
|
-
<div v-if="source.Appearance" class="u-appearance" v-text="'外观名称:' + source.Appearance"></div>
|
|
180
|
-
<!-- 可收集门派 -->
|
|
181
|
-
<div v-if="source.CanExterior" class="u-can-exterior" v-text="'外观:' + source.CanExterior"></div>
|
|
182
|
-
<!-- 储物箱共享 -->
|
|
183
|
-
<div v-if="source.CanShared && !(source.AucGenre >= 1 && source.AucGenre <= 4)" class="u-can-shared">
|
|
184
|
-
该物品可以放入账号储物箱共享。
|
|
185
|
-
</div>
|
|
186
|
-
<div v-if="source.CanShared && source.AucGenre >= 1 && source.AucGenre <= 4" class="u-can-shared">
|
|
187
|
-
该装备未精炼、镶嵌、附魔、穿戴前可以放入账号储物箱共享。
|
|
188
|
-
</div>
|
|
189
|
-
<!-- 家具可交互可缩放 -->
|
|
190
|
-
<div v-if="source.furniture_attributes" class="u-furniture-can">
|
|
191
|
-
<span v-if="source.furniture_attributes.interact">可交互</span>
|
|
192
|
-
<span
|
|
193
|
-
v-if="source.furniture_attributes.scale_range"
|
|
194
|
-
v-text="`可缩放(${source.furniture_attributes.scale_range.replace(';', ' - ')}倍)`"
|
|
195
|
-
></span>
|
|
196
|
-
</div>
|
|
197
|
-
<!-- 物品来源 -->
|
|
198
|
-
<div v-if="source.GetType" class="u-get-type" v-text="`物品来源:${source.GetType}`"></div>
|
|
199
|
-
</div>
|
|
200
|
-
</div>
|
|
201
|
-
</template>
|
|
202
|
-
|
|
203
|
-
<script>
|
|
204
|
-
import { get_item } from "../../../service/item.js";
|
|
205
|
-
|
|
206
|
-
import GameText from "./GameText.vue";
|
|
207
|
-
|
|
208
|
-
import attribute_percent from "../../../assets/js/item/attribute_percent.js";
|
|
209
|
-
import bind from "../../../assets/js/item/bind.js";
|
|
210
|
-
import color from "../../../assets/js/item/color.js";
|
|
211
|
-
import * as utilModule from "@jx3box/jx3box-common/js/utils";
|
|
212
|
-
const { iconLink } = utilModule;
|
|
213
|
-
|
|
214
|
-
import second_format from "../../../assets/js/item/second_format.js";
|
|
215
|
-
import dayjs from "dayjs";
|
|
216
|
-
import duration from "dayjs/plugin/duration";
|
|
217
|
-
dayjs.extend(duration);
|
|
218
|
-
|
|
219
|
-
export default {
|
|
220
|
-
name: "ItemComponent",
|
|
221
|
-
props: {
|
|
222
|
-
item: {
|
|
223
|
-
type: Object,
|
|
224
|
-
},
|
|
225
|
-
item_id: {
|
|
226
|
-
type: String,
|
|
227
|
-
},
|
|
228
|
-
client: {
|
|
229
|
-
type: String,
|
|
230
|
-
},
|
|
231
|
-
jx3ClientType: {
|
|
232
|
-
type: Number,
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
data() {
|
|
236
|
-
return {
|
|
237
|
-
source: null,
|
|
238
|
-
};
|
|
239
|
-
},
|
|
240
|
-
components: {
|
|
241
|
-
GameText,
|
|
242
|
-
},
|
|
243
|
-
computed: {
|
|
244
|
-
// 兼容旧版传值
|
|
245
|
-
env_client_id: function () {
|
|
246
|
-
return location.href.includes("origin") ? 2 : 1;
|
|
247
|
-
},
|
|
248
|
-
client_id: function () {
|
|
249
|
-
return this.jx3ClientType || this.env_client_id;
|
|
250
|
-
},
|
|
251
|
-
client_by_id: function () {
|
|
252
|
-
return this.client_id == 1 ? "std" : "origin";
|
|
253
|
-
},
|
|
254
|
-
// 新版传值
|
|
255
|
-
final_client: function () {
|
|
256
|
-
return this.client || this.client_by_id;
|
|
257
|
-
},
|
|
258
|
-
cache_key: function () {
|
|
259
|
-
return `item-${this.final_client}-${this.item_id}`;
|
|
260
|
-
},
|
|
261
|
-
},
|
|
262
|
-
methods: {
|
|
263
|
-
iconLink: function (id) {
|
|
264
|
-
return iconLink(id, this.final_client);
|
|
265
|
-
},
|
|
266
|
-
second_format,
|
|
267
|
-
showDuration: function (val) {
|
|
268
|
-
val = Number(val);
|
|
269
|
-
return val && dayjs.duration(val).asDays().toFixed(0) + "天";
|
|
270
|
-
},
|
|
271
|
-
attribute_percent,
|
|
272
|
-
bind,
|
|
273
|
-
color,
|
|
274
|
-
formatDescHtml: function (str) {
|
|
275
|
-
return str.replace(/font=\d+\s>/g, "");
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
watch: {
|
|
279
|
-
item: {
|
|
280
|
-
immediate: true,
|
|
281
|
-
handler() {
|
|
282
|
-
if (typeof this.item !== "undefined") this.source = this.item;
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
item_id: {
|
|
286
|
-
immediate: true,
|
|
287
|
-
handler(val) {
|
|
288
|
-
if (val) {
|
|
289
|
-
// 提取本地数据
|
|
290
|
-
let _cache = sessionStorage.getItem(this.cache_key);
|
|
291
|
-
|
|
292
|
-
// 本地读取缓存
|
|
293
|
-
if (_cache) {
|
|
294
|
-
try {
|
|
295
|
-
this.source = JSON.parse(_cache);
|
|
296
|
-
} catch (e) {
|
|
297
|
-
console.log(e, "[Item]无法解析本地缓存");
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// 服务端拉取
|
|
301
|
-
} else {
|
|
302
|
-
get_item(this.item_id, this.final_client).then((res) => {
|
|
303
|
-
let data = res.data;
|
|
304
|
-
if (data.code === 200) {
|
|
305
|
-
let item = data.data.item;
|
|
306
|
-
let isValidItem = JSON.stringify(item) !== "{}";
|
|
307
|
-
if (isValidItem) {
|
|
308
|
-
this.source = item;
|
|
309
|
-
sessionStorage.setItem(this.cache_key, JSON.stringify(this.source));
|
|
310
|
-
} else {
|
|
311
|
-
this.source = null;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
},
|
|
319
|
-
},
|
|
320
|
-
};
|
|
321
|
-
</script>
|
|
322
|
-
|
|
323
|
-
<style lang="less">
|
|
324
|
-
@import "../../../assets/css/module/item.less";
|
|
325
|
-
</style>
|