@jx3box/jx3box-common-ui 8.7.1 → 8.7.3

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.7.1",
3
+ "version": "8.7.3",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,7 +30,7 @@
30
30
  "last 2 versions"
31
31
  ],
32
32
  "dependencies": {
33
- "@jx3box/jx3box-comment-ui": "^1.8.8",
33
+ "@jx3box/jx3box-comment-ui": "^1.9.3",
34
34
  "@jx3box/jx3box-common": "^8.2.18",
35
35
  "@jx3box/jx3box-data": "^3.5.8",
36
36
  "@jx3box/jx3box-editor": "^2.1.9",
package/src/App.vue CHANGED
@@ -309,7 +309,7 @@ export default {
309
309
  },
310
310
  loadCommunity: function () {
311
311
  // 72
312
- getTopicDetails(82).then((res) => {
312
+ getTopicDetails(120).then((res) => {
313
313
  this.community = res.data.data;
314
314
  });
315
315
  },
@@ -282,7 +282,7 @@ export default {
282
282
  // 上传
283
283
  uploadSuccess: function (res, file, list) {
284
284
  this.banner_preview = URL.createObjectURL(file.raw);
285
- this.post_banner = res.data[0];
285
+ this.post_banner = res.data?.[0] || "";
286
286
  },
287
287
  uploadFail: function (err, file, fileList) {
288
288
  this.$message.error("上传失败");
@@ -72,6 +72,27 @@
72
72
  </div>
73
73
  </div>
74
74
 
75
+ <el-divider content-position="left">封面海报</el-divider>
76
+ <div class="c-admin-banner">
77
+ <el-upload
78
+ class="c-admin-upload el-upload--picture-card"
79
+ :action="uploadurl"
80
+ :with-credentials="true"
81
+ :show-file-list="false"
82
+ :on-success="uploadSuccess"
83
+ :on-error="uploadFail"
84
+ >
85
+ <img v-if="post_banner" :src="post_banner" />
86
+ <i class="el-icon-plus"></i>
87
+ </el-upload>
88
+ <el-input class="u-banner" v-model="post_banner">
89
+ <span slot="prepend">海报地址</span>
90
+ <span slot="append">
91
+ <span class="u-btn" @click="removeBanner"> <i class="el-icon-circle-close"></i> 移除海报 </span>
92
+ </span>
93
+ </el-input>
94
+ </div>
95
+
75
96
  <el-divider content-position="left">高亮置顶</el-divider>
76
97
 
77
98
  <p class="c-admin-space">
@@ -141,7 +162,7 @@ import {
141
162
  updateTopicItem,
142
163
  manageTopicAll
143
164
  } from "../../service/community";
144
- import {cloneDeep} from "lodash";
165
+ import { __cms } from "@jx3box/jx3box-common/data/jx3box.json";
145
166
 
146
167
  export default {
147
168
  name: "CommunityAdmin",
@@ -186,7 +207,12 @@ export default {
186
207
  hight_color: "rgb(255,0,1)",
187
208
  },
188
209
 
189
- finalTags: []
210
+ finalTags: [],
211
+
212
+ // 海报
213
+ uploadurl: __cms + "api/cms/upload",
214
+ banner_preview: "",
215
+ post_banner: "",
190
216
  };
191
217
  },
192
218
  computed: {
@@ -243,6 +269,7 @@ export default {
243
269
  user_id: this.form.user_id,
244
270
  title: this.form.title,
245
271
  category: this.form.category,
272
+ banner_img: this.post_banner,
246
273
  }));
247
274
 
248
275
  promises.push(manageTopicAll(id, {
@@ -327,6 +354,7 @@ export default {
327
354
 
328
355
  this.finalTags = this.post.color_tag;
329
356
  this.topStatus = [];
357
+ this.post_banner = this.post.banner_img;
330
358
  if (this.post.is_top) {
331
359
  this.topStatus.push("is_top");
332
360
  }
@@ -349,7 +377,19 @@ export default {
349
377
  }
350
378
  });
351
379
  this.finalTags = tags;
352
- }
380
+ },
381
+ // 上传
382
+ uploadSuccess: function (res, file, list) {
383
+ this.banner_preview = URL.createObjectURL(file.raw);
384
+ this.post_banner = res.data[0];
385
+ },
386
+ uploadFail: function (err, file, fileList) {
387
+ this.$message.error("上传失败");
388
+ console.log(err);
389
+ },
390
+ removeBanner: function () {
391
+ this.post_banner = "";
392
+ },
353
393
  },
354
394
  };
355
395
  </script>
@@ -5,10 +5,10 @@
5
5
  <div class="c-topic-text__year">{{ year }}</div>
6
6
  <div class="c-topic-text__text">{{ topicText }}</div>
7
7
  </div>
8
- <img class="c-topic-bg" src="../../assets/img/rightsidebar/topic_bg_bps.svg" alt="">
8
+ <img class="c-topic-bg" src="../../assets/img/rightsidebar/topic_bg_bps.svg" alt="" />
9
9
  </div>
10
10
  <div class="c-post-topic__img">
11
- <img :src="topicImage" alt="">
11
+ <img :src="topicImage" alt="" />
12
12
  </div>
13
13
  </div>
14
14
  </template>
@@ -35,19 +35,22 @@ export default {
35
35
  },
36
36
  data() {
37
37
  return {
38
- topicInfo: null
39
- }
38
+ topicInfo: null,
39
+ };
40
40
  },
