jmash-core-mp 0.1.25 → 0.1.27
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/src/components/cms/jmash-cms-activity-list.mpx +3 -1
- package/src/components/cms/jmash-cms-article-list.mpx +2 -0
- package/src/components/cms/jmash-cms-location-list.mpx +22 -11
- package/src/components/cms/jmash-cms-product-list.mpx +2 -0
- package/src/components/core/jmash-cms-protocol.mpx +10 -4
- package/src/packages/pages/auth/cms-protocol.mpx +5 -2
- package/src/packages/pages/cms/cms-activity-list.mpx +1 -9
- package/src/packages/pages/cms/cms-article-list.mpx +1 -6
- package/src/packages/pages/cms/cms-location-list.mpx +3 -14
- package/src/packages/pages/cms/cms-product-list.mpx +1 -7
- package/lib/components/cms/cms-channel-list.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-acticle-list.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-activity-page.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-location-page.mpx.d.ts +0 -1
- package/lib/components/common/jmash-none-data.mpx.d.ts +0 -1
- package/lib/packages/pages/cms/cms-info.mpx.d.ts +0 -1
- package/lib/packages/pages/cms/cms-list.mpx.d.ts +0 -1
package/package.json
CHANGED
|
@@ -82,8 +82,10 @@ createComponent({
|
|
|
82
82
|
console.log("cms", props);
|
|
83
83
|
|
|
84
84
|
const loadRecords = function (page: number = 1) {
|
|
85
|
+
if (!props.channelAlias && !props.channelId) return
|
|
85
86
|
if (loading.value) return
|
|
86
87
|
loading.value = true;
|
|
88
|
+
curPage.value = page;
|
|
87
89
|
cmsApi.findCmsInfoPage({
|
|
88
90
|
tenant: props.organTenant || config.siteTenant,
|
|
89
91
|
siteId: props.siteId,
|
|
@@ -116,13 +118,13 @@ createComponent({
|
|
|
116
118
|
if (!hasMore.value || loading.value) return
|
|
117
119
|
loadRecords(curPage.value + 1)
|
|
118
120
|
}
|
|
119
|
-
loadRecords(1);
|
|
120
121
|
watch(
|
|
121
122
|
() => props.refreshKey,
|
|
122
123
|
() => {
|
|
123
124
|
loadRecords(1)
|
|
124
125
|
}
|
|
125
126
|
)
|
|
127
|
+
loadRecords(1);
|
|
126
128
|
return { resourceUrl, articleList, imageUrl, curPage, hasMore, loading, scrollTop, loadMore }
|
|
127
129
|
},
|
|
128
130
|
methods: {
|
|
@@ -81,8 +81,10 @@ createComponent({
|
|
|
81
81
|
console.log("cms", props);
|
|
82
82
|
|
|
83
83
|
const loadRecords = function (page: number = 1) {
|
|
84
|
+
if (!props.channelAlias && !props.channelId) return
|
|
84
85
|
if (loading.value) return
|
|
85
86
|
loading.value = true;
|
|
87
|
+
curPage.value = page;
|
|
86
88
|
cmsApi.findCmsInfoPage({
|
|
87
89
|
tenant: props.organTenant || config.siteTenant,
|
|
88
90
|
siteId: props.siteId,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<scroll-view class="article-main" type="custom" scroll-y scroll-top="{{ scrollTop }}" bindscrolltolower="loadMore">
|
|
3
|
-
<
|
|
4
|
-
<view class="article-border"
|
|
3
|
+
<view class="article-list" wx:if="{{ styles == '1' }}">
|
|
4
|
+
<view class="article-border" wx:for="{{ articleList }}" wx:key="index" bind:tap="handleInfo"
|
|
5
|
+
data-item="{{ item }}">
|
|
5
6
|
<view class="cms-info">
|
|
6
7
|
<view class="cms-image" catch:tap="handlePreview" data-url="{{ item.imgUrl }}">
|
|
7
8
|
<image class="cms-image-thumb" src="{{ imageUrl + item.imgUrl }}" mode="aspectFill" />
|
|
@@ -16,9 +17,8 @@
|
|
|
16
17
|
</view>
|
|
17
18
|
</view>
|
|
18
19
|
</view>
|
|
19
|
-
</
|
|
20
|
-
<view wx:if="{{ loading }}"
|
|
21
|
-
<view wx:elif="{{ !hasMore && articleList.length > 0 }}" class="load-tip">没有更多了</view>
|
|
20
|
+
</view>
|
|
21
|
+
<view wx:if="{{ loading }}">加载中...</view>
|
|
22
22
|
</scroll-view>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
@@ -31,7 +31,7 @@ import { CmsInfoModel } from '../../api/cms/types';
|
|
|
31
31
|
createComponent({
|
|
32
32
|
properties: {
|
|
33
33
|
// 样式
|
|
34
|
-
|
|
34
|
+
styles: {
|
|
35
35
|
type: String,
|
|
36
36
|
value: "0",
|
|
37
37
|
},
|
|
@@ -74,7 +74,7 @@ createComponent({
|
|
|
74
74
|
setup(props) {
|
|
75
75
|
let config = getApp().globalData.config;
|
|
76
76
|
const curPage = ref(1)
|
|
77
|
-
const
|
|
77
|
+
const totalSize = ref(0)
|
|
78
78
|
const loading = ref(false)
|
|
79
79
|
const scrollTop = ref(0)
|
|
80
80
|
// 资源路径
|
|
@@ -84,8 +84,10 @@ createComponent({
|
|
|
84
84
|
console.log("cms", props);
|
|
85
85
|
|
|
86
86
|
const loadRecords = function (page: number = 1) {
|
|
87
|
+
if (!props.channelAlias && !props.channelId) return
|
|
87
88
|
if (loading.value) return
|
|
88
89
|
loading.value = true;
|
|
90
|
+
curPage.value = page;
|
|
89
91
|
cmsApi.findCmsInfoPage({
|
|
90
92
|
tenant: props.organTenant || config.siteTenant,
|
|
91
93
|
siteId: props.siteId,
|
|
@@ -103,6 +105,7 @@ createComponent({
|
|
|
103
105
|
} else {
|
|
104
106
|
articleList.value = [...articleList.value, ...(res.data.results || [])];
|
|
105
107
|
}
|
|
108
|
+
totalSize.value = res.data.totalSize as number;
|
|
106
109
|
}
|
|
107
110
|
}).finally(() => {
|
|
108
111
|
loading.value = false
|
|
@@ -111,7 +114,10 @@ createComponent({
|
|
|
111
114
|
// 接口图片资源路径 容器宽高度150rpx 裁剪2倍
|
|
112
115
|
let imageUrl = config.baseUrl + "/v1/file/image/clip/300/300/";
|
|
113
116
|
const loadMore = () => {
|
|
114
|
-
if (
|
|
117
|
+
if (totalSize.value === articleList.value.length || loading.value) {
|
|
118
|
+
mpx.showToast({ title: "没有更多数据了", icon: "none" });
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
115
121
|
loadRecords(curPage.value + 1)
|
|
116
122
|
}
|
|
117
123
|
loadRecords(1);
|
|
@@ -121,7 +127,7 @@ createComponent({
|
|
|
121
127
|
loadRecords(1)
|
|
122
128
|
}
|
|
123
129
|
)
|
|
124
|
-
return { resourceUrl, articleList, imageUrl, curPage,
|
|
130
|
+
return { resourceUrl, articleList, imageUrl, curPage, totalSize, loading, scrollTop, loadMore }
|
|
125
131
|
},
|
|
126
132
|
methods: {
|
|
127
133
|
// 点击详情事件
|
|
@@ -157,9 +163,14 @@ createComponent({
|
|
|
157
163
|
@use "../../styles/index.scss" as *;
|
|
158
164
|
|
|
159
165
|
.article-main {
|
|
160
|
-
|
|
161
|
-
|
|
166
|
+
max-height: calc(100vh - 90rpx - env(safe-area-inset-bottom));
|
|
167
|
+
width: 100vw;
|
|
168
|
+
box-sizing: border-box;
|
|
162
169
|
background-color: #fff;
|
|
170
|
+
|
|
171
|
+
.article-list {
|
|
172
|
+
padding: 0 30rpx;
|
|
173
|
+
}
|
|
163
174
|
}
|
|
164
175
|
|
|
165
176
|
// 有分割线列表
|
|
@@ -74,8 +74,10 @@ createComponent({
|
|
|
74
74
|
console.log("cms", props);
|
|
75
75
|
|
|
76
76
|
const loadRecords = function (page: number = 1) {
|
|
77
|
+
if (!props.channelAlias && !props.channelId) return
|
|
77
78
|
if (loading.value) return
|
|
78
79
|
loading.value = true;
|
|
80
|
+
curPage.value = page;
|
|
79
81
|
cmsApi.findCmsInfoPage({
|
|
80
82
|
tenant: props.organTenant || config.siteTenant,
|
|
81
83
|
siteId: props.siteId,
|
|
@@ -25,14 +25,20 @@ createComponent({
|
|
|
25
25
|
channelAlias: {
|
|
26
26
|
type: String,
|
|
27
27
|
value: ""
|
|
28
|
-
}
|
|
28
|
+
},
|
|
29
|
+
//refreshKey
|
|
30
|
+
refreshKey: {
|
|
31
|
+
type: Number,
|
|
32
|
+
value: 0
|
|
33
|
+
},
|
|
29
34
|
},
|
|
30
35
|
setup(props) {
|
|
31
36
|
let contents = ref([{ contentId: "123" }]);
|
|
32
37
|
let title = ref("");
|
|
33
|
-
const {
|
|
34
|
-
watch(
|
|
35
|
-
|
|
38
|
+
const { refreshKey } = toRefs(props)
|
|
39
|
+
watch(refreshKey, () => {
|
|
40
|
+
if (!props.channelAlias) return;
|
|
41
|
+
cmsApi.findCmsContentInfo({ siteId: props.siteId, channelAlias: props.channelAlias, tenant: props.tenant }).then(({ data }) => {
|
|
36
42
|
console.log(data)
|
|
37
43
|
title.value = data.cmsInfo.infoTitle;
|
|
38
44
|
contents.value = data.infoContentResults;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<cms-protocol siteId="{{ siteId }}" tenant="{{ tenant }}" channelAlias="{{ channelAlias }}"
|
|
2
|
+
<cms-protocol siteId="{{ siteId }}" tenant="{{ tenant }}" channelAlias="{{ channelAlias }}"
|
|
3
|
+
refreshKey="{{ refreshKey }}"></cms-protocol>
|
|
3
4
|
</template>
|
|
4
5
|
|
|
5
6
|
<script>
|
|
@@ -12,13 +13,15 @@ createPage({
|
|
|
12
13
|
let tenant = ref(config.siteTenant);
|
|
13
14
|
let siteId = ref(config.siteId);
|
|
14
15
|
let channelAlias = ref('');
|
|
16
|
+
let refreshKey = ref(0);
|
|
15
17
|
onLoad((options) => {
|
|
16
18
|
console.log(options);
|
|
17
19
|
tenant.value = options.tenant || config.siteTenant;
|
|
18
20
|
siteId.value = options.siteId || config.siteId;
|
|
19
21
|
channelAlias.value = options.channelAlias || 'privacy';
|
|
22
|
+
refreshKey.value = refreshKey.value + 1;
|
|
20
23
|
})
|
|
21
|
-
return { siteId, tenant, channelAlias };
|
|
24
|
+
return { siteId, tenant, channelAlias, refreshKey };
|
|
22
25
|
},
|
|
23
26
|
})
|
|
24
27
|
</script>
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
<jmash-search placeholder="搜索" bind:handleSearch="handleInput" />
|
|
5
5
|
</view>
|
|
6
6
|
<!-- 栏目列表 -->
|
|
7
|
-
|
|
8
7
|
<jmash-cms-activity-list isInfo="false" style="1" organTenant="{{ queryParams.tenant }}"
|
|
9
8
|
siteId="{{ queryParams.siteId }}" likeInfoTitle="{{ queryParams.likeInfoTitle }}"
|
|
10
9
|
channelAlias="{{ queryParams.channelAlias }}" pageSize="10" refreshKey="{{ refreshKey }}" />
|
|
@@ -13,7 +12,6 @@
|
|
|
13
12
|
|
|
14
13
|
<script lang="ts">
|
|
15
14
|
import mpx, { createPage, ref } from "@mpxjs/core";
|
|
16
|
-
import { CmsChannelModel } from '../../../api/cms/types'
|
|
17
15
|
import { EventBase } from "../../../api/types";
|
|
18
16
|
|
|
19
17
|
createPage({
|
|
@@ -23,19 +21,13 @@ createPage({
|
|
|
23
21
|
let queryParams = ref({
|
|
24
22
|
tenant: config.siteTenant,
|
|
25
23
|
siteId: config.siteId,
|
|
26
|
-
channelAlias: "
|
|
24
|
+
channelAlias: "",
|
|
27
25
|
likeInfoTitle: "",
|
|
28
|
-
status: true,
|
|
29
26
|
isOpen: true,
|
|
30
27
|
});
|
|
31
|
-
// 栏目列表
|
|
32
|
-
let channelList = ref([] as CmsChannelModel[]);
|
|
33
|
-
|
|
34
28
|
let refreshKey = ref(0);
|
|
35
|
-
|
|
36
29
|
return {
|
|
37
30
|
queryParams,
|
|
38
|
-
channelList,
|
|
39
31
|
refreshKey,
|
|
40
32
|
}
|
|
41
33
|
},
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
<script lang="ts">
|
|
14
14
|
import mpx, { createPage, ref } from "@mpxjs/core";
|
|
15
|
-
import { CmsChannelModel } from '../../../api/cms/types'
|
|
16
15
|
import { EventBase } from "../../../api/types";
|
|
17
16
|
|
|
18
17
|
createPage({
|
|
@@ -22,19 +21,15 @@ createPage({
|
|
|
22
21
|
let queryParams = ref({
|
|
23
22
|
tenant: config.siteTenant,
|
|
24
23
|
siteId: config.siteId,
|
|
25
|
-
channelAlias: "
|
|
24
|
+
channelAlias: "",
|
|
26
25
|
likeInfoTitle: "",
|
|
27
|
-
status: true,
|
|
28
26
|
isOpen: true,
|
|
29
27
|
});
|
|
30
|
-
// 栏目列表
|
|
31
|
-
let channelList = ref([] as CmsChannelModel[]);
|
|
32
28
|
|
|
33
29
|
let refreshKey = ref(0);
|
|
34
30
|
|
|
35
31
|
return {
|
|
36
32
|
queryParams,
|
|
37
|
-
channelList,
|
|
38
33
|
refreshKey,
|
|
39
34
|
}
|
|
40
35
|
},
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- 搜索框 -->
|
|
3
3
|
<view class="search-box">
|
|
4
|
-
<jmash-search placeholder="搜索" bind:handleSearch="handleInput" />
|
|
4
|
+
<jmash-search placeholder="搜索" backColor="#f3f4f6" bind:handleSearch="handleInput" />
|
|
5
5
|
</view>
|
|
6
6
|
<!-- 栏目列表 -->
|
|
7
|
-
|
|
8
|
-
<jmash-cms-location-list isInfo="false" style="1" organTenant="{{ queryParams.tenant }}"
|
|
7
|
+
<jmash-cms-location-list isInfo="false" styles="1" organTenant="{{ queryParams.tenant }}"
|
|
9
8
|
siteId="{{ queryParams.siteId }}" likeInfoTitle="{{ queryParams.likeInfoTitle }}"
|
|
10
9
|
channelAlias="{{ queryParams.channelAlias }}" pageSize="10" refreshKey="{{ refreshKey }}" />
|
|
11
10
|
|
|
@@ -13,7 +12,6 @@
|
|
|
13
12
|
|
|
14
13
|
<script lang="ts">
|
|
15
14
|
import mpx, { createPage, ref } from "@mpxjs/core";
|
|
16
|
-
import { CmsChannelModel } from '../../../api/cms/types'
|
|
17
15
|
import { EventBase } from "../../../api/types";
|
|
18
16
|
|
|
19
17
|
createPage({
|
|
@@ -23,19 +21,15 @@ createPage({
|
|
|
23
21
|
let queryParams = ref({
|
|
24
22
|
tenant: config.siteTenant,
|
|
25
23
|
siteId: config.siteId,
|
|
26
|
-
channelAlias: "
|
|
24
|
+
channelAlias: "",
|
|
27
25
|
likeInfoTitle: "",
|
|
28
|
-
status: true,
|
|
29
26
|
isOpen: true,
|
|
30
27
|
});
|
|
31
|
-
// 栏目列表
|
|
32
|
-
let channelList = ref([] as CmsChannelModel[]);
|
|
33
28
|
|
|
34
29
|
let refreshKey = ref(0);
|
|
35
30
|
|
|
36
31
|
return {
|
|
37
32
|
queryParams,
|
|
38
|
-
channelList,
|
|
39
33
|
refreshKey,
|
|
40
34
|
}
|
|
41
35
|
},
|
|
@@ -77,11 +71,6 @@ page {
|
|
|
77
71
|
.search-box {
|
|
78
72
|
padding: 15rpx 30rpx;
|
|
79
73
|
}
|
|
80
|
-
|
|
81
|
-
.article-list {
|
|
82
|
-
max-height: calc(100vh - 90rpx - env(safe-area-inset-bottom));
|
|
83
|
-
box-sizing: border-box;
|
|
84
|
-
}
|
|
85
74
|
</style>
|
|
86
75
|
|
|
87
76
|
<script type="application/json">
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
<jmash-search placeholder="搜索" bind:handleSearch="handleInput" />
|
|
5
5
|
</view>
|
|
6
6
|
<!-- 栏目列表 -->
|
|
7
|
-
|
|
8
7
|
<jmash-cms-product-list isInfo="false" style="1" organTenant="{{ queryParams.tenant }}"
|
|
9
8
|
siteId="{{ queryParams.siteId }}" likeInfoTitle="{{ queryParams.likeInfoTitle }}"
|
|
10
9
|
channelAlias="{{ queryParams.channelAlias }}" pageSize="10" refreshKey="{{ refreshKey }}" />
|
|
@@ -13,7 +12,6 @@
|
|
|
13
12
|
|
|
14
13
|
<script lang="ts">
|
|
15
14
|
import mpx, { createPage, ref } from "@mpxjs/core";
|
|
16
|
-
import { CmsChannelModel } from '../../../api/cms/types'
|
|
17
15
|
import { EventBase } from "../../../api/types";
|
|
18
16
|
|
|
19
17
|
createPage({
|
|
@@ -23,19 +21,15 @@ createPage({
|
|
|
23
21
|
let queryParams = ref({
|
|
24
22
|
tenant: config.siteTenant,
|
|
25
23
|
siteId: config.siteId,
|
|
26
|
-
channelAlias: "
|
|
24
|
+
channelAlias: "",
|
|
27
25
|
likeInfoTitle: "",
|
|
28
|
-
status: true,
|
|
29
26
|
isOpen: true,
|
|
30
27
|
});
|
|
31
|
-
// 栏目列表
|
|
32
|
-
let channelList = ref([] as CmsChannelModel[]);
|
|
33
28
|
|
|
34
29
|
let refreshKey = ref(0);
|
|
35
30
|
|
|
36
31
|
return {
|
|
37
32
|
queryParams,
|
|
38
|
-
channelList,
|
|
39
33
|
refreshKey,
|
|
40
34
|
}
|
|
41
35
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|