@jx3box/jx3box-vue3-ui 0.4.16 → 0.4.18

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.
@@ -417,6 +417,11 @@ body {
417
417
  border-top-right-radius: 4px;
418
418
  }
419
419
 
420
+ .u-expire {
421
+ color: #999;
422
+ font-size: 12px;
423
+ }
424
+
420
425
  .u-basic {
421
426
  .flex;
422
427
  align-items: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-vue3-ui",
3
- "version": "0.4.16",
3
+ "version": "0.4.18",
4
4
  "description": "JX3BOX Vue3 UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,8 +26,8 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@element-plus/icons-vue": "^2.1.0",
29
- "@jx3box/jx3box-common": "^8.0.0",
30
- "@jx3box/jx3box-data": "^3.5.2",
29
+ "@jx3box/jx3box-common": "^8.0.3",
30
+ "@jx3box/jx3box-data": "^3.5.3",
31
31
  "@jx3box/jx3box-emotion": "^1.2.4",
32
32
  "@jx3box/jx3box-macro": "^1.0.1",
33
33
  "@jx3box/jx3box-talent": "^1.2.7",
package/service/admin.js CHANGED
@@ -12,4 +12,9 @@ function postSetting(data) {
12
12
  return $cms().put(`/api/cms/manage/post/${data.ID}`, data);
13
13
  }
14
14
 
15
- export { getSetting, postSetting };
15
+ // 管理员发送私信
16
+ function sendMessage(data) {
17
+ return $cms().post(`/api/cms/manage/message`, data);
18
+ }
19
+
20
+ export { getSetting, postSetting, sendMessage };
@@ -10,6 +10,12 @@
10
10
  :class="{ on: isFocus(item.link) }"
11
11
  :href="item.link"
12
12
  :target="isSelf(item.link)"
13
+ v-reporter="{
14
+ data: {
15
+ item: trimSlash(item.link),
16
+ },
17
+ caller: 'index_nav',
18
+ }"
13
19
  >{{ item.label }}<el-icon><ArrowDown /></el-icon
14
20
  ></a>
15
21
  <template #dropdown>
@@ -23,6 +29,12 @@
23
29
  :href="subitem.link"
24
30
  :target="isSelf(subitem.link)"
25
31
  v-if="subitem.status && matchedClient(subitem.client)"
32
+ v-reporter="{
33
+ data: {
34
+ item: trimSlash(subitem.link),
35
+ },
36
+ caller: 'index_nav',
37
+ }"
26
38
  >{{ subitem.label }} <span v-if="subitem.desc">{{ subitem.desc }}</span></a
27
39
  ></el-dropdown-item
28
40
  >
@@ -31,7 +43,18 @@
31
43
  </el-dropdown>
32
44
  </template>
33
45
  <template v-else>
34
- <a class="u-item" :class="{ on: isFocus(item.link) }" :href="item.link">{{ item.label }}</a>
46
+ <a
47
+ class="u-item"
48
+ :class="{ on: isFocus(item.link) }"
49
+ :href="item.link"
50
+ v-reporter="{
51
+ data: {
52
+ item: trimSlash(item.link),
53
+ },
54
+ caller: 'index_nav',
55
+ }"
56
+ >{{ item.label }}</a
57
+ >
35
58
  </template>
36
59
  </template>
37
60
  </div>
@@ -53,6 +76,12 @@
53
76
  :class="{ on: isFocus(item.link) }"
54
77
  :href="item.link"
55
78
  :target="isSelf(item.link)"
79
+ v-reporter="{
80
+ data: {
81
+ item: trimSlash(item.link),
82
+ },
83
+ caller: 'index_nav',
84
+ }"
56
85
  >{{ item.label }}</a
57
86
  ></template
58
87
  >
@@ -61,6 +90,12 @@
61
90
  v-if="matchedClient(subitem.client)"
62
91
  :key="'header-nav-drop-' + subitem.key + subIndex"
63
92
  :index="subitem.key"
93
+ v-reporter="{
94
+ data: {
95
+ item: trimSlash(subitem.link),
96
+ },
97
+ caller: 'index_nav',
98
+ }"
64
99
  >
65
100
  <a class="u-menu-item" :href="subitem.link" :target="isSelf(subitem.link)"
66
101
  >{{ subitem.label }} <span v-if="subitem.desc">{{ subitem.desc }}</span>
@@ -69,9 +104,18 @@
69
104
  </template>
70
105
  </el-sub-menu>
71
106
  <el-menu-item v-else>
