@jx3box/jx3box-common-ui 8.9.4 → 8.9.6

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.9.4",
3
+ "version": "8.9.6",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/cms.js CHANGED
@@ -45,6 +45,10 @@ function getSliders(source_type, source_ids, client="std") {
45
45
  });
46
46
  }
47
47
 
48
+ function getSlider(params) {
49
+ return $cms({ mute: true }).get(`/api/cms/news/item`, { params });
50
+ }
51
+
48
52
  function getCollection(id) {
49
53
  return $cms({ mute: true }).get(`/api/cms/post/collection/${id}`);
50
54
  }
@@ -74,4 +78,4 @@ function setUserMeta(key,data) {
74
78
  }
75
79
 
76
80
  export { getPostAuthors, uploadImage, upload, getDecoration, getDecorationJson, checkTeamMember,
77
- getSliders, getCollection, getTopicBucket, getConfig, getUserMeta, setUserMeta };
81
+ getSliders,getSlider, getCollection, getTopicBucket, getConfig, getUserMeta, setUserMeta };
@@ -65,7 +65,7 @@ export default {
65
65
  default: "medium",
66
66
  },
67
67
  post: {
68
- type: Object,
68
+ type: [Object, String],
69
69
  default: () => {},
70
70
  },
71
71
  userId: {
@@ -176,7 +176,7 @@ export default {
176
176
  default: false,
177
177
  },
178
178
  postId: {
179
- type: Number,
179
+ type: [Number, String],
180
180
  default: 0,
181
181
  },
182
182
  },
@@ -61,7 +61,7 @@ export default {
61
61
  default: false,
62
62
  },
63
63
  post: {
64
- type: Object,
64
+ type: [Object, String],
65
65
  default: () => {
66
66
  return {};
67
67
  },
@@ -44,7 +44,7 @@
44
44
  <div class="u-meta u-sub-block">
45
45
  <em class="u-label">适用客户端</em>
46
46
  <span class="u-value u-client" :class="'i-client-' + client">{{ showClientLabel(client) }}</span>
47
- <span class="u-value u-client i-client-wujie">无界</span>
47
+ <span class="u-value u-client i-client-wujie" v-if="is_wujie">无界</span>
48
48
  </div>
49
49
 
50
50
  <!-- 发布日期 -->
@@ -14,7 +14,7 @@
14
14
  </template>
15
15
 
16
16
  <script>
17
- import { getSliders } from "../../service/cms";
17
+ import { getSlider } from "../../service/cms";
18
18
  import { getThumbnail } from "@jx3box/jx3box-common/js/utils";
19
19
  import dayjs from "dayjs";
20
20
  export default {
@@ -67,14 +67,11 @@ export default {
67
67
  },
68
68
  methods: {
69
69
  loadData() {
70
- getSliders(this.type, this.id, this.client).then((res) => {
71
- if (res.data.data?.list) {
72
- // 取创建时间最新的一条
73
- const list = res.data.data.list.sort((a, b) =>
74
- dayjs(b.created_at).isAfter(dayjs(a.created_at)) ? 1 : -1
75
- );
76
- this.topicInfo = list[0];
77
- }
70
+ getSlider({
71
+ source_type: this.type,
72
+ source_id: this.id,
73
+ }).then((res) => {
74
+ this.topicInfo = res.data?.data
78
75
  });
79
76
  },
80
77
  },