@jx3box/jx3box-vue3-ui 0.4.21 → 0.4.23
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 +1 -1
- package/service/cms.js +2 -1
- package/src/header/Nav.vue +1 -1
- package/src/single/PostTopic.vue +14 -6
package/package.json
CHANGED
package/service/cms.js
CHANGED
|
@@ -45,11 +45,12 @@ function upload(formData) {
|
|
|
45
45
|
return $cms().post(`/api/cms/upload`, formData);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
function getSliders(source_type, source_ids) {
|
|
48
|
+
function getSliders(source_type, source_ids, client='std') {
|
|
49
49
|
let _params = {
|
|
50
50
|
type: "slider",
|
|
51
51
|
source_type,
|
|
52
52
|
per: 10,
|
|
53
|
+
client
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
if (source_ids) {
|
package/src/header/Nav.vue
CHANGED
|
@@ -184,7 +184,7 @@ export default {
|
|
|
184
184
|
isFocus: function (type) {
|
|
185
185
|
// return location.pathname.includes(type);
|
|
186
186
|
let active = '';
|
|
187
|
-
const pathname = location.pathname?.split('/')?.filter(Boolean)?.[0] || '
|
|
187
|
+
const pathname = location.pathname?.split('/')?.filter(Boolean)?.[0] || '';
|
|
188
188
|
for (const key in activeNav) {
|
|
189
189
|
if (activeNav[key].includes(pathname)) {
|
|
190
190
|
active = key;
|
package/src/single/PostTopic.vue
CHANGED
|
@@ -28,6 +28,10 @@ export default {
|
|
|
28
28
|
type: Number,
|
|
29
29
|
default: 46917,
|
|
30
30
|
},
|
|
31
|
+
postBanner: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "",
|
|
34
|
+
}
|
|
31
35
|
},
|
|
32
36
|
data() {
|
|
33
37
|
return {
|
|
@@ -42,7 +46,8 @@ export default {
|
|
|
42
46
|
return dayjs(this.topicInfo?.created_at).format('YYYY年')
|
|
43
47
|
},
|
|
44
48
|
topicImage() {
|
|
45
|
-
|
|
49
|
+
const img = this.postBanner || this.topicInfo?.img;
|
|
50
|
+
return getThumbnail(img, [260*2, 78*2])
|
|
46
51
|
},
|
|
47
52
|
client() {
|
|
48
53
|
return location.href.includes("origin") ? "origin" : "std";
|
|
@@ -59,7 +64,7 @@ export default {
|
|
|
59
64
|
},
|
|
60
65
|
methods: {
|
|
61
66
|
loadData() {
|
|
62
|
-
getSliders(this.type, this.id).then((res) => {
|
|
67
|
+
getSliders(this.type, this.id, this.client).then((res) => {
|
|
63
68
|
if (res.data.data?.list) {
|
|
64
69
|
// 取创建时间最新的一条
|
|
65
70
|
const list = res.data.data.list.sort((a, b) => dayjs(b.created_at).isAfter(dayjs(a.created_at)) ? 1 : -1);
|
|
@@ -105,11 +110,14 @@ export default {
|
|
|
105
110
|
}
|
|
106
111
|
}
|
|
107
112
|
.c-post-topic__img {
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
.pr;
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
.r(4px);
|
|
116
|
+
min-height: 71px;
|
|
110
117
|
img{
|
|
111
|
-
.
|
|
112
|
-
|
|
118
|
+
.pa;
|
|
119
|
+
left: 50%;
|
|
120
|
+
transform: translateX(-50%);
|
|
113
121
|
}
|
|
114
122
|
}
|
|
115
123
|
</style>
|