@jx3box/jx3box-editor 1.7.3 → 1.7.5

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.
@@ -188,8 +188,7 @@
188
188
  .mb(20px);
189
189
  }
190
190
  .e-jx3-emotion {
191
- max-width: 200px;
192
- max-height: 200px;
191
+ height: 200px;
193
192
  vertical-align: middle;
194
193
  .e-jx3-emotion-img {
195
194
  border: none !important;
@@ -22,6 +22,26 @@
22
22
  border: 1px solid #eee;
23
23
  box-sizing: border-box;
24
24
  }
25
+ @media screen and (max-width:@ipad){
26
+ .w-player-bilibili{
27
+ height: 600px;
28
+ }
29
+ }
30
+ @media screen and (max-width:@ipad-y){
31
+ .w-player-bilibili{
32
+ height: 500px;
33
+ }
34
+ }
35
+ @media screen and (max-width:@phone){
36
+ .w-player-bilibili{
37
+ height: 240px;
38
+ }
39
+ }
40
+ @media screen and (max-width:@ip5){
41
+ .w-player-bilibili{
42
+ height: 180px;
43
+ }
44
+ }
25
45
  .c-article-editor {
26
46
  video,
27
47
  iframe {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,9 +31,9 @@
31
31
  "last 2 versions"
32
32
  ],
33
33
  "dependencies": {
34
- "@jx3box/jx3box-common": "^7.6.8",
34
+ "@jx3box/jx3box-common": "^7.7.3",
35
35
  "@jx3box/jx3box-data": "^3.0.4",
36
- "@jx3box/jx3box-emotion": "^1.1.5",
36
+ "@jx3box/jx3box-emotion": "^1.1.8",
37
37
  "@jx3box/jx3box-macro": "^1.0.1",
38
38
  "@jx3box/jx3box-talent": "^1.1.9",
39
39
  "@jx3box/markdown": "^0.1.5",
package/service/cms.js CHANGED
@@ -1,26 +1,31 @@
1
1
  import { $cms } from "@jx3box/jx3box-common/js/https";
2
-
2
+ import axios from "axios";
3
+ import { __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
3
4
  function uploadFile(data) {
4
5
  return $cms().post(`/api/cms/upload`, data);
5
6
  }
6
7
 
7
8
  // 获取用户列表
8
- function loadAuthors(params){
9
+ function loadAuthors(params) {
9
10
  return $cms().get(`/api/cms/user/list`, {
10
- params: params
11
+ params: params,
11
12
  });
12
13
  }
13
14
 
14
15
  // 获取表情列表
15
- function loadEmotions(params){
16
+ function loadEmotions(params) {
16
17
  return $cms().get(`/api/cms/post/emotions`, {
17
- params: params
18
+ params: params,
18
19
  });
19
20
  }
20
21
  //获取装扮
21
22
  function getDecoration(params) {
22
- return $cms().get(`/api/cms/user/decoration`,{
23
- params
23
+ return $cms().get(`/api/cms/user/decoration`, {
24
+ params,
24
25
  });
25
26
  }
26
- export { uploadFile, loadAuthors, loadEmotions,getDecoration };
27
+ function getDecorationJson() {
28
+ let url = __imgPath + "decoration/index.json";
29
+ return axios.get(url);
30
+ }
31
+ export { uploadFile, loadAuthors, loadEmotions, getDecoration, getDecorationJson };
@@ -1,10 +1,6 @@
1
1
  <template>
2
2
  <div class="w-author" v-loading="loading">
3
- <div
4
- class="w-author-wrapper el-popover"
5
- v-if="data"
6
- :style="{ backgroundImage: bg }"
7
- >
3
+ <div class="w-author-wrapper el-popover" v-if="data" :style="{ backgroundImage: `url(${bg})` }">
8
4
  <div class="u-author">
9
5
  <Avatar
10
6
  class="u-avatar"
@@ -15,34 +11,17 @@
15
11
  />
16
12
  <div class="u-info">
17
13
  <a class="u-name" :href="authorLink(uid)" target="_blank">
18
- <el-tooltip
19
- class="item"
20
- effect="dark"
21
- content="签约作者"
22
- placement="top"
23
- v-if="isSuperAuthor"
24
- >
25
- <a
26
- class="u-superauthor"
27
- href="/dashboard/cooperation"
28
- target="_blank"
29
- >
30
- <img
31
- :src="super_author_icon"
32
- alt="superauthor"
33
- />
14
+ <el-tooltip class="item" effect="dark" content="签约作者" placement="top" v-if="isSuperAuthor">
15
+ <a class="u-superauthor" href="/dashboard/cooperation" target="_blank">
16
+ <img :src="super_author_icon" alt="superauthor" />
34
17
  </a>
35
18
  </el-tooltip>
36
- <span class="u-displayname" :title="data.display_name">{{
37
- data.display_name || "未知"
38
- }}</span>
19
+ <span class="u-displayname" :title="data.display_name">{{ data.display_name || "未知" }}</span>
39
20
  </a>
40
21
  <div class="u-extend">
41
22
  <el-tooltip class="item" effect="dark" placement="top">
42
23
  <div slot="content">
43
- <span class="u-tips"
44
- >经验值:{{ data.experience }}</span
45
- >
24
+ <span class="u-tips">经验值:{{ data.experience }}</span>
46
25
  </div>
47
26
  <span
48
27
  class="u-level"
@@ -53,44 +32,24 @@
53
32
  >Lv.{{ level }}</span
54
33
  >
55
34
  </el-tooltip>
56
- <el-tooltip
57
- class="item"
58
- effect="dark"
59
- :content="vipTypeTitle"
60
- placement="top"
61
- v-if="isVip"
62
- >
63
- <a
64
- class="u-vip"
65
- href="/vip/premium?from=sidebar_author"
66
- target="_blank"
67
- >
35
+ <el-tooltip class="item" effect="dark" :content="vipTypeTitle" placement="top" v-if="isVip">
36
+ <a class="u-vip" href="/vip/premium?from=sidebar_author" target="_blank">
68
37
  <i class="i-icon-vip on">{{ vipType }}</i>
69
38
  </a>
70
39
  </el-tooltip>
71
40
  </div>
72
41
  </div>
73
42
  </div>
43
+ <!-- <div class="u-honor" :style="honorStyle" v-if="honor">{{ honor }}</div> -->
74
44
  <div class="u-trophy" v-if="hasTrophy">
75
45
  <div class="u-medals" v-if="medals && medals.length">
76
46
  <medal :medals="medals" :showIcon="showMedalIcon"></medal>
77
47
  </div>
78
48
  </div>
79
49
  <div class="u-teams" v-if="teams && teams.length">
80
- <a
81
- class="u-team"
82
- v-for="(item, i) in teams"
83
- :key="i"
84
- :href="teamLink(item.team_id)"
85
- target="_blank"
86
- >
87
- <img
88
- class="u-team-logo"
89
- :src="showTeamLogo(item.team_logo)"
90
- />
91
- <span class="u-team-name"
92
- >{{ item.team_name }}@{{ item.team_server }}</span
93
- >
50
+ <a class="u-team" v-for="(item, i) in teams" :key="i" :href="teamLink(item.team_id)" target="_blank">
51
+ <img class="u-team-logo" :src="showTeamLogo(item.team_logo)" />
52
+ <span class="u-team-name">{{ item.team_name }}@{{ item.team_server }}</span>
94
53
  </a>
95
54
  </div>
96
55
  </div>
@@ -98,26 +57,18 @@
98
57
  </template>
99
58
 
100
59
  <script>
101
- import {
102
- authorLink,
103
- getLink,
104
- getThumbnail,
105
- } from "@jx3box/jx3box-common/js/utils";
106
- import {
107
- getUserInfo,
108
- getUserMedals,
109
- getUserPublicTeams,
110
- } from "../../service/author";
111
- import { getDecoration } from "../../service/cms";
112
- import {
113
- __server,
114
- __imgPath,
115
- __userLevelColor,
116
- } from "@jx3box/jx3box-common/data/jx3box.json";
60
+ import { authorLink, getLink, getThumbnail } from "@jx3box/jx3box-common/js/utils";
61
+ import { getUserInfo, getUserMedals, getUserPublicTeams } from "../../service/author";
62
+ import { getDecoration, getDecorationJson } from "../../service/cms";
63
+ import { __server, __imgPath, __userLevelColor } from "@jx3box/jx3box-common/data/jx3box.json";
117
64
  import User from "@jx3box/jx3box-common/js/user";
118
65
  import { __userLevel } from "@jx3box/jx3box-common/data/jx3box.json";
119
66
  import Avatar from "./Avatar.vue";
120
67
  import medal from "./medal.vue";
68
+ const ATCARD_KEY = "decoration_atcard";
69
+ const DECORATION_JSON = "decoration_json";
70
+ const DECORATION_KEY = "decoration_me";
71
+ const HONOR_KEY = "honor_me";
121
72
  export default {
122
73
  name: "Author",
123
74
  components: {
@@ -131,6 +82,8 @@ export default {
131
82
  teams: [],
132
83
  loading: false,
133
84
  bg: "",
85
+ honor: "",
86
+ honorStyle: {},
134
87
  }),
135
88
  computed: {
136
89
  super_author_icon: function () {
@@ -161,18 +114,15 @@ export default {
161
114
  handler(val) {
162
115
  if (val) {
163
116
  this.loadData();
164
- this.getDecoration();
117
+ this.getAtcard();
118
+ // this.getHonor();
165
119
  }
166
120
  },
167
121
  },
168
122
  },
169
123
  methods: {
170
124
  loadData: function () {
171
- const promises = [
172
- getUserInfo(this.uid),
173
- getUserMedals(this.uid),
174
- getUserPublicTeams(this.uid),
175
- ];
125
+ const promises = [getUserInfo(this.uid), getUserMedals(this.uid), getUserPublicTeams(this.uid)];
176
126
  this.loading = true;
177
127
  Promise.all(promises).then((res) => {
178
128
  this.data = res[0];
@@ -196,45 +146,108 @@ export default {
196
146
  this.teams = data && data.slice(0, 5);
197
147
  });
198
148
  },
199
- getDecoration() {
200
- let decoration_atcard = sessionStorage.getItem(
201
- "decoration_atcard" + this.uid
202
- );
149
+ getAtcard() {
150
+ let decoration_atcard = sessionStorage.getItem(ATCARD_KEY + this.uid);
203
151
  if (decoration_atcard == "no") {
204
152
  this.bg = "";
205
153
  return;
206
154
  }
207
155
  //已有缓存,读取解析
208
156
  if (decoration_atcard) {
209
- this.setDecoration(JSON.parse(decoration_atcard));
157
+ this.setDecoration(decoration_atcard);
210
158
  return;
211
159
  }
212
- getDecoration({ using: 1, user_id: this.uid, type: "atcard" }).then(
213
- (data) => {
214
- let res = data.data.data;
215
- if (res.length == 0) {
216
- //空 则为无主题,不再加载接口,界面设No
217
- sessionStorage.setItem(
218
- "decoration_atcard" + this.uid,
219
- "no"
220
- );
221
- this.bg = "";
222
- return;
223
- }
224
- sessionStorage.setItem(
225
- "decoration_atcard" + this.uid,
226
- JSON.stringify(res[0])
227
- );
228
- this.setDecoration(res[0]);
160
+ getDecoration({ using: 1, user_id: this.uid, type: "atcard" }).then((data) => {
161
+ let res = data.data.data;
162
+ if (res.length == 0) {
163
+ //空 则为无主题,不再加载接口,界面设No
164
+ sessionStorage.setItem(ATCARD_KEY + this.uid, "no");
165
+ this.bg = "";
166
+ return;
229
167
  }
230
- );
168
+ sessionStorage.setItem(ATCARD_KEY + this.uid, res[0].val);
169
+ this.setDecoration(res[0].val);
170
+ });
231
171
  },
232
- setDecoration(decoration_sidebar) {
233
- this.bg = `url(${this.showDecoration(
234
- decoration_sidebar.val,
235
- decoration_sidebar.type
236
- )})`;
172
+ setDecoration(val) {
173
+ this.bg = this.showDecoration(val, "atcard");
174
+ },
175
+ getHonor() {
176
+ this.honor = "";
177
+ let user_id = this.uid;
178
+ if (!user_id) {
179
+ return;
180
+ }
181
+ let honor_local = sessionStorage.getItem(HONOR_KEY + user_id);
182
+ if (honor_local == "no") return;
183
+ //已有缓存,读取解析
184
+ if (honor_local) {
185
+ this.honor = honor_local;
186
+ this.getHonorStyle();
187
+ return;
188
+ }
189
+ getDecoration({ using: 1, user_id: user_id, type: "honor" }).then((data) => {
190
+ let res = data.data.data;
191
+ if (res.length == 0) {
192
+ //空 则为无主题,不再加载接口,界面设No
193
+ sessionStorage.setItem(HONOR_KEY + user_id, "no");
194
+ return;
195
+ }
196
+ let honor = res[0];
197
+ sessionStorage.setItem(HONOR_KEY + user_id, honor.val);
198
+ this.honor = honor.val;
199
+ this.getHonorStyle();
200
+ });
237
201
  },
202
+ //有称号后,获取样式配置
203
+ getHonorStyle() {
204
+ let user_id = this.uid;
205
+ let decoration_local = sessionStorage.getItem(DECORATION_KEY + user_id);
206
+ if (decoration_local) {
207
+ //解析本地缓存
208
+ let decoration_parse = JSON.parse(decoration_local);
209
+ if (!decoration_parse.status) return;
210
+
211
+ if (decoration_parse) {
212
+ this.setHonorStyle(decoration_parse);
213
+ return;
214
+ }
215
+ }
216
+ getDecoration({ using: 1, user_id: user_id, type: "homebg" }).then((data) => {
217
+ let res = data.data.data;
218
+ if (res.length == 0) {
219
+ //空 则为无主题,不再加载接口,界面设No
220
+ sessionStorage.setItem(DECORATION_KEY + user_id, JSON.stringify({ status: false }));
221
+ return;
222
+ }
223
+ let decoration = res[0];
224
+ let decorationJson = sessionStorage.getItem(DECORATION_JSON);
225
+ if (!decorationJson) {
226
+ //加载远程json,用于Honor颜色配置
227
+ getDecorationJson().then((json) => {
228
+ let decoration_json = json.data;
229
+ let theme = JSON.parse(JSON.stringify(decoration_json[decoration.val]));
230
+ theme.status = true;
231
+ sessionStorage.setItem(DECORATION_KEY + this.uid, JSON.stringify(theme));
232
+ //缓存远程JSON文件
233
+ sessionStorage.setItem(DECORATION_JSON, JSON.stringify(decoration_json));
234
+ this.setHonorStyle(theme);
235
+ });
236
+ } else {
237
+ let theme = JSON.parse(decorationJson)[decoration.val];
238
+ theme.status = true;
239
+ sessionStorage.setItem(DECORATION_KEY + this.uid, JSON.stringify(theme));
240
+ this.setHonorStyle(theme);
241
+ }
242
+ });
243
+ },
244
+ setHonorStyle(style) {
245
+ this.honorStyle = {
246
+ "background-color": style.buttoncolor,
247
+ color: style.buttontextcolor,
248
+ };
249
+ },
250
+
238
251
  showMedalIcon: function (val) {
239
252
  return __imgPath + "image/medals/user/" + val + ".gif";
240
253
  },
@@ -294,5 +307,16 @@ export default {
294
307
  .bold;
295
308
  }
296
309
  }
310
+ .u-honor {
311
+ .mt(2px);
312
+ .dbi;
313
+ .h(18px);
314
+ background-color: #494038;
315
+ color: #ffffff;
316
+ .fz(12px,14px);
317
+ padding: 2px 50px 2px 10px;
318
+ .mb(15px);
319
+ .r(2px);
320
+ }
297
321
  }
298
322
  </style>