jmash-core-mp 0.1.21 → 0.1.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/lib/api/cms/types.d.ts +4 -3
- package/lib/components/cms/cms-channel-list.mpx.d.ts +1 -0
- package/lib/components/cms/jmash-cms-activity-page.mpx.d.ts +1 -0
- package/lib/components/cms/jmash-cms-article-list.mpx.d.ts +1 -0
- package/lib/components/cms/jmash-cms-location-page.mpx.d.ts +1 -0
- package/lib/components/cms/jmash-cms-location.mpx.d.ts +1 -0
- package/lib/components/common/jmash-none-data.mpx.d.ts +1 -0
- package/lib/components/common/jmash-search.mpx.d.ts +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +4 -0
- package/lib/packages/pages/cms/cms-activity-list.mpx.d.ts +1 -0
- package/lib/packages/pages/cms/cms-info.mpx.d.ts +1 -0
- package/lib/packages/pages/cms/cms-list.mpx.d.ts +1 -0
- package/lib/packages/pages/cms/cms-location-list.mpx.d.ts +1 -0
- package/package.json +3 -2
- package/src/api/cms/types.ts +7 -1
- package/src/components/cms/jmash-cms-activity-page.mpx +360 -0
- package/src/components/cms/jmash-cms-article.mpx +174 -11
- package/src/components/cms/jmash-cms-location-page.mpx +275 -0
- package/src/components/cms/jmash-cms-location.mpx +257 -0
- package/src/components/common/jmash-upload-picture.mpx +129 -126
- package/src/index.ts +5 -0
- package/src/packages/index.mpx +3 -1
- package/src/packages/pages/cms/cms-activity-list.mpx +95 -0
- package/src/packages/pages/cms/cms-location-list.mpx +95 -0
- package/src/packages/pages/cms/cms-location.mpx +33 -0
- package/src/pages/home.mpx +0 -2
- package/src/pages/home2.mpx +0 -2
- package/src/pages/tabbar/home.mpx +45 -34
- package/src/components/cms/jmash-cms-acticle-list.mpx +0 -183
- package/src/packages/pages/cms/cms-article-list.mpx +0 -165
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<view class="location-card">
|
|
4
|
+
<view class="location-body" catch:tap="handleNavigate">
|
|
5
|
+
<view class="location-image" catch:tap="handlePreview" data-url="{{ article.imgUrl }}">
|
|
6
|
+
<image class="location-image-thumb" src="{{ imageUrl + '/clip/300/300/'+ article.imgUrl }}"
|
|
7
|
+
mode="aspectFill" />
|
|
8
|
+
</view>
|
|
9
|
+
<view class="location-text">
|
|
10
|
+
<view class="location-name">{{ article.infoTitle }}</view>
|
|
11
|
+
<view class="location-desc">{{ article.intro }}</view>
|
|
12
|
+
<view class="location-address">
|
|
13
|
+
<text class="address-pin">📍</text>
|
|
14
|
+
<text class="address-text">{{ article.address }}</text>
|
|
15
|
+
</view>
|
|
16
|
+
</view>
|
|
17
|
+
<view class="location-arrow">›</view>
|
|
18
|
+
</view>
|
|
19
|
+
</view>
|
|
20
|
+
|
|
21
|
+
<view class="article-body">
|
|
22
|
+
<block wx:for="{{ contents }}" wx:key="*this" wx:for-item="item">
|
|
23
|
+
<block wx:if="{{ item.infoType === 'image' }}">
|
|
24
|
+
<view class="article-image-wrap" wx:for="{{ item.infoContentList }}" wx:key="index" wx:for-item="url">
|
|
25
|
+
<image class="article-image" src="{{ imageUrl + '/clip/' + winWid + '/0/' + url }}"
|
|
26
|
+
mode="widthFix" />
|
|
27
|
+
</view>
|
|
28
|
+
</block>
|
|
29
|
+
<block wx:if="{{ item.infoType === 'movie' }}">
|
|
30
|
+
<view class="article-video-wrap" wx:for="{{ item.infoContentList }}" wx:key="index" wx:for-item="url">
|
|
31
|
+
<video class="article-video" show-mute-btn autoplay="{{ false }}" controls
|
|
32
|
+
src="{{ fileUrl + url }}" />
|
|
33
|
+
</view>
|
|
34
|
+
</block>
|
|
35
|
+
<block wx:if="{{ item.infoType === 'text' }}">
|
|
36
|
+
<rich-text class="article-text" nodes="{{ item.infoContent }}" />
|
|
37
|
+
</block>
|
|
38
|
+
</block>
|
|
39
|
+
</view>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script lang="ts">
|
|
43
|
+
import mpx, { createComponent, ref, toRefs, watch } from '@mpxjs/core'
|
|
44
|
+
import { cmsApi } from '../../api/cms/index'
|
|
45
|
+
import { CmsInfoModel, CmsInfoContentReq, CmsInfoContentModel } from '../../api/cms/types'
|
|
46
|
+
import * as dayjs from 'dayjs';
|
|
47
|
+
|
|
48
|
+
createComponent({
|
|
49
|
+
properties: {
|
|
50
|
+
// 租户
|
|
51
|
+
tenant: {
|
|
52
|
+
type: String,
|
|
53
|
+
value: ""
|
|
54
|
+
},
|
|
55
|
+
// 站点ID
|
|
56
|
+
siteId: {
|
|
57
|
+
type: String,
|
|
58
|
+
value: ""
|
|
59
|
+
},
|
|
60
|
+
// 信息ID
|
|
61
|
+
infoId: {
|
|
62
|
+
type: String,
|
|
63
|
+
value: ""
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
setup(props) {
|
|
67
|
+
let config = getApp().globalData.config;
|
|
68
|
+
let contents = ref([{} as CmsInfoContentModel]);
|
|
69
|
+
let article = ref({} as CmsInfoModel);
|
|
70
|
+
const { infoId } = toRefs(props)
|
|
71
|
+
watch(infoId, (newVal) => {
|
|
72
|
+
cmsApi.findCmsInfoById({ infoId: newVal, tenant: props.tenant }).then(({ data }) => {
|
|
73
|
+
article.value = data;
|
|
74
|
+
article.value.publishDateStr = dayjs(article.value.publishDate).format("YYYY-MM-DD");
|
|
75
|
+
})
|
|
76
|
+
cmsApi.findCmsInfoContent({ siteId: props.siteId, infoId: newVal, tenant: props.tenant } as CmsInfoContentReq).then(({ data }) => {
|
|
77
|
+
contents.value = data.results;
|
|
78
|
+
for (let item of contents.value) {
|
|
79
|
+
if (item.infoType !== "text") {
|
|
80
|
+
item.infoContentList = item.infoContent?.split(',') || [];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
console.log(contents)
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
let imageUrl = config.baseUrl + "/v1/file/image";
|
|
87
|
+
// 视频资源路径
|
|
88
|
+
let fileUrl = config.baseUrl + "/v1/file/range/";
|
|
89
|
+
let winWid = mpx.getWindowInfo().screenWidth;
|
|
90
|
+
|
|
91
|
+
const handleNavigate = () => {
|
|
92
|
+
const { address, geoLatitude, geoLongitude, infoTitle } = article.value;
|
|
93
|
+
if (!geoLatitude || !geoLongitude) {
|
|
94
|
+
mpx.showToast({ title: '暂无坐标信息', icon: 'none' });
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
wx.openLocation({
|
|
98
|
+
latitude: geoLatitude,
|
|
99
|
+
longitude: geoLongitude,
|
|
100
|
+
name: infoTitle,
|
|
101
|
+
address: address,
|
|
102
|
+
scale: 16
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
article,
|
|
108
|
+
contents,
|
|
109
|
+
imageUrl,
|
|
110
|
+
fileUrl,
|
|
111
|
+
winWid,
|
|
112
|
+
handleNavigate
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
})
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<style lang="scss">
|
|
119
|
+
.article-body {
|
|
120
|
+
padding: 30rpx;
|
|
121
|
+
line-height: 1.8;
|
|
122
|
+
|
|
123
|
+
.article-image-wrap {
|
|
124
|
+
margin-bottom: 24rpx;
|
|
125
|
+
border-radius: 12rpx;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
|
|
128
|
+
.article-image {
|
|
129
|
+
display: block;
|
|
130
|
+
width: 100%;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.article-video-wrap {
|
|
135
|
+
margin-bottom: 24rpx;
|
|
136
|
+
border-radius: 12rpx;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
|
|
139
|
+
.article-video {
|
|
140
|
+
width: 100%;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.article-text {
|
|
145
|
+
font-size: 30rpx;
|
|
146
|
+
color: #333;
|
|
147
|
+
line-height: 1.8;
|
|
148
|
+
margin-bottom: 16rpx;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// 位置卡片
|
|
153
|
+
.location-card {
|
|
154
|
+
margin: 0 16rpx 24rpx;
|
|
155
|
+
background: linear-gradient(135deg, #e8f4fd 0%, #fff 40%);
|
|
156
|
+
border-radius: 20rpx;
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
|
|
159
|
+
.location-label {
|
|
160
|
+
padding: 20rpx 24rpx 0;
|
|
161
|
+
font-size: 22rpx;
|
|
162
|
+
color: #69b1e7;
|
|
163
|
+
font-weight: 500;
|
|
164
|
+
letter-spacing: 2rpx;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.location-body {
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
padding: 20rpx 24rpx;
|
|
171
|
+
gap: 20rpx;
|
|
172
|
+
position: relative;
|
|
173
|
+
transition: background 0.2s;
|
|
174
|
+
|
|
175
|
+
&:active {
|
|
176
|
+
background: rgba(0, 0, 0, 0.03);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.location-image {
|
|
180
|
+
flex-shrink: 0;
|
|
181
|
+
width: 140rpx;
|
|
182
|
+
height: 140rpx;
|
|
183
|
+
border-radius: 12rpx;
|
|
184
|
+
overflow: hidden;
|
|
185
|
+
background: #f0f0f0;
|
|
186
|
+
|
|
187
|
+
.location-image-thumb {
|
|
188
|
+
width: 100%;
|
|
189
|
+
height: 100%;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.location-text {
|
|
194
|
+
flex: 1;
|
|
195
|
+
min-width: 0;
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-direction: column;
|
|
198
|
+
gap: 10rpx;
|
|
199
|
+
|
|
200
|
+
.location-name {
|
|
201
|
+
font-size: 28rpx;
|
|
202
|
+
font-weight: 600;
|
|
203
|
+
color: #222;
|
|
204
|
+
overflow: hidden;
|
|
205
|
+
white-space: nowrap;
|
|
206
|
+
text-overflow: ellipsis;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.location-desc {
|
|
210
|
+
font-size: 24rpx;
|
|
211
|
+
color: #888;
|
|
212
|
+
line-height: 1.5;
|
|
213
|
+
overflow: hidden;
|
|
214
|
+
display: -webkit-box;
|
|
215
|
+
-webkit-box-orient: vertical;
|
|
216
|
+
-webkit-line-clamp: 2;
|
|
217
|
+
text-overflow: ellipsis;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.location-address {
|
|
221
|
+
display: flex;
|
|
222
|
+
align-items: center;
|
|
223
|
+
gap: 6rpx;
|
|
224
|
+
|
|
225
|
+
.address-pin {
|
|
226
|
+
font-size: 22rpx;
|
|
227
|
+
flex-shrink: 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.address-text {
|
|
231
|
+
font-size: 22rpx;
|
|
232
|
+
color: #aaa;
|
|
233
|
+
overflow: hidden;
|
|
234
|
+
white-space: nowrap;
|
|
235
|
+
text-overflow: ellipsis;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.location-arrow {
|
|
241
|
+
flex-shrink: 0;
|
|
242
|
+
font-size: 32rpx;
|
|
243
|
+
color: #69b1e7;
|
|
244
|
+
font-weight: 300;
|
|
245
|
+
width: 40rpx;
|
|
246
|
+
text-align: center;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
</style>
|
|
251
|
+
|
|
252
|
+
<script type="application/json">
|
|
253
|
+
{
|
|
254
|
+
"component": true,
|
|
255
|
+
"usingComponents": {}
|
|
256
|
+
}
|
|
257
|
+
</script>
|
|
@@ -1,172 +1,175 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</view>
|
|
2
|
+
<!-- 上传图片组件 -->
|
|
3
|
+
<view class="upload-picture-box">
|
|
4
|
+
<block wx:for="{{ imageArray }}" wx:key="index">
|
|
5
|
+
<view class="image_box">
|
|
6
|
+
<image class="upload_image" src="{{ baseUrl + item }}" />
|
|
7
|
+
<image class="del_image" src="{{ resourceUrl + 'file_del_icon.png' }}" mode="widthFix" data-index="{{ index }}"
|
|
8
|
+
bind:tap="handleDel" />
|
|
9
|
+
</view>
|
|
10
|
+
</block>
|
|
11
|
+
<view wx:if="{{ imageArray.length < limit }}" class="upload-box" bind:tap="handleUploadImage">
|
|
12
|
+
<image class="upload-icon" src="{{ resourceUrl + 'upload_icon.png' }}" mode="widthFix" />
|
|
13
|
+
<text>添加图片</text>
|
|
15
14
|
</view>
|
|
15
|
+
</view>
|
|
16
16
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script lang="ts">
|
|
20
20
|
import mpx, { createComponent, ref } from "@mpxjs/core";
|
|
21
21
|
import { EventBase } from "../../api/types";
|
|
22
|
+
// import { config } from "../../utils/config";
|
|
22
23
|
|
|
23
24
|
createComponent({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
properties: {
|
|
26
|
+
// 上传图片数量限制
|
|
27
|
+
limit: {
|
|
28
|
+
type: Number,
|
|
29
|
+
value: 6
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
setup() {
|
|
33
|
+
let config = getApp().globalData.config;
|
|
34
|
+
// 资源路径
|
|
35
|
+
let resourceUrl = config.resourceUrl + "/images/mall/";
|
|
36
|
+
// 图片路径
|
|
37
|
+
let baseUrl = config.baseUrl + "/v1/file/image/clip/100/100/";
|
|
38
|
+
// 上传图片数组
|
|
39
|
+
let imageArray = ref([] as Array<string>);
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
return {
|
|
42
|
+
resourceUrl,
|
|
43
|
+
baseUrl,
|
|
44
|
+
imageArray,
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
methods: {
|
|
48
|
+
handleUploadImage() {
|
|
49
|
+
if (this.imageArray.length > this.limit - 1) {
|
|
50
|
+
mpx.showToast({
|
|
51
|
+
title: "图片最多上传" + this.limit + "张",
|
|
52
|
+
icon: "none",
|
|
53
|
+
duration: 2000
|
|
54
|
+
});
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
mpx.showActionSheet({
|
|
58
|
+
itemList: ["从相册中选择", "拍照"],
|
|
59
|
+
itemColor: "#486aff",
|
|
60
|
+
success: (res) => {
|
|
61
|
+
if (res.tapIndex === 0) {
|
|
62
|
+
this.chooseWxHeadImage("album");
|
|
63
|
+
} else if (res.tapIndex === 1) {
|
|
64
|
+
this.chooseWxHeadImage("camera");
|
|
65
|
+
}
|
|
44
66
|
}
|
|
67
|
+
});
|
|
45
68
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
69
|
+
chooseWxHeadImage: function (type: any) {
|
|
70
|
+
let config = getApp().globalData.config;
|
|
71
|
+
const token: string = mpx.getStorageSync("token") ? "Bearer " + mpx.getStorageSync("token") : "";
|
|
72
|
+
mpx.chooseMedia({
|
|
73
|
+
count: this.limit,
|
|
74
|
+
mediaType: ['image'],
|
|
75
|
+
sizeType: ["original", "compressed"],
|
|
76
|
+
sourceType: [type],
|
|
77
|
+
success: (res) => {
|
|
78
|
+
console.log('chooseImage success, temp path is', res)
|
|
79
|
+
const files = res.tempFiles || [];
|
|
80
|
+
// 逐个上传
|
|
81
|
+
files.forEach((file: any) => {
|
|
82
|
+
mpx.uploadFile({
|
|
83
|
+
url: config.baseUrl + "/v1/file/upload?tenant=" + config.tenant,
|
|
84
|
+
filePath: file.tempFilePath,
|
|
85
|
+
header: {
|
|
86
|
+
"Content-Type": "multipart/form-data",
|
|
87
|
+
"Authorization": token
|
|
88
|
+
},
|
|
89
|
+
formData: {
|
|
90
|
+
method: "POST",
|
|
91
|
+
},
|
|
92
|
+
name: "file",
|
|
93
|
+
success: (response) => {
|
|
94
|
+
console.log(response);
|
|
95
|
+
if (response.statusCode === 200) {
|
|
96
|
+
const src = JSON.parse(response.data).fileSrc;
|
|
97
|
+
this.imageArray.push(src);
|
|
98
|
+
this.triggerEvent("getImageArray", this.imageArray);
|
|
99
|
+
} else {
|
|
100
|
+
mpx.showToast({
|
|
101
|
+
title: "图片上传失败",
|
|
51
102
|
icon: "none",
|
|
52
103
|
duration: 2000
|
|
53
|
-
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
mpx.showActionSheet({
|
|
57
|
-
itemList: ["从相册中选择", "拍照"],
|
|
58
|
-
itemColor: "#486aff",
|
|
59
|
-
success: (res) => {
|
|
60
|
-
if (res.tapIndex === 0) {
|
|
61
|
-
this.chooseWxHeadImage("album");
|
|
62
|
-
} else if (res.tapIndex === 1) {
|
|
63
|
-
this.chooseWxHeadImage("camera");
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
},
|
|
68
|
-
chooseWxHeadImage: function (type: any) {
|
|
69
|
-
let config = getApp().globalData.config;
|
|
70
|
-
const token: string = mpx.getStorageSync("token") ? "Bearer " + mpx.getStorageSync("token") : "";
|
|
71
|
-
mpx.chooseMedia({
|
|
72
|
-
count: this.limit,
|
|
73
|
-
sizeType: ["original", "compressed"],
|
|
74
|
-
sourceType: [type],
|
|
75
|
-
success: (res) => {
|
|
76
|
-
console.log('chooseImage success, temp path is', res)
|
|
77
|
-
const tempFilePaths = res.tempFiles[0].tempFilePath;
|
|
78
|
-
// 上传文件
|
|
79
|
-
mpx.uploadFile({
|
|
80
|
-
url: config.baseUrl + "/v1/file/upload?tenant=" + config.tenant,
|
|
81
|
-
filePath: tempFilePaths,
|
|
82
|
-
header: {
|
|
83
|
-
"Content-Type": "multipart/form-data",
|
|
84
|
-
"Authorization": token
|
|
85
|
-
},
|
|
86
|
-
formData: {
|
|
87
|
-
method: "POST", //请求方式
|
|
88
|
-
},
|
|
89
|
-
name: "file",
|
|
90
|
-
success: (response) => {
|
|
91
|
-
console.log(response);
|
|
92
|
-
if (response.statusCode === 200) {
|
|
93
|
-
const src = JSON.parse(response.data).fileSrc;
|
|
94
|
-
this.imageArray.push(src);
|
|
95
|
-
// 使用this.triggerEvent传索引值给页面
|
|
96
|
-
this.triggerEvent("getImageArray", this.imageArray);
|
|
97
|
-
} else {
|
|
98
|
-
mpx.showToast({
|
|
99
|
-
title: "图片上传失败",
|
|
100
|
-
icon: "none",
|
|
101
|
-
duration: 2000
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
})
|
|
104
|
+
});
|
|
106
105
|
}
|
|
106
|
+
}
|
|
107
107
|
})
|
|
108
|
-
|
|
109
|
-
// 删除图片
|
|
110
|
-
handleDel(e: EventBase) {
|
|
111
|
-
this.imageArray.splice(e.currentTarget.dataset.index, 1);
|
|
112
|
-
// 使用this.triggerEvent传索引值给页面
|
|
113
|
-
this.triggerEvent("getImageArray", this.imageArray);
|
|
108
|
+
});
|
|
114
109
|
}
|
|
110
|
+
})
|
|
111
|
+
},
|
|
112
|
+
// 删除图片
|
|
113
|
+
handleDel(e: EventBase) {
|
|
114
|
+
this.imageArray.splice(e.currentTarget.dataset.index, 1);
|
|
115
|
+
// 使用this.triggerEvent传索引值给页面
|
|
116
|
+
this.triggerEvent("getImageArray", this.imageArray);
|
|
115
117
|
}
|
|
118
|
+
}
|
|
116
119
|
})
|
|
117
120
|
</script>
|
|
118
121
|
|
|
119
122
|
<style lang="scss">
|
|
120
123
|
.upload-picture-box {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
flex-wrap: wrap;
|
|
124
127
|
}
|
|
125
128
|
|
|
126
129
|
.upload_image {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
width: 100%;
|
|
131
|
+
height: 196rpx;
|
|
132
|
+
vertical-align: top;
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
.upload-box {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
border: 2rpx dashed #dddddd;
|
|
137
|
+
font-size: 24rpx;
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
height: 192rpx;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
align-items: center;
|
|
143
|
+
flex: 0 0 calc((100% - 42rpx)/3);
|
|
141
144
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
.upload-icon {
|
|
146
|
+
width: 60rpx;
|
|
147
|
+
margin-bottom: 10rpx;
|
|
148
|
+
}
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
.image_box {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
position: relative;
|
|
153
|
+
height: 196rpx;
|
|
154
|
+
flex: 0 0 calc((100% - 42rpx)/3);
|
|
155
|
+
margin: 0 20rpx 20rpx 0;
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
.image_box:nth-child(3n) {
|
|
156
|
-
|
|
159
|
+
margin-right: 0;
|
|
157
160
|
}
|
|
158
161
|
|
|
159
162
|
.del_image {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
width: 36rpx;
|
|
164
|
+
position: absolute;
|
|
165
|
+
right: -10rpx;
|
|
166
|
+
top: -10rpx;
|
|
164
167
|
}
|
|
165
168
|
</style>
|
|
166
169
|
|
|
167
170
|
<script type="application/json">
|
|
168
171
|
{
|
|
169
|
-
|
|
170
|
-
|
|
172
|
+
"component": true,
|
|
173
|
+
"usingComponents": {}
|
|
171
174
|
}
|
|
172
|
-
</script>
|
|
175
|
+
</script>
|
package/src/index.ts
CHANGED
package/src/packages/index.mpx
CHANGED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 搜索框 -->
|
|
3
|
+
<view class="search-box">
|
|
4
|
+
<jmash-search placeholder="搜索" bind:handleSearch="handleInput" />
|
|
5
|
+
</view>
|
|
6
|
+
<!-- 栏目列表 -->
|
|
7
|
+
|
|
8
|
+
<jmash-cms-activity-page isInfo="false" style="1" organTenant="{{ queryParams.tenant }}"
|
|
9
|
+
siteId="{{ queryParams.siteId }}" likeInfoTitle="{{ queryParams.likeInfoTitle }}"
|
|
10
|
+
channelAlias="{{ queryParams.channelAlias }}" pageSize="10" refreshKey="{{ refreshKey }}" />
|
|
11
|
+
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import mpx, { createPage, ref } from "@mpxjs/core";
|
|
16
|
+
import { CmsChannelModel } from '../../../api/cms/types'
|
|
17
|
+
import { EventBase } from "../../../api/types";
|
|
18
|
+
|
|
19
|
+
createPage({
|
|
20
|
+
setup() {
|
|
21
|
+
let config = getApp().globalData.config;
|
|
22
|
+
// 搜索参数
|
|
23
|
+
let queryParams = ref({
|
|
24
|
+
tenant: mpx.getStorageSync("tenant"),
|
|
25
|
+
siteId: config.siteId,
|
|
26
|
+
channelAlias: "hdzx",
|
|
27
|
+
likeInfoTitle: "",
|
|
28
|
+
status: true,
|
|
29
|
+
isOpen: true,
|
|
30
|
+
});
|
|
31
|
+
// 栏目列表
|
|
32
|
+
let channelList = ref([] as CmsChannelModel[]);
|
|
33
|
+
|
|
34
|
+
let refreshKey = ref(0);
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
queryParams,
|
|
38
|
+
channelList,
|
|
39
|
+
refreshKey,
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 生命周期函数--监听页面加载
|
|
45
|
+
* @param options 页面跳转参数{title: string, tenant: string, siteId: string, alias: string}
|
|
46
|
+
*/
|
|
47
|
+
onLoad(options) {
|
|
48
|
+
console.log("cms文章列表页面参数 ==>", options);
|
|
49
|
+
let config = getApp().globalData.config;
|
|
50
|
+
mpx.setNavigationBarTitle({ title: options.title || "列表" });
|
|
51
|
+
this.queryParams.tenant = options.tenant || mpx.getStorageSync("tenant") || config.tenant;
|
|
52
|
+
this.queryParams.siteId = options.siteId as string || config.siteId;
|
|
53
|
+
this.queryParams.channelAlias = options.channelAlias as string || "hdzx";
|
|
54
|
+
this.refreshKey = this.refreshKey + 1;
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
// 搜索
|
|
58
|
+
handleInput(e: EventBase) {
|
|
59
|
+
console.log("搜索 ==>", e.detail);
|
|
60
|
+
this.queryParams.likeInfoTitle = e.detail;
|
|
61
|
+
this.refreshKey = this.refreshKey + 1;
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
})
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style lang="scss">
|
|
68
|
+
@use "../../../styles/index.scss" as *;
|
|
69
|
+
|
|
70
|
+
page {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
height: 70vh;
|
|
74
|
+
margin: 0 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.search-box {
|
|
78
|
+
padding: 15rpx 30rpx;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.article-list {
|
|
82
|
+
max-height: calc(100vh - 90rpx - env(safe-area-inset-bottom));
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
86
|
+
|
|
87
|
+
<script type="application/json">
|
|
88
|
+
{
|
|
89
|
+
"navigationBarTitleText": "列表",
|
|
90
|
+
"usingComponents": {
|
|
91
|
+
"jmash-search": "../../../components/common/jmash-search",
|
|
92
|
+
"jmash-cms-activity-page": "../../../components/cms/jmash-cms-activity-page.mpx"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
</script>
|