@jx3box/jx3box-common-ui 7.7.2 → 7.7.4

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.
@@ -0,0 +1 @@
1
+ <?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M28.2857 37H39.7143M42 42L39.7143 37L42 42ZM26 42L28.2857 37L26 42ZM28.2857 37L34 24L39.7143 37H28.2857Z" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 6L17 9" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><path d="M6 11H28" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 16C10 16 11.7895 22.2609 16.2632 25.7391C20.7368 29.2174 28 32 28 32" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 11C24 11 22.2105 19.2174 17.7368 23.7826C13.2632 28.3478 6 32 6 32" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>
@@ -1,13 +1,13 @@
1
1
  import { Notification } from 'element-ui';
2
2
  // 复制
3
- export function copyText(text){
3
+ export function copyText(text) {
4
4
  if (window.navigator.clipboard) {
5
- window.navigator.clipboard.writeText(text).then(function() {
5
+ window.navigator.clipboard.writeText(text).then(function () {
6
6
  Notification.success({
7
7
  title: '复制成功',
8
8
  });
9
9
  console.log('Async: Copying to clipboard was successful!');
10
- }, function(err) {
10
+ }, function (err) {
11
11
  console.error('Async: Could not copy text: ', err);
12
12
  });
13
13
  } else {
@@ -28,6 +28,23 @@ export function copyText(text){
28
28
  }
29
29
 
30
30
  // 去除最后的/
31
- export function trimSlash (str) {
31
+ export function trimSlash(str) {
32
32
  return str.replace(/\/$/, "");
33
33
  }
34
+
35
+ // 监听 localStorage 的改变
36
+ export function dispatchEventStorage() {
37
+ const _setItem = localStorage.setItem
38
+
39
+ localStorage.setItem = function (key, val) {
40
+ // 注册一个名称为 setItemEvent 的事件
41
+ let setEvent = new Event('setItemEvent')
42
+ // key 为改变的 key, newVal 为改变的 value
43
+ setEvent.key = key
44
+ setEvent.newVal = val
45
+
46
+ window.dispatchEvent(setEvent)
47
+
48
+ _setItem.apply(this, arguments)
49
+ }
50
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "7.7.2",
3
+ "version": "7.7.4",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Box.vue CHANGED
@@ -11,7 +11,7 @@
11
11
  href="/index"
12
12
  v-reporter="{
13
13
  data: {
14
- item: '/index',
14
+ item: `${prefix}:/index`,
15
15
  },
16
16
  caller: 'index_nav_matrix',
17
17
  }"
@@ -80,6 +80,9 @@ export default {
80
80
  return item.status && (item.client == this.client || item.client == "all");
81
81
  });
82
82
  },
83
+ prefix: function (){
84
+ return this.client === 'std' ? 'www' : 'origin';
85
+ }
83
86
  },
84
87
  methods: {
85
88
  closeBox: function () {
@@ -114,7 +117,9 @@ export default {
114
117
  console.log("loadBox error", e);
115
118
  }
116
119
  },
117
- trimSlash,
120
+ trimSlash(link) {
121
+ return trimSlash(`${this.prefix}:${link}`);
122
+ },
118
123
  },
119
124
  created: function () {
120
125
  if (this.overlayEnable) {
package/src/Header.vue CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  <script>
34
34
  import _ from "lodash";
35
- import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
35
+ // import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
36
36
  import { isApp, KW } from "../assets/js/app.js";
37
37
 
38
38
  import logo from "./header/logo.vue";
@@ -41,7 +41,7 @@ import search from "./header/search.vue";
41
41
  import nav from "./header/nav.vue";
42
42
  import user from "./header/user.vue";
43
43
  import Box from "../src/Box.vue";
44
- import gameSwitch from "./header/gameSwitch.vue";
44
+ // import gameSwitch from "./header/gameSwitch.vue";
45
45
 
46
46
  export default {
47
47
  name: "Header",
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <div class="c-header-panel c-lang-switcher" id="c-header-lang-switcher">
3
+ <span class="u-translator" href="/dashboard/boxcoin">
4
+ <img class="u-icon" src="../../assets/img/header/translator.svg" alt="" />
5
+ </span>
6
+ <ul class="u-menu u-pop-content">
7
+ <li
8
+ v-for="item in langs"
9
+ :key="item.key"
10
+ @click="onLangChange(item.key)"
11
+ :class="{ 'is-active': item.key === currentLang }"
12
+ >
13
+ <a>{{ item.name }}</a>
14
+ </li>
15
+ </ul>
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ export default {
21
+ name: "langSwitch",
22
+ data() {
23
+ return {
24
+ langs: [
25
+ {
26
+ name: "简体中文",
27
+ key: "zh-cn",
28
+ disabled: false,
29
+ },
30
+ {
31
+ name: "繁体中文",
32
+ key: "zh-tw",
33
+ disabled: false,
34
+ },
35
+ {
36
+ name: "Tiếng Việt",
37
+ key: "vi",
38
+ disabled: false,
39
+ },
40
+ {
41
+ name: "English",
42
+ key: "en-us",
43
+ disabled: false,
44
+ },
45
+ ], // 语言列表 简体中文、繁体中文、英文、越南语
46
+ currentLang: "zh-cn", // 当前语言
47
+ };
48
+ },
49
+ mounted() {
50
+ const lang = localStorage.getItem("lang") || "zh-cn";
51
+ this.currentLang = lang;
52
+ },
53
+ methods: {
54
+ onLangChange(lang) {
55
+ localStorage.setItem("lang", lang);
56
+ },
57
+ },
58
+ };
59
+ </script>
60
+
61
+ <style lang="less">
62
+ .c-lang-switcher {
63
+ .u-translator {
64
+ padding: 0 10px;
65
+ width: 14;
66
+ height: 100%;
67
+ .flex;
68
+ align-items: center;
69
+ .pointer;
70
+ &:hover {
71
+ .tm(0.7);
72
+ }
73
+ }
74
+ .u-icon {
75
+ .size(19px);
76
+ }
77
+ li {
78
+ &.is-active {
79
+ a {
80
+ color: @primary;
81
+ font-weight: 600;
82
+ }
83
+ }
84
+ }
85
+ }
86
+ @media screen and (max-width: @phone) {
87
+ .c-lang-switcher {
88
+ display: none;
89
+ }
90
+ }
91
+ </style>
@@ -164,6 +164,9 @@ export default {
164
164
  client() {
165
165
  return location.href.includes("origin") ? "origin" : "std";
166
166
  },
167
+ prefix() {
168
+ return this.client === 'std' ? 'www' : 'origin';
169
+ }
167
170
  },
168
171
  methods: {
169
172
  isFocus: function (type) {
@@ -193,7 +196,9 @@ export default {
193
196
  console.log("loadNav error", e);
194
197
  }
195
198
  },
196
- trimSlash,
199
+ trimSlash(link) {
200
+ return trimSlash(`${this.prefix}:${link}`);
201
+ },
197
202
  },
198
203
  created: function () {
199
204
  this.loadNav();
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <div class="c-header-panel c-header-shop">
3
+ <el-tooltip effect="dark" content="积分商城" placement="bottom" popper-class="c-header-tooltip">
4
+ <a class="u-present" href="/vip/mall" target="_blank">
5
+ <i class="el-icon-present u-icon"></i>
6
+ </a>
7
+ </el-tooltip>
8
+ </div>
9
+ </template>
10
+
11
+ <style lang="less">
12
+ .c-header-shop {
13
+ .u-present {
14
+ padding: 0 10px;
15
+ height: 100%;
16
+ .flex;
17
+ align-items: center;
18
+ &:hover {
19
+ .tm(0.7);
20
+ }
21
+ }
22
+ .u-icon {
23
+ font-size: 15px;
24
+ color: #fff;
25
+ }
26
+ }
27
+ </style>
@@ -10,12 +10,18 @@
10
10
  <!-- vip -->
11
11
  <vip />
12
12
 
13
+ <!-- 商城 -->
14
+ <shop />
15
+
13
16
  <!-- 我的资产 -->
14
17
  <asset :asset="asset" />
15
18
 
16
19
  <!-- manage -->
17
20
  <manage />
18
21
 
22
+ <!-- 语言切换 -->
23
+ <lang-switch />
24
+
19
25
  <!-- user info -->
20
26
  <user-info :asset="asset" @logout="logout" />
21
27
  </template>
@@ -43,6 +49,8 @@ import vip from "./vip.vue"
43
49
  import asset from "./asset.vue"
44
50
  import manage from "./manage.vue"
45
51
  import userInfo from './userInfo.vue';
52
+ import langSwitch from "./langSwitch.vue";
53
+ import shop from "./shop.vue";
46
54
  export default {
47
55
  components: {
48
56
  message,
@@ -50,7 +58,9 @@ export default {
50
58
  vip,
51
59
  asset,
52
60
  manage,
53
- userInfo
61
+ userInfo,
62
+ langSwitch,
63
+ shop
54
64
  },
55
65
  data: function () {
56
66
  return {