@jx3box/jx3box-common-ui 8.2.15 → 8.2.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "8.2.15",
3
+ "version": "8.2.17",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -40,8 +40,7 @@ export default {
40
40
  clients = Object.assign({}, clients, {
41
41
  all: "全端",
42
42
  });
43
- }
44
- console.log(clients)
43
+ }
45
44
  return clients;
46
45
  },
47
46
  },
@@ -6,15 +6,15 @@
6
6
  <ul class="u-menu u-pop-content">
7
7
  <li v-for="item in userPanel" :key="item.label">
8
8
  <a :href="item.link" :target="item.target || '_self'" class="u-menu-item">
9
- <img :src="resolveImg(item.icon)" svg-inline class="u-menu-icon" :alt="item.icon">
9
+ <img :src="resolveImg(item.icon)" svg-inline class="u-menu-icon" :alt="item.icon" />
10
10
  {{ item.label }}
11
11
  </a>
12
12
  </li>
13
13
  <hr v-if="userPanel.length" />
14
- <template v-if="isEditor">
14
+ <template v-if="isTeammate">
15
15
  <li v-for="item in adminPanel" :key="item.label">
16
16
  <a :href="item.link" :target="item.target || '_self'" class="u-menu-item">
17
- <img :src="resolveImg(item.icon)" svg-inline class="u-menu-icon" :alt="item.icon">
17
+ <img :src="resolveImg(item.icon)" svg-inline class="u-menu-icon" :alt="item.icon" />
18
18
  {{ item.label }}
19
19
  </a>
20
20
  </li>
@@ -24,7 +24,6 @@
24
24
  </template>
25
25
 
26
26
  <script>
27
- import User from "@jx3box/jx3box-common/js/user";
28
27
  import panel from "../../assets/data/panel.json";
29
28
  import { getMenu } from "../../service/header";
30
29
  import { __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
@@ -35,6 +34,12 @@ export default {
35
34
  panel,
36
35
  };
37
36
  },
37
+ props: {
38
+ isTeammate: {
39
+ type: Boolean,
40
+ default: false,
41
+ },
42
+ },
38
43
  computed: {
39
44
  userPanel: function () {
40
45
  return this.panel.filter((item) => {
@@ -46,9 +51,6 @@ export default {
46
51
  return item.onlyAdmin;
47
52
  });
48
53
  },
49
- isEditor() {
50
- return User.isEditor();
51
- },
52
54
  },
53
55
  mounted() {
54
56
  this.loadPanel();
@@ -72,7 +74,7 @@ export default {
72
74
  },
73
75
  resolveImg: function (img) {
74
76
  // return __imgPath + "image/header/panel/" + img;
75
- return 'https://img.jx3box.com/image/box/pvp.svg'
77
+ return "https://img.jx3box.com/image/box/pvp.svg";
76
78
  },
77
79
  },
78
80
  };
@@ -92,7 +94,6 @@ export default {
92
94
  svg {
93
95
  .size(19px);
94
96
  }
95
-
96
97
  }
97
98
  .u-menu {
98
99
  .u-menu-item {
@@ -103,7 +104,7 @@ export default {
103
104
  .u-menu-icon {
104
105
  width: 16px;
105
106
  height: 16px;
106
- }
107
+ }
107
108
  }
108
109
  }
109
110
  </style>
@@ -17,13 +17,13 @@
17
17
  <asset :asset="asset" />
18
18
 
19
19
  <!-- manage -->
20
- <manage />
20
+ <manage :isTeammate="isTeammate" />
21
21
 
22
22
  <!-- 语言切换 -->
23
23
  <!-- <lang-switch /> -->
24
24
 
25
25
  <!-- user info -->
26
- <user-info :asset="asset" @logout="logout" />
26
+ <user-info :asset="asset" @logout="logout" @update="update" />
27
27
  </template>
28
28
  <template v-else>
29
29
  <div class="c-header-login">
@@ -43,12 +43,12 @@ import dayjs from "dayjs";
43
43
  import isToday from "dayjs/plugin/isToday";
44
44
  dayjs.extend(isToday);
45
45
 
46
- import message from "./message.vue"
47
- import publish from "./publish.vue"
48
- import vip from "./vip.vue"
49
- import asset from "./asset.vue"
50
- import manage from "./manage.vue"
51
- import userInfo from './userInfo.vue';
46
+ import message from "./message.vue";
47
+ import publish from "./publish.vue";
48
+ import vip from "./vip.vue";
49
+ import asset from "./asset.vue";
50
+ import manage from "./manage.vue";
51
+ import userInfo from "./userInfo.vue";
52
52
  // import langSwitch from "./langSwitch.vue";
53
53
  import shop from "./shop.vue";
