@cloudbase/lowcode-builder 1.8.41 → 1.8.43-alpha.0
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/dist/builder.web.js +11 -11
- package/lib/builder/config/index.d.ts +2 -2
- package/lib/builder/config/index.js +2 -2
- package/lib/builder/mp/index.js +1 -0
- package/lib/builder/mp/mp_config.js +1 -0
- package/lib/builder/mp/wxml.js +22 -0
- package/lib/builder.web.js +11 -11
- package/package.json +2 -2
- package/template/html/index.html.ejs +1 -1
- package/template/mp/common/info/index.js +14 -2
- package/template/mp/common/info/index.wxml +1 -0
- package/template/mp/common/info/index.wxss +2 -1
- package/template/mp/common/privacyModal/index.js +133 -0
- package/template/mp/common/privacyModal/index.json +10 -0
- package/template/mp/common/privacyModal/index.wxml +11 -0
- package/template/mp/common/privacyModal/index.wxss +5 -0
- package/template/mp/common/weapp-page.js +5 -1
- package/template/mp/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.43-alpha.0",
|
|
4
4
|
"description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
|
|
5
5
|
"author": "yhsunshining@gmail.com",
|
|
6
6
|
"homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@babel/core": "7.21.4",
|
|
43
43
|
"@babel/preset-env": "7.21.4",
|
|
44
|
-
"@cloudbase/cals": "^1.0.
|
|
44
|
+
"@cloudbase/cals": "^1.0.29",
|
|
45
45
|
"@cloudbase/lowcode-generator": "^1.8.14",
|
|
46
46
|
"axios": "^0.21.0",
|
|
47
47
|
"browserfs": "^1.4.3",
|
|
@@ -540,7 +540,7 @@
|
|
|
540
540
|
crossorigin
|
|
541
541
|
src="<%=
|
|
542
542
|
cdnEndpoints.cdngo
|
|
543
|
-
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.
|
|
543
|
+
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.2d2239ac89ba2c135587.bundle.js"
|
|
544
544
|
></script>
|
|
545
545
|
</body>
|
|
546
546
|
</html>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { redirectToLogin, findLoginPage } from '../util';
|
|
2
|
+
|
|
1
3
|
Component({
|
|
2
4
|
/**
|
|
3
5
|
* 组件的属性列表
|
|
4
6
|
*/
|
|
5
7
|
properties: {
|
|
6
8
|
type: String,
|
|
7
|
-
message: String
|
|
9
|
+
message: String,
|
|
10
|
+
toLogin: Boolean
|
|
8
11
|
},
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -19,10 +22,19 @@ Component({
|
|
|
19
22
|
* 组件的方法列表
|
|
20
23
|
*/
|
|
21
24
|
methods: {
|
|
22
|
-
|
|
25
|
+
login() {
|
|
26
|
+
if(this.data.toLogin) {
|
|
27
|
+
redirectToLogin()
|
|
28
|
+
} else {
|
|
29
|
+
getApp()?.app?.relaunchHome()
|
|
30
|
+
}
|
|
31
|
+
}
|
|
23
32
|
},
|
|
24
33
|
lifetimes: {
|
|
25
34
|
attached() {
|
|
35
|
+
this.setData({
|
|
36
|
+
toLogin: findLoginPage()
|
|
37
|
+
})
|
|
26
38
|
setTimeout(() => {
|
|
27
39
|
const data = {
|
|
28
40
|
visible: true
|
|
@@ -10,4 +10,5 @@
|
|
|
10
10
|
<view class="text" id="message">
|
|
11
11
|
{{message}}
|
|
12
12
|
</view>
|
|
13
|
+
<button wx:if="{{type == 'auth' && toLogin}}" style="margin-top: 10px; width: 200rpx;" variant="outline" type="default" size="mini" plain="true" bind:tap="login">{{toLogin?'登录':'刷新'}}</button>
|
|
13
14
|
</view>
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
display: flex;
|
|
16
16
|
justify-content: center;
|
|
17
17
|
text-align: center;
|
|
18
|
+
margin-top: -200rpx;
|
|
18
19
|
margin-bottom: 50rpx;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -41,4 +42,4 @@
|
|
|
41
42
|
@keyframes spCircRot {
|
|
42
43
|
from { transform: rotate(0deg); }
|
|
43
44
|
to { transform: rotate(359deg); }
|
|
44
|
-
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
let privacyHandler;
|
|
2
|
+
// let privacyResolves = new Set();
|
|
3
|
+
let closeOtherPagePopUpHooks = new Set();
|
|
4
|
+
|
|
5
|
+
const isSuportPrivacyApi = wx.onNeedPrivacyAuthorization && wx.requirePrivacyAuthorize && wx.openPrivacyContract;
|
|
6
|
+
|
|
7
|
+
if (wx.onNeedPrivacyAuthorization) {
|
|
8
|
+
wx.onNeedPrivacyAuthorization((resolve) => {
|
|
9
|
+
if (typeof privacyHandler === 'function') {
|
|
10
|
+
privacyHandler(resolve);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const closeOtherPagePopUp = (closePopUp) => {
|
|
16
|
+
closeOtherPagePopUpHooks.forEach((hook) => {
|
|
17
|
+
if (closePopUp !== hook) {
|
|
18
|
+
hook();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
Component({
|
|
24
|
+
/**
|
|
25
|
+
* 组件的属性列表
|
|
26
|
+
*/
|
|
27
|
+
properties: {},
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 组件的初始数据
|
|
31
|
+
*/
|
|
32
|
+
data: {
|
|
33
|
+
visible: false,
|
|
34
|
+
title: getApp().app.mpAppName || '用户隐私保护提示',
|
|
35
|
+
desc1: `在您使用 ${getApp().app.mpAppName || '本小程序'} 的后续服务之前,请仔细阅读并同意`,
|
|
36
|
+
urlTitle: '《用户隐私保护指引》。',
|
|
37
|
+
desc2: '如您拒绝,则指引中提及的相关功能使用将受限。',
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
lifetimes: {
|
|
41
|
+
created() {
|
|
42
|
+
this.resolvers = new Set();
|
|
43
|
+
},
|
|
44
|
+
attached: function () {
|
|
45
|
+
this.resolvers = new Set();
|
|
46
|
+
const closePopUp = () => {
|
|
47
|
+
this.close();
|
|
48
|
+
};
|
|
49
|
+
privacyHandler = (resolve) => {
|
|
50
|
+
this.resolvers.add(resolve);
|
|
51
|
+
this.show();
|
|
52
|
+
|
|
53
|
+
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
|
54
|
+
closeOtherPagePopUp(closePopUp);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
this.closePopUp = closePopUp;
|
|
58
|
+
closeOtherPagePopUpHooks.add(this.closePopUp);
|
|
59
|
+
},
|
|
60
|
+
detached: function () {
|
|
61
|
+
this.handleDisagree();
|
|
62
|
+
closeOtherPagePopUpHooks.delete(this.closePopUp);
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
pageLifetimes: {
|
|
67
|
+
show() {
|
|
68
|
+
if (this.closePopUp) {
|
|
69
|
+
privacyHandler = (resolve) => {
|
|
70
|
+
this.resolvers.add(resolve);
|
|
71
|
+
this.show();
|
|
72
|
+
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
|
|
73
|
+
closeOtherPagePopUp(this.closePopUp);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* 组件的方法列表
|
|
80
|
+
*/
|
|
81
|
+
methods: {
|
|
82
|
+
handleAgree(e) {
|
|
83
|
+
this.close();
|
|
84
|
+
// 这里演示了同时调用多个wx隐私接口时要如何处理:让隐私弹窗保持单例,点击一次同意按钮即可让所有pending中的wx隐私接口继续执行
|
|
85
|
+
this.resolvers.forEach((resolve) => {
|
|
86
|
+
resolve({
|
|
87
|
+
event: 'agree',
|
|
88
|
+
buttonId: 'agree-btn',
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
this.resolvers.clear();
|
|
92
|
+
},
|
|
93
|
+
handleDisagree() {
|
|
94
|
+
this.close();
|
|
95
|
+
this.resolvers.forEach((resolve) => {
|
|
96
|
+
resolve({
|
|
97
|
+
event: 'disagree',
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
this.resolvers.clear();
|
|
101
|
+
},
|
|
102
|
+
openPrivacyContract() {
|
|
103
|
+
return new Promise((resolve, reject) => {
|
|
104
|
+
if (wx.openPrivacyContract) {
|
|
105
|
+
wx.openPrivacyContract({
|
|
106
|
+
success: resolve,
|
|
107
|
+
fail: reject,
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
reject(new Error('wx.openPrivacyContract is not a function'));
|
|
111
|
+
}
|
|
112
|
+
}).catch((e) => {
|
|
113
|
+
// wx.previewImage({
|
|
114
|
+
// urls: ['https://img-operation.csdnimg.cn/csdn/silkroad/img/1693902370785.jpg']
|
|
115
|
+
// })
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
close() {
|
|
119
|
+
if (this.data.visible) {
|
|
120
|
+
this.setData({
|
|
121
|
+
visible: false,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
show() {
|
|
126
|
+
if (this.data.visible === false) {
|
|
127
|
+
this.setData({
|
|
128
|
+
visible: true,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": true,
|
|
3
|
+
"styleIsolation": "shared",
|
|
4
|
+
"usingComponents": {
|
|
5
|
+
"modal": "/materials/gsd-h5-react/components/wd-modal/index",
|
|
6
|
+
"text": "/materials/gsd-h5-react/components/wd-text/index",
|
|
7
|
+
"icon": "/materials/gsd-h5-react/components/wd-icon/index",
|
|
8
|
+
"wd-button": "/materials/gsd-h5-react/components/wd-button/index"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<modal defaultShow="{{visible}}" closeType="{{[]}}">
|
|
2
|
+
<text level="title-6" text="{{title}}" slot="headerSlot">{{title}}</text>
|
|
3
|
+
<icon style="color: rgba(0, 0, 0, 0.6);" name="td:close" size="md" bind:tap="handleDisagree" slot="headerSlot"/>
|
|
4
|
+
|
|
5
|
+
<text style="display:inline;" level="body-default" text="{{desc1}}" slot="contentSlot" />
|
|
6
|
+
<text style="display:inline;color: var(--wd-color-brand)" level="body-default" text="{{urlTitle}}" slot="contentSlot" bindtap="openPrivacyContract" />
|
|
7
|
+
<text style="display:inline;" level="body-default" text="{{desc2}}" slot="contentSlot" />
|
|
8
|
+
|
|
9
|
+
<wd-button text="取消" slot="footerSlot" theme="secondary" variant="outline" size="md" bindtap="handleDisagree"/>
|
|
10
|
+
<button class="wd-btn wd-btn--primary wd-btn--base wd-btn--md wd-mp-btn" id="agree-btn" theme="primary" variant="base" size="md" open-type="agreePrivacyAuthorization" bindtap="close" bindagreeprivacyauthorization="handleAgree" slot="footerSlot">同意</button>
|
|
11
|
+
</modal>
|
|
@@ -100,7 +100,7 @@ export function createPage({
|
|
|
100
100
|
...createInitData(widgetProps, dataBinds),
|
|
101
101
|
_isCheckingAtuh: false,
|
|
102
102
|
_expiredMessage: '',
|
|
103
|
-
weDaHasLogin:
|
|
103
|
+
weDaHasLogin: null,
|
|
104
104
|
},
|
|
105
105
|
lifetimes: {
|
|
106
106
|
attached() {
|
|
@@ -172,6 +172,10 @@ export function createPage({
|
|
|
172
172
|
weDaHasLogin: true,
|
|
173
173
|
});
|
|
174
174
|
createStateDataSourceVar($page.uuid, generateParamsParser({ app, $page, $w: $page.__internal__?.$w }));
|
|
175
|
+
}else {
|
|
176
|
+
this.setData({
|
|
177
|
+
weDaHasLogin: false,
|
|
178
|
+
});
|
|
175
179
|
}
|
|
176
180
|
} finally {
|
|
177
181
|
this.setData({ _isCheckingAtuh: false });
|
package/template/mp/package.json
CHANGED