jmash-core-mp 0.1.21 → 0.1.22
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/.editorconfig +9 -9
- package/README.md +60 -60
- package/babel.config.json +34 -34
- package/eslint.config.mjs +7 -7
- package/lib/api/auth/index.d.ts +21 -21
- package/lib/api/auth/index.js +199 -199
- package/lib/api/auth/types.d.ts +86 -86
- package/lib/api/auth/types.js +9 -9
- package/lib/api/cms/index.d.ts +20 -20
- package/lib/api/cms/index.js +161 -161
- package/lib/api/cms/types.d.ts +200 -200
- package/lib/api/cms/types.js +1 -1
- package/lib/api/constant.d.ts +5 -5
- package/lib/api/constant.js +6 -6
- package/lib/api/dict/index.d.ts +18 -18
- package/lib/api/dict/index.js +34 -34
- package/lib/api/dict/types.d.ts +28 -28
- package/lib/api/dict/types.js +1 -1
- package/lib/api/dicts.d.ts +18 -18
- package/lib/api/dicts.js +67 -67
- package/lib/api/files/index.d.ts +25 -25
- package/lib/api/files/index.js +135 -135
- package/lib/api/files/types.d.ts +38 -38
- package/lib/api/files/types.js +1 -1
- package/lib/api/index.d.ts +4 -4
- package/lib/api/index.js +6 -6
- package/lib/api/myorgan/types.d.ts +22 -22
- package/lib/api/myorgan/types.js +1 -1
- package/lib/api/region/index.d.ts +7 -7
- package/lib/api/region/index.js +19 -19
- package/lib/api/region/types.d.ts +19 -19
- package/lib/api/region/types.js +1 -1
- package/lib/api/storage/index.d.ts +10 -10
- package/lib/api/storage/index.js +43 -43
- package/lib/api/storage/types.d.ts +28 -28
- package/lib/api/storage/types.js +1 -1
- package/lib/api/types.d.ts +42 -42
- package/lib/api/types.js +1 -1
- package/lib/app.mpx.d.ts +1 -1
- package/lib/components/auth-user/jmash-update-user.mpx.d.ts +1 -1
- package/lib/components/auth-user/jmash-user.mpx.d.ts +1 -1
- package/lib/components/cms/jmash-cms-acticle-list.mpx.d.ts +1 -1
- package/lib/components/cms/jmash-cms-article-item.mpx.d.ts +1 -1
- package/lib/components/cms/jmash-cms-article-view.mpx.d.ts +1 -0
- package/lib/components/cms/jmash-cms-article.mpx.d.ts +1 -1
- package/lib/components/cms/jmash-cms-like.mpx.d.ts +1 -1
- package/lib/components/common/jmash-upload-picture.mpx.d.ts +1 -0
- package/lib/components/core/jmash-login.mpx.d.ts +1 -0
- package/lib/index.d.ts +21 -21
- package/lib/index.js +14 -14
- package/lib/packages/pages/cms/cms-article-list.mpx.d.ts +1 -1
- package/lib/pages/index.mpx.d.ts +1 -0
- package/lib/store/user.d.ts +31 -31
- package/lib/store/user.js +227 -227
- package/lib/utils/common.d.ts +35 -35
- package/lib/utils/common.js +166 -166
- package/lib/utils/config.d.ts +5 -5
- package/lib/utils/config.js +29 -29
- package/lib/utils/db.d.ts +21 -21
- package/lib/utils/db.js +84 -84
- package/lib/utils/grpc.d.ts +5 -5
- package/lib/utils/grpc.js +20 -20
- package/lib/utils/net.d.ts +7 -7
- package/lib/utils/net.js +15 -15
- package/lib/utils/request.d.ts +2 -2
- package/lib/utils/request.js +123 -123
- package/mpx.config.js +27 -27
- package/package.json +1 -1
- package/postcss.config.js +11 -11
- package/project.config.json +24 -24
- package/project.private.config.json +13 -13
- package/public/index.html +15 -15
- package/src/api/auth/index.ts +227 -227
- package/src/api/auth/types.ts +166 -166
- package/src/api/cms/index.ts +218 -218
- package/src/api/cms/types.ts +379 -379
- package/src/api/constant.ts +6 -6
- package/src/api/dict/index.ts +44 -44
- package/src/api/dict/types.ts +49 -49
- package/src/api/dicts.ts +72 -72
- package/src/api/files/index.ts +163 -163
- package/src/api/files/types.ts +67 -67
- package/src/api/index.ts +11 -11
- package/src/api/myorgan/types.ts +42 -42
- package/src/api/region/index.ts +23 -23
- package/src/api/region/types.ts +36 -36
- package/src/api/storage/index.ts +62 -62
- package/src/api/storage/types.ts +54 -54
- package/src/api/types.ts +72 -72
- package/src/app.mpx +71 -71
- package/src/components/auth-user/jmash-logout.mpx +91 -91
- package/src/components/auth-user/jmash-update-user.mpx +386 -386
- package/src/components/auth-user/jmash-update-user.web.mpx +366 -366
- package/src/components/auth-user/jmash-user.mpx +359 -359
- package/src/components/cms/jmash-cms-acticle-list.mpx +182 -182
- package/src/components/cms/jmash-cms-article-item.mpx +241 -241
- package/src/components/cms/jmash-cms-article-view.mpx +131 -131
- package/src/components/cms/jmash-cms-article.mpx +68 -68
- package/src/components/cms/jmash-cms-like.mpx +151 -151
- package/src/components/common/jmash-avatar-edit.mpx +153 -153
- package/src/components/common/jmash-cascader-region.mpx +112 -112
- package/src/components/common/jmash-menu.mpx +129 -129
- package/src/components/common/jmash-none-data.mpx +82 -82
- package/src/components/common/jmash-pic-swiper.mpx +71 -71
- package/src/components/common/jmash-popup.mpx +137 -137
- package/src/components/common/jmash-search.mpx +126 -126
- package/src/components/common/jmash-single-btn.mpx +53 -53
- package/src/components/common/jmash-stepper.mpx +214 -214
- package/src/components/common/jmash-tab-bar.mpx +50 -50
- package/src/components/common/jmash-textarea.mpx +88 -88
- package/src/components/common/jmash-top-navigation.mpx +203 -203
- package/src/components/common/jmash-upload-picture.mpx +129 -126
- package/src/components/core/jmash-cms-protocol.mpx +66 -66
- package/src/components/core/jmash-login.ali.mpx +284 -284
- package/src/components/core/jmash-login.mpx +348 -348
- package/src/components/core/jmash-login.web.mpx +421 -421
- package/src/components/core/jmash-popup-login.ali.mpx +311 -311
- package/src/components/core/jmash-popup-login.mpx +415 -415
- package/src/components/core/jmash-popup-login.web.mpx +389 -389
- package/src/custom-tab-bar/index.mpx +10 -10
- package/src/global.d.ts +11 -11
- package/src/index.ts +71 -71
- package/src/packages/index.mpx +10 -10
- package/src/packages/pages/auth/cms-protocol.mpx +31 -31
- package/src/packages/pages/auth/login.mpx +59 -59
- package/src/packages/pages/auth/update-user.mpx +17 -17
- package/src/packages/pages/cms/cms-article-list.mpx +164 -164
- package/src/packages/pages/cms/cms-article.mpx +32 -32
- package/src/pages/basic-component.mpx +30 -30
- package/src/pages/half-home.mpx +58 -58
- package/src/pages/home.mpx +52 -52
- package/src/pages/home2.mpx +47 -47
- package/src/pages/index.mpx +13 -3
- package/src/pages/tabbar/home.mpx +77 -77
- package/src/pages/tabbar/my.mpx +80 -80
- package/src/store/user.ts +270 -270
- package/src/styles/index.scss +20 -20
- package/src/styles/vars.scss +27 -27
- package/src/utils/common.ts +179 -179
- package/src/utils/config.ts +35 -35
- package/src/utils/db.ts +100 -100
- package/src/utils/grpc.ts +21 -21
- package/src/utils/net.ts +18 -18
- package/src/utils/request.ts +134 -134
- package/static/ali/mini.project.json +4 -4
- package/static/dd/project.config.json +15 -15
- package/static/swan/project.swan.json +14 -14
- package/static/tt/project.config.json +11 -11
- package/static/wx/project.config.json +40 -40
- package/uno.config.js +9 -9
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="article-main">
|
|
3
|
-
<!-- 默认图片在右侧的样式 枚举值为0 -->
|
|
4
|
-
<block wx:for="{{ articleList }}" wx:key="index">
|
|
5
|
-
<view class="{{ isInfo ? 'article-info' : 'article-border' }}" bind:tap="handleInfo" data-item="{{ item }}">
|
|
6
|
-
<!-- 内容 -->
|
|
7
|
-
<view class="cms-info">
|
|
8
|
-
<view class="cms-left">
|
|
9
|
-
<!-- 标题 -->
|
|
10
|
-
<view class="cms-left-title">{{ item.infoTitle }}</view>
|
|
11
|
-
<!-- 内容 -->
|
|
12
|
-
<view class="cms-left-info">{{ item.intro }}</view>
|
|
13
|
-
</view>
|
|
14
|
-
<view bind:tap="handlePreview" data-url="{{ item.imgUrl }}">
|
|
15
|
-
<image class="cms-right-image" src="{{ imageUrl + item.imgUrl }}" mode="widthFix" />
|
|
16
|
-
</view>
|
|
17
|
-
</view>
|
|
18
|
-
</view>
|
|
19
|
-
</block>
|
|
20
|
-
</view>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script lang="ts">
|
|
24
|
-
import mpx, { createPage, ref, onLoad, onPullDownRefresh } from '@mpxjs/core'
|
|
25
|
-
import { EventBase } from '../../../api/types';
|
|
26
|
-
import { cmsApi } from '../../../api/cms';
|
|
27
|
-
import { CmsInfoModel } from '../../../api/cms/types';
|
|
28
|
-
|
|
29
|
-
createPage({
|
|
30
|
-
setup(props) {
|
|
31
|
-
let config = getApp().globalData.config;
|
|
32
|
-
let organTenant = ref(config.tenant);
|
|
33
|
-
let siteId = ref(config.siteId);
|
|
34
|
-
let channelId = ref('');
|
|
35
|
-
let channelAlias = ref('');
|
|
36
|
-
let curPage = ref(1);
|
|
37
|
-
let articleList = ref([] as CmsInfoModel[]);
|
|
38
|
-
let imageUrl = config.baseUrl + "/v1/file/image/clip/300/300/";
|
|
39
|
-
let queryCmsInfo = function () {
|
|
40
|
-
cmsApi.findCmsInfoPage({
|
|
41
|
-
tenant: organTenant.value || config.tenant,
|
|
42
|
-
siteId: siteId.value,
|
|
43
|
-
channelId: channelId.value,
|
|
44
|
-
channelAlias: channelAlias.value,
|
|
45
|
-
curPage: curPage.value,
|
|
46
|
-
pageSize: 10,
|
|
47
|
-
}).then(res => {
|
|
48
|
-
if (res.statusCode === 200) {
|
|
49
|
-
console.log("article-list-add", res.data.results);
|
|
50
|
-
articleList.value.push(...res.data.results);
|
|
51
|
-
curPage.value++;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
onLoad((options) => {
|
|
56
|
-
console.log("article-list", options);
|
|
57
|
-
siteId.value = options.siteId || config.siteId;
|
|
58
|
-
channelId.value = options.channelId || '';
|
|
59
|
-
channelAlias.value = options.channelAlias || '';
|
|
60
|
-
curPage.value = 1;
|
|
61
|
-
queryCmsInfo();
|
|
62
|
-
})
|
|
63
|
-
onPullDownRefresh(() => {
|
|
64
|
-
queryCmsInfo();
|
|
65
|
-
})
|
|
66
|
-
return { organTenant, siteId, channelId, channelAlias, curPage, articleList, imageUrl, queryCmsInfo };
|
|
67
|
-
},
|
|
68
|
-
methods: {
|
|
69
|
-
// 点击详情事件
|
|
70
|
-
handleInfo(e: EventBase) {
|
|
71
|
-
let config = getApp().globalData.config;
|
|
72
|
-
let item = e.currentTarget.dataset.item;
|
|
73
|
-
mpx.navigateTo({
|
|
74
|
-
url: '/jmash/pages/cms/cms-article?siteId=' + this.siteId + '&infoId=' + item.infoId,
|
|
75
|
-
});
|
|
76
|
-
// 浏览
|
|
77
|
-
this.handelBrowse(this.organTenant || config.tenant, item.infoId);
|
|
78
|
-
},
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
</script>
|
|
82
|
-
|
|
83
|
-
<style lang="scss">
|
|
84
|
-
@use "../../../styles/index.scss" as *;
|
|
85
|
-
|
|
86
|
-
.article-main {
|
|
87
|
-
padding: 0 30rpx;
|
|
88
|
-
border-radius: 20rpx;
|
|
89
|
-
background-color: #fff;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// 有分割线列表
|
|
93
|
-
.article-border {
|
|
94
|
-
padding: 30rpx 0;
|
|
95
|
-
border-bottom: 1rpx solid $border-line;
|
|
96
|
-
|
|
97
|
-
// 分割线最后一条内容无分割线
|
|
98
|
-
&:last-child {
|
|
99
|
-
border: none;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// 无分割线列表
|
|
104
|
-
.article-info {
|
|
105
|
-
padding: 30rpx;
|
|
106
|
-
background-color: #fff;
|
|
107
|
-
border-radius: 20rpx;
|
|
108
|
-
margin-bottom: 20rpx;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.cms-info {
|
|
112
|
-
display: flex;
|
|
113
|
-
align-items: center;
|
|
114
|
-
justify-content: space-between;
|
|
115
|
-
gap: 30rpx;
|
|
116
|
-
margin-bottom: 30rpx;
|
|
117
|
-
|
|
118
|
-
// 文章左侧内容
|
|
119
|
-
.cms-left {
|
|
120
|
-
width: 450rpx;
|
|
121
|
-
display: flex;
|
|
122
|
-
flex-direction: column;
|
|
123
|
-
|
|
124
|
-
.cms-left-title {
|
|
125
|
-
color: #333;
|
|
126
|
-
font-size: 28rpx;
|
|
127
|
-
font-weight: 600;
|
|
128
|
-
margin-bottom: 20rpx;
|
|
129
|
-
overflow: hidden;
|
|
130
|
-
/* 隐藏超出部分 */
|
|
131
|
-
white-space: nowrap;
|
|
132
|
-
/* 强制文本不换行 */
|
|
133
|
-
text-overflow: ellipsis;
|
|
134
|
-
/* 超出部分以省略号显示 */
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.cms-left-info {
|
|
138
|
-
color: #666;
|
|
139
|
-
font-size: 26rpx;
|
|
140
|
-
line-height: 37rpx;
|
|
141
|
-
overflow: hidden;
|
|
142
|
-
/* 隐藏超出部分 */
|
|
143
|
-
display: -webkit-box;
|
|
144
|
-
-webkit-box-orient: vertical;
|
|
145
|
-
-webkit-line-clamp: 2;
|
|
146
|
-
/* 文本只显示两行 */
|
|
147
|
-
text-overflow: ellipsis;
|
|
148
|
-
/* 超出部分以省略号显示 */
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// 文章右侧图片
|
|
153
|
-
.cms-right-image {
|
|
154
|
-
width: 150rpx;
|
|
155
|
-
height: 150rpx;
|
|
156
|
-
border-radius: 10rpx;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
</style>
|
|
160
|
-
|
|
161
|
-
<script type="application/json">
|
|
162
|
-
{
|
|
163
|
-
"usingComponents": {}
|
|
164
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<view class="article-main">
|
|
3
|
+
<!-- 默认图片在右侧的样式 枚举值为0 -->
|
|
4
|
+
<block wx:for="{{ articleList }}" wx:key="index">
|
|
5
|
+
<view class="{{ isInfo ? 'article-info' : 'article-border' }}" bind:tap="handleInfo" data-item="{{ item }}">
|
|
6
|
+
<!-- 内容 -->
|
|
7
|
+
<view class="cms-info">
|
|
8
|
+
<view class="cms-left">
|
|
9
|
+
<!-- 标题 -->
|
|
10
|
+
<view class="cms-left-title">{{ item.infoTitle }}</view>
|
|
11
|
+
<!-- 内容 -->
|
|
12
|
+
<view class="cms-left-info">{{ item.intro }}</view>
|
|
13
|
+
</view>
|
|
14
|
+
<view bind:tap="handlePreview" data-url="{{ item.imgUrl }}">
|
|
15
|
+
<image class="cms-right-image" src="{{ imageUrl + item.imgUrl }}" mode="widthFix" />
|
|
16
|
+
</view>
|
|
17
|
+
</view>
|
|
18
|
+
</view>
|
|
19
|
+
</block>
|
|
20
|
+
</view>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import mpx, { createPage, ref, onLoad, onPullDownRefresh } from '@mpxjs/core'
|
|
25
|
+
import { EventBase } from '../../../api/types';
|
|
26
|
+
import { cmsApi } from '../../../api/cms';
|
|
27
|
+
import { CmsInfoModel } from '../../../api/cms/types';
|
|
28
|
+
|
|
29
|
+
createPage({
|
|
30
|
+
setup(props) {
|
|
31
|
+
let config = getApp().globalData.config;
|
|
32
|
+
let organTenant = ref(config.tenant);
|
|
33
|
+
let siteId = ref(config.siteId);
|
|
34
|
+
let channelId = ref('');
|
|
35
|
+
let channelAlias = ref('');
|
|
36
|
+
let curPage = ref(1);
|
|
37
|
+
let articleList = ref([] as CmsInfoModel[]);
|
|
38
|
+
let imageUrl = config.baseUrl + "/v1/file/image/clip/300/300/";
|
|
39
|
+
let queryCmsInfo = function () {
|
|
40
|
+
cmsApi.findCmsInfoPage({
|
|
41
|
+
tenant: organTenant.value || config.tenant,
|
|
42
|
+
siteId: siteId.value,
|
|
43
|
+
channelId: channelId.value,
|
|
44
|
+
channelAlias: channelAlias.value,
|
|
45
|
+
curPage: curPage.value,
|
|
46
|
+
pageSize: 10,
|
|
47
|
+
}).then(res => {
|
|
48
|
+
if (res.statusCode === 200) {
|
|
49
|
+
console.log("article-list-add", res.data.results);
|
|
50
|
+
articleList.value.push(...res.data.results);
|
|
51
|
+
curPage.value++;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
onLoad((options) => {
|
|
56
|
+
console.log("article-list", options);
|
|
57
|
+
siteId.value = options.siteId || config.siteId;
|
|
58
|
+
channelId.value = options.channelId || '';
|
|
59
|
+
channelAlias.value = options.channelAlias || '';
|
|
60
|
+
curPage.value = 1;
|
|
61
|
+
queryCmsInfo();
|
|
62
|
+
})
|
|
63
|
+
onPullDownRefresh(() => {
|
|
64
|
+
queryCmsInfo();
|
|
65
|
+
})
|
|
66
|
+
return { organTenant, siteId, channelId, channelAlias, curPage, articleList, imageUrl, queryCmsInfo };
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
// 点击详情事件
|
|
70
|
+
handleInfo(e: EventBase) {
|
|
71
|
+
let config = getApp().globalData.config;
|
|
72
|
+
let item = e.currentTarget.dataset.item;
|
|
73
|
+
mpx.navigateTo({
|
|
74
|
+
url: '/jmash/pages/cms/cms-article?siteId=' + this.siteId + '&infoId=' + item.infoId,
|
|
75
|
+
});
|
|
76
|
+
// 浏览
|
|
77
|
+
this.handelBrowse(this.organTenant || config.tenant, item.infoId);
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<style lang="scss">
|
|
84
|
+
@use "../../../styles/index.scss" as *;
|
|
85
|
+
|
|
86
|
+
.article-main {
|
|
87
|
+
padding: 0 30rpx;
|
|
88
|
+
border-radius: 20rpx;
|
|
89
|
+
background-color: #fff;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// 有分割线列表
|
|
93
|
+
.article-border {
|
|
94
|
+
padding: 30rpx 0;
|
|
95
|
+
border-bottom: 1rpx solid $border-line;
|
|
96
|
+
|
|
97
|
+
// 分割线最后一条内容无分割线
|
|
98
|
+
&:last-child {
|
|
99
|
+
border: none;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// 无分割线列表
|
|
104
|
+
.article-info {
|
|
105
|
+
padding: 30rpx;
|
|
106
|
+
background-color: #fff;
|
|
107
|
+
border-radius: 20rpx;
|
|
108
|
+
margin-bottom: 20rpx;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.cms-info {
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
gap: 30rpx;
|
|
116
|
+
margin-bottom: 30rpx;
|
|
117
|
+
|
|
118
|
+
// 文章左侧内容
|
|
119
|
+
.cms-left {
|
|
120
|
+
width: 450rpx;
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
|
|
124
|
+
.cms-left-title {
|
|
125
|
+
color: #333;
|
|
126
|
+
font-size: 28rpx;
|
|
127
|
+
font-weight: 600;
|
|
128
|
+
margin-bottom: 20rpx;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
/* 隐藏超出部分 */
|
|
131
|
+
white-space: nowrap;
|
|
132
|
+
/* 强制文本不换行 */
|
|
133
|
+
text-overflow: ellipsis;
|
|
134
|
+
/* 超出部分以省略号显示 */
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.cms-left-info {
|
|
138
|
+
color: #666;
|
|
139
|
+
font-size: 26rpx;
|
|
140
|
+
line-height: 37rpx;
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
/* 隐藏超出部分 */
|
|
143
|
+
display: -webkit-box;
|
|
144
|
+
-webkit-box-orient: vertical;
|
|
145
|
+
-webkit-line-clamp: 2;
|
|
146
|
+
/* 文本只显示两行 */
|
|
147
|
+
text-overflow: ellipsis;
|
|
148
|
+
/* 超出部分以省略号显示 */
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// 文章右侧图片
|
|
153
|
+
.cms-right-image {
|
|
154
|
+
width: 150rpx;
|
|
155
|
+
height: 150rpx;
|
|
156
|
+
border-radius: 10rpx;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
</style>
|
|
160
|
+
|
|
161
|
+
<script type="application/json">
|
|
162
|
+
{
|
|
163
|
+
"usingComponents": {}
|
|
164
|
+
}
|
|
165
165
|
</script>
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<cms-article siteId="{{ siteId }}" tenant="{{ tenant }}" infoId="{{ infoId }}"></cms-article>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
import { createPage, ref, onLoad } from '@mpxjs/core'
|
|
7
|
-
|
|
8
|
-
createPage({
|
|
9
|
-
setup(props) {
|
|
10
|
-
//console.log("123", props);
|
|
11
|
-
let config = getApp().globalData.config;
|
|
12
|
-
let siteId = ref(config.siteId);
|
|
13
|
-
let tenant = ref(config.tenant);
|
|
14
|
-
let infoId = ref('');
|
|
15
|
-
onLoad((options) => {
|
|
16
|
-
console.log(options);
|
|
17
|
-
siteId.value = options.siteId || config.siteId;
|
|
18
|
-
infoId.value = options.infoId || '';
|
|
19
|
-
})
|
|
20
|
-
return { siteId, tenant, infoId };
|
|
21
|
-
},
|
|
22
|
-
})
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<style lang="scss"></style>
|
|
26
|
-
|
|
27
|
-
<script type="application/json">
|
|
28
|
-
{
|
|
29
|
-
"usingComponents": {
|
|
30
|
-
"cms-article": "../../../components/cms/jmash-cms-article.mpx"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<cms-article siteId="{{ siteId }}" tenant="{{ tenant }}" infoId="{{ infoId }}"></cms-article>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import { createPage, ref, onLoad } from '@mpxjs/core'
|
|
7
|
+
|
|
8
|
+
createPage({
|
|
9
|
+
setup(props) {
|
|
10
|
+
//console.log("123", props);
|
|
11
|
+
let config = getApp().globalData.config;
|
|
12
|
+
let siteId = ref(config.siteId);
|
|
13
|
+
let tenant = ref(config.tenant);
|
|
14
|
+
let infoId = ref('');
|
|
15
|
+
onLoad((options) => {
|
|
16
|
+
console.log(options);
|
|
17
|
+
siteId.value = options.siteId || config.siteId;
|
|
18
|
+
infoId.value = options.infoId || '';
|
|
19
|
+
})
|
|
20
|
+
return { siteId, tenant, infoId };
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<style lang="scss"></style>
|
|
26
|
+
|
|
27
|
+
<script type="application/json">
|
|
28
|
+
{
|
|
29
|
+
"usingComponents": {
|
|
30
|
+
"cms-article": "../../../components/cms/jmash-cms-article.mpx"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
33
|
</script>
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="basic-component-page">
|
|
3
|
-
<text>{{ title }}</text>
|
|
4
|
-
</view>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import { createPage, ref } from '@mpxjs/core'
|
|
9
|
-
|
|
10
|
-
createPage({
|
|
11
|
-
setup(props, context) {
|
|
12
|
-
let title = ref('组件演示');
|
|
13
|
-
return { title };
|
|
14
|
-
},
|
|
15
|
-
})
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<style lang="scss">
|
|
19
|
-
.basic-component-page {
|
|
20
|
-
padding: 40rpx;
|
|
21
|
-
text-align: center;
|
|
22
|
-
font-size: 32rpx;
|
|
23
|
-
color: #333;
|
|
24
|
-
}
|
|
25
|
-
</style>
|
|
26
|
-
|
|
27
|
-
<script type="application/json">
|
|
28
|
-
{
|
|
29
|
-
"usingComponents": {}
|
|
30
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<view class="basic-component-page">
|
|
3
|
+
<text>{{ title }}</text>
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { createPage, ref } from '@mpxjs/core'
|
|
9
|
+
|
|
10
|
+
createPage({
|
|
11
|
+
setup(props, context) {
|
|
12
|
+
let title = ref('组件演示');
|
|
13
|
+
return { title };
|
|
14
|
+
},
|
|
15
|
+
})
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style lang="scss">
|
|
19
|
+
.basic-component-page {
|
|
20
|
+
padding: 40rpx;
|
|
21
|
+
text-align: center;
|
|
22
|
+
font-size: 32rpx;
|
|
23
|
+
color: #333;
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
26
|
+
|
|
27
|
+
<script type="application/json">
|
|
28
|
+
{
|
|
29
|
+
"usingComponents": {}
|
|
30
|
+
}
|
|
31
31
|
</script>
|
package/src/pages/half-home.mpx
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="half-home-page">
|
|
3
|
-
<text>主页(半屏登录)</text>
|
|
4
|
-
<!-- 授权登录弹出层 -->
|
|
5
|
-
<jmash-popup-login visible="{{ isLoginPopup }}" bind:close="onLoginClose"
|
|
6
|
-
bind:status="loginSuccess"></jmash-popup-login>
|
|
7
|
-
</view>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
import { createPage, ref } from '@mpxjs/core'
|
|
12
|
-
import { useUserStore } from '../store/user'
|
|
13
|
-
|
|
14
|
-
createPage({
|
|
15
|
-
setup() {
|
|
16
|
-
let isLoginPopup = ref(false);
|
|
17
|
-
let userStore = useUserStore();
|
|
18
|
-
//检查登录并跳转登录
|
|
19
|
-
userStore.loginOnlyAC().then(() => {
|
|
20
|
-
//登录成功,加载业务
|
|
21
|
-
console.log("静默登录成功");
|
|
22
|
-
}).catch(() => {
|
|
23
|
-
isLoginPopup.value = true;
|
|
24
|
-
});
|
|
25
|
-
return { isLoginPopup };
|
|
26
|
-
},
|
|
27
|
-
methods: {
|
|
28
|
-
// 授权登录弹出层关闭
|
|
29
|
-
onLoginClose: function (visible) {
|
|
30
|
-
console.log(visible.detail);
|
|
31
|
-
this.isLoginPopup = visible.detail;
|
|
32
|
-
},
|
|
33
|
-
// 登录成功
|
|
34
|
-
loginSuccess: function (status) {
|
|
35
|
-
if (status.detail) {
|
|
36
|
-
// 登录成功,加载业务
|
|
37
|
-
console.log("登录成功");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
<style lang="scss">
|
|
45
|
-
.half-home-page {
|
|
46
|
-
padding: 40rpx;
|
|
47
|
-
text-align: center;
|
|
48
|
-
font-size: 32rpx;
|
|
49
|
-
color: #333;
|
|
50
|
-
}
|
|
51
|
-
</style>
|
|
52
|
-
|
|
53
|
-
<script type="application/json">
|
|
54
|
-
{
|
|
55
|
-
"usingComponents": {
|
|
56
|
-
"jmash-popup-login": "../components/core/jmash-popup-login.mpx"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<view class="half-home-page">
|
|
3
|
+
<text>主页(半屏登录)</text>
|
|
4
|
+
<!-- 授权登录弹出层 -->
|
|
5
|
+
<jmash-popup-login visible="{{ isLoginPopup }}" bind:close="onLoginClose"
|
|
6
|
+
bind:status="loginSuccess"></jmash-popup-login>
|
|
7
|
+
</view>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { createPage, ref } from '@mpxjs/core'
|
|
12
|
+
import { useUserStore } from '../store/user'
|
|
13
|
+
|
|
14
|
+
createPage({
|
|
15
|
+
setup() {
|
|
16
|
+
let isLoginPopup = ref(false);
|
|
17
|
+
let userStore = useUserStore();
|
|
18
|
+
//检查登录并跳转登录
|
|
19
|
+
userStore.loginOnlyAC().then(() => {
|
|
20
|
+
//登录成功,加载业务
|
|
21
|
+
console.log("静默登录成功");
|
|
22
|
+
}).catch(() => {
|
|
23
|
+
isLoginPopup.value = true;
|
|
24
|
+
});
|
|
25
|
+
return { isLoginPopup };
|
|
26
|
+
},
|
|
27
|
+
methods: {
|
|
28
|
+
// 授权登录弹出层关闭
|
|
29
|
+
onLoginClose: function (visible) {
|
|
30
|
+
console.log(visible.detail);
|
|
31
|
+
this.isLoginPopup = visible.detail;
|
|
32
|
+
},
|
|
33
|
+
// 登录成功
|
|
34
|
+
loginSuccess: function (status) {
|
|
35
|
+
if (status.detail) {
|
|
36
|
+
// 登录成功,加载业务
|
|
37
|
+
console.log("登录成功");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style lang="scss">
|
|
45
|
+
.half-home-page {
|
|
46
|
+
padding: 40rpx;
|
|
47
|
+
text-align: center;
|
|
48
|
+
font-size: 32rpx;
|
|
49
|
+
color: #333;
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
52
|
+
|
|
53
|
+
<script type="application/json">
|
|
54
|
+
{
|
|
55
|
+
"usingComponents": {
|
|
56
|
+
"jmash-popup-login": "../components/core/jmash-popup-login.mpx"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
59
|
</script>
|