54
54
  export default {
@@ -60,7 +60,7 @@ export default {
60
60
  manage,
61
61
  userInfo,
62
62
  // langSwitch,
63
- shop
63
+ shop,
64
64
  },
65
65
  data: function () {
66
66
  return {
@@ -83,6 +83,8 @@ export default {
83
83
  // 链接
84
84
  login_url: __Links.account.login + "?redirect=" + location.href,
85
85
  register_url: __Links.account.register + "?redirect=" + location.href,
86
+
87
+ isTeammate: false,
86
88
  };
87
89
  },
88
90
  methods: {
@@ -133,7 +135,7 @@ export default {
133
135
  // 初始化
134
136
  init: function () {
135
137
  if (this.isLogin) {
136
- this.loadAsset( )
138
+ this.loadAsset();
137
139
  this.signIn();
138
140
  }
139
141
  },
@@ -142,6 +144,10 @@ export default {
142
144
  logout: function () {
143
145
  this.isLogin = false;
144
146
  },
147
+ // 更新用户信息
148
+ update: function ({ is_teammate }) {
149
+ this.isTeammate = is_teammate;
150
+ },
145
151
  },
146
152
  created: function () {
147
153
  this.init();
@@ -13,14 +13,14 @@
13
13
  <li>
14
14
  <a :href="url.publish">发布中心</a>
15
15
  </li>
16
- <hr>
16
+ <hr />
17
17
  <li v-for="item in userPanel" :key="item.label">
18
18
  <a :href="item.link" :target="item.target || '_self'">
19
19
  <!-- <i :class="item.icon || 'el-icon-present'"></i> -->
20
20
  {{ item.label }}
21
21
  </a>
22
22
  </li>
23
- <template v-if="isEditor">
23
+ <template v-if="isTeammate">
24
24
  <li v-for="item in adminPanel" :key="item.label">
25
25
  <a :href="item.link" :target="item.target || '_self'">
26
26
  <!-- <i :class="item.icon || 'el-icon-present'"></i> -->
@@ -41,14 +41,27 @@
41
41
  showUserName(user.display_name)
42
42
  }}</a>
43
43
  <a class="u-sign" href="/dashboard/cooperation">
44
- <img :src="super_author_icon" class="u-superauthor-profile" alt="superauthor" title="签约作者" :class="{ off: !isSuperAuthor }" /></a>
45
- <a class="u-vip" href="/vip/premium?from=header_usermenu" target="_blank" title="专业版账号">
44
+ <img
45
+ :src="super_author_icon"
46
+ class="u-superauthor-profile"
47
+ alt="superauthor"
48
+ title="签约作者"
49
+ :class="{ off: !isSuperAuthor }"
50
+ /></a>
51
+ <a
52
+ class="u-vip"
53
+ href="/vip/premium?from=header_usermenu"
54
+ target="_blank"
55
+ title="专业版账号"
56
+ >
46
57
  <i class="i-icon-vip" :class="{ on: isPRO }">{{ vipType }}</i>
47
58
  <span class="u-expire" v-if="isPRO">(有效期至:{{ pro_expire_date }})</span>
48
59
  </a>
49
60
  </div>
50
61
  <div class="u-id">
51
- <span>魔盒UID:<b>{{ user.ID }}</b></span>
62
+ <span
63
+ >魔盒UID:<b>{{ user.ID }}</b></span
64
+ >
52
65
  <i class="el-icon-document-copy u-copy" @click.stop="copyText(user.ID)"></i>
53
66
  </div>
54
67
  </div>
@@ -62,7 +75,8 @@
62
75
  <div class="u-other">
63
76
  <a href="/dashboard/fav" class="u-item"><i class="el-icon-star-off"></i>收藏订阅 </a>
64
77
  <a href="/team/role/manage" class="u-item"><i class="el-icon-user"></i>角色管理 </a>
65
- <a href="/dashboard/purchases" class="u-item"><i class="el-icon-shopping-cart-2"></i>已购资源
78
+ <a href="/dashboard/purchases" class="u-item"
79
+ ><i class="el-icon-shopping-cart-2"></i>已购资源
66
80
  </a>
67
81
  <a href="/dashboard/mall" class="u-item"><i class="el-icon-shopping-bag-1"></i>订单中心 </a>
68
82
  <hr />
@@ -89,6 +103,7 @@ import { getMenu } from "../../service/header";
89
103
  export default {
90
104
  name: "info",
91
105
  props: ["asset"],
106
+ emits: ["update"],
92
107
  data() {
93
108
  return {
94
109
  isPhone: window.innerWidth < 768,
@@ -106,6 +121,7 @@ export default {
106
121
  isSuperAuthor: false,
107
122
 
108
123
  panel: [],
124
+ isTeammate: false,
109
125
  };
110
126
  },
111
127
  computed: {
@@ -134,11 +150,8 @@ export default {
134
150
  return item.onlyAdmin;
135
151
  });
136
152
  },
137
- isEditor() {
138
- return User.isEditor();
139
- },
140
- pro_expire_date: function() {
141
- return this.asset.pro_expire_date ? showDate(this.asset.pro_expire_date) : '-';
153
+ pro_expire_date: function () {
154
+ return this.asset.pro_expire_date ? showDate(this.asset.pro_expire_date) : "-";
142
155
  },
143
156
  },
144
157
  mounted() {
@@ -174,6 +187,8 @@ export default {
174
187
  .then((data) => {
175
188
  this.user = data;
176
189
  this.isSuperAuthor = !!data.sign;
190
+ this.isTeammate = this.user?.is_teammate;
191
+ this.$emit("update", this.user);
177
192
  })
178
193
  .catch((err) => {
179
194
  if (err?.data.code < -1) {