72
- <a class="u-item" :class="{ on: isFocus(item.link) }" :href="item.link">{{
73
- item.label
74
- }}</a>
107
+ <a
108
+ class="u-item"
109
+ :class="{ on: isFocus(item.link) }"
110
+ :href="item.link"
111
+ v-reporter="{
112
+ data: {
113
+ item: trimSlash(item.link),
114
+ },
115
+ caller: 'index_nav',
116
+ }"
117
+ >{{ item.label }}</a
118
+ >
75
119
  </el-menu-item>
76
120
  </template>
77
121
  </el-menu-item>
@@ -84,6 +128,19 @@
84
128
  <script>
85
129
  import default_nav from "../../assets/data/nav.json";
86
130
  import { getMenu } from "../../service/header";
131
+ import { trimSlash } from "../../utils";
132
+
133
+ const activeNav = {
134
+ index: ['index'],
135
+ macro: ['macro', 'pz'],
136
+ tool: ['app', 'jx3dat', 'dbm'],
137
+ bps: ['bps', 'jcl', 'battle'],
138
+ fb: ['fb','baizhan','team', 'jdt', 'rank'],
139
+ cj: ['cj', 'item', 'knowledge', 'quest'],
140
+ pvx: ['face', 'adventure', 'pvg'],
141
+ bbs: ['bbs','topic','event'],
142
+ pvp: ['pvp']
143
+ }
87
144
  export default {
88
145
  name: "HeaderNav",
89
146
  props: [],
@@ -119,10 +176,22 @@ export default {
119
176
  client() {
120
177
  return location.href.includes("origin") ? "origin" : "std";
121
178
  },
179
+ prefix() {
180
+ return this.client === "std" ? "www" : "origin";
181
+ },
122
182
  },
123
183
  methods: {
124
184
  isFocus: function (type) {
125
- return location.pathname.includes(type);
185
+ // return location.pathname.includes(type);
186
+ let active = '';
187
+ const pathname = location.pathname?.split('/')?.filter(Boolean)?.[0] || 'index';
188
+ for (const key in activeNav) {
189
+ if (activeNav[key].includes(pathname)) {
190
+ active = key;
191
+ break;
192
+ }
193
+ }
194
+ return type.includes(active);
126
195
  },
127
196
  matchedClient: function (client) {
128
197
  return client == "all" ? true : client == this.client;
@@ -148,6 +217,9 @@ export default {
148
217
  console.log("loadNav error", e);
149
218
  }
150
219
  },
220
+ trimSlash(link) {
221
+ return trimSlash(`${this.prefix}:${link}`);
222
+ },
151
223
  },
152
224
  created: function () {
153
225
  this.loadNav();
@@ -48,6 +48,7 @@
48
48
  title="专业版账号"
49
49
  >
50
50
  <i class="i-icon-vip" :class="{ on: isPRO }">{{ vipType }}</i>
51
+ <span class="u-expire">有效期至:{{ pro_expire_date }}</span>
51
52
  </a>
52
53
  </div>
53
54
  <div class="u-id">
@@ -95,6 +96,7 @@
95
96
  <script>
96
97
  import User from "@jx3box/jx3box-common/js/user";
97
98
  import { showAvatar } from "@jx3box/jx3box-common/js/utils";
99
+ import {showDate} from "@jx3box/jx3box-common/js/moment";
98
100
  import { getMyInfo } from "../../service/author";
99
101
  import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
100
102
  import { copyText } from "../../utils";
@@ -138,6 +140,9 @@ export default {
138
140
  isEditor() {
139
141
  return User.isEditor();
140
142
  },
143
+ pro_expire_date: function() {
144
+ return this.asset.pro_expire_date ? showDate(this.asset.pro_expire_date) : '-';
145
+ },
141
146
  },
142
147
  mounted() {
143
148
  this.loadMyInfo();
package/src/main.js CHANGED
@@ -16,6 +16,8 @@ import "../assets/css/var.less";
16
16
 
17
17
  import "@jx3box/jx3box-common/css/normalize.css";
18
18
 
19
+ import reporter from "@jx3box/jx3box-common/js/reporter";
20
+
19
21
  app.use(ElementPlus, {
20
22
  locale: zhCn,
21
23
  });
@@ -29,5 +31,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
29
31
  import { install } from "../index.js";
30
32
  install(app);
31
33
 
34
+ reporter.installVue3(app);
35
+
32
36
  // 3.Mount DOM
33
37
  app.mount("#app");
package/utils/index.js CHANGED
@@ -29,3 +29,8 @@ export function copyText(text) {
29
29
  document.body.removeChild(textArea);
30
30
  }
31
31
  }
32
+
33
+ // 去除最后的/
34
+ export function trimSlash(str) {
35
+ return str.replace(/\/$/, "");
36
+ }