41
41
  computed: {
42
42
  topicText() {
43
- return this.topicInfo ? `${dayjs(this.topicInfo.created_at).format('MM月DD日')}荣登头条榜` : ''
43
+ return this.topicInfo ? `${dayjs(this.topicInfo.created_at).format("MM月DD日")}荣登头条榜` : "";
44
44
  },
45
45
  year() {
46
- return this.topicInfo ? dayjs(this.topicInfo.created_at).format('YYYY年') : ""
46
+ return this.topicInfo ? dayjs(this.topicInfo.created_at).format("YYYY年") : "";
47
47
  },
48
48
  topicImage() {
49
49
  const img = this.postBanner || this.topicInfo?.img;
50
- return getThumbnail(img, [260*2, 78*2])
50
+ if (img?.indexOf(".gif") > -1) {
51
+ return img;
52
+ }
53
+ return getThumbnail(img, [260 * 2, 78 * 2]);
51
54
  },
52
55
  client() {
53
56
  return location.href.includes("origin") ? "origin" : "std";
@@ -59,21 +62,23 @@ export default {
59
62
  handler(val) {
60
63
  if (!val) return;
61
64
  this.loadData();
62
- }
63
- }
65
+ },
66
+ },
64
67
  },
65
68
  methods: {
66
69
  loadData() {
67
70
  getSliders(this.type, this.id, this.client).then((res) => {
68
71
  if (res.data.data?.list) {
69
72
  // 取创建时间最新的一条
70
- const list = res.data.data.list.sort((a, b) => dayjs(b.created_at).isAfter(dayjs(a.created_at)) ? 1 : -1);
73
+ const list = res.data.data.list.sort((a, b) =>
74
+ dayjs(b.created_at).isAfter(dayjs(a.created_at)) ? 1 : -1
75
+ );
71
76
  this.topicInfo = list[0];
72
77
  }
73
78
  });
74
79
  },
75
- }
76
- }
80
+ },
81
+ };
77
82
  </script>
78
83
 
79
84
  <style lang="less" scoped>
@@ -93,7 +98,7 @@ export default {
93
98
  // left: 50%;
94
99
  // transform: translate(-50%, -50%);
95
100
  z-index: 1;
96
- color: #FFD28F;
101
+ color: #ffd28f;
97
102
  letter-spacing: 1px;
98
103
  white-space: nowrap;
99
104
  margin-right: 8px;
@@ -115,7 +120,7 @@ export default {
115
120
  overflow: hidden;
116
121
  .r(4px);
117
122
  min-height: 71px;
118
- img{
123
+ img {
119
124
  .pa;
120
125
  left: 50%;
121
126
  transform: translateX(-50%);