diff --git a/cloudfunctions/getServerDataDemo/package.json b/cloudfunctions/getServerDataDemo/package.json
index d282a69e..d6aeb330 100644
--- a/cloudfunctions/getServerDataDemo/package.json
+++ b/cloudfunctions/getServerDataDemo/package.json
@@ -11,4 +11,4 @@
"dependencies": {
"wx-server-sdk": "latest"
}
-}
\ No newline at end of file
+}
diff --git a/cloudfunctions/getTempFileURL/package.json b/cloudfunctions/getTempFileURL/package.json
index 873cd0a4..a22375aa 100644
--- a/cloudfunctions/getTempFileURL/package.json
+++ b/cloudfunctions/getTempFileURL/package.json
@@ -11,4 +11,4 @@
"dependencies": {
"wx-server-sdk": "latest"
}
-}
\ No newline at end of file
+}
diff --git a/cloudfunctions/wxContext/package.json b/cloudfunctions/wxContext/package.json
index dc469ea0..c53d307f 100644
--- a/cloudfunctions/wxContext/package.json
+++ b/cloudfunctions/wxContext/package.json
@@ -11,4 +11,4 @@
"dependencies": {
"wx-server-sdk": "latest"
}
-}
\ No newline at end of file
+}
diff --git a/miniprogram/app-darkmode.json b/miniprogram/app-darkmode.json
new file mode 100644
index 00000000..c7fc7815
--- /dev/null
+++ b/miniprogram/app-darkmode.json
@@ -0,0 +1,39 @@
+{
+ "window": {
+ "navigationBarTextStyle": "white",
+ "navigationBarBackgroundColor": "#191919",
+ "backgroundColor": "#191919"
+ },
+ "tabBar": {
+ "color": "#FCFCFC",
+ "selectedColor": "#51A937",
+ "borderStyle": "white",
+ "backgroundColor": "#191919",
+ "list": [
+ {
+ "pagePath": "page/component/index",
+ "iconPath": "image/icon_component_HL.png",
+ "selectedIconPath": "image/icon_component_dark.png",
+ "text": "组件"
+ },
+ {
+ "pagePath": "page/weui/example/index",
+ "iconPath": "image/icon_component_HL.png",
+ "selectedIconPath": "image/icon_component_dark.png",
+ "text": "扩展能力"
+ },
+ {
+ "pagePath": "page/API/index",
+ "iconPath": "image/icon_API_HL.png",
+ "selectedIconPath": "image/icon_API_dark.png",
+ "text": "接口"
+ },
+ {
+ "pagePath": "page/cloud/index",
+ "iconPath": "image/icon_cloud_HL.png",
+ "selectedIconPath": "image/icon_cloud_dark.png",
+ "text": "云开发"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/miniprogram/app.js b/miniprogram/app.js
index 5d761e83..d3963b2b 100644
--- a/miniprogram/app.js
+++ b/miniprogram/app.js
@@ -1,9 +1,41 @@
const config = require('./config')
-
+const themeListeners = []
global.isDemo = true
App({
- onLaunch(opts) {
+
+ onLaunch(opts, data) {
+ const that = this;
+ const canIUseSetBackgroundFetchToken = wx.canIUse('setBackgroundFetchToken')
+ if (canIUseSetBackgroundFetchToken) {
+ wx.setBackgroundFetchToken({
+ token: 'getBackgroundFetchToken',
+ })
+ }
+ if (wx.getBackgroundFetchData) {
+ wx.getBackgroundFetchData({
+ fetchType: 'pre',
+ success(res) {
+ that.globalData.backgroundFetchData = res;
+ console.log('读取预拉取数据成功')
+ },
+ fail() {
+ console.log('读取预拉取数据失败')
+ wx.showToast({
+ title: '无缓存数据',
+ icon: 'none'
+ })
+ },
+ complete() {
+ console.log('结束读取')
+ }
+ })
+ }
console.log('App Launch', opts)
+ if (data && data.path) {
+ wx.navigateTo({
+ url: data.path,
+ })
+ }
if (!wx.cloud) {
console.error('请使用 2.2.3 或以上的基础库以使用云能力')
} else {
@@ -13,15 +45,36 @@ App({
})
}
},
+
+
onShow(opts) {
console.log('App Show', opts)
},
onHide() {
console.log('App Hide')
},
+ onThemeChange({ theme }) {
+ this.globalData.theme = theme
+ themeListeners.forEach((listener) => {
+ listener(theme)
+ })
+ },
+ watchThemeChange(listener) {
+ if (themeListeners.indexOf(listener) < 0) {
+ themeListeners.push(listener)
+ }
+ },
+ unWatchThemeChange(listener) {
+ const index = themeListeners.indexOf(listener)
+ if (index > -1) {
+ themeListeners.splice(index, 1)
+ }
+ },
globalData: {
+ theme: wx.getSystemInfoSync().theme,
hasLogin: false,
- openid: null
+ openid: null,
+ iconTabbar: '/page/weui/example/images/icon_tabbar.png',
},
// lazy loading openid
getUserOpenId(callback) {
@@ -32,17 +85,17 @@ App({
} else {
wx.login({
success(data) {
- wx.request({
- url: config.openIdUrl,
+ wx.cloud.callFunction({
+ name: 'login',
data: {
- code: data.code
+ action: 'openid'
},
- success(res) {
+ success: res => {
console.log('拉取openid成功', res)
- self.globalData.openid = res.data.openid
+ self.globalData.openid = res.result.openid
callback(null, self.globalData.openid)
},
- fail(res) {
+ fail: err => {
console.log('拉取用户openid失败,将无法正常使用开放接口等服务', res)
callback(res)
}
diff --git a/miniprogram/app.json b/miniprogram/app.json
index b423578e..a98b7be4 100644
--- a/miniprogram/app.json
+++ b/miniprogram/app.json
@@ -21,7 +21,6 @@
"page/component/pages/navigator/navigate",
"page/component/pages/navigator/redirect",
"page/component/pages/image/image",
- "page/component/pages/audio/audio",
"page/component/pages/video/video",
"page/component/pages/map/map",
"page/component/pages/canvas/canvas",
@@ -29,84 +28,18 @@
"page/component/pages/movable-view/movable-view",
"page/component/pages/cover-view/cover-view",
"page/component/pages/rich-text/rich-text",
- "page/API/index",
- "page/API/pages/login/login",
- "page/API/pages/get-user-info/get-user-info",
- "page/API/pages/request-payment/request-payment",
- "page/API/pages/share/share",
- "page/API/pages/share-button/share-button",
- "page/API/pages/custom-message/custom-message",
- "page/API/pages/template-message/template-message",
- "page/API/pages/set-navigation-bar-title/set-navigation-bar-title",
- "page/API/pages/navigation-bar-loading/navigation-bar-loading",
- "page/API/pages/navigator/navigator",
- "page/API/pages/pull-down-refresh/pull-down-refresh",
- "page/API/pages/animation/animation",
- "page/API/pages/action-sheet/action-sheet",
- "page/API/pages/modal/modal",
- "page/API/pages/toast/toast",
- "page/API/pages/get-network-type/get-network-type",
- "page/API/pages/on-network-status-change/on-network-status-change",
- "page/API/pages/get-system-info/get-system-info",
- "page/API/pages/on-compass-change/on-compass-change",
- "page/API/pages/make-phone-call/make-phone-call",
- "page/API/pages/scan-code/scan-code",
- "page/API/pages/request/request",
- "page/API/pages/web-socket/web-socket",
- "page/API/pages/upload-file/upload-file",
- "page/API/pages/download-file/download-file",
- "page/API/pages/image/image",
- "page/API/pages/voice/voice",
- "page/API/pages/file/file",
- "page/API/pages/on-accelerometer-change/on-accelerometer-change",
- "page/API/pages/canvas/canvas",
- "page/API/pages/background-audio/background-audio",
- "page/API/pages/video/video",
- "page/API/pages/get-location/get-location",
- "page/API/pages/open-location/open-location",
- "page/API/pages/choose-location/choose-location",
- "page/API/pages/storage/storage",
"page/component/pages/picker-view/picker-view",
"page/component/pages/camera/camera",
"page/component/pages/camera-scan-code/camera-scan-code",
- "page/API/pages/get-wxml-node-info/get-wxml-node-info",
- "page/component/pages/open-data/open-data",
- "page/component/pages/web-view/web-view",
- "page/API/pages/load-font-face/load-font-face",
- "page/API/pages/clipboard-data/clipboard-data",
- "page/API/pages/bluetooth/bluetooth",
- "page/API/pages/screen-brightness/screen-brightness",
- "page/API/pages/vibrate/vibrate",
- "page/API/pages/add-contact/add-contact",
- "page/API/pages/wifi/wifi",
- "page/API/pages/page-scroll/page-scroll",
- "page/API/pages/intersection-observer/intersection-observer",
- "page/API/pages/capture-screen/capture-screen",
- "page/API/pages/worker/worker",
- "page/API/pages/ibeacon/ibeacon",
- "page/API/pages/choose-address/choose-address",
- "page/API/pages/setting/setting",
- "page/API/pages/choose-invoice-title/choose-invoice-title",
- "page/API/pages/soter-authentication/soter-authentication",
"page/component/pages/map-styles/map-styles",
+ "page/component/pages/live-player/live-player",
+ "page/component/pages/live-pusher/live-pusher",
+ "page/component/pages/aria-component/aria-component",
+ "page/API/index",
"page/cloud/index",
- "page/cloud/pages/user-authentication/user-authentication",
- "page/cloud/pages/get-wx-context/get-wx-context",
- "page/cloud/pages/upload-file/upload-file",
- "page/cloud/pages/download-file/download-file",
- "page/cloud/pages/get-temp-file-url/get-temp-file-url",
- "page/cloud/pages/delete-file/delete-file",
- "page/cloud/pages/cloud-file-component/cloud-file-component",
- "page/cloud/pages/crud/crud",
- "page/cloud/pages/crud-detail/crud-detail",
- "page/cloud/pages/db-permission/db-permission",
- "page/cloud/pages/server-date/server-date",
- "page/cloud/pages/scf-database/scf-database",
- "page/cloud/pages/scf-storage/scf-storage",
- "page/cloud/pages/scf-openapi/scf-openapi",
"page/component/pages/doc-web-view/doc-web-view",
- "page/API/pages/doc-web-view/doc-web-view",
- "page/cloud/pages/doc-web-view/doc-web-view",
+ "page/component/pages/open-data/open-data",
+ "page/component/pages/web-view/web-view",
"page/component/pages/editor/editor",
"page/weui/example/index",
"page/weui/example/cell/cell",
@@ -135,42 +68,158 @@
"page/weui/example/icons/icons",
"page/weui/example/form-page/form-page",
"page/weui/example/half-screen-dialog/half-screen-dialog",
- "page/weui/example/actionsheet/actionsheet"
+ "page/weui/example/actionsheet/actionsheet",
+ "page/weui/example/toptips/toptips",
+ "page/weui/example/searchbar/searchbar",
+ "page/weui/example/emoji/emoji",
+ "page/weui/example/video-swiper/video-swiper",
+ "page/weui/example/index-list/index-list",
+ "page/weui/example/recycle-view/recycle-view",
+ "page/weui/example/sticky/sticky",
+ "page/weui/example/tabs/tabs",
+ "page/weui/example/vtabs/vtabs",
+ "page/weui/example/select-text/select-text",
+ "page/weui/example/barrage/barrage",
+ "page/weui/example/wxml-to-canvas/wxml-to-canvas"
+ ],
+ "subpackages": [
+ {
+ "root": "packageAPI",
+ "pages": [
+ "pages/login/login",
+ "pages/get-user-info/get-user-info",
+ "pages/request-payment/request-payment",
+ "pages/share/share",
+ "pages/share-button/share-button",
+ "pages/custom-message/custom-message",
+ "pages/template-message/template-message",
+ "pages/set-navigation-bar-title/set-navigation-bar-title",
+ "pages/navigation-bar-loading/navigation-bar-loading",
+ "pages/navigator/navigator",
+ "pages/pull-down-refresh/pull-down-refresh",
+ "pages/animation/animation",
+ "pages/action-sheet/action-sheet",
+ "pages/modal/modal",
+ "pages/toast/toast",
+ "pages/get-network-type/get-network-type",
+ "pages/on-network-status-change/on-network-status-change",
+ "pages/get-system-info/get-system-info",
+ "pages/on-compass-change/on-compass-change",
+ "pages/make-phone-call/make-phone-call",
+ "pages/scan-code/scan-code",
+ "pages/request/request",
+ "pages/web-socket/web-socket",
+ "pages/upload-file/upload-file",
+ "pages/download-file/download-file",
+ "pages/image/image",
+ "pages/voice/voice",
+ "pages/file/file",
+ "pages/on-accelerometer-change/on-accelerometer-change",
+ "pages/canvas/canvas",
+ "pages/background-audio/background-audio",
+ "pages/video/video",
+ "pages/get-location/get-location",
+ "pages/open-location/open-location",
+ "pages/choose-location/choose-location",
+ "pages/storage/storage",
+ "pages/get-wxml-node-info/get-wxml-node-info",
+ "pages/load-font-face/load-font-face",
+ "pages/clipboard-data/clipboard-data",
+ "pages/bluetooth/bluetooth",
+ "pages/screen-brightness/screen-brightness",
+ "pages/vibrate/vibrate",
+ "pages/add-contact/add-contact",
+ "pages/wifi/wifi",
+ "pages/page-scroll/page-scroll",
+ "pages/intersection-observer/intersection-observer",
+ "pages/capture-screen/capture-screen",
+ "pages/worker/worker",
+ "pages/ibeacon/ibeacon",
+ "pages/choose-address/choose-address",
+ "pages/setting/setting",
+ "pages/choose-invoice-title/choose-invoice-title",
+ "pages/soter-authentication/soter-authentication",
+ "pages/subscribe-message/subscribe-message",
+ "pages/doc-web-view/doc-web-view",
+ "pages/audio/audio",
+ "pages/get-battery-info/get-battery-info",
+ "pages/get-performance/get-performance",
+ "pages/mdns/mdns",
+ "pages/udp-socket/udp-socket",
+ "pages/two-way-bindings/two-way-bindings",
+ "pages/media-container/media-container",
+ "pages/get-background-fetch-data/get-background-fetch-data",
+ "pages/get-background-prefetch-data/get-background-prefetch-data",
+ "pages/wxs/wxs",
+ "pages/bluetooth/slave/slave",
+ "pages/resizable/resizable",
+ "pages/wxs/movable",
+ "pages/wxs/sidebar",
+ "pages/wxs/stick-top",
+ "pages/wxs/nearby"
+ ]
+ },
+ {
+ "root": "packageCloud",
+ "pages": [
+ "pages/doc-web-view/doc-web-view",
+ "pages/user-authentication/user-authentication",
+ "pages/get-wx-context/get-wx-context",
+ "pages/upload-file/upload-file",
+ "pages/download-file/download-file",
+ "pages/get-temp-file-url/get-temp-file-url",
+ "pages/delete-file/delete-file",
+ "pages/cloud-file-component/cloud-file-component",
+ "pages/crud/crud",
+ "pages/crud-detail/crud-detail",
+ "pages/db-permission/db-permission",
+ "pages/server-date/server-date",
+ "pages/scf-database/scf-database",
+ "pages/scf-storage/scf-storage",
+ "pages/scf-openapi/scf-openapi"
+ ]
+ }
],
+ "preloadRule": {
+ "page/component/index": {
+ "network": "all",
+ "packages": ["packageAPI", "packageCloud"]
+ }
+ },
"window": {
- "navigationBarTextStyle": "black",
+ "navigationBarTextStyle": "@navigationBarTextStyle",
"navigationBarTitleText": "演示",
- "navigationBarBackgroundColor": "#F8F8F8",
- "backgroundColor": "#F8F8F8"
+ "navigationBarBackgroundColor": "@navigationBarBackgroundColor",
+ "backgroundColor": "@backgroundColor"
},
"tabBar": {
- "color": "#7A7E83",
- "selectedColor": "#3cc51f",
- "borderStyle": "black",
- "backgroundColor": "#ffffff",
+ "color": "@tabBarColor",
+ "selectedColor": "@tabBarSelectedColor",
+ "borderStyle": "@tabBarBorderStyle",
+ "backgroundColor": "@tabBarBackgroundColor",
"list": [
{
"pagePath": "page/component/index",
- "iconPath": "image/icon_component.png",
- "selectedIconPath": "image/icon_component_HL.png",
+ "iconPath": "@iconPathComponent",
+ "selectedIconPath": "@selectedIconPathComponent",
"text": "组件"
},
{
"pagePath": "page/weui/example/index",
- "iconPath": "image/icon_component.png",
- "selectedIconPath": "image/icon_component_HL.png",
- "text": "扩展组件"
+ "iconPath": "@iconPathComponent",
+ "selectedIconPath": "@selectedIconPathComponent",
+ "text": "扩展能力"
},
{
"pagePath": "page/API/index",
- "iconPath": "image/icon_API.png",
- "selectedIconPath": "image/icon_API_HL.png",
+ "iconPath": "@iconPathAPI",
+ "selectedIconPath": "@selectedIconPathAPI",
"text": "接口"
},
{
"pagePath": "page/cloud/index",
- "iconPath": "image/icon_cloud.png",
- "selectedIconPath": "image/icon_cloud_HL.png",
+ "iconPath": "@iconPathCloud",
+ "selectedIconPath": "@selectedIconPathCloud",
"text": "云开发"
}
]
@@ -193,5 +242,7 @@
}
},
"cloud": true,
- "sitemapLocation": "sitemap.json"
+ "sitemapLocation": "sitemap.json",
+ "themeLocation": "demo.theme.json",
+ "darkmode": true
}
\ No newline at end of file
diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss
index f6ae693b..6d4f5cbe 100644
--- a/miniprogram/app.wxss
+++ b/miniprogram/app.wxss
@@ -1,9 +1,13 @@
+@import "./page/common/lib/weui.wxss";
+
+
/* reset */
page {
- background-color: #F8F8F8;
+ background-color: var(--weui-BG-1);
height: 100%;
font-size: 32rpx;
line-height: 1.6;
+ color: var(--weui-FG-0);
}
checkbox, radio{
margin-right: 10rpx;
@@ -40,21 +44,20 @@ input {
padding: 60rpx 50rpx 80rpx;
text-align: center;
}
-.page-head-title{
+.page-head-title {
display: inline-block;
padding: 0 40rpx 20rpx 40rpx;
font-size: 32rpx;
- color: #BEBEBE;
}
.page-head-line{
margin: 0 auto;
width: 150rpx;
height: 2rpx;
- background-color: #D8D8D8;
+ background-color: var(--weui-FG-1);
}
.page-head-desc{
padding-top: 20rpx;
- color: #9B9B9B;
+ color: var(--weui-FG-1);
font-size: 32rpx;
}
@@ -77,7 +80,7 @@ input {
display: flex;
flex-direction: column;
align-items: center;
- background-color: #fff;
+ background-color: var(--weui-BG-2);
width: 100%;
padding: 50rpx 0 150rpx 0;
}
@@ -88,16 +91,19 @@ input {
.page-body-text {
font-size: 30rpx;
line-height: 26px;
- color: #ccc;
+ color: var(--weui-FG-2);
}
.page-body-text-small {
font-size: 24rpx;
- color: #000;
+ color: var(--weui-FG-0);
margin-bottom: 100rpx;
}
.page-foot{
- margin: 100rpx 0 30rpx 0;
+ margin: 100rpx 0 0 0;
+ margin-bottom: constant(safe-area-inset-bottom);
+ margin-bottom: env(safe-area-inset-bottom);
+ padding-bottom: 30rpx;
text-align: center;
color: #1aad19;
font-size: 0;
@@ -129,7 +135,7 @@ input {
}
.page-section-title{
font-size: 28rpx;
- color: #999999;
+ color: var(--weui-FG-1);
margin-bottom: 10rpx;
padding-left: 30rpx;
padding-right: 30rpx;
@@ -153,21 +159,21 @@ input {
.image-plus {
width: 150rpx;
height: 150rpx;
- border: 2rpx solid #D9D9D9;
+ border: 2rpx solid var(--weui-FG-1);
position: relative;
}
.image-plus-nb{
border: 0;
}
.image-plus-text{
- color: #888888;
+ color: var(--weui-FG-2);
font-size: 28rpx;
}
.image-plus-horizontal {
position: absolute;
top: 50%;
left: 50%;
- background-color: #d9d9d9;
+ background-color: var(--weui-FG-1);
width: 4rpx;
height: 80rpx;
transform: translate(-50%, -50%);
@@ -176,7 +182,7 @@ input {
position: absolute;
top: 50%;
left: 50%;
- background-color: #d9d9d9;
+ background-color: var(--weui-FG-1);
width: 80rpx;
height: 4rpx;
transform: translate(-50%, -50%);
diff --git a/miniprogram/common/foot.wxml b/miniprogram/common/foot.wxml
new file mode 100644
index 00000000..2375957b
--- /dev/null
+++ b/miniprogram/common/foot.wxml
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/miniprogram/common/head.wxml b/miniprogram/common/head.wxml
new file mode 100644
index 00000000..73b26e6f
--- /dev/null
+++ b/miniprogram/common/head.wxml
@@ -0,0 +1,7 @@
+
+
+ {{title}}
+
+ {{desc}}
+
+
diff --git a/miniprogram/common/index.wxss b/miniprogram/common/index.wxss
new file mode 100644
index 00000000..6f840547
--- /dev/null
+++ b/miniprogram/common/index.wxss
@@ -0,0 +1,111 @@
+.index-hd {
+ padding: 80rpx;
+ text-align: center;
+}
+.index-bd {
+ padding: 0 30rpx 40rpx;
+}
+.index-ft {
+ padding-bottom: 20rpx;
+ text-align: center;
+}
+.index-logo {
+ width: 86rpx;
+ height: 86rpx;
+}
+.index-desc {
+ margin-top: 20rpx;
+ color: #888888;
+ font-size: 28rpx;
+}
+
+
+.navigator-box {
+ opacity: 0;
+ position: relative;
+ background-color: #FFFFFF;
+ line-height: 1.41176471;
+ font-size: 34rpx;
+
+ transform: translateY(-50%);
+ transition: .3s;
+}
+.navigator-box-show {
+ opacity: 1;
+ transform: translateY(0);
+}
+.navigator {
+ padding: 20rpx 30rpx;
+ position: relative;
+ display: flex;
+ align-items: center;
+}
+.navigator:before {
+ content: " ";
+ position: absolute;
+ left: 30rpx;
+ top: 0;
+ right: 30rpx;
+ height: 1px;
+ border-top: 1rpx solid #D8D8D8;
+ color: #D8D8D8;
+}
+.navigator:first-child:before {
+ display: none;
+}
+.navigator-text {
+ flex: 1;
+}
+.navigator-arrow {
+ padding-right: 26rpx;
+ position: relative;
+}
+.navigator-arrow:after {
+ content: " ";
+ display: inline-block;
+ height: 18rpx;
+ width: 18rpx;
+ border-width: 2rpx 2rpx 0 0;
+ border-color: #888888;
+ border-style: solid;
+ transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
+ position: absolute;
+ top: 50%;
+ margin-top: -8rpx;
+ right: 28rpx;
+}
+
+
+.kind-list-item {
+ margin: 20rpx 0;
+ background-color: #FFFFFF;
+ border-radius: 4rpx;
+ overflow: hidden;
+}
+.kind-list-item:first-child {
+ margin-top: 0;
+}
+.kind-list-text{
+ flex: 1;
+}
+.kind-list-img {
+ width: 60rpx;
+ height: 60rpx;
+}
+.kind-list-item-hd {
+ padding: 30rpx;
+ display: flex;
+ align-items: center;
+
+ transition: opacity .3s;
+}
+.kind-list-item-hd-show {
+ opacity: .2;
+}
+.kind-list-item-bd {
+ height: 0;
+ overflow: hidden;
+}
+.kind-list-item-bd-show {
+ height: auto;
+}
\ No newline at end of file
diff --git a/miniprogram/common/lib/weui.wxss b/miniprogram/common/lib/weui.wxss
new file mode 100644
index 00000000..e732bb4a
--- /dev/null
+++ b/miniprogram/common/lib/weui.wxss
@@ -0,0 +1,4393 @@
+/*!
+ * WeUI v2.3.0 (https://github.com/weui/weui-wxss)
+ * Copyright 2020 Tencent, Inc.
+ * Licensed under the MIT license
+ */
+[data-weui-theme=light],
+page {
+ --weui-BTN-DISABLED-FONT-COLOR: rgba(0, 0, 0, .2)
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BTN-DISABLED-FONT-COLOR: hsla(0, 0%, 100%, .2)
+ }
+}
+
+[data-weui-theme=light],
+page {
+ --weui-BTN-DEFAULT-BG: #f2f2f2
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BTN-DEFAULT-BG: hsla(0, 0%, 100%, .08)
+ }
+}
+
+[data-weui-theme=light],
+page {
+ --weui-BTN-DEFAULT-COLOR: #06ae56
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BTN-DEFAULT-COLOR: hsla(0, 0%, 100%, .8)
+ }
+}
+
+[data-weui-theme=light],
+page {
+ --weui-BTN-DEFAULT-ACTIVE-BG: #e6e6e6
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BTN-DEFAULT-ACTIVE-BG: hsla(0, 0%, 100%, .126)
+ }
+}
+
+[data-weui-theme=light],
+page {
+ --weui-DIALOG-LINE-COLOR: rgba(0, 0, 0, .1)
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-DIALOG-LINE-COLOR: hsla(0, 0%, 100%, .1)
+ }
+}
+
+page {
+ line-height: 1.6;
+ font-family: -apple-system-font, Helvetica Neue, sans-serif
+}
+
+icon {
+ vertical-align: middle
+}
+
+[data-weui-theme=light],
+page {
+ --weui-BG-0: #ededed;
+ --weui-BG-1: #f7f7f7;
+ --weui-BG-2: #fff;
+ --weui-BG-3: #f7f7f7;
+ --weui-BG-4: #4c4c4c;
+ --weui-BG-5: #fff;
+ --weui-FG-0: rgba(0, 0, 0, .9);
+ --weui-FG-HALF: rgba(0, 0, 0, .9);
+ --weui-FG-1: rgba(0, 0, 0, .5);
+ --weui-FG-2: rgba(0, 0, 0, .3);
+ --weui-FG-3: rgba(0, 0, 0, .1);
+ --weui-RED: #fa5151;
+ --weui-ORANGE: #fa9d3b;
+ --weui-YELLOW: #ffc300;
+ --weui-GREEN: #91d300;
+ --weui-LIGHTGREEN: #95ec69;
+ --weui-BRAND: #07c160;
+ --weui-BLUE: #10aeff;
+ --weui-INDIGO: #1485ee;
+ --weui-PURPLE: #6467f0;
+ --weui-WHITE: #fff;
+ --weui-LINK: #576b95;
+ --weui-TEXTGREEN: #06ae56;
+ --weui-FG: #000;
+ --weui-BG: #fff;
+ --weui-TAG-TEXT-ORANGE: #fa9d3b;
+ --weui-TAG-BACKGROUND-ORANGE: rgba(250, 157, 59, .1);
+ --weui-TAG-TEXT-GREEN: #06ae56;
+ --weui-TAG-BACKGROUND-GREEN: rgba(6, 174, 86, .1);
+ --weui-TAG-TEXT-BLUE: #10aeff;
+ --weui-TAG-BACKGROUND-BLUE: rgba(16, 174, 255, .1);
+ --weui-TAG-TEXT-BLACK: rgba(0, 0, 0, .5);
+ --weui-TAG-BACKGROUND-BLACK: rgba(0, 0, 0, .05)
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BG-0: #191919;
+ --weui-BG-1: #1f1f1f;
+ --weui-BG-2: #232323;
+ --weui-BG-3: #2f2f2f;
+ --weui-BG-4: #606060;
+ --weui-BG-5: #2c2c2c;
+ --weui-FG-0: hsla(0, 0%, 100%, .8);
+ --weui-FG-HALF: hsla(0, 0%, 100%, .6);
+ --weui-FG-1: hsla(0, 0%, 100%, .5);
+ --weui-FG-2: hsla(0, 0%, 100%, .3);
+ --weui-FG-3: hsla(0, 0%, 100%, .05);
+ --weui-RED: #fa5151;
+ --weui-ORANGE: #c87d2f;
+ --weui-YELLOW: #cc9c00;
+ --weui-GREEN: #74a800;
+ --weui-LIGHTGREEN: #28b561;
+ --weui-BRAND: #07c160;
+ --weui-BLUE: #10aeff;
+ --weui-INDIGO: #1196ff;
+ --weui-PURPLE: #8183ff;
+ --weui-WHITE: hsla(0, 0%, 100%, .8);
+ --weui-LINK: #7d90a9;
+ --weui-TEXTGREEN: #259c5c;
+ --weui-FG: #fff;
+ --weui-BG: #000;
+ --weui-TAG-TEXT-ORANGE: rgba(250, 157, 59, .6);
+ --weui-TAG-BACKGROUND-ORANGE: rgba(250, 157, 59, .1);
+ --weui-TAG-TEXT-GREEN: rgba(6, 174, 86, .6);
+ --weui-TAG-BACKGROUND-GREEN: rgba(6, 174, 86, .1);
+ --weui-TAG-TEXT-BLUE: rgba(16, 174, 255, .6);
+ --weui-TAG-BACKGROUND-BLUE: rgba(16, 174, 255, .1);
+ --weui-TAG-TEXT-BLACK: hsla(0, 0%, 100%, .5);
+ --weui-TAG-BACKGROUND-BLACK: hsla(0, 0%, 100%, .05)
+ }
+}
+
+[data-weui-theme=light],
+page {
+ --weui-BG-COLOR-ACTIVE: #ececec
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BG-COLOR-ACTIVE: #373737
+ }
+}
+
+[class*=" weui-icon-"],
+[class^=weui-icon-] {
+ display: inline-block;
+ vertical-align: middle;
+ width: 24px;
+ height: 24px;
+ -webkit-mask-position: 50% 50%;
+ mask-position: 50% 50%;
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-size: 100%;
+ mask-size: 100%;
+ background-color: currentColor
+}
+
+.weui-icon-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-download {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.25%2012.04l-1.72-1.72-1.06%201.06%202.828%202.83a1%201%200%20001.414-.001l2.828-2.828-1.06-1.061-1.73%201.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55%200%20.999.446.999.996v13.008a.998.998%200%2001-.996.996H4.996A.998.998%200%20014%2021.004V7.996A1%201%200%20014.999%207h6.251z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.25%2012.04l-1.72-1.72-1.06%201.06%202.828%202.83a1%201%200%20001.414-.001l2.828-2.828-1.06-1.061-1.73%201.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55%200%20.999.446.999.996v13.008a.998.998%200%2001-.996.996H4.996A.998.998%200%20014%2021.004V7.996A1%201%200%20014.999%207h6.251z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-info {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.75-12v7h1.5v-7h-1.5zM12%209a1%201%200%20100-2%201%201%200%20000%202z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.75-12v7h1.5v-7h-1.5zM12%209a1%201%200%20100-2%201%201%200%20000%202z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-safe-success {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.6C315.5%2046.7%20180.4%2093.1%2057.6%20132c0%20129.3.2%20231.7.2%20339.7%200%20304.2%20248.3%20471.6%20443.1%20523.7C695.7%20943.3%20944%20775.9%20944%20471.7c0-108%20.2-210.4.2-339.7C821.4%2093.1%20686.3%2046.7%20500.9%204.6zm248.3%20349.1l-299.7%20295c-2.1%202-5.3%202-7.4-.1L304.4%20506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3%205-2.8%207.2-1l112.2%2086c2.3%201.8%206%201.7%208.1-.1l274.7-228.9c2.2-1.8%205.7-1.7%207.7.3l17%2016.8c2.2%202.1%202.2%205.3.2%207.4z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23070202%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.6C315.5%2046.7%20180.4%2093.1%2057.6%20132c0%20129.3.2%20231.7.2%20339.7%200%20304.2%20248.3%20471.6%20443.1%20523.7C695.7%20943.3%20944%20775.9%20944%20471.7c0-108%20.2-210.4.2-339.7C821.4%2093.1%20686.3%2046.7%20500.9%204.6zm248.3%20349.1l-299.7%20295c-2.1%202-5.3%202-7.4-.1L304.4%20506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3%205-2.8%207.2-1l112.2%2086c2.3%201.8%206%201.7%208.1-.1l274.7-228.9c2.2-1.8%205.7-1.7%207.7.3l17%2016.8c2.2%202.1%202.2%205.3.2%207.4z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23070202%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-safe-warn {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.5c-185.4%2042-320.4%2088.4-443.2%20127.3%200%20129.3.2%20231.7.2%20339.6%200%20304.1%20248.2%20471.4%20443%20523.6%20194.7-52.2%20443-219.5%20443-523.6%200-107.9.2-210.3.2-339.6C821.3%2092.9%20686.2%2046.5%20500.9%204.5zm-26.1%20271.1h52.1c5.8%200%2010.3%204.7%2010.1%2010.4l-11.6%20313.8c-.1%202.8-2.5%205.2-5.4%205.2h-38.2c-2.9%200-5.3-2.3-5.4-5.2L464.8%20286c-.2-5.8%204.3-10.4%2010-10.4zm26.1%20448.3c-20.2%200-36.5-16.3-36.5-36.5s16.3-36.5%2036.5-36.5%2036.5%2016.3%2036.5%2036.5-16.4%2036.5-36.5%2036.5z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23020202%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.5c-185.4%2042-320.4%2088.4-443.2%20127.3%200%20129.3.2%20231.7.2%20339.6%200%20304.1%20248.2%20471.4%20443%20523.6%20194.7-52.2%20443-219.5%20443-523.6%200-107.9.2-210.3.2-339.6C821.3%2092.9%20686.2%2046.5%20500.9%204.5zm-26.1%20271.1h52.1c5.8%200%2010.3%204.7%2010.1%2010.4l-11.6%20313.8c-.1%202.8-2.5%205.2-5.4%205.2h-38.2c-2.9%200-5.3-2.3-5.4-5.2L464.8%20286c-.2-5.8%204.3-10.4%2010-10.4zm26.1%20448.3c-20.2%200-36.5-16.3-36.5-36.5s16.3-36.5%2036.5-36.5%2036.5%2016.3%2036.5%2036.5-16.4%2036.5-36.5%2036.5z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23020202%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-success {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-success-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm-1.172-6.242l5.809-5.808.848.849-5.95%205.95a1%201%200%2001-1.414%200L7%2012.426l.849-.849%202.98%202.98z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm-1.172-6.242l5.809-5.808.848.849-5.95%205.95a1%201%200%2001-1.414%200L7%2012.426l.849-.849%202.98%202.98z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-success-no-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-waiting {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.75%2011.38V6h-1.5v6l4.243%204.243%201.06-1.06-3.803-3.804zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.75%2011.38V6h-1.5v6l4.243%204.243%201.06-1.06-3.803-3.804zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-waiting-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.6%2011.503l3.891%203.891-.848.849L11.4%2012V6h1.2v5.503zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.6%2011.503l3.891%203.891-.848.849L11.4%2012V6h1.2v5.503zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-warn {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-info-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zM11.4%2010h1.2v7h-1.2v-7zm.6-1a1%201%200%20110-2%201%201%200%20010%202z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zM11.4%2010h1.2v7h-1.2v-7zm.6-1a1%201%200%20110-2%201%201%200%20010%202z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-cancel {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%20fill-rule%3D%22nonzero%22%2F%3E%3Cpath%20d%3D%22M12.849%2012l3.11%203.111-.848.849L12%2012.849l-3.111%203.11-.849-.848L11.151%2012l-3.11-3.111.848-.849L12%2011.151l3.111-3.11.849.848L12.849%2012z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%20fill-rule%3D%22nonzero%22%2F%3E%3Cpath%20d%3D%22M12.849%2012l3.11%203.111-.848.849L12%2012.849l-3.111%203.11-.849-.848L11.151%2012l-3.11-3.111.848-.849L12%2011.151l3.111-3.11.849.848L12.849%2012z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-search {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-clear {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.06%2012l3.006-3.005-1.06-1.06L12%2010.938%208.995%207.934l-1.06%201.06L10.938%2012l-3.005%203.005%201.06%201.06L12%2013.062l3.005%203.005%201.06-1.06L13.062%2012zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.06%2012l3.006-3.005-1.06-1.06L12%2010.938%208.995%207.934l-1.06%201.06L10.938%2012l-3.005%203.005%201.06%201.06L12%2013.062l3.005%203.005%201.06-1.06L13.062%2012zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-back {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm1.999-6.563L10.68%2012%2014%208.562%2012.953%207.5%209.29%2011.277a1.045%201.045%200%20000%201.446l3.663%203.777L14%2015.437z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm1.999-6.563L10.68%2012%2014%208.562%2012.953%207.5%209.29%2011.277a1.045%201.045%200%20000%201.446l3.663%203.777L14%2015.437z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-delete {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.774%206.4l.812%2013.648a.8.8%200%2000.798.752h7.232a.8.8%200%2000.798-.752L17.226%206.4H6.774zm11.655%200l-.817%2013.719A2%202%200%200115.616%2022H8.384a2%202%200%2001-1.996-1.881L5.571%206.4H3.5v-.7a.5.5%200%2001.5-.5h16a.5.5%200%2001.5.5v.7h-2.071zM14%203a.5.5%200%2001.5.5v.7h-5v-.7A.5.5%200%200110%203h4zM9.5%209h1.2l.5%209H10l-.5-9zm3.8%200h1.2l-.5%209h-1.2l.5-9z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.774%206.4l.812%2013.648a.8.8%200%2000.798.752h7.232a.8.8%200%2000.798-.752L17.226%206.4H6.774zm11.655%200l-.817%2013.719A2%202%200%200115.616%2022H8.384a2%202%200%2001-1.996-1.881L5.571%206.4H3.5v-.7a.5.5%200%2001.5-.5h16a.5.5%200%2001.5.5v.7h-2.071zM14%203a.5.5%200%2001.5.5v.7h-5v-.7A.5.5%200%200110%203h4zM9.5%209h1.2l.5%209H10l-.5-9zm3.8%200h1.2l-.5%209h-1.2l.5-9z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-success-no-circle-thin {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.864%2016.617l-5.303-5.303-1.061%201.06%205.657%205.657a1%201%200%20001.414%200L21.238%206.364l-1.06-1.06L8.864%2016.616z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.864%2016.617l-5.303-5.303-1.061%201.06%205.657%205.657a1%201%200%20001.414%200L21.238%206.364l-1.06-1.06L8.864%2016.616z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-arrow {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-arrow-bold {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2212%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.157%2012.711L4.5%2018.368l-1.414-1.414%204.95-4.95-4.95-4.95L4.5%205.64l5.657%205.657a1%201%200%20010%201.414z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2212%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.157%2012.711L4.5%2018.368l-1.414-1.414%204.95-4.95-4.95-4.95L4.5%205.64l5.657%205.657a1%201%200%20010%201.414z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-back-arrow {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.343%2012l7.071%207.071L9%2020.485l-7.778-7.778a1%201%200%20010-1.414L9%203.515l1.414%201.414L3.344%2012z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.343%2012l7.071%207.071L9%2020.485l-7.778-7.778a1%201%200%20010-1.414L9%203.515l1.414%201.414L3.344%2012z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-back-arrow-thin {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-close {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2010.586l5.657-5.657%201.414%201.414L13.414%2012l5.657%205.657-1.414%201.414L12%2013.414l-5.657%205.657-1.414-1.414L10.586%2012%204.929%206.343%206.343%204.93%2012%2010.586z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2010.586l5.657-5.657%201.414%201.414L13.414%2012l5.657%205.657-1.414%201.414L12%2013.414l-5.657%205.657-1.414-1.414L10.586%2012%204.929%206.343%206.343%204.93%2012%2010.586z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-close-thin {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-back-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm1.999-5.363L12.953%2016.5%209.29%2012.723a1.045%201.045%200%20010-1.446L12.953%207.5%2014%208.563%2010.68%2012%2014%2015.438z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm1.999-5.363L12.953%2016.5%209.29%2012.723a1.045%201.045%200%20010-1.446L12.953%207.5%2014%208.563%2010.68%2012%2014%2015.438z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-success {
+ color: var(--weui-BRAND)
+}
+
+.weui-icon-waiting {
+ color: var(--weui-BLUE)
+}
+
+.weui-icon-warn {
+ color: var(--weui-RED)
+}
+
+.weui-icon-info {
+ color: var(--weui-BLUE)
+}
+
+.weui-icon-success-circle,
+.weui-icon-success-no-circle,
+.weui-icon-success-no-circle-thin {
+ color: var(--weui-BRAND)
+}
+
+.weui-icon-waiting-circle {
+ color: var(--weui-BLUE)
+}
+
+.weui-icon-circle {
+ color: var(--weui-FG-2)
+}
+
+.weui-icon-download {
+ color: var(--weui-BRAND)
+}
+
+.weui-icon-info-circle {
+ color: var(--weui-FG-2)
+}
+
+.weui-icon-safe-success {
+ color: var(--weui-BRAND)
+}
+
+.weui-icon-safe-warn {
+ color: var(--weui-YELLOW)
+}
+
+.weui-icon-cancel {
+ color: var(--weui-RED)
+}
+
+.weui-icon-search {
+ color: var(--weui-FG-1)
+}
+
+.weui-icon-clear {
+ color: var(--weui-FG-2)
+}
+
+.weui-icon-clear:active {
+ color: var(--weui-FG-1)
+}
+
+.weui-icon-delete.weui-icon_gallery-delete {
+ color: var(--weui-WHITE)
+}
+
+.weui-icon-arrow,
+.weui-icon-arrow-bold,
+.weui-icon-back-arrow,
+.weui-icon-back-arrow-thin {
+ width: 12px
+}
+
+.weui-icon-arrow,
+.weui-icon-arrow-bold {
+ color: var(--weui-FG-2)
+}
+
+.weui-icon-back,
+.weui-icon-back-arrow,
+.weui-icon-back-arrow-thin,
+.weui-icon-back-circle {
+ color: var(--weui-FG-0)
+}
+
+.weui-icon_msg {
+ width: 64px;
+ height: 64px
+}
+
+.weui-icon_msg.weui-icon-warn {
+ color: var(--weui-RED)
+}
+
+.weui-icon_msg-primary {
+ width: 64px;
+ height: 64px
+}
+
+.weui-icon_msg-primary.weui-icon-warn {
+ color: var(--weui-YELLOW)
+}
+
+.weui-link {
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-link,
+.weui-link:visited {
+ color: var(--weui-LINK)
+}
+
+.weui-btn {
+ position: relative;
+ display: block;
+ width: 184px;
+ margin-left: auto;
+ margin-right: auto;
+ padding: 8px 24px;
+ box-sizing: border-box;
+ font-weight: 700;
+ font-size: 17px;
+ text-align: center;
+ text-decoration: none;
+ color: #fff;
+ line-height: 1.41176471;
+ border-radius: 4px;
+ overflow: hidden;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-btn_block {
+ width: auto
+}
+
+.weui-btn_inline {
+ display: inline-block
+}
+
+.weui-btn_default {
+ background-color: var(--weui-BTN-DEFAULT-BG)
+}
+
+.weui-btn_default,
+.weui-btn_default:not(.weui-btn_disabled):visited {
+ color: var(--weui-BTN-DEFAULT-COLOR)
+}
+
+.weui-btn_default:not(.weui-btn_disabled):active {
+ background-color: var(--weui-BTN-DEFAULT-ACTIVE-BG)
+}
+
+.weui-btn_primary {
+ background-color: var(--weui-BRAND)
+}
+
+.weui-btn_primary:not(.weui-btn_disabled):visited {
+ color: #fff
+}
+
+.weui-btn_primary:not(.weui-btn_disabled):active {
+ background-color: var(--weui-TAG-TEXT-GREEN)
+}
+
+.weui-btn_warn {
+ background-color: var(--weui-BTN-DEFAULT-BG)
+}
+
+.weui-btn_warn,
+.weui-btn_warn:not(.weui-btn_disabled):visited {
+ color: var(--weui-RED)
+}
+
+.weui-btn_warn:not(.weui-btn_disabled):active {
+ background-color: var(--weui-BTN-DEFAULT-ACTIVE-BG)
+}
+
+.weui-btn_disabled {
+ color: var(--weui-BTN-DISABLED-FONT-COLOR);
+ background-color: var(--weui-BTN-DEFAULT-BG)
+}
+
+.weui-btn_loading .weui-loading {
+ margin: -.2em .34em 0 0
+}
+
+.weui-btn_loading.weui-btn_primary {
+ background-color: var(--weui-TAG-TEXT-GREEN);
+ color: var(--weui-WHITE)
+}
+
+.weui-btn_loading.weui-btn_default,
+.weui-btn_loading.weui-btn_warn {
+ background-color: var(--weui-BTN-DEFAULT-ACTIVE-BG)
+}
+
+.weui-btn_cell {
+ position: relative;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ box-sizing: border-box;
+ font-size: 17px;
+ text-align: center;
+ text-decoration: none;
+ color: #fff;
+ line-height: 1.41176471;
+ padding: 16px;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ overflow: hidden;
+ background-color: var(--weui-BG-5)
+}
+
+.weui-btn_cell+.weui-btn_cell {
+ margin-top: 16px
+}
+
+.weui-btn_cell:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-btn_cell__icon {
+ display: inline-block;
+ vertical-align: middle;
+ width: 24px;
+ height: 24px;
+ margin: -.2em .34em 0 0
+}
+
+.weui-btn_cell-default {
+ color: var(--weui-FG-0)
+}
+
+.weui-btn_cell-primary {
+ color: var(--weui-LINK)
+}
+
+.weui-btn_cell-warn {
+ color: var(--weui-RED)
+}
+
+button.weui-btn,
+input.weui-btn {
+ border-width: 0;
+ outline: 0;
+ -webkit-appearance: none
+}
+
+button.weui-btn:focus,
+input.weui-btn:focus {
+ outline: 0
+}
+
+button.weui-btn_inline,
+button.weui-btn_mini,
+input.weui-btn_inline,
+input.weui-btn_mini {
+ width: auto
+}
+
+.weui-btn_mini {
+ display: inline-block;
+ width: auto;
+ padding: 0 .75em;
+ line-height: 2;
+ font-size: 16px
+}
+
+.weui-btn:not(.weui-btn_mini)+.weui-btn:not(.weui-btn_mini) {
+ margin-top: 16px
+}
+
+.weui-btn.weui-btn_inline+.weui-btn.weui-btn_inline {
+ margin-top: auto;
+ margin-left: 16px
+}
+
+.weui-btn-area {
+ margin: 48px 16px 8px
+}
+
+.weui-btn-area_inline {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex
+}
+
+.weui-btn-area_inline .weui-btn {
+ margin-top: auto;
+ margin-right: 16px;
+ width: 100%;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
+}
+
+.weui-btn-area_inline .weui-btn:last-child {
+ margin-right: 0
+}
+
+.weui-btn_reset {
+ background: transparent;
+ border: 0;
+ padding: 0;
+ outline: 0
+}
+
+.weui-btn_icon {
+ font-size: 0
+}
+
+.weui-btn_icon:active [class*=weui-icon-] {
+ color: var(--weui-FG-1)
+}
+
+.weui-cells {
+ margin-top: 8px;
+ background-color: var(--weui-BG-2);
+ line-height: 1.41176471;
+ font-size: 17px;
+ overflow: hidden;
+ position: relative
+}
+
+.weui-cells:before {
+ top: 0;
+ border-top: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-cells:after,
+.weui-cells:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ right: 0;
+ height: 1px;
+ color: var(--weui-FG-3);
+ z-index: 2
+}
+
+.weui-cells:after {
+ bottom: 0;
+ border-bottom: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-cells__title {
+ margin-top: 16px;
+ margin-bottom: 3px;
+ padding-left: 16px;
+ padding-right: 16px;
+ color: var(--weui-FG-1);
+ font-size: 14px;
+ line-height: 1.4
+}
+
+.weui-cells__title+.weui-cells {
+ margin-top: 0
+}
+
+.weui-cells__tips {
+ margin-top: 8px;
+ color: var(--weui-FG-1);
+ padding-left: 16px;
+ padding-right: 16px;
+ font-size: 14px;
+ line-height: 1.4
+}
+
+.weui-cells__tips a,
+.weui-cells__tips navigator {
+ color: var(--weui-LINK)
+}
+
+.weui-cells__tips navigator {
+ display: inline
+}
+
+.weui-cell {
+ padding: 16px;
+ position: relative;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-cell:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ height: 1px;
+ border-top: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5);
+ left: 16px;
+ z-index: 2
+}
+
+.weui-cell:first-child:before {
+ display: none
+}
+
+.weui-cell_active:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-cell_primary {
+ -webkit-box-align: start;
+ -webkit-align-items: flex-start;
+ align-items: flex-start
+}
+
+.weui-cell__bd {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
+}
+
+.weui-cell__ft {
+ text-align: right;
+ color: var(--weui-FG-1)
+}
+
+.weui-cell_swiped {
+ display: block;
+ padding: 0
+}
+
+.weui-cell_swiped>.weui-cell__bd {
+ position: relative;
+ z-index: 1;
+ background-color: var(--weui-BG-2)
+}
+
+.weui-cell_swiped>.weui-cell__ft {
+ position: absolute;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ color: #fff
+}
+
+.weui-swiped-btn {
+ display: block;
+ padding: 16px 1em;
+ line-height: 1.41176471;
+ color: inherit
+}
+
+.weui-swiped-btn_default {
+ background-color: var(--weui-BG-0)
+}
+
+.weui-swiped-btn_warn {
+ background-color: var(--weui-RED)
+}
+
+.weui-cell_access {
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ color: inherit
+}
+
+.weui-cell_access:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-cell_access .weui-cell__ft {
+ padding-right: 22px;
+ position: relative
+}
+
+.weui-cell_access .weui-cell__ft:after {
+ content: " ";
+ width: 12px;
+ height: 24px;
+ -webkit-mask-position: 0 0;
+ mask-position: 0 0;
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-size: 100%;
+ mask-size: 100%;
+ background-color: currentColor;
+ color: var(--weui-FG-2);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ position: absolute;
+ top: 50%;
+ right: 0;
+ margin-top: -12px
+}
+
+.weui-cell_link {
+ color: var(--weui-LINK);
+ font-size: 17px
+}
+
+.weui-cell_link:first-child:before {
+ display: block
+}
+
+.weui-check__label {
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-check__label:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-check {
+ position: absolute;
+ left: -9999px
+}
+
+.weui-cells_radio .weui-cell__ft {
+ padding-left: 16px;
+ font-size: 0
+}
+
+.weui-cells_radio .weui-check+.weui-icon-checked {
+ min-width: 16px;
+ color: transparent
+}
+
+.weui-cells_radio .weui-check:checked+.weui-icon-checked,
+.weui-cells_radio .weui-check[aria-checked=true]+.weui-icon-checked {
+ color: var(--weui-BRAND);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-cells_checkbox .weui-check__label:before {
+ left: 55px
+}
+
+.weui-cells_checkbox .weui-cell__hd {
+ padding-right: 16px;
+ font-size: 0
+}
+
+.weui-cells_checkbox .weui-icon-checked {
+ color: var(--weui-FG-2);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-cells_checkbox .weui-check:checked+.weui-icon-checked,
+.weui-cells_checkbox .weui-check[aria-checked=true]+.weui-icon-checked {
+ color: var(--weui-BRAND);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-label {
+ display: block;
+ width: 105px;
+ word-wrap: break-word;
+ word-break: break-all
+}
+
+.weui-input {
+ width: 100%;
+ border: 0;
+ outline: 0;
+ -webkit-appearance: none;
+ background-color: transparent;
+ font-size: inherit;
+ color: inherit;
+ height: 1.41176471em;
+ line-height: 1.41176471
+}
+
+.weui-input::-webkit-inner-spin-button,
+.weui-input::-webkit-outer-spin-button {
+ -webkit-appearance: none;
+ margin: 0
+}
+
+.weui-input:focus:not(:placeholder-shown)+.weui-btn_input-clear {
+ display: inline
+}
+
+.weui-input::-webkit-input-placeholder,
+.weui-input__placeholder {
+ color: var(--weui-FG-2)
+}
+
+.weui-input::placeholder,
+.weui-input__placeholder {
+ color: var(--weui-FG-2)
+}
+
+.weui-textarea {
+ display: block;
+ border: 0;
+ resize: none;
+ background: transparent;
+ width: 100%;
+ color: inherit;
+ font-size: 1em;
+ line-height: inherit;
+ outline: 0
+}
+
+.weui-textarea-counter {
+ color: var(--weui-FG-2);
+ text-align: right;
+ font-size: 14px
+}
+
+.weui-cell_warn .weui-textarea-counter {
+ color: var(--weui-RED)
+}
+
+.weui-cells_form .weui-cell_disabled:active,
+.weui-cells_form .weui-cell_readonly:active,
+.weui-cells_form .weui-cell_switch:active,
+.weui-cells_form .weui-cell_vcode:active {
+ background-color: transparent
+}
+
+.weui-cells_form .weui-cell__ft {
+ font-size: 0
+}
+
+.weui-cells_form .weui-icon-warn {
+ display: none
+}
+
+.weui-cells_form input,
+.weui-cells_form label[for],
+.weui-cells_form textarea {
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-cell_warn {
+ color: var(--weui-RED)
+}
+
+.weui-cell_warn .weui-icon-warn {
+ display: inline-block
+}
+
+.weui-cell_disabled .weui-input:disabled,
+.weui-cell_disabled .weui-textarea:disabled,
+.weui-cell_readonly .weui-input:disabled,
+.weui-cell_readonly .weui-textarea:disabled {
+ opacity: 1;
+ -webkit-text-fill-color: var(--weui-FG-1)
+}
+
+.weui-cell_disabled .weui-input[disabled],
+.weui-cell_disabled .weui-input[readonly],
+.weui-cell_disabled .weui-textarea[disabled],
+.weui-cell_disabled .weui-textarea[readonly],
+.weui-cell_readonly .weui-input[disabled],
+.weui-cell_readonly .weui-input[readonly],
+.weui-cell_readonly .weui-textarea[disabled],
+.weui-cell_readonly .weui-textarea[readonly] {
+ color: var(--weui-FG-1)
+}
+
+.weui-btn_input-clear {
+ display: none;
+ padding-left: 8px
+}
+
+.weui-btn_input-clear [class*=weui-icon-] {
+ width: 18px
+}
+
+.weui-form-preview {
+ position: relative;
+ background-color: var(--weui-BG-2)
+}
+
+.weui-form-preview:before {
+ top: 0;
+ border-top: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-form-preview:after,
+.weui-form-preview:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ right: 0;
+ height: 1px;
+ color: var(--weui-FG-3)
+}
+
+.weui-form-preview:after {
+ bottom: 0;
+ border-bottom: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-form-preview__hd {
+ position: relative;
+ padding: 16px;
+ text-align: right;
+ line-height: 2.5em
+}
+
+.weui-form-preview__hd:after {
+ content: " ";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ border-bottom: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5);
+ left: 16px
+}
+
+.weui-form-preview__hd .weui-form-preview__value {
+ font-style: normal;
+ font-size: 1.6em
+}
+
+.weui-form-preview__bd {
+ padding: 16px;
+ font-size: .9em;
+ text-align: right;
+ color: var(--weui-FG-1);
+ line-height: 2
+}
+
+.weui-form-preview__ft {
+ position: relative;
+ line-height: 50px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex
+}
+
+.weui-form-preview__ft:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ height: 1px;
+ border-top: 1px solid var(--weui-DIALOG-LINE-COLOR);
+ color: var(--weui-DIALOG-LINE-COLOR);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-form-preview__item {
+ overflow: hidden
+}
+
+.weui-form-preview__label {
+ float: left;
+ margin-right: 1em;
+ min-width: 4em;
+ color: var(--weui-FG-1);
+ text-align: justify;
+ text-align-last: justify
+}
+
+.weui-form-preview__value {
+ display: block;
+ overflow: hidden;
+ word-break: normal;
+ word-wrap: break-word;
+ color: var(--weui-FG-0)
+}
+
+.weui-form-preview__btn {
+ position: relative;
+ display: block;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ color: var(--weui-LINK);
+ text-align: center;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+button.weui-form-preview__btn {
+ background-color: transparent;
+ border: 0;
+ outline: 0;
+ line-height: inherit;
+ font-size: inherit
+}
+
+.weui-form-preview__btn:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-form-preview__btn:after {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid var(--weui-DIALOG-LINE-COLOR);
+ color: var(--weui-DIALOG-LINE-COLOR);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-form-preview__btn:first-child:after {
+ display: none
+}
+
+.weui-form-preview__btn_default {
+ color: var(--weui-FG-HALF)
+}
+
+.weui-form-preview__btn_primary {
+ color: var(--weui-LINK)
+}
+
+.weui-cell_select {
+ padding: 0
+}
+
+.weui-cell_select .weui-select {
+ padding-right: 30px
+}
+
+.weui-cell_select .weui-cell__bd:after {
+ content: " ";
+ width: 12px;
+ height: 24px;
+ -webkit-mask-position: 0 0;
+ mask-position: 0 0;
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-size: 100%;
+ mask-size: 100%;
+ background-color: currentColor;
+ color: var(--weui-FG-2);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ position: absolute;
+ top: 50%;
+ right: 16px;
+ margin-top: -12px
+}
+
+.weui-select {
+ -webkit-appearance: none;
+ border: 0;
+ outline: 0;
+ background-color: transparent;
+ width: 100%;
+ font-size: inherit;
+ height: 56px;
+ line-height: 56px;
+ position: relative;
+ z-index: 1;
+ padding-left: 16px;
+ color: var(--weui-FG-0)
+}
+
+.weui-cell_select-before {
+ padding-right: 16px
+}
+
+.weui-cell_select-before .weui-select {
+ width: 105px;
+ box-sizing: border-box
+}
+
+.weui-cell_select-before .weui-cell__hd {
+ position: relative
+}
+
+.weui-cell_select-before .weui-cell__hd:after {
+ content: " ";
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-right: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 100% 0;
+ transform-origin: 100% 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-cell_select-before .weui-cell__hd:before {
+ content: " ";
+ width: 12px;
+ height: 24px;
+ -webkit-mask-position: 0 0;
+ mask-position: 0 0;
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-size: 100%;
+ mask-size: 100%;
+ background-color: currentColor;
+ color: var(--weui-FG-2);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ position: absolute;
+ top: 50%;
+ right: 16px;
+ margin-top: -12px
+}
+
+.weui-cell_select-before .weui-cell__bd {
+ padding-left: 16px
+}
+
+.weui-cell_select-before .weui-cell__bd:after {
+ display: none
+}
+
+.weui-cell_select-before.weui-cell_access .weui-cell__hd {
+ line-height: 56px;
+ padding-left: 32px
+}
+
+.weui-cell_select-after {
+ padding-left: 16px
+}
+
+.weui-cell_select-after .weui-select {
+ padding-left: 0
+}
+
+.weui-cell_select-after.weui-cell_access .weui-cell__bd {
+ line-height: 56px
+}
+
+.weui-cell_vcode {
+ padding-top: 0;
+ padding-right: 0;
+ padding-bottom: 0
+}
+
+.weui-vcode-btn,
+.weui-vcode-img {
+ margin-left: 5px;
+ height: 56px;
+ vertical-align: middle
+}
+
+.weui-vcode-btn {
+ display: inline-block;
+ padding: 0 .6em 0 .7em;
+ line-height: 56px;
+ font-size: 17px;
+ color: var(--weui-LINK);
+ position: relative
+}
+
+.weui-vcode-btn:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+button.weui-vcode-btn {
+ background-color: transparent;
+ border: 0;
+ outline: 0
+}
+
+.weui-vcode-btn:active {
+ color: #767676
+}
+
+.weui-gallery {
+ display: none;
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ background-color: #000;
+ z-index: 1000
+}
+
+.weui-gallery__img,
+.weui-gallery__opr {
+ position: absolute;
+ left: 0;
+ left: constant(safe-area-inset-left);
+ left: env(safe-area-inset-left);
+ right: 0;
+ right: constant(safe-area-inset-right);
+ right: env(safe-area-inset-right)
+}
+
+.weui-gallery__img {
+ top: 0;
+ top: constant(safe-area-inset-top);
+ top: env(safe-area-inset-top);
+ bottom: 60px;
+ bottom: calc(60px + constant(safe-area-inset-bottom));
+ bottom: calc(60px + env(safe-area-inset-bottom));
+ background: 50% no-repeat;
+ background-size: contain
+}
+
+.weui-gallery__opr {
+ position: absolute;
+ bottom: 0;
+ padding-bottom: 0;
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
+ background-color: #0d0d0d;
+ color: var(--weui-WHITE);
+ line-height: 60px;
+ text-align: center
+}
+
+.weui-gallery__del {
+ display: block
+}
+
+.weui-cell_switch {
+ padding-top: 12px;
+ padding-bottom: 12px
+}
+
+.weui-switch {
+ -webkit-appearance: none;
+ appearance: none
+}
+
+.weui-switch,
+.weui-switch-cp__box {
+ position: relative;
+ width: 52px;
+ height: 32px;
+ border: 2px solid var(--weui-FG-3);
+ outline: 0;
+ border-radius: 16px;
+ box-sizing: border-box;
+ -webkit-transition: background-color .1s, border .1s;
+ transition: background-color .1s, border .1s
+}
+
+.weui-switch-cp__box:before,
+.weui-switch:before {
+ content: " ";
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ border-radius: 15px;
+ background-color: var(--weui-BG-3);
+ -webkit-transition: -webkit-transform .35s cubic-bezier(.45, 1, .4, 1);
+ transition: -webkit-transform .35s cubic-bezier(.45, 1, .4, 1);
+ transition: transform .35s cubic-bezier(.45, 1, .4, 1);
+ transition: transform .35s cubic-bezier(.45, 1, .4, 1), -webkit-transform .35s cubic-bezier(.45, 1, .4, 1)
+}
+
+.weui-switch-cp__box:after,
+.weui-switch:after {
+ content: " ";
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 28px;
+ height: 28px;
+ border-radius: 15px;
+ background-color: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
+ -webkit-transition: -webkit-transform .35s cubic-bezier(.4, .4, .25, 1.35);
+ transition: -webkit-transform .35s cubic-bezier(.4, .4, .25, 1.35);
+ transition: transform .35s cubic-bezier(.4, .4, .25, 1.35);
+ transition: transform .35s cubic-bezier(.4, .4, .25, 1.35), -webkit-transform .35s cubic-bezier(.4, .4, .25, 1.35)
+}
+
+.weui-switch-cp__input:checked+.weui-switch-cp__box,
+.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box,
+.weui-switch:checked {
+ border-color: var(--weui-BRAND);
+ background-color: var(--weui-BRAND)
+}
+
+.weui-switch-cp__input:checked+.weui-switch-cp__box:before,
+.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box:before,
+.weui-switch:checked:before {
+ -webkit-transform: scale(0);
+ transform: scale(0)
+}
+
+.weui-switch-cp__input:checked+.weui-switch-cp__box:after,
+.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box:after,
+.weui-switch:checked:after {
+ -webkit-transform: translateX(20px);
+ transform: translateX(20px)
+}
+
+.weui-switch-cp__input {
+ position: absolute;
+ left: -9999px
+}
+
+.weui-switch-cp__box {
+ display: block
+}
+
+.weui-uploader {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
+}
+
+.weui-uploader__hd {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ padding-bottom: 16px;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-uploader__title {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
+}
+
+.weui-uploader__info {
+ color: var(--weui-FG-2)
+}
+
+.weui-uploader__bd {
+ margin-bottom: -8px;
+ margin-right: -8px;
+ overflow: hidden
+}
+
+.weui-uploader__files {
+ list-style: none
+}
+
+.weui-uploader__file {
+ float: left;
+ margin-right: 8px;
+ margin-bottom: 8px;
+ width: 96px;
+ height: 96px;
+ background: no-repeat 50%;
+ background-size: cover
+}
+
+.weui-uploader__file_status {
+ position: relative
+}
+
+.weui-uploader__file_status:before {
+ content: " ";
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ background-color: rgba(0, 0, 0, .5)
+}
+
+.weui-uploader__file_status .weui-uploader__file-content {
+ display: block
+}
+
+.weui-uploader__file-content {
+ display: none;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ -webkit-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+ color: var(--weui-WHITE)
+}
+
+.weui-uploader__file-content .weui-icon-warn {
+ display: inline-block
+}
+
+.weui-uploader__input-box {
+ float: left;
+ position: relative;
+ margin-right: 8px;
+ margin-bottom: 8px;
+ width: 96px;
+ height: 96px;
+ box-sizing: border-box;
+ background-color: #ededed
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-uploader__input-box {
+ background-color: #2e2e2e
+ }
+}
+
+.weui-uploader__input-box:after,
+.weui-uploader__input-box:before {
+ content: " ";
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ -webkit-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+ background-color: #a3a3a3
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-uploader__input-box:after,
+ .weui-uploader__input-box:before {
+ background-color: #6d6d6d
+ }
+}
+
+.weui-uploader__input-box:before {
+ width: 2px;
+ height: 32px
+}
+
+.weui-uploader__input-box:after {
+ width: 32px;
+ height: 2px
+}
+
+.weui-uploader__input-box:active:after,
+.weui-uploader__input-box:active:before {
+ opacity: .7
+}
+
+.weui-uploader__input {
+ position: absolute;
+ z-index: 1;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-msg {
+ padding-top: 48px;
+ padding: calc(48px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);
+ padding: calc(48px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
+ text-align: center;
+ line-height: 1.4;
+ min-height: 100%;
+ box-sizing: border-box;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ background-color: var(--weui-BG-2)
+}
+
+.weui-msg a:not(.weui-btn) {
+ color: var(--weui-LINK);
+ display: inline-block;
+ vertical-align: baseline
+}
+
+.weui-msg__icon-area {
+ margin-bottom: 32px
+}
+
+.weui-msg__text-area {
+ margin-bottom: 32px;
+ padding: 0 32px;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ line-height: 1.6
+}
+
+.weui-msg__text-area:first-child {
+ padding-top: 96px
+}
+
+.weui-msg__title {
+ font-weight: 700;
+ font-size: 22px
+}
+
+.weui-msg__desc,
+.weui-msg__title {
+ margin-bottom: 16px;
+ color: var(--weui-FG-0);
+ word-wrap: break-word;
+ word-break: break-all
+}
+
+.weui-msg__desc {
+ font-size: 17px
+}
+
+.weui-msg__desc-primary {
+ font-size: 14px;
+ color: var(--weui-FG-1);
+ word-wrap: break-word;
+ word-break: break-all;
+ margin-bottom: 16px
+}
+
+.weui-msg__opr-area {
+ margin-bottom: 16px
+}
+
+.weui-msg__opr-area .weui-btn-area {
+ margin: 0
+}
+
+.weui-msg__opr-area .weui-btn+.weui-btn {
+ margin-bottom: 16px
+}
+
+.weui-msg__opr-area:last-child {
+ margin-bottom: 96px
+}
+
+.weui-msg__opr-area+.weui-msg__extra-area {
+ margin-top: 48px
+}
+
+.weui-msg__tips-area {
+ margin-bottom: 16px;
+ padding: 0 40px
+}
+
+.weui-msg__opr-area+.weui-msg__tips-area {
+ margin-bottom: 48px
+}
+
+.weui-msg__tips-area:last-child {
+ margin-bottom: 64px
+}
+
+.weui-msg__extra-area,
+.weui-msg__tips {
+ font-size: 12px;
+ color: var(--weui-FG-1)
+}
+
+.weui-msg__extra-area {
+ margin-bottom: 24px
+}
+
+.weui-msg__extra-area a,
+.weui-msg__extra-area navigator {
+ color: var(--weui-LINK)
+}
+
+.weui-msg__extra-area navigator {
+ display: inline
+}
+
+.weui-cells__group_form:first-child .weui-cells__title {
+ margin-top: 0
+}
+
+.weui-cells__group_form .weui-cells__title {
+ margin-top: 24px;
+ margin-bottom: 8px;
+ padding: 0 32px
+}
+
+.weui-cells__group_form .weui-cell:before,
+.weui-cells__group_form .weui-cells:before {
+ left: 32px;
+ right: 32px
+}
+
+.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before {
+ left: 72px
+}
+
+.weui-cells__group_form .weui-cells:after {
+ left: 32px;
+ right: 32px
+}
+
+.weui-cells__group_form .weui-cell {
+ padding: 16px 32px
+}
+
+.weui-cells__group_form .weui-cell:not(.weui-cell_link) {
+ color: var(--weui-FG-0)
+}
+
+.weui-cells__group_form .weui-cell__hd {
+ padding-right: 16px
+}
+
+.weui-cells__group_form .weui-cell__ft {
+ padding-left: 16px
+}
+
+.weui-cells__group_form .weui-cell_warn input {
+ color: var(--weui-RED)
+}
+
+.weui-cells__group_form .weui-label {
+ max-width: 5em;
+ margin-right: 8px
+}
+
+.weui-cells__group_form .weui-cells__tips {
+ margin-top: 8px;
+ padding: 0 32px;
+ color: rgba(0, 0, 0, .3)
+}
+
+.weui-cells__group_form .weui-cells__tips a {
+ font-weight: 700
+}
+
+.weui-cells__group_form .weui-cell_vcode {
+ padding: 12px 32px
+}
+
+.weui-cells__group_form .weui-vcode-btn {
+ font-size: 16px;
+ padding: 0 12px;
+ margin-left: 0;
+ height: auto;
+ width: auto;
+ line-height: 2em;
+ color: var(--weui-BTN-DEFAULT-COLOR);
+ background-color: var(--weui-BTN-DEFAULT-BG)
+}
+
+.weui-cells__group_form .weui-vcode-btn:before {
+ display: none
+}
+
+.weui-cells__group_form .weui-cell_select {
+ padding: 0
+}
+
+.weui-cells__group_form .weui-cell_select .weui-select {
+ padding: 0 32px
+}
+
+.weui-cells__group_form .weui-cell_select .weui-cell__bd:after {
+ right: 32px
+}
+
+.weui-cells__group_form .weui-cell_select-before .weui-label {
+ margin-right: 24px
+}
+
+.weui-cells__group_form .weui-cell_select-before .weui-select {
+ padding-right: 24px;
+ box-sizing: initial
+}
+
+.weui-cells__group_form .weui-cell_select-after {
+ padding-left: 32px
+}
+
+.weui-cells__group_form .weui-cell_select-after .weui-select {
+ padding-left: 0
+}
+
+.weui-cells__group_form .weui-cell_switch {
+ padding: 12px 32px
+}
+
+.weui-form {
+ padding: 56px 0 0;
+ padding: calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);
+ padding: calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ line-height: 1.4;
+ min-height: 100%;
+ box-sizing: border-box;
+ background-color: var(--weui-BG-2)
+}
+
+.weui-form .weui-footer,
+.weui-form .weui-footer__link {
+ font-size: 14px
+}
+
+.weui-form .weui-agree {
+ padding: 0
+}
+
+.weui-form__text-area {
+ padding: 0 32px;
+ color: var(--weui-FG-0);
+ text-align: center
+}
+
+.weui-form__control-area {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ margin: 48px 0
+}
+
+.weui-form__tips-area {
+ overflow: hidden
+}
+
+.weui-form__extra-area,
+.weui-form__tips-area {
+ margin-bottom: 24px;
+ text-align: center
+}
+
+.weui-form__opr-area {
+ margin-bottom: 64px
+}
+
+.weui-form__opr-area:last-child {
+ margin-bottom: 96px
+}
+
+.weui-form__title {
+ font-size: 22px;
+ font-weight: 700;
+ line-height: 1.36
+}
+
+.weui-form__desc {
+ font-size: 17px;
+ margin-top: 16px
+}
+
+.weui-form__tips {
+ color: var(--weui-FG-1);
+ font-size: 14px
+}
+
+.weui-form__tips a,
+.weui-form__tips navigator {
+ color: var(--weui-LINK)
+}
+
+.weui-form__tips navigator {
+ display: inline
+}
+
+.weui-article {
+ padding: 24px 16px;
+ padding: 24px calc(16px + constant(safe-area-inset-right)) calc(24px + constant(safe-area-inset-bottom)) calc(16px + constant(safe-area-inset-left));
+ padding: 24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
+ font-size: 17px;
+ color: var(--weui-FG-0)
+}
+
+.weui-article__section {
+ margin-bottom: 1.5em
+}
+
+.weui-article__h1 {
+ font-size: 22px;
+ font-weight: 700;
+ margin-bottom: .9em;
+ line-height: 1.4
+}
+
+.weui-article__h2 {
+ font-size: 17px
+}
+
+.weui-article__h2,
+.weui-article__h3 {
+ font-weight: 700;
+ margin-bottom: .34em;
+ line-height: 1.4
+}
+
+.weui-article__h3 {
+ font-size: 15px
+}
+
+.weui-article__p {
+ margin: 0 0 .8em
+}
+
+.weui-tabbar {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ position: relative;
+ z-index: 500;
+ background-color: var(--weui-BG-1)
+}
+
+.weui-tabbar:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ height: 1px;
+ border-top: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-tabbar__item {
+ display: block;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ padding: 8px 0;
+ padding-bottom: calc(8px + constant(safe-area-inset-bottom));
+ padding-bottom: calc(8px + env(safe-area-inset-bottom));
+ font-size: 0;
+ color: var(--weui-FG-1);
+ text-align: center;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-tabbar__item:first-child {
+ padding-left: constant(safe-area-inset-left);
+ padding-left: env(safe-area-inset-left)
+}
+
+.weui-tabbar__item:last-child {
+ padding-right: constant(safe-area-inset-right);
+ padding-right: env(safe-area-inset-right)
+}
+
+.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,
+.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,
+.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label {
+ color: var(--weui-BRAND)
+}
+
+.weui-tabbar__icon {
+ display: inline-block;
+ width: 28px;
+ height: 28px;
+ margin-bottom: 2px
+}
+
+.weui-tabbar__icon>i,
+i.weui-tabbar__icon {
+ font-size: 24px;
+ color: var(--weui-FG-1)
+}
+
+.weui-tabbar__icon img {
+ width: 100%;
+ height: 100%
+}
+
+.weui-tabbar__label {
+ color: var(--weui-FG-0);
+ font-size: 10px;
+ line-height: 1.4
+}
+
+.weui-navbar {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ position: relative;
+ z-index: 500;
+ background-color: var(--weui-BG-2);
+ padding-top: constant(safe-area-inset-top);
+ padding-top: env(safe-area-inset-top)
+}
+
+.weui-navbar:after {
+ content: " ";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ border-bottom: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-navbar+.weui-tab__panel {
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom)
+}
+
+.weui-navbar__item {
+ position: relative;
+ display: block;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ padding: 16px 0;
+ padding-top: calc(16px + constant(safe-area-inset-top));
+ padding-top: calc(16px + env(safe-area-inset-top));
+ text-align: center;
+ font-size: 17px;
+ line-height: 1.41176471;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-navbar__item.weui-bar__item_on,
+.weui-navbar__item:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-navbar__item:after {
+ content: " ";
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-right: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 100% 0;
+ transform-origin: 100% 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-navbar__item:first-child {
+ padding-left: constant(safe-area-inset-left);
+ padding-left: env(safe-area-inset-left)
+}
+
+.weui-navbar__item:last-child {
+ padding-right: constant(safe-area-inset-right);
+ padding-right: env(safe-area-inset-right)
+}
+
+.weui-navbar__item:last-child:after {
+ display: none
+}
+
+.weui-tab {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ height: 100%;
+ box-sizing: border-box;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column
+}
+
+.weui-tab__panel {
+ box-sizing: border-box;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ overflow: auto;
+ -webkit-overflow-scrolling: touch
+}
+
+.weui-tab__content {
+ display: none
+}
+
+.weui-progress {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-progress__bar {
+ background-color: var(--weui-BG-0);
+ height: 3px;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
+}
+
+.weui-progress__inner-bar {
+ width: 0;
+ height: 100%;
+ background-color: var(--weui-BRAND)
+}
+
+.weui-progress__opr {
+ display: block;
+ margin-left: 15px;
+ font-size: 0
+}
+
+.weui-panel {
+ background-color: var(--weui-BG-2);
+ margin-top: 10px;
+ position: relative;
+ overflow: hidden
+}
+
+.weui-panel:first-child {
+ margin-top: 0
+}
+
+.weui-panel:before {
+ top: 0;
+ border-top: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-panel:after,
+.weui-panel:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ right: 0;
+ height: 1px;
+ color: var(--weui-FG-3)
+}
+
+.weui-panel:after {
+ bottom: 0;
+ border-bottom: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-panel__hd {
+ padding: 16px 16px 13px;
+ color: var(--weui-FG-0);
+ font-size: 15px;
+ font-weight: 700;
+ position: relative
+}
+
+.weui-panel__hd:after {
+ content: " ";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ border-bottom: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5);
+ left: 15px
+}
+
+.weui-media-box {
+ padding: 16px;
+ position: relative
+}
+
+.weui-media-box:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ height: 1px;
+ border-top: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5);
+ left: 16px
+}
+
+.weui-media-box:first-child:before {
+ display: none
+}
+
+a.weui-media-box {
+ color: #000;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+a.weui-media-box:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-media-box__title {
+ font-weight: 400;
+ font-size: 17px;
+ color: var(--weui-FG-0);
+ width: auto;
+ white-space: nowrap;
+ word-wrap: normal;
+ word-wrap: break-word;
+ word-break: break-all
+}
+
+.weui-media-box__desc,
+.weui-media-box__title {
+ line-height: 1.4;
+ overflow: hidden;
+ text-overflow: ellipsis
+}
+
+.weui-media-box__desc {
+ color: var(--weui-FG-2);
+ font-size: 14px;
+ padding-top: 4px;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2
+}
+
+.weui-media-box__info {
+ margin-top: 16px;
+ padding-bottom: 4px;
+ font-size: 13px;
+ color: var(--weui-FG-2);
+ line-height: 1em;
+ list-style: none;
+ overflow: hidden
+}
+
+.weui-media-box__info__meta {
+ float: left;
+ padding-right: 1em
+}
+
+.weui-media-box__info__meta_extra {
+ padding-left: 1em;
+ border-left: 1px solid var(--weui-FG-2)
+}
+
+.weui-media-box_appmsg {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-media-box_appmsg .weui-media-box__hd {
+ margin-right: 16px;
+ width: 60px;
+ height: 60px;
+ line-height: 60px;
+ text-align: center
+}
+
+.weui-media-box_appmsg .weui-media-box__thumb {
+ width: 100%;
+ max-height: 100%;
+ vertical-align: top
+}
+
+.weui-media-box_appmsg .weui-media-box__bd {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ min-width: 0
+}
+
+.weui-media-box_small-appmsg {
+ padding: 0
+}
+
+.weui-media-box_small-appmsg .weui-cells {
+ margin-top: 0
+}
+
+.weui-media-box_small-appmsg .weui-cells:before {
+ display: none
+}
+
+.weui-grids {
+ position: relative;
+ overflow: hidden
+}
+
+.weui-grids:before {
+ right: 0;
+ height: 1px;
+ border-top: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-grids:after,
+.weui-grids:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ color: var(--weui-FG-3)
+}
+
+.weui-grids:after {
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-grid {
+ position: relative;
+ float: left;
+ padding: 20px 10px;
+ width: 33.33333333%;
+ box-sizing: border-box
+}
+
+.weui-grid:before {
+ top: 0;
+ width: 1px;
+ border-right: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 100% 0;
+ transform-origin: 100% 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-grid:after,
+.weui-grid:before {
+ content: " ";
+ position: absolute;
+ right: 0;
+ bottom: 0;
+ color: var(--weui-FG-3)
+}
+
+.weui-grid:after {
+ left: 0;
+ height: 1px;
+ border-bottom: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-grid:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-grid__icon {
+ width: 28px;
+ height: 28px;
+ margin: 0 auto
+}
+
+.weui-grid__icon img {
+ display: block;
+ width: 100%;
+ height: 100%
+}
+
+.weui-grid__icon+.weui-grid__label {
+ margin-top: 4px
+}
+
+.weui-grid__label {
+ display: block;
+ color: var(--weui-FG-0);
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden
+}
+
+.weui-footer,
+.weui-grid__label {
+ text-align: center;
+ font-size: 14px
+}
+
+.weui-footer {
+ color: var(--weui-FG-2);
+ line-height: 1.4
+}
+
+.weui-footer a,
+.weui-footer navigator {
+ color: var(--weui-LINK)
+}
+
+.weui-footer navigator {
+ display: inline
+}
+
+.weui-footer_fixed-bottom {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ padding-top: 16px;
+ padding-bottom: 16px;
+ padding-bottom: calc(16px + constant(safe-area-inset-bottom));
+ padding-bottom: calc(16px + env(safe-area-inset-bottom));
+ left: constant(safe-area-inset-left);
+ left: env(safe-area-inset-left);
+ right: constant(safe-area-inset-right);
+ right: env(safe-area-inset-right)
+}
+
+.weui-footer__links {
+ font-size: 0
+}
+
+.weui-footer__link {
+ display: inline-block;
+ vertical-align: top;
+ margin: 0 8px;
+ position: relative;
+ font-size: 14px
+}
+
+.weui-footer__link:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5);
+ left: -8px;
+ top: .36em;
+ bottom: .36em
+}
+
+.weui-footer__link:first-child:before {
+ display: none
+}
+
+.weui-footer__text {
+ padding: 0 16px;
+ font-size: 12px
+}
+
+.weui-flex {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex
+}
+
+.weui-flex__item {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
+}
+
+.weui-dialog {
+ position: fixed;
+ z-index: 5000;
+ top: 50%;
+ left: 16px;
+ right: 16px;
+ -webkit-transform: translateY(-50%);
+ transform: translateY(-50%);
+ background-color: var(--weui-BG-2);
+ text-align: center;
+ border-radius: 12px;
+ overflow: hidden;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-flex-direction: column;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ flex-direction: column;
+ max-height: 90%
+}
+
+.weui-dialog__hd {
+ padding: 32px 24px 16px
+}
+
+.weui-dialog__title {
+ font-weight: 700;
+ font-size: 17px;
+ line-height: 1.4
+}
+
+.weui-dialog__bd {
+ overflow-y: auto;
+ -webkit-overflow-scrolling: touch;
+ padding: 0 24px;
+ margin-bottom: 32px;
+ font-size: 17px;
+ line-height: 1.4;
+ word-wrap: break-word;
+ -webkit-hyphens: auto;
+ hyphens: auto;
+ color: var(--weui-FG-1)
+}
+
+.weui-dialog__bd:first-child {
+ min-height: 40px;
+ padding: 32px 24px 0;
+ font-weight: 700;
+ color: var(--weui-FG-0);
+ -webkit-flex-direction: column;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ flex-direction: column;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center
+}
+
+.weui-dialog__bd:first-child,
+.weui-dialog__ft {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex
+}
+
+.weui-dialog__ft {
+ position: relative;
+ line-height: 56px;
+ min-height: 56px;
+ font-size: 17px
+}
+
+.weui-dialog__ft:after {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ height: 1px;
+ border-top: 1px solid var(--weui-DIALOG-LINE-COLOR);
+ color: var(--weui-DIALOG-LINE-COLOR);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-dialog__btn {
+ display: block;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ color: var(--weui-LINK);
+ font-weight: 700;
+ text-decoration: none;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ position: relative
+}
+
+.weui-dialog__btn:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-dialog__btn:after {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid var(--weui-DIALOG-LINE-COLOR);
+ color: var(--weui-DIALOG-LINE-COLOR);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-dialog__btn:first-child:after {
+ display: none
+}
+
+.weui-dialog__btn_default {
+ color: var(--weui-FG-HALF)
+}
+
+.weui-skin_android .weui-dialog {
+ text-align: left;
+ box-shadow: 0 6px 30px 0 rgba(0, 0, 0, .1)
+}
+
+.weui-skin_android .weui-dialog__title {
+ font-size: 22px;
+ line-height: 1.4
+}
+
+.weui-skin_android .weui-dialog__hd {
+ text-align: left
+}
+
+.weui-skin_android .weui-dialog__bd {
+ color: var(--weui-FG-1);
+ text-align: left
+}
+
+.weui-skin_android .weui-dialog__bd:first-child {
+ color: var(--weui-FG-0)
+}
+
+.weui-skin_android .weui-dialog__ft {
+ display: block;
+ text-align: right;
+ line-height: 40px;
+ min-height: 40px;
+ padding: 0 24px 16px
+}
+
+.weui-skin_android .weui-dialog__ft:after {
+ display: none
+}
+
+.weui-skin_android .weui-dialog__btn {
+ display: inline-block;
+ vertical-align: top;
+ padding: 0 .8em
+}
+
+.weui-skin_android .weui-dialog__btn:after {
+ display: none
+}
+
+.weui-skin_android .weui-dialog__btn:last-child {
+ margin-right: -.8em
+}
+
+.weui-skin_android .weui-dialog__btn_default {
+ color: var(--weui-FG-HALF)
+}
+
+@media screen and (min-width:352px) {
+ .weui-dialog {
+ width: 320px;
+ margin: 0 auto
+ }
+}
+
+.weui-half-screen-dialog {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ max-height: 75%;
+ z-index: 5000;
+ line-height: 1.4;
+ background-color: var(--weui-BG-2);
+ border-top-left-radius: 12px;
+ border-top-right-radius: 12px;
+ overflow: hidden;
+ padding: 0 24px;
+ padding: 0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));
+ padding: 0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))
+}
+
+@media only screen and (max-height:558px) {
+ .weui-half-screen-dialog {
+ max-height: none
+ }
+}
+
+.weui-half-screen-dialog__hd {
+ font-size: 8px;
+ height: 8em;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-half-screen-dialog__hd .weui-icon-btn {
+ position: absolute;
+ top: 50%;
+ -webkit-transform: translateY(-50%);
+ transform: translateY(-50%)
+}
+
+.weui-half-screen-dialog__hd .weui-icon-btn:active {
+ opacity: .5
+}
+
+.weui-half-screen-dialog__hd__side {
+ position: relative;
+ left: -8px
+}
+
+.weui-half-screen-dialog__hd__main {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
+}
+
+.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main {
+ text-align: center;
+ padding: 0 40px
+}
+
+.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side {
+ right: -8px;
+ left: auto
+}
+
+.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn {
+ right: 0
+}
+
+.weui-half-screen-dialog__title {
+ display: block;
+ color: var(--weui-FG-0);
+ font-weight: 700;
+ font-size: 15px
+}
+
+.weui-half-screen-dialog__subtitle {
+ display: block;
+ color: var(--weui-FG-1);
+ font-size: 10px
+}
+
+.weui-half-screen-dialog__bd {
+ word-wrap: break-word;
+ -webkit-hyphens: auto;
+ hyphens: auto;
+ overflow-y: auto;
+ padding-top: 4px;
+ padding-bottom: 40px;
+ font-size: 14px;
+ color: var(--weui-FG-0)
+}
+
+.weui-half-screen-dialog__desc {
+ font-size: 17px;
+ font-weight: 700;
+ color: var(--weui-FG-0);
+ line-height: 1.4
+}
+
+.weui-half-screen-dialog__tips {
+ padding-top: 16px;
+ font-size: 14px;
+ color: var(--weui-FG-2);
+ line-height: 1.4
+}
+
+.weui-half-screen-dialog__ft {
+ padding: 0 24px 32px;
+ text-align: center
+}
+
+.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),
+.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn {
+ display: inline-block;
+ vertical-align: top;
+ margin: 0 8px;
+ width: 120px
+}
+
+.weui-icon-btn {
+ outline: 0;
+ -webkit-appearance: none;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ border-width: 0;
+ background-color: transparent;
+ color: var(--weui-FG-0);
+ font-size: 0
+}
+
+.weui-icon-more {
+ width: 24px;
+ -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M5 10.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E%3C/svg%3E") no-repeat 50% 50%;
+ mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M5 10.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E%3C/svg%3E") no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover
+}
+
+.weui-icon-btn_goback,
+.weui-icon-more {
+ display: inline-block;
+ vertical-align: middle;
+ height: 24px;
+ background-color: currentColor;
+ color: var(--weui-FG-0)
+}
+
+.weui-icon-btn_goback {
+ width: 12px;
+ -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;
+ mask: url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover
+}
+
+.weui-icon-btn_close {
+ color: var(--weui-FG-0);
+ display: inline-block;
+ vertical-align: middle;
+ width: 14px;
+ height: 24px;
+ -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;
+ mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover;
+ background-color: currentColor
+}
+
+.weui-toast {
+ position: fixed;
+ z-index: 5000;
+ width: 120px;
+ height: 120px;
+ top: 40%;
+ left: 50%;
+ -webkit-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+ text-align: center;
+ border-radius: 5px;
+ color: hsla(0, 0%, 100%, .9);
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ background-color: #4c4c4c
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-toast {
+ background-color: #606060
+ }
+}
+
+.weui-icon_toast {
+ display: block
+}
+
+.weui-icon_toast.weui-icon-success-no-circle {
+ color: hsla(0, 0%, 100%, .9);
+ width: 55px;
+ height: 55px
+}
+
+.weui-icon_toast.weui-loading {
+ margin: 8px 0;
+ width: 38px;
+ height: 38px;
+ vertical-align: baseline
+}
+
+.weui-toast__content {
+ font-size: 14px
+}
+
+.weui-mask {
+ background: rgba(0, 0, 0, .6)
+}
+
+.weui-mask,
+.weui-mask_transparent {
+ position: fixed;
+ z-index: 1000;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0
+}
+
+.weui-actionsheet {
+ position: fixed;
+ left: 0;
+ bottom: 0;
+ -webkit-transform: translateY(100%);
+ transform: translateY(100%);
+ -webkit-backface-visibility: hidden;
+ backface-visibility: hidden;
+ z-index: 5000;
+ width: 100%;
+ background-color: var(--weui-BG-1);
+ -webkit-transition: -webkit-transform .3s;
+ transition: -webkit-transform .3s;
+ transition: transform .3s;
+ transition: transform .3s, -webkit-transform .3s;
+ border-top-left-radius: 12px;
+ border-top-right-radius: 12px;
+ overflow: hidden
+}
+
+.weui-actionsheet__title {
+ position: relative;
+ height: 56px;
+ padding: 0 24px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ text-align: center;
+ font-size: 12px;
+ color: var(--weui-FG-1);
+ line-height: 1.4;
+ background: var(--weui-BG-2)
+}
+
+.weui-actionsheet__title:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ border-bottom: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-actionsheet__title .weui-actionsheet__title-text {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2
+}
+
+.weui-actionsheet__menu {
+ color: var(--weui-FG-0);
+ background-color: var(--weui-BG-2)
+}
+
+.weui-actionsheet__action {
+ margin-top: 8px;
+ background-color: var(--weui-BG-2);
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom)
+}
+
+.weui-actionsheet__cell {
+ position: relative;
+ padding: 16px;
+ text-align: center;
+ font-size: 17px;
+ line-height: 1.41176471
+}
+
+.weui-actionsheet__cell:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ height: 1px;
+ border-top: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-actionsheet__cell:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-actionsheet__cell:first-child:before {
+ display: none
+}
+
+.weui-actionsheet__cell_warn {
+ color: var(--weui-RED)
+}
+
+.weui-skin_android .weui-actionsheet {
+ position: fixed;
+ left: 50%;
+ top: 50%;
+ bottom: auto;
+ -webkit-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+ width: 274px;
+ box-sizing: border-box;
+ -webkit-backface-visibility: hidden;
+ backface-visibility: hidden;
+ background: transparent;
+ -webkit-transition: -webkit-transform .3s;
+ transition: -webkit-transform .3s;
+ transition: transform .3s;
+ transition: transform .3s, -webkit-transform .3s;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0
+}
+
+.weui-skin_android .weui-actionsheet__action {
+ display: none
+}
+
+.weui-skin_android .weui-actionsheet__menu {
+ border-radius: 2px;
+ box-shadow: 0 6px 30px 0 rgba(0, 0, 0, .1)
+}
+
+.weui-skin_android .weui-actionsheet__cell {
+ padding: 16px;
+ font-size: 17px;
+ line-height: 1.41176471;
+ color: var(--weui-FG-0);
+ text-align: left
+}
+
+.weui-skin_android .weui-actionsheet__cell:first-child {
+ border-top-left-radius: 2px;
+ border-top-right-radius: 2px
+}
+
+.weui-skin_android .weui-actionsheet__cell:last-child {
+ border-bottom-left-radius: 2px;
+ border-bottom-right-radius: 2px
+}
+
+.weui-actionsheet_toggle {
+ -webkit-transform: translate(0);
+ transform: translate(0)
+}
+
+.weui-loadmore {
+ width: 65%;
+ margin: 1.5em auto;
+ line-height: 1.6em;
+ font-size: 14px;
+ text-align: center
+}
+
+.weui-loadmore__tips {
+ display: inline-block;
+ vertical-align: middle;
+ color: var(--weui-FG-0)
+}
+
+.weui-loadmore_line {
+ border-top: 1px solid var(--weui-FG-3);
+ margin-top: 2.4em
+}
+
+.weui-loadmore_line .weui-loadmore__tips {
+ position: relative;
+ top: -.9em;
+ padding: 0 .55em;
+ background-color: var(--weui-BG-2);
+ color: var(--weui-FG-1)
+}
+
+.weui-loadmore_dot .weui-loadmore__tips {
+ padding: 0 .16em
+}
+
+.weui-loadmore_dot .weui-loadmore__tips:before {
+ content: " ";
+ width: 4px;
+ height: 4px;
+ border-radius: 50%;
+ background-color: var(--weui-FG-3);
+ display: inline-block;
+ position: relative;
+ vertical-align: 0;
+ top: -.16em
+}
+
+.weui-badge {
+ display: inline-block;
+ padding: .15em .4em;
+ min-width: 8px;
+ border-radius: 18px;
+ background-color: var(--weui-RED);
+ color: #fff;
+ line-height: 1.2;
+ text-align: center;
+ font-size: 12px;
+ vertical-align: middle
+}
+
+.weui-badge_dot {
+ padding: .4em;
+ min-width: 0
+}
+
+.weui-toptips {
+ display: none;
+ position: fixed;
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0);
+ top: 8px;
+ left: 8px;
+ right: 8px;
+ padding: 10px;
+ border-radius: 8px;
+ font-size: 14px;
+ text-align: center;
+ color: #fff;
+ z-index: 5000;
+ word-wrap: break-word;
+ word-break: break-all
+}
+
+.weui-toptips_warn {
+ background-color: var(--weui-RED)
+}
+
+.weui-search-bar {
+ position: relative;
+ padding: 8px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ box-sizing: border-box;
+ background-color: var(--weui-BG-0);
+ -webkit-text-size-adjust: 100%;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-search-bar.weui-search-bar_focusing .weui-search-bar__cancel-btn {
+ display: block
+}
+
+.weui-search-bar.weui-search-bar_focusing .weui-search-bar__label {
+ display: none
+}
+
+.weui-search-bar .weui-icon-search {
+ width: 16px;
+ height: 16px
+}
+
+.weui-search-bar__form {
+ position: relative;
+ -webkit-box-flex: 1;
+ -webkit-flex: auto;
+ flex: auto;
+ background-color: var(--weui-BG-2);
+ border-radius: 4px
+}
+
+.weui-search-bar__box {
+ position: relative;
+ padding-left: 28px;
+ padding-right: 32px;
+ height: 100%;
+ width: 100%;
+ box-sizing: border-box;
+ z-index: 1
+}
+
+.weui-search-bar__box .weui-search-bar__input {
+ padding: 8px 0;
+ width: 100%;
+ height: 1.14285714em;
+ border: 0;
+ font-size: 14px;
+ line-height: 1.14285714em;
+ box-sizing: content-box;
+ background: transparent;
+ caret-color: var(--weui-BRAND);
+ color: var(--weui-FG-0)
+}
+
+.weui-search-bar__box .weui-search-bar__input:focus {
+ outline: none
+}
+
+.weui-search-bar__box .weui-icon-search {
+ position: absolute;
+ top: 50%;
+ left: 8px;
+ margin-top: -8px
+}
+
+.weui-search-bar__box .weui-icon-clear {
+ position: absolute;
+ top: 50%;
+ right: 0;
+ margin-top: -16px;
+ padding: 8px;
+ width: 16px;
+ height: 16px;
+ -webkit-mask-size: 16px;
+ mask-size: 16px
+}
+
+.weui-search-bar__label {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 2;
+ font-size: 0;
+ border-radius: 4px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ color: var(--weui-FG-1);
+ background: var(--weui-BG-2)
+}
+
+.weui-search-bar__label span {
+ display: inline-block;
+ font-size: 14px;
+ vertical-align: middle
+}
+
+.weui-search-bar__label .weui-icon-search {
+ margin-right: 4px
+}
+
+.weui-search-bar__cancel-btn {
+ display: none;
+ margin-left: 8px;
+ line-height: 28px;
+ color: var(--weui-LINK);
+ white-space: nowrap
+}
+
+.weui-search-bar__input:not(:valid)+.weui-icon-clear {
+ display: none
+}
+
+input[type=search]::-webkit-search-cancel-button,
+input[type=search]::-webkit-search-decoration,
+input[type=search]::-webkit-search-results-button,
+input[type=search]::-webkit-search-results-decoration {
+ display: none
+}
+
+.weui-picker {
+ position: fixed;
+ width: 100%;
+ box-sizing: border-box;
+ left: 0;
+ bottom: 0;
+ z-index: 5000;
+ background-color: var(--weui-BG-2);
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
+ -webkit-backface-visibility: hidden;
+ backface-visibility: hidden;
+ -webkit-transform: translateY(100%);
+ transform: translateY(100%);
+ -webkit-transition: -webkit-transform .3s;
+ transition: -webkit-transform .3s;
+ transition: transform .3s;
+ transition: transform .3s, -webkit-transform .3s
+}
+
+.weui-picker__hd {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ padding: 16px;
+ padding: 16px calc(16px + constant(safe-area-inset-right)) 16px calc(16px + constant(safe-area-inset-left));
+ padding: 16px calc(16px + env(safe-area-inset-right)) 16px calc(16px + env(safe-area-inset-left));
+ position: relative;
+ text-align: center;
+ font-size: 17px;
+ line-height: 1.4
+}
+
+.weui-picker__hd:after {
+ content: " ";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ border-bottom: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-picker__bd {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ position: relative;
+ background-color: var(--weui-BG-2);
+ height: 240px;
+ overflow: hidden
+}
+
+.weui-picker__group {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ position: relative;
+ height: 100%
+}
+
+.weui-picker__group:first-child .weui-picker__item {
+ padding-left: constant(safe-area-inset-left);
+ padding-left: env(safe-area-inset-left)
+}
+
+.weui-picker__group:last-child .weui-picker__item {
+ padding-right: constant(safe-area-inset-right);
+ padding-right: env(safe-area-inset-right)
+}
+
+.weui-picker__mask {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ margin: 0 auto;
+ z-index: 3;
+ background-image: -webkit-linear-gradient(top, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6)), -webkit-linear-gradient(bottom, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6));
+ background-image: linear-gradient(180deg, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6)), linear-gradient(0deg, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6));
+ background-position: top, bottom;
+ background-size: 100% 92px;
+ background-repeat: no-repeat;
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0)
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-picker__mask {
+ background-image: -webkit-linear-gradient(top, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6)), -webkit-linear-gradient(bottom, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6));
+ background-image: linear-gradient(180deg, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6)), linear-gradient(0deg, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6))
+ }
+}
+
+.weui-picker__indicator {
+ width: 100%;
+ height: 56px;
+ position: absolute;
+ left: 0;
+ top: 92px;
+ z-index: 3
+}
+
+.weui-picker__indicator:before {
+ top: 0;
+ border-top: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-picker__indicator:after,
+.weui-picker__indicator:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ right: 0;
+ height: 1px;
+ color: var(--weui-FG-3)
+}
+
+.weui-picker__indicator:after {
+ bottom: 0;
+ border-bottom: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-picker__content {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%
+}
+
+.weui-picker__item {
+ height: 48px;
+ line-height: 48px;
+ text-align: center;
+ color: var(--weui-FG-0);
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden
+}
+
+.weui-picker__item_disabled {
+ color: var(--weui-FG-1)
+}
+
+@-webkit-keyframes a {
+ 0% {
+ -webkit-transform: translate3d(0, 100%, 0);
+ transform: translate3d(0, 100%, 0)
+ }
+
+ to {
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0)
+ }
+}
+
+@keyframes a {
+ 0% {
+ -webkit-transform: translate3d(0, 100%, 0);
+ transform: translate3d(0, 100%, 0)
+ }
+
+ to {
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0)
+ }
+}
+
+.weui-animate-slide-up {
+ -webkit-animation: a ease .3s forwards;
+ animation: a ease .3s forwards
+}
+
+@-webkit-keyframes b {
+ 0% {
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0)
+ }
+
+ to {
+ -webkit-transform: translate3d(0, 100%, 0);
+ transform: translate3d(0, 100%, 0)
+ }
+}
+
+@keyframes b {
+ 0% {
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0)
+ }
+
+ to {
+ -webkit-transform: translate3d(0, 100%, 0);
+ transform: translate3d(0, 100%, 0)
+ }
+}
+
+.weui-animate-slide-down {
+ -webkit-animation: b ease .3s forwards;
+ animation: b ease .3s forwards
+}
+
+@-webkit-keyframes c {
+ 0% {
+ opacity: 0
+ }
+
+ to {
+ opacity: 1
+ }
+}
+
+@keyframes c {
+ 0% {
+ opacity: 0
+ }
+
+ to {
+ opacity: 1
+ }
+}
+
+.weui-animate-fade-in {
+ -webkit-animation: c ease .3s forwards;
+ animation: c ease .3s forwards
+}
+
+@-webkit-keyframes d {
+ 0% {
+ opacity: 1
+ }
+
+ to {
+ opacity: 0
+ }
+}
+
+@keyframes d {
+ 0% {
+ opacity: 1
+ }
+
+ to {
+ opacity: 0
+ }
+}
+
+.weui-animate-fade-out {
+ -webkit-animation: d ease .3s forwards;
+ animation: d ease .3s forwards
+}
+
+.weui-agree {
+ display: block;
+ padding: 8px 15px 0;
+ font-size: 14px;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-agree a,
+.weui-agree navigator {
+ color: var(--weui-LINK)
+}
+
+.weui-agree navigator {
+ display: inline
+}
+
+.weui-agree__text {
+ color: var(--weui-FG-1);
+ margin-left: 2px
+}
+
+.weui-agree__checkbox {
+ -webkit-appearance: none;
+ appearance: none;
+ display: inline-block;
+ border: 0;
+ outline: 0;
+ vertical-align: middle;
+ background-color: currentColor;
+ -webkit-mask-position: 0 0;
+ mask-position: 0 0;
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-size: 100%;
+ mask-size: 100%;
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);
+ color: var(--weui-FG-2);
+ width: 1em;
+ height: 1em;
+ font-size: 17px;
+ margin-top: -.2em
+}
+
+.weui-agree__checkbox-check {
+ position: absolute;
+ left: -9999px
+}
+
+.weui-agree__checkbox-check[aria-checked=true]+.weui-agree__checkbox,
+.weui-agree__checkbox:checked {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);
+ color: var(--weui-BRAND)
+}
+
+.weui-agree_animate {
+ -webkit-animation: e .3s 1;
+ animation: e .3s 1
+}
+
+@-webkit-keyframes e {
+ 0% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 16% {
+ -webkit-transform: translateX(-8px);
+ transform: translateX(-8px)
+ }
+
+ 28% {
+ -webkit-transform: translateX(-16px);
+ transform: translateX(-16px)
+ }
+
+ 44% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 59% {
+ -webkit-transform: translateX(-16px);
+ transform: translateX(-16px)
+ }
+
+ 73% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 82% {
+ -webkit-transform: translateX(16px);
+ transform: translateX(16px)
+ }
+
+ 94% {
+ -webkit-transform: translateX(8px);
+ transform: translateX(8px)
+ }
+
+ to {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+}
+
+@keyframes e {
+ 0% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 16% {
+ -webkit-transform: translateX(-8px);
+ transform: translateX(-8px)
+ }
+
+ 28% {
+ -webkit-transform: translateX(-16px);
+ transform: translateX(-16px)
+ }
+
+ 44% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 59% {
+ -webkit-transform: translateX(-16px);
+ transform: translateX(-16px)
+ }
+
+ 73% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 82% {
+ -webkit-transform: translateX(16px);
+ transform: translateX(16px)
+ }
+
+ 94% {
+ -webkit-transform: translateX(8px);
+ transform: translateX(8px)
+ }
+
+ to {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+}
+
+.weui-loading {
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+ vertical-align: middle;
+ -webkit-animation: f 1s steps(12) infinite;
+ animation: f 1s steps(12) infinite;
+ background: transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;
+ background-size: 100%
+}
+
+.weui-btn_loading.weui-btn_primary .weui-loading,
+.weui-loading.weui-loading_transparent {
+ background-image: url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")
+}
+
+@-webkit-keyframes f {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg)
+ }
+
+ to {
+ -webkit-transform: rotate(1turn);
+ transform: rotate(1turn)
+ }
+}
+
+@keyframes f {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg)
+ }
+
+ to {
+ -webkit-transform: rotate(1turn);
+ transform: rotate(1turn)
+ }
+}
+
+.weui-slider {
+ padding: 15px 18px;
+ -webkit-user-select: none;
+ user-select: none
+}
+
+.weui-slider__inner {
+ position: relative;
+ height: 2px;
+ background-color: var(--weui-FG-3)
+}
+
+.weui-slider__track {
+ height: 2px;
+ background-color: var(--weui-BRAND);
+ width: 0
+}
+
+.weui-slider__handler {
+ position: absolute;
+ left: 0;
+ top: 50%;
+ width: 28px;
+ height: 28px;
+ margin-left: -14px;
+ margin-top: -14px;
+ border-radius: 50%;
+ background-color: #fff;
+ box-shadow: 0 0 4px var(--weui-FG-3)
+}
+
+.weui-slider-box {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-slider-box .weui-slider {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
+}
+
+.weui-slider-box__value {
+ margin-left: .5em;
+ min-width: 24px;
+ color: var(--weui-FG-1);
+ text-align: center;
+ font-size: 14px
+}
+
+.wx_dot_loading,
+.wx_dot_loading:after,
+.wx_dot_loading:before {
+ display: inline-block;
+ vertical-align: middle;
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background-color: rgba(0, 0, 0, .3);
+ font-size: 0;
+ -webkit-animation: h 1.6s step-start infinite;
+ animation: h 1.6s step-start infinite
+}
+
+.wx_dot_loading {
+ position: relative
+}
+
+.wx_dot_loading:before {
+ content: "";
+ position: absolute;
+ left: -12px;
+ background-color: rgba(0, 0, 0, .1);
+ -webkit-animation: g 1.6s step-start infinite;
+ animation: g 1.6s step-start infinite
+}
+
+.wx_dot_loading:after {
+ content: "";
+ position: absolute;
+ right: -12px;
+ background-color: rgba(0, 0, 0, .5);
+ -webkit-animation: i 1.6s step-start infinite;
+ animation: i 1.6s step-start infinite
+}
+
+@-webkit-keyframes g {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .1)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .5)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .3)
+ }
+}
+
+@keyframes g {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .1)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .5)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .3)
+ }
+}
+
+@-webkit-keyframes h {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .3)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .1)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .5)
+ }
+}
+
+@keyframes h {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .3)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .1)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .5)
+ }
+}
+
+@-webkit-keyframes i {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .5)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .3)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .1)
+ }
+}
+
+@keyframes i {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .5)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .3)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .1)
+ }
+}
+
+.wx_dot_loading_white {
+ background-color: hsla(0, 0%, 100%, .3);
+ -webkit-animation: k 1.6s step-start infinite;
+ animation: k 1.6s step-start infinite
+}
+
+.wx_dot_loading_white:before {
+ background-color: hsla(0, 0%, 100%, .5);
+ -webkit-animation: j 1.6s step-start infinite;
+ animation: j 1.6s step-start infinite
+}
+
+.wx_dot_loading_white:after {
+ background-color: hsla(0, 0%, 100%, .1);
+ -webkit-animation: l 1.6s step-start infinite;
+ animation: l 1.6s step-start infinite
+}
+
+@-webkit-keyframes j {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+}
+
+@keyframes j {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+}
+
+@-webkit-keyframes k {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+}
+
+@keyframes k {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+}
+
+@-webkit-keyframes l {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+}
+
+@keyframes l {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+}
+
+:host {
+ width: 100%
+}
+
+.weui-slideview {
+ position: relative;
+ overflow: hidden
+}
+
+.weui-slideview__left {
+ position: relative;
+ z-index: 10
+}
+
+.weui-slideview__right {
+ position: absolute;
+ z-index: 1;
+ left: 100%;
+ top: 0;
+ height: 100%
+}
+
+.weui-slideview__btn__wrp {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ text-align: center;
+ min-width: 69px;
+ height: 100%;
+ white-space: nowrap
+}
+
+.weui-slideview__btn {
+ color: #fff;
+ padding: 0 17px
+}
+
+.weui-slideview__btn-group_default .weui-slideview__btn {
+ background: #c7c7cc
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-slideview__btn-group_default .weui-slideview__btn {
+ background: var(--weui-BG-4)
+ }
+}
+
+.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid #fff;
+ color: #fff;
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before {
+ border-left-color: var(--weui-FG-3)
+ }
+}
+
+.weui-slideview__btn-group_default:first-child:before {
+ display: none
+}
+
+.weui-slideview__btn-group_warn .weui-slideview__btn {
+ background: #fe3b30
+}
+
+.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid #fff;
+ color: #fff;
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-slideview__btn-group_warn:first-child:before {
+ display: none
+}
+
+.weui-slideview_icon .weui-slideview__btn__wrp {
+ background: transparent;
+ font-size: 0
+}
+
+.weui-slideview_icon .weui-slideview__btn__wrp:first-child {
+ padding-left: 16px
+}
+
+.weui-slideview_icon .weui-slideview__btn__wrp:last-child {
+ padding-right: 8px
+}
+
+.weui-slideview_icon .weui-slideview__btn {
+ width: 48px;
+ height: 48px;
+ line-height: 48px;
+ padding: 0;
+ display: inline-block;
+ vertical-align: middle;
+ border-radius: 50%;
+ background-color: #fff
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-slideview_icon .weui-slideview__btn {
+ background-color: var(--weui-BG-4)
+ }
+}
+
+.weui-slideview_icon .weui-slideview__btn__icon {
+ display: inline-block;
+ vertical-align: middle;
+ width: 22px;
+ height: 22px
+}
+
+page {
+ --height: 44px;
+ --right: 190rpx
+}
+
+.weui-navigation-bar {
+ overflow: hidden;
+ color: var(--weui-FG-0)
+}
+
+.weui-navigation-bar .android {
+ --height: 48px;
+ --right: 222rpx
+}
+
+.weui-navigation-bar__inner {
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 5001;
+ height: var(--height);
+ padding-right: var(--right);
+ width: calc(100% - var(--right))
+}
+
+.weui-navigation-bar__inner,
+.weui-navigation-bar__inner .weui-navigation-bar__left {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__left {
+ position: relative;
+ width: var(--right);
+ padding-left: 16px
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn {
+ display: inline-block;
+ vertical-align: middle;
+ background-repeat: no-repeat
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback {
+ font-size: 12px;
+ width: 1em;
+ height: 2em;
+ -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%;
+ mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover;
+ background-color: currentColor
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active {
+ opacity: .5
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__center {
+ font-size: 17px;
+ text-align: center;
+ position: relative;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__loading {
+ margin-right: 4px;
+ font-size: 0
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading {
+ margin-left: 0
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__right {
+ margin-right: 16px
+}
+
+.weui-navigation-bar__placeholder {
+ height: var(--height);
+ background: var(--weui-BG-1);
+ position: relative;
+ z-index: 50
+}
+
+.weui-uploader__hd {
+ display: block
+}
+
+.weui-uploader__overview {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-uploader__tips {
+ color: var(--weui-FG-2);
+ font-size: 14px;
+ line-height: 1.4;
+ padding-top: 4px
+}
+
+.weui-uploader__img {
+ display: block;
+ width: 100%;
+ height: 100%
+}
+
+.weui-gallery {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ -webkit-flex-wrap: nowrap;
+ flex-wrap: nowrap
+}
+
+.weui-gallery__info {
+ color: #fff;
+ font-size: 17px;
+ line-height: 60px;
+ min-height: 60px;
+ text-align: center
+}
+
+.weui-gallery__img__wrp {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ position: relative;
+ font-size: 0
+}
+
+.weui-gallery__img {
+ position: absolute;
+ width: 100%;
+ height: 100%
+}
+
+.weui-gallery__opr {
+ position: static
+}
+
+.weui-search-bar .weui-search-bar__box .weui-search-bar__input {
+ height: inherit;
+ line-height: inherit
+}
+
+.weui-search-bar .weui-search-bar__box .weui-icon-clear {
+ display: block
+}
+
+.weui-loadmore .weui-loading {
+ margin-right: .3em
+}
+
+.weui-btn_input-clear {
+ display: block
+}
\ No newline at end of file
diff --git a/miniprogram/config.js b/miniprogram/config.js
index 553482be..0f249e4e 100644
--- a/miniprogram/config.js
+++ b/miniprogram/config.js
@@ -37,13 +37,13 @@ const config = {
uploadFileUrl: `https://${host}/upload`,
// 下载示例图片接口
- downloadExampleUrl: `https://${host}/static/weapp.jpg`,
+ downloadExampleUrl: 'cloud://release-b86096.7265-release-b86096-1258211818/demo.jpg',
// 云开发环境 ID
envId: 'release-b86096',
// 云开发-存储 示例文件的文件 ID
- demoImageFileId: 'cloud://release-b86096.7265-release-b86096/demo.jpg',
+ demoImageFileId: 'cloud://release-b86096.7265-release-b86096-1258211818/demo.jpg',
demoVideoFileId: 'cloud://release-b86096.7265-release-b86096/demo.mp4',
}
diff --git a/miniprogram/demo.theme.json b/miniprogram/demo.theme.json
new file mode 100644
index 00000000..bfa22242
--- /dev/null
+++ b/miniprogram/demo.theme.json
@@ -0,0 +1,40 @@
+{
+ "light": {
+ "navigationBarTextStyle": "black",
+ "navigationBarBackgroundColor": "#F7F7F7",
+ "backgroundColor": "#F7F7F7",
+
+ "tabBarColor": "#7A7E83",
+ "tabBarSelectedColor": "#3cc51f",
+ "tabBarBorderStyle": "black",
+ "tabBarBackgroundColor": "#F7F7F7",
+
+ "iconPathComponent": "image/icon_component.png",
+ "selectedIconPathComponent": "image/icon_component_HL.png",
+ "iconPathAPI": "image/icon_API.png",
+ "selectedIconPathAPI": "image/icon_API_HL.png",
+ "iconPathCloud": "image/icon_cloud.png",
+ "selectedIconPathCloud": "image/icon_cloud_HL.png",
+
+ "backgroundTextStyle": "dark"
+ },
+ "dark": {
+ "navigationBarTextStyle": "white",
+ "navigationBarBackgroundColor": "#1F1F1F",
+ "backgroundColor": "#1F1F1F",
+
+ "tabBarColor": "#FFFFFFCC",
+ "tabBarSelectedColor": "#51A937",
+ "tabBarBorderStyle": "white",
+ "tabBarBackgroundColor": "#1F1F1F",
+
+ "iconPathComponent": "image/icon_component_dark.png",
+ "selectedIconPathComponent": "image/icon_component_HL.png",
+ "iconPathAPI": "image/icon_API_dark.png",
+ "selectedIconPathAPI": "image/icon_API_HL.png",
+ "iconPathCloud": "image/icon_cloud_dark.png",
+ "selectedIconPathCloud": "image/icon_cloud_HL.png",
+
+ "backgroundTextStyle": "light"
+ }
+}
\ No newline at end of file
diff --git a/miniprogram/image/icon_API_HL.png b/miniprogram/image/icon_API_HL.png
index 5b7ae94b..6fa3707f 100644
Binary files a/miniprogram/image/icon_API_HL.png and b/miniprogram/image/icon_API_HL.png differ
diff --git a/miniprogram/image/icon_API_dark.png b/miniprogram/image/icon_API_dark.png
new file mode 100644
index 00000000..7b8f2e25
Binary files /dev/null and b/miniprogram/image/icon_API_dark.png differ
diff --git a/miniprogram/image/icon_cloud_dark.png b/miniprogram/image/icon_cloud_dark.png
new file mode 100644
index 00000000..d30fc6f9
Binary files /dev/null and b/miniprogram/image/icon_cloud_dark.png differ
diff --git a/miniprogram/image/icon_component_dark.png b/miniprogram/image/icon_component_dark.png
new file mode 100644
index 00000000..12285204
Binary files /dev/null and b/miniprogram/image/icon_component_dark.png differ
diff --git a/miniprogram/image/plus_dark.png b/miniprogram/image/plus_dark.png
new file mode 100644
index 00000000..b9bb6833
Binary files /dev/null and b/miniprogram/image/plus_dark.png differ
diff --git a/miniprogram/miniprogram_npm/eventemitter3/index.js b/miniprogram/miniprogram_npm/eventemitter3/index.js
new file mode 100644
index 00000000..3ea05841
--- /dev/null
+++ b/miniprogram/miniprogram_npm/eventemitter3/index.js
@@ -0,0 +1,348 @@
+module.exports = (function() {
+var __MODS__ = {};
+var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
+var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
+var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
+var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
+__DEFINE__(1591242034685, function(require, module, exports) {
+
+
+var has = Object.prototype.hasOwnProperty
+ , prefix = '~';
+
+/**
+ * Constructor to create a storage for our `EE` objects.
+ * An `Events` instance is a plain object whose properties are event names.
+ *
+ * @constructor
+ * @private
+ */
+function Events() {}
+
+//
+// We try to not inherit from `Object.prototype`. In some engines creating an
+// instance in this way is faster than calling `Object.create(null)` directly.
+// If `Object.create(null)` is not supported we prefix the event names with a
+// character to make sure that the built-in object properties are not
+// overridden or used as an attack vector.
+//
+if (Object.create) {
+ Events.prototype = Object.create(null);
+
+ //
+ // This hack is needed because the `__proto__` property is still inherited in
+ // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
+ //
+ if (!new Events().__proto__) prefix = false;
+}
+
+/**
+ * Representation of a single event listener.
+ *
+ * @param {Function} fn The listener function.
+ * @param {*} context The context to invoke the listener with.
+ * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
+ * @constructor
+ * @private
+ */
+function EE(fn, context, once) {
+ this.fn = fn;
+ this.context = context;
+ this.once = once || false;
+}
+
+/**
+ * Add a listener for a given event.
+ *
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} context The context to invoke the listener with.
+ * @param {Boolean} once Specify if the listener is a one-time listener.
+ * @returns {EventEmitter}
+ * @private
+ */
+function addListener(emitter, event, fn, context, once) {
+ if (typeof fn !== 'function') {
+ throw new TypeError('The listener must be a function');
+ }
+
+ var listener = new EE(fn, context || emitter, once)
+ , evt = prefix ? prefix + event : event;
+
+ if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
+ else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
+ else emitter._events[evt] = [emitter._events[evt], listener];
+
+ return emitter;
+}
+
+/**
+ * Clear event by name.
+ *
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
+ * @param {(String|Symbol)} evt The Event name.
+ * @private
+ */
+function clearEvent(emitter, evt) {
+ if (--emitter._eventsCount === 0) emitter._events = new Events();
+ else delete emitter._events[evt];
+}
+
+/**
+ * Minimal `EventEmitter` interface that is molded against the Node.js
+ * `EventEmitter` interface.
+ *
+ * @constructor
+ * @public
+ */
+function EventEmitter() {
+ this._events = new Events();
+ this._eventsCount = 0;
+}
+
+/**
+ * Return an array listing the events for which the emitter has registered
+ * listeners.
+ *
+ * @returns {Array}
+ * @public
+ */
+EventEmitter.prototype.eventNames = function eventNames() {
+ var names = []
+ , events
+ , name;
+
+ if (this._eventsCount === 0) return names;
+
+ for (name in (events = this._events)) {
+ if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
+ }
+
+ if (Object.getOwnPropertySymbols) {
+ return names.concat(Object.getOwnPropertySymbols(events));
+ }
+
+ return names;
+};
+
+/**
+ * Return the listeners registered for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Array} The registered listeners.
+ * @public
+ */
+EventEmitter.prototype.listeners = function listeners(event) {
+ var evt = prefix ? prefix + event : event
+ , handlers = this._events[evt];
+
+ if (!handlers) return [];
+ if (handlers.fn) return [handlers.fn];
+
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
+ ee[i] = handlers[i].fn;
+ }
+
+ return ee;
+};
+
+/**
+ * Return the number of listeners listening to a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Number} The number of listeners.
+ * @public
+ */
+EventEmitter.prototype.listenerCount = function listenerCount(event) {
+ var evt = prefix ? prefix + event : event
+ , listeners = this._events[evt];
+
+ if (!listeners) return 0;
+ if (listeners.fn) return 1;
+ return listeners.length;
+};
+
+/**
+ * Calls each of the listeners registered for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Boolean} `true` if the event had listeners, else `false`.
+ * @public
+ */
+EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events[evt]) return false;
+
+ var listeners = this._events[evt]
+ , len = arguments.length
+ , args
+ , i;
+
+ if (listeners.fn) {
+ if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
+
+ switch (len) {
+ case 1: return listeners.fn.call(listeners.context), true;
+ case 2: return listeners.fn.call(listeners.context, a1), true;
+ case 3: return listeners.fn.call(listeners.context, a1, a2), true;
+ case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
+ case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
+ case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
+ }
+
+ for (i = 1, args = new Array(len -1); i < len; i++) {
+ args[i - 1] = arguments[i];
+ }
+
+ listeners.fn.apply(listeners.context, args);
+ } else {
+ var length = listeners.length
+ , j;
+
+ for (i = 0; i < length; i++) {
+ if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
+
+ switch (len) {
+ case 1: listeners[i].fn.call(listeners[i].context); break;
+ case 2: listeners[i].fn.call(listeners[i].context, a1); break;
+ case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
+ case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
+ default:
+ if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
+ args[j - 1] = arguments[j];
+ }
+
+ listeners[i].fn.apply(listeners[i].context, args);
+ }
+ }
+ }
+
+ return true;
+};
+
+/**
+ * Add a listener for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} [context=this] The context to invoke the listener with.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.on = function on(event, fn, context) {
+ return addListener(this, event, fn, context, false);
+};
+
+/**
+ * Add a one-time listener for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} [context=this] The context to invoke the listener with.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.once = function once(event, fn, context) {
+ return addListener(this, event, fn, context, true);
+};
+
+/**
+ * Remove the listeners of a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn Only remove the listeners that match this function.
+ * @param {*} context Only remove the listeners that have this context.
+ * @param {Boolean} once Only remove one-time listeners.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events[evt]) return this;
+ if (!fn) {
+ clearEvent(this, evt);
+ return this;
+ }
+
+ var listeners = this._events[evt];
+
+ if (listeners.fn) {
+ if (
+ listeners.fn === fn &&
+ (!once || listeners.once) &&
+ (!context || listeners.context === context)
+ ) {
+ clearEvent(this, evt);
+ }
+ } else {
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
+ if (
+ listeners[i].fn !== fn ||
+ (once && !listeners[i].once) ||
+ (context && listeners[i].context !== context)
+ ) {
+ events.push(listeners[i]);
+ }
+ }
+
+ //
+ // Reset the array, or remove it completely if we have no more listeners.
+ //
+ if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
+ else clearEvent(this, evt);
+ }
+
+ return this;
+};
+
+/**
+ * Remove all listeners, or those of the specified event.
+ *
+ * @param {(String|Symbol)} [event] The event name.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
+ var evt;
+
+ if (event) {
+ evt = prefix ? prefix + event : event;
+ if (this._events[evt]) clearEvent(this, evt);
+ } else {
+ this._events = new Events();
+ this._eventsCount = 0;
+ }
+
+ return this;
+};
+
+//
+// Alias methods names because people roll like that.
+//
+EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
+EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+
+//
+// Expose the prefix.
+//
+EventEmitter.prefixed = prefix;
+
+//
+// Allow `EventEmitter` to be imported as module namespace.
+//
+EventEmitter.EventEmitter = EventEmitter;
+
+//
+// Expose the module.
+//
+if ('undefined' !== typeof module) {
+ module.exports = EventEmitter;
+}
+
+}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
+return __REQUIRE__(1591242034685);
+})()
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/eventemitter3/index.js.map b/miniprogram/miniprogram_npm/eventemitter3/index.js.map
new file mode 100644
index 00000000..4f2cb7b6
--- /dev/null
+++ b/miniprogram/miniprogram_npm/eventemitter3/index.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n"]}
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-barrage/index.js b/miniprogram/miniprogram_npm/miniprogram-barrage/index.js
new file mode 100644
index 00000000..06cbf7bb
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-barrage/index.js
@@ -0,0 +1,1368 @@
+module.exports =
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // create a fake namespace object
+/******/ // mode & 1: value is a module id, require it
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = __webpack_require__(value);
+/******/ if(mode & 8) return value;
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ return ns;
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 1);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+// 获取字节长度,中文算2个字节
+function getStrLen(str) {
+ // eslint-disable-next-line no-control-regex
+ return str.replace(/[^\x00-\xff]/g, 'aa').length;
+}
+
+// 截取指定字节长度的子串
+function substring(str, n) {
+ if (!str) return '';
+
+ var len = getStrLen(str);
+ if (n >= len) return str;
+
+ var l = 0;
+ var result = '';
+ for (var i = 0; i < str.length; i++) {
+ var ch = str.charAt(i);
+ // eslint-disable-next-line no-control-regex
+ l = /[^\x00-\xff]/i.test(ch) ? l + 2 : l + 1;
+ result += ch;
+ if (l >= n) break;
+ }
+ return result;
+}
+
+function getRandom() {
+ var max = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
+ var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
+
+ return Math.floor(Math.random() * (max - min) + min);
+}
+
+function getFontSize(font) {
+ var reg = /(\d+)(px)/i;
+ var match = font.match(reg);
+ return match && match[1] || 10;
+}
+
+function compareVersion(v1, v2) {
+ v1 = v1.split('.');
+ v2 = v2.split('.');
+ var len = Math.max(v1.length, v2.length);
+
+ while (v1.length < len) {
+ v1.push('0');
+ }
+ while (v2.length < len) {
+ v2.push('0');
+ }
+
+ for (var i = 0; i < len; i++) {
+ var num1 = parseInt(v1[i], 10);
+ var num2 = parseInt(v2[i], 10);
+
+ if (num1 > num2) {
+ return 1;
+ } else if (num1 < num2) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
+module.exports = {
+ getStrLen: getStrLen,
+ substring: substring,
+ getRandom: getRandom,
+ getFontSize: getFontSize,
+ compareVersion: compareVersion
+};
+
+/***/ }),
+/* 1 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var _barrageDom = __webpack_require__(2);
+
+var _barrageDom2 = _interopRequireDefault(_barrageDom);
+
+var _barrageCanvas = __webpack_require__(3);
+
+var _barrageCanvas2 = _interopRequireDefault(_barrageCanvas);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+Component({
+ options: {
+ addGlobalClass: true
+ },
+
+ properties: {
+ zIndex: {
+ type: Number,
+ value: 10
+ },
+
+ renderingMode: {
+ type: String,
+ value: 'canvas'
+ }
+ },
+
+ methods: {
+ getBarrageInstance: function getBarrageInstance() {
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ opt.comp = this;
+ this.barrageInstance = this.data.renderingMode === 'dom' ? new _barrageDom2.default(opt) : new _barrageCanvas2.default(opt);
+ return this.barrageInstance;
+ },
+ onAnimationend: function onAnimationend(e) {
+ var _e$currentTarget$data = e.currentTarget.dataset,
+ tunnelid = _e$currentTarget$data.tunnelid,
+ bulletid = _e$currentTarget$data.bulletid;
+
+ this.barrageInstance.animationend({
+ tunnelId: tunnelid,
+ bulletId: bulletid
+ });
+ },
+ onTapBullet: function onTapBullet(e) {
+ var _e$currentTarget$data2 = e.currentTarget.dataset,
+ tunnelid = _e$currentTarget$data2.tunnelid,
+ bulletid = _e$currentTarget$data2.bulletid;
+
+ this.barrageInstance.tapBullet({
+ tunnelId: tunnelid,
+ bulletId: bulletid
+ });
+ }
+ }
+});
+
+/***/ }),
+/* 2 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var _require = __webpack_require__(0),
+ substring = _require.substring,
+ getRandom = _require.getRandom,
+ getFontSize = _require.getFontSize;
+
+var Bullet = function () {
+ function Bullet() {
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ _classCallCheck(this, Bullet);
+
+ this.bulletId = opt.bulletId;
+ this.addContent(opt);
+ }
+
+ /**
+ * image 结构
+ * {
+ * head: {src, width, height},
+ * tail: {src, width, height},
+ * gap: 4 // 图片与文本间隔
+ * }
+ */
+
+
+ Bullet.prototype.addContent = function addContent() {
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ var defaultBulletOpt = {
+ duration: 0, // 动画时长
+ passtime: 0, // 弹幕穿越右边界耗时
+ content: '', // 文本
+ color: '#000000', // 默认黑色
+ width: 0, // 弹幕宽度
+ height: 0, // 弹幕高度
+ image: {}, // 图片
+ paused: false // 是否暂停
+ };
+ Object.assign(this, defaultBulletOpt, opt);
+ };
+
+ Bullet.prototype.removeContent = function removeContent() {
+ this.addContent({});
+ };
+
+ return Bullet;
+}();
+
+// tunnel(轨道)
+
+
+var Tunnel = function () {
+ function Tunnel() {
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ _classCallCheck(this, Tunnel);
+
+ var defaultTunnelOpt = {
+ tunnelId: 0,
+ height: 0, // 轨道高度
+ width: 0, // 轨道宽度
+ safeGap: 4, // 相邻弹幕安全间隔
+ maxNum: 10, // 缓冲队列长度
+ bullets: [], // 弹幕
+ last: -1, // 上一条发送的弹幕序号
+ bulletStatus: [], // 0 空闲,1 占用中
+ disabled: false, // 禁用中
+ sending: false, // 弹幕正在发送
+ timer: null // 定时器
+ };
+ Object.assign(this, defaultTunnelOpt, opt);
+ this.bulletStatus = new Array(this.maxNum).fill(0);
+ for (var i = 0; i < this.maxNum; i++) {
+ this.bullets.push(new Bullet({
+ bulletId: i
+ }));
+ }
+ }
+
+ Tunnel.prototype.disable = function disable() {
+ this.disabled = true;
+ this.last = -1;
+ this.sending = false;
+ this.bulletStatus = new Array(this.maxNum).fill(1);
+ this.bullets.forEach(function (bullet) {
+ return bullet.removeContent();
+ });
+ };
+
+ Tunnel.prototype.enable = function enable() {
+ if (this.disabled) {
+ this.bulletStatus = new Array(this.maxNum).fill(0);
+ }
+ this.disabled = false;
+ };
+
+ Tunnel.prototype.clear = function clear() {
+ this.last = -1;
+ this.sending = false;
+ this.bulletStatus = new Array(this.maxNum).fill(0);
+ this.bullets.forEach(function (bullet) {
+ return bullet.removeContent();
+ });
+ if (this.timer) {
+ clearTimeout(this.timer);
+ }
+ };
+
+ Tunnel.prototype.getIdleBulletIdx = function getIdleBulletIdx() {
+ var idle = this.bulletStatus.indexOf(0, this.last + 1);
+ if (idle === -1) {
+ idle = this.bulletStatus.indexOf(0);
+ }
+
+ return idle;
+ };
+
+ Tunnel.prototype.getIdleBulletNum = function getIdleBulletNum() {
+ var count = 0;
+ this.bulletStatus.forEach(function (status) {
+ if (status === 0) count++;
+ });
+ return count;
+ };
+
+ Tunnel.prototype.addBullet = function addBullet(opt) {
+ if (this.disabled) return;
+ var idx = this.getIdleBulletIdx();
+ if (idx >= 0) {
+ this.bulletStatus[idx] = 1;
+ this.bullets[idx].addContent(opt);
+ }
+ };
+
+ Tunnel.prototype.removeBullet = function removeBullet(bulletId) {
+ if (this.disabled) return;
+ this.bulletStatus[bulletId] = 0;
+ var bullet = this.bullets[bulletId];
+ bullet.removeContent();
+ };
+
+ return Tunnel;
+}();
+
+// Barrage(控制中心)
+
+
+var Barrage = function () {
+ function Barrage() {
+ var _this = this;
+
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ _classCallCheck(this, Barrage);
+
+ var defaultBarrageOpt = {
+ duration: 10, // 弹幕动画时长
+ lineHeight: 1.2, // 弹幕行高
+ padding: [0, 0, 0, 0], // 弹幕区四周留白
+ alpha: 1, // 全局透明度
+ font: '10px sans-serif', // 全局字体
+ mode: 'separate', // 弹幕重叠 overlap 不重叠 separate
+ range: [0, 1], // 弹幕显示的垂直范围,支持两个值。[0,1]表示弹幕整个随机分布,
+ tunnelShow: false, // 显示轨道线
+ tunnelMaxNum: 30, // 隧道最大缓冲长度
+ maxLength: 30, // 弹幕最大字节长度,汉字算双字节
+ safeGap: 4, // 发送时的安全间隔
+ enableTap: false, // 点击弹幕停止动画高亮显示
+ tunnelHeight: 0,
+ tunnelNum: 0,
+ tunnels: [],
+ idleTunnels: null,
+ enableTunnels: null,
+ distance: 2000,
+ comp: null // 组件实例
+ };
+ Object.assign(this, defaultBarrageOpt, opt);
+ this._ready = false;
+ this._deferred = [];
+
+ var query = this.comp.createSelectorQuery();
+ query.select('.barrage-area').boundingClientRect(function (res) {
+ _this.init(res);
+ _this.ready();
+ }).exec();
+ }
+
+ Barrage.prototype.ready = function ready() {
+ var _this2 = this;
+
+ this._ready = true;
+ this._deferred.forEach(function (item) {
+ // eslint-disable-next-line prefer-spread
+ _this2[item.callback].apply(_this2, item.args);
+ });
+
+ this._deferred = [];
+ };
+
+ Barrage.prototype._delay = function _delay(method, args) {
+ this._deferred.push({
+ callback: method,
+ args: args
+ });
+ };
+
+ Barrage.prototype.init = function init(opt) {
+ this.width = opt.width;
+ this.height = opt.height;
+ this.fontSize = getFontSize(this.font);
+ this.idleTunnels = new Set();
+ this.enableTunnels = new Set();
+ this.tunnels = [];
+ this.availableHeight = this.height - this.padding[0] - this.padding[2];
+ this.tunnelHeight = this.fontSize * this.lineHeight;
+ this.tunnelNum = Math.floor(this.availableHeight / this.tunnelHeight);
+ for (var i = 0; i < this.tunnelNum; i++) {
+ this.idleTunnels.add(i); // 空闲的隧道id集合
+ this.enableTunnels.add(i); // 可用的隧道id集合
+
+ this.tunnels.push(new Tunnel({ // 隧道集合
+ width: this.width,
+ height: this.tunnelHeight,
+ safeGap: this.safeGap,
+ maxNum: this.tunnelMaxNum,
+ tunnelId: i
+ }));
+ }
+ this.comp.setData({
+ fontSize: this.fontSize,
+ tunnelShow: this.tunnelShow,
+ tunnels: this.tunnels,
+ font: this.font,
+ alpha: this.alpha,
+ padding: this.padding.map(function (item) {
+ return item + 'px';
+ }).join(' ')
+ });
+ // 筛选符合范围的隧道
+ this.setRange();
+ };
+
+ // 设置显示范围 range: [0,1]
+
+
+ Barrage.prototype.setRange = function setRange(range) {
+ var _this3 = this;
+
+ if (!this._ready) {
+ this._delay('setRange', range);
+ return;
+ }
+
+ range = range || this.range;
+ var top = range[0] * this.tunnelNum;
+ var bottom = range[1] * this.tunnelNum;
+ // 释放符合要求的隧道
+ // 找到目前空闲的隧道
+ var idleTunnels = new Set();
+ var enableTunnels = new Set();
+ this.tunnels.forEach(function (tunnel, tunnelId) {
+ if (tunnelId >= top && tunnelId < bottom) {
+ var disabled = tunnel.disabled;
+ tunnel.enable();
+ enableTunnels.add(tunnelId);
+
+ if (disabled || _this3.idleTunnels.has(tunnelId)) {
+ idleTunnels.add(tunnelId);
+ }
+ } else {
+ tunnel.disable();
+ }
+ });
+ this.idleTunnels = idleTunnels;
+ this.enableTunnels = enableTunnels;
+ this.range = range;
+ this.comp.setData({ tunnels: this.tunnels });
+ };
+
+ Barrage.prototype.setFont = function setFont(font) {
+ if (!this._ready) {
+ this._delay('setFont', font);
+ return;
+ }
+
+ if (typeof font !== 'string') return;
+ this.font = font;
+ this.comp.setData({ font: font });
+ };
+
+ Barrage.prototype.setAlpha = function setAlpha(alpha) {
+ if (!this._ready) {
+ this._delay('setAlpha', alpha);
+ return;
+ }
+
+ if (typeof alpha !== 'number') return;
+ this.alpha = alpha;
+ this.comp.setData({ alpha: alpha });
+ };
+
+ Barrage.prototype.setDuration = function setDuration(duration) {
+ if (!this._ready) {
+ this._delay('setDuration', duration);
+ return;
+ }
+
+ if (typeof duration !== 'number') return;
+ this.duration = duration;
+ this.clear();
+ };
+
+ // 开启弹幕
+
+
+ Barrage.prototype.open = function open() {
+ if (!this._ready) {
+ this._delay('open');
+ return;
+ }
+
+ this._isActive = true;
+ };
+
+ // 关闭弹幕,清除所有数据
+
+
+ Barrage.prototype.close = function close() {
+ if (!this._ready) {
+ this._delay('close');
+ return;
+ }
+
+ this._isActive = false;
+ this.clear();
+ };
+
+ Barrage.prototype.clear = function clear() {
+ this.tunnels.forEach(function (tunnel) {
+ return tunnel.clear();
+ });
+ this.idleTunnels = new Set(this.enableTunnels);
+ this.comp.setData({ tunnels: this.tunnels });
+ };
+
+ // 添加一批弹幕,轨道满时会被丢弃
+
+
+ Barrage.prototype.addData = function addData() {
+ var _this4 = this;
+
+ var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+
+ if (!this._ready) {
+ this._delay('addData', data);
+ return;
+ }
+
+ if (!this._isActive) return;
+
+ data.forEach(function (item) {
+ item.content = substring(item.content, _this4.maxLength);
+ _this4.addBullet2Tunnel(item);
+ });
+ this.comp.setData({
+ tunnels: this.tunnels
+ }, function () {
+ _this4.updateBullets();
+ });
+ };
+
+ // 发送一条弹幕
+
+
+ Barrage.prototype.send = function send() {
+ var _this5 = this;
+
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ if (!this._ready) {
+ this._delay('send', opt);
+ return;
+ }
+ var tunnel = this.getEnableTunnel();
+ if (tunnel === null) return;
+
+ var timer = setInterval(function () {
+ var tunnel = _this5.getIdleTunnel();
+ if (tunnel) {
+ _this5.addData([opt]);
+ clearInterval(timer);
+ }
+ }, 16);
+ };
+
+ // 添加至轨道
+
+
+ Barrage.prototype.addBullet2Tunnel = function addBullet2Tunnel() {
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ var tunnel = this.getIdleTunnel();
+ if (tunnel === null) return;
+
+ var tunnelId = tunnel.tunnelId;
+ tunnel.addBullet(opt);
+ if (tunnel.getIdleBulletNum() === 0) this.removeIdleTunnel(tunnelId);
+ };
+
+ Barrage.prototype.updateBullets = function updateBullets() {
+ var _this6 = this;
+
+ var self = this;
+ var query = this.comp.createSelectorQuery();
+ query.selectAll('.bullet-item').boundingClientRect(function (res) {
+ if (!_this6._isActive) return;
+
+ for (var i = 0; i < res.length; i++) {
+ var _res$i$dataset = res[i].dataset,
+ tunnelid = _res$i$dataset.tunnelid,
+ bulletid = _res$i$dataset.bulletid;
+
+ var tunnel = self.tunnels[tunnelid];
+ var bullet = tunnel.bullets[bulletid];
+ bullet.width = res[i].width;
+ bullet.height = res[i].height;
+ }
+ self.animate();
+ }).exec();
+ };
+
+ Barrage.prototype.animate = function animate() {
+ var _this7 = this;
+
+ this.tunnels.forEach(function (tunnel) {
+ _this7.tunnelAnimate(tunnel);
+ });
+ };
+
+ Barrage.prototype.tunnelAnimate = function tunnelAnimate(tunnel) {
+ var _this8 = this;
+
+ if (tunnel.disabled || tunnel.sending || !this._isActive) return;
+
+ var next = (tunnel.last + 1) % tunnel.maxNum;
+ var bullet = tunnel.bullets[next];
+
+ if (!bullet) return;
+
+ if (bullet.content || bullet.image.head || bullet.image.tail) {
+ var _comp$setData;
+
+ tunnel.sending = true;
+ tunnel.last = next;
+ var duration = this.duration;
+ if (this.mode === 'overlap') {
+ duration = this.distance * this.duration / (this.distance + bullet.width);
+ }
+ var passDistance = bullet.width + tunnel.safeGap;
+ bullet.duration = duration;
+ // 等上一条通过右边界
+ bullet.passtime = Math.ceil(passDistance * bullet.duration * 1000 / this.distance);
+ this.comp.setData((_comp$setData = {}, _comp$setData['tunnels[' + tunnel.tunnelId + '].bullets[' + bullet.bulletId + ']'] = bullet, _comp$setData), function () {
+ tunnel.timer = setTimeout(function () {
+ tunnel.sending = false;
+ _this8.tunnelAnimate(tunnel);
+ }, bullet.passtime);
+ });
+ }
+ };
+
+ Barrage.prototype.showTunnel = function showTunnel() {
+ this.comp.setData({
+ tunnelShow: true
+ });
+ };
+
+ Barrage.prototype.hideTunnel = function hideTunnel() {
+ this.comp.setData({
+ tunnelShow: false
+ });
+ };
+
+ Barrage.prototype.removeIdleTunnel = function removeIdleTunnel(tunnelId) {
+ this.idleTunnels.delete(tunnelId);
+ };
+
+ Barrage.prototype.addIdleTunnel = function addIdleTunnel(tunnelId) {
+ this.idleTunnels.add(tunnelId);
+ };
+
+ // 从可用的隧道中随机挑选一个
+
+
+ Barrage.prototype.getEnableTunnel = function getEnableTunnel() {
+ if (this.enableTunnels.size === 0) return null;
+ var enableTunnels = Array.from(this.enableTunnels);
+ var index = getRandom(enableTunnels.length);
+ return this.tunnels[enableTunnels[index]];
+ };
+
+ // 从还有余量的隧道中随机挑选一个
+
+
+ Barrage.prototype.getIdleTunnel = function getIdleTunnel() {
+ if (this.idleTunnels.size === 0) return null;
+ var idleTunnels = Array.from(this.idleTunnels);
+ var index = getRandom(idleTunnels.length);
+ return this.tunnels[idleTunnels[index]];
+ };
+
+ Barrage.prototype.animationend = function animationend(opt) {
+ var _comp$setData2;
+
+ var tunnelId = opt.tunnelId,
+ bulletId = opt.bulletId;
+
+ var tunnel = this.tunnels[tunnelId];
+ var bullet = tunnel.bullets[bulletId];
+
+ if (!tunnel || !bullet) return;
+
+ tunnel.removeBullet(bulletId);
+ this.addIdleTunnel(tunnelId);
+ this.comp.setData((_comp$setData2 = {}, _comp$setData2['tunnels[' + tunnelId + '].bullets[' + bulletId + ']'] = bullet, _comp$setData2));
+ };
+
+ Barrage.prototype.tapBullet = function tapBullet(opt) {
+ var _comp$setData3;
+
+ if (!this.enableTap) return;
+
+ var tunnelId = opt.tunnelId,
+ bulletId = opt.bulletId;
+
+ var tunnel = this.tunnels[tunnelId];
+ var bullet = tunnel.bullets[bulletId];
+ bullet.paused = !bullet.paused;
+ this.comp.setData((_comp$setData3 = {}, _comp$setData3['tunnels[' + tunnelId + '].bullets[' + bulletId + ']'] = bullet, _comp$setData3));
+ };
+
+ return Barrage;
+}();
+
+exports.default = Barrage;
+
+/***/ }),
+/* 3 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+var _utils = __webpack_require__(0);
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var Bullet = function () {
+ function Bullet(barrage) {
+ var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+
+ _classCallCheck(this, Bullet);
+
+ var defaultBulletOpt = {
+ color: '#000000', // 默认黑色
+ font: '10px sans-serif',
+ fontSize: 10, // 全局字体大小
+ content: '',
+ textWidth: 0,
+ speed: 0, // 根据屏幕停留时长计算
+ x: 0,
+ y: 0,
+ tunnelId: 0,
+ // image: {
+ // head: {src, width, height}, // 弹幕头部添加图片
+ // tail: {src, width, height}, // 弹幕尾部添加图片
+ // gap: 4 // 图片与文本间隔
+ // }
+ image: {},
+ imageHead: null, // Image 对象
+ imageTail: null
+ // status: 0 //0:待播放 1: 未完全进入屏幕 2: 完全进入屏幕 3: 完全退出屏幕
+ };
+ Object.assign(this, defaultBulletOpt, opt);
+
+ this.barrage = barrage;
+ this.ctx = barrage.ctx;
+ this.canvas = barrage.canvas;
+ }
+
+ Bullet.prototype.move = function move() {
+ var _this = this;
+
+ if (this.image.head && !this.imageHead) {
+ var Image = this.canvas.createImage();
+ Image.src = this.image.head.src;
+ Image.onload = function () {
+ _this.imageHead = Image;
+ };
+ Image.onerror = function () {
+ // eslint-disable-next-line no-console
+ console.log('Fail to load image: ' + _this.image.head.src);
+ };
+ }
+
+ if (this.image.tail && !this.imageTail) {
+ var _Image = this.canvas.createImage();
+ _Image.src = this.image.tail.src;
+ _Image.onload = function () {
+ _this.imageTail = _Image;
+ };
+ _Image.onerror = function () {
+ // eslint-disable-next-line no-console
+ console.log('Fail to load image: ' + _this.image.tail.src);
+ };
+ }
+
+ if (this.imageHead) {
+ var _image$head = this.image.head,
+ _image$head$width = _image$head.width,
+ width = _image$head$width === undefined ? this.fontSize : _image$head$width,
+ _image$head$height = _image$head.height,
+ height = _image$head$height === undefined ? this.fontSize : _image$head$height,
+ _image$head$gap = _image$head.gap,
+ gap = _image$head$gap === undefined ? 4 : _image$head$gap;
+
+ var x = this.x - gap - width;
+ var y = this.y - 0.5 * height;
+ this.ctx.drawImage(this.imageHead, x, y, width, height);
+ }
+
+ if (this.imageTail) {
+ var _image$tail = this.image.tail,
+ _image$tail$width = _image$tail.width,
+ _width = _image$tail$width === undefined ? this.fontSize : _image$tail$width,
+ _image$tail$height = _image$tail.height,
+ _height = _image$tail$height === undefined ? this.fontSize : _image$tail$height,
+ _image$tail$gap = _image$tail.gap,
+ _gap = _image$tail$gap === undefined ? 4 : _image$tail$gap;
+
+ var _x2 = this.x + this.textWidth + _gap;
+ var _y = this.y - 0.5 * _height;
+ this.ctx.drawImage(this.imageTail, _x2, _y, _width, _height);
+ }
+
+ this.x = this.x - this.speed;
+ this.ctx.fillStyle = this.color;
+ this.ctx.fillText(this.content, this.x, this.y);
+ };
+
+ return Bullet;
+}();
+
+// tunnel(轨道)
+
+
+var Tunnel = function () {
+ function Tunnel(barrage) {
+ var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+
+ _classCallCheck(this, Tunnel);
+
+ var defaultTunnelOpt = {
+ activeQueue: [], // 正在屏幕中列表
+ nextQueue: [], // 待播放列表
+ maxNum: 30,
+ freeNum: 30, // 剩余可添加量
+ height: 0,
+ width: 0,
+ disabled: false,
+ tunnelId: 0,
+ safeArea: 4,
+ sending: false // 弹幕正在发送
+ };
+ Object.assign(this, defaultTunnelOpt, opt);
+
+ this.freeNum = this.maxNum;
+ this.barrage = barrage; // 控制中心
+ this.ctx = barrage.ctx;
+ }
+
+ Tunnel.prototype.disable = function disable() {
+ this.disabled = true;
+ };
+
+ Tunnel.prototype.enable = function enable() {
+ this.disabled = false;
+ };
+
+ Tunnel.prototype.clear = function clear() {
+ this.activeQueue = [];
+ this.nextQueue = [];
+ this.sending = false;
+ this.freeNum = this.maxNum;
+ this.barrage.addIdleTunnel(this.tunnelId);
+ };
+
+ Tunnel.prototype.addBullet = function addBullet(bullet) {
+ if (this.disabled) return;
+ if (this.freeNum === 0) return;
+ this.nextQueue.push(bullet);
+ this.freeNum--;
+ if (this.freeNum === 0) {
+ this.barrage.removeIdleTunnel(this.tunnelId);
+ }
+ };
+
+ Tunnel.prototype.animate = function animate() {
+ if (this.disabled) return;
+ // 无正在发送弹幕,添加一条
+ var nextQueue = this.nextQueue;
+ var activeQueue = this.activeQueue;
+ if (!this.sending && nextQueue.length > 0) {
+ var bullet = nextQueue.shift();
+ activeQueue.push(bullet);
+ this.freeNum++;
+ this.sending = true;
+ this.barrage.addIdleTunnel(this.tunnelId);
+ }
+
+ if (activeQueue.length > 0) {
+ activeQueue.forEach(function (bullet) {
+ return bullet.move();
+ });
+ var head = activeQueue[0];
+ var tail = activeQueue[activeQueue.length - 1];
+ // 队首移出屏幕
+ if (head.x + head.textWidth < 0) {
+ activeQueue.shift();
+ }
+ // 队尾离开超过安全区
+ if (tail.x + tail.textWidth + this.safeArea < this.width) {
+ this.sending = false;
+ }
+ }
+ };
+
+ return Tunnel;
+}();
+
+var Barrage = function () {
+ function Barrage() {
+ var _this2 = this;
+
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ _classCallCheck(this, Barrage);
+
+ var defaultBarrageOpt = {
+ font: '10px sans-serif',
+ duration: 15, // 弹幕屏幕停留时长
+ lineHeight: 1.2,
+ padding: [0, 0, 0, 0],
+ tunnelHeight: 0,
+ tunnelNum: 0,
+ tunnelMaxNum: 30, // 隧道最大缓冲长度
+ maxLength: 30, // 最大字节长度,汉字算双字节
+ safeArea: 4, // 发送时的安全间隔
+ tunnels: [],
+ idleTunnels: [],
+ enableTunnels: [],
+ alpha: 1, // 全局透明度
+ mode: 'separate', // 弹幕重叠 overlap 不重叠 separate
+ range: [0, 1], // 弹幕显示的垂直范围,支持两个值。[0,1]表示弹幕整个随机分布,
+ fps: 60, // 刷新率
+ tunnelShow: false, // 显示轨道线
+ comp: null // 组件实例
+ };
+ Object.assign(this, defaultBarrageOpt, opt);
+ var systemInfo = wx.getSystemInfoSync();
+ this.ratio = systemInfo.pixelRatio;
+ this.selector = '#weui-canvas';
+ this._ready = false;
+ this._deferred = [];
+
+ var query = this.comp.createSelectorQuery();
+ query.select(this.selector).boundingClientRect();
+ query.select(this.selector).node();
+ query.exec(function (res) {
+ _this2.canvas = res[1].node;
+ _this2.init(res[0]);
+ _this2.ready();
+ });
+ }
+
+ Barrage.prototype.ready = function ready() {
+ var _this3 = this;
+
+ this._ready = true;
+ this._deferred.forEach(function (item) {
+ // eslint-disable-next-line prefer-spread
+ _this3[item.callback].apply(_this3, item.args);
+ });
+
+ this._deferred = [];
+ };
+
+ Barrage.prototype._delay = function _delay(method, args) {
+ this._deferred.push({
+ callback: method,
+ args: args
+ });
+ };
+
+ Barrage.prototype.init = function init() {
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ this.width = opt.width;
+ this.height = opt.height;
+ this.fontSize = (0, _utils.getFontSize)(this.font);
+ this.innerDuration = this.transfromDuration2Canvas(this.duration);
+
+ var ratio = this.ratio; // 设备像素比
+ this.canvas.width = this.width * ratio;
+ this.canvas.height = this.height * ratio;
+ this.ctx = this.canvas.getContext('2d');
+ this.ctx.scale(ratio, ratio);
+
+ this.ctx.textBaseline = 'middle';
+ this.ctx.globalAlpha = this.alpha;
+ this.ctx.font = this.font;
+
+ this.idleTunnels = [];
+ this.enableTunnels = [];
+ this.tunnels = [];
+
+ this.availableHeight = this.height - this.padding[0] - this.padding[2];
+ this.tunnelHeight = this.fontSize * this.lineHeight;
+ this.tunnelNum = Math.floor(this.availableHeight / this.tunnelHeight);
+ for (var i = 0; i < this.tunnelNum; i++) {
+ this.idleTunnels.push(i); // 空闲的隧道id集合
+ this.enableTunnels.push(i); // 可用的隧道id集合
+ this.tunnels.push(new Tunnel(this, { // 隧道集合
+ width: this.width,
+ height: this.tunnelHeight,
+ safeArea: this.safeArea,
+ maxNum: this.tunnelMaxNum,
+ tunnelId: i
+ }));
+ }
+ // 筛选符合范围的隧道
+ this.setRange();
+ this._isActive = false;
+ };
+
+ Barrage.prototype.transfromDuration2Canvas = function transfromDuration2Canvas(duration) {
+ // 2000 是 dom 中移动的距离
+ return duration * this.width / 2000;
+ };
+
+ // 设置显示范围 range: [0,1]
+
+
+ Barrage.prototype.setRange = function setRange(range) {
+ var _this4 = this;
+
+ if (!this._ready) {
+ this._delay('setRange', range);
+ return;
+ }
+
+ range = range || this.range;
+ var top = range[0] * this.tunnelNum;
+ var bottom = range[1] * this.tunnelNum;
+
+ // 释放符合要求的隧道
+ // 找到目前空闲的隧道
+ var idleTunnels = [];
+ var enableTunnels = [];
+ this.tunnels.forEach(function (tunnel, tunnelId) {
+ if (tunnelId >= top && tunnelId < bottom) {
+ tunnel.enable();
+ enableTunnels.push(tunnelId);
+ if (_this4.idleTunnels.indexOf(tunnelId) >= 0) {
+ idleTunnels.push(tunnelId);
+ }
+ } else {
+ tunnel.disable();
+ }
+ });
+ this.idleTunnels = idleTunnels;
+ this.enableTunnels = enableTunnels;
+ this.range = range;
+ };
+
+ Barrage.prototype.setFont = function setFont(font) {
+ if (!this._ready) {
+ this._delay('setFont', font);
+ return;
+ }
+
+ this.font = font;
+ this.fontSize = (0, _utils.getFontSize)(this.font);
+ this.ctx.font = font;
+ };
+
+ Barrage.prototype.setAlpha = function setAlpha(alpha) {
+ if (!this._ready) {
+ this._delay('setAlpha', alpha);
+ return;
+ }
+
+ this.alpha = alpha;
+ this.ctx.globalAlpha = alpha;
+ };
+
+ Barrage.prototype.setDuration = function setDuration(duration) {
+ if (!this._ready) {
+ this._delay('setDuration', duration);
+ return;
+ }
+
+ this.clear();
+ this.duration = duration;
+ this.innerDuration = this.transfromDuration2Canvas(duration);
+ };
+
+ // 开启弹幕
+
+
+ Barrage.prototype.open = function open() {
+ if (!this._ready) {
+ this._delay('open');
+ return;
+ }
+
+ if (this._isActive) return;
+ this._isActive = true;
+ this.play();
+ };
+
+ // 关闭弹幕,清除所有数据
+
+
+ Barrage.prototype.close = function close() {
+ if (!this._ready) {
+ this._delay('close');
+ return;
+ }
+
+ if (!this._isActive) return;
+ this._isActive = false;
+ this.pause();
+ this.clear();
+ };
+
+ // 开启弹幕滚动
+
+
+ Barrage.prototype.play = function play() {
+ var _this5 = this;
+
+ this._rAFId = this.canvas.requestAnimationFrame(function () {
+ _this5.animate();
+ _this5.play();
+ });
+ };
+
+ // 停止弹幕滚动
+
+
+ Barrage.prototype.pause = function pause() {
+ if (typeof this._rAFId === 'number') {
+ this.canvas.cancelAnimationFrame(this._rAFId);
+ }
+ };
+
+ // 清空屏幕和缓冲的数据
+
+
+ Barrage.prototype.clear = function clear() {
+ this.ctx.clearRect(0, 0, this.width, this.height);
+ this.tunnels.forEach(function (tunnel) {
+ return tunnel.clear();
+ });
+ };
+
+ // 添加一批弹幕,轨道满时会被丢弃
+
+
+ Barrage.prototype.addData = function addData() {
+ var _this6 = this;
+
+ var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+
+ if (!this._ready) {
+ this._delay('addData', data);
+ return;
+ }
+
+ if (!this._isActive) return;
+ data.forEach(function (item) {
+ return _this6.addBullet2Tunnel(item);
+ });
+ };
+
+ // 发送一条弹幕
+ // 为保证发送成功,选取一条可用隧道,替换待发送队列队头元素
+
+
+ Barrage.prototype.send = function send() {
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ if (!this._ready) {
+ this._delay('send', opt);
+ return;
+ }
+
+ var tunnel = this.getEnableTunnel();
+ if (tunnel === null) return;
+
+ opt.tunnelId = tunnel.tunnelId;
+ var bullet = this.registerBullet(opt);
+ tunnel.nextQueue[0] = bullet;
+ };
+
+ // 添加至轨道 {content, color}
+
+
+ Barrage.prototype.addBullet2Tunnel = function addBullet2Tunnel() {
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ var tunnel = this.getIdleTunnel();
+ if (tunnel === null) return;
+
+ opt.tunnelId = tunnel.tunnelId;
+ var bullet = this.registerBullet(opt);
+ tunnel.addBullet(bullet);
+ };
+
+ Barrage.prototype.registerBullet = function registerBullet() {
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ opt.tunnelId = opt.tunnelId || 0;
+ opt.content = (0, _utils.substring)(opt.content, this.maxLength);
+ var textWidth = this.getTextWidth(opt.content);
+ var distance = this.mode === 'overlap' ? this.width + textWidth : this.width;
+ opt.textWidth = textWidth;
+ opt.speed = distance / (this.innerDuration * this.fps);
+ opt.fontSize = this.fontSize;
+ opt.x = this.width;
+ opt.y = this.tunnelHeight * (opt.tunnelId + 0.5) + this.padding[0];
+ return new Bullet(this, opt);
+ };
+
+ // 每帧执行的操作
+
+
+ Barrage.prototype.animate = function animate() {
+ // 清空画面后重绘
+ this.ctx.clearRect(0, 0, this.width, this.height);
+ if (this.tunnelShow) {
+ this.drawTunnel();
+ }
+ this.tunnels.forEach(function (tunnel) {
+ return tunnel.animate();
+ });
+ };
+
+ Barrage.prototype.showTunnel = function showTunnel() {
+ this.tunnelShow = true;
+ };
+
+ Barrage.prototype.hideTunnel = function hideTunnel() {
+ this.tunnelShow = false;
+ };
+
+ Barrage.prototype.removeIdleTunnel = function removeIdleTunnel(tunnelId) {
+ var idx = this.idleTunnels.indexOf(tunnelId);
+ if (idx >= 0) this.idleTunnels.splice(idx, 1);
+ };
+
+ Barrage.prototype.addIdleTunnel = function addIdleTunnel(tunnelId) {
+ var idx = this.idleTunnels.indexOf(tunnelId);
+ if (idx < 0) this.idleTunnels.push(tunnelId);
+ };
+
+ // 从可用的隧道中随机挑选一个
+
+
+ Barrage.prototype.getEnableTunnel = function getEnableTunnel() {
+ if (this.enableTunnels.length === 0) return null;
+ var index = (0, _utils.getRandom)(this.enableTunnels.length);
+ return this.tunnels[this.enableTunnels[index]];
+ };
+
+ // 从还有余量的隧道中随机挑选一个
+
+
+ Barrage.prototype.getIdleTunnel = function getIdleTunnel() {
+ if (this.idleTunnels.length === 0) return null;
+ var index = (0, _utils.getRandom)(this.idleTunnels.length);
+ return this.tunnels[this.idleTunnels[index]];
+ };
+
+ Barrage.prototype.getTextWidth = function getTextWidth(content) {
+ this.ctx.font = this.font;
+ return Math.ceil(this.ctx.measureText(content).width);
+ };
+
+ Barrage.prototype.drawTunnel = function drawTunnel() {
+ var ctx = this.ctx;
+ var tunnelColor = '#CCB24D';
+ for (var i = 0; i <= this.tunnelNum; i++) {
+ var y = this.padding[0] + i * this.tunnelHeight;
+ ctx.beginPath();
+ ctx.strokeStyle = tunnelColor;
+ ctx.setLineDash([5, 10]);
+ ctx.moveTo(0, y);
+ ctx.lineTo(this.width, y);
+ ctx.stroke();
+ if (i < this.tunnelNum) {
+ ctx.fillStyle = tunnelColor;
+ ctx.fillText('\u5F39\u9053' + (i + 1), 10, this.tunnelHeight / 2 + y);
+ }
+ }
+ };
+
+ return Barrage;
+}();
+
+exports.default = Barrage;
+
+/***/ })
+/******/ ]);
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-barrage/index.json b/miniprogram/miniprogram_npm/miniprogram-barrage/index.json
new file mode 100644
index 00000000..e8cfaaf8
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-barrage/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxml b/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxml
new file mode 100644
index 00000000..baceeffe
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+ 轨道{{tunnelId}}
+
+
+
+
+ {{bullet.content}}
+
+
+
+
+
+
+
diff --git a/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxss b/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxss
new file mode 100644
index 00000000..b4ce68f8
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxss
@@ -0,0 +1,61 @@
+.barrage-area {
+ position: relative;
+ box-sizing: border-box;
+ width: 100%;
+ height: 100%;
+ pointer-events: auto;
+}
+
+.barrage-tunnel {
+ box-sizing: border-box;
+ position: relative;
+ display: flex;
+ align-items: center;
+ border-top: 1px dashed #CCB24D;
+ width: 100%;
+}
+
+.tunnel-tips {
+ display: inline-block;
+ margin-left: 10px;
+ color: #CCB24D;
+}
+
+.bullet-item {
+ position: absolute;
+ display: flex;
+ align-items: center;
+ top: 0;
+ left: 100%;
+ white-space: nowrap;
+}
+
+.bullet-item.paused {
+ background: #000;
+ opacity: 0.6;
+ padding: 0 10px;
+ z-index: 1001;
+}
+
+.bullet-item_img {
+ max-height: 100%;
+ display: inline-block;
+}
+
+.bullet-item_text {
+ display: inline-block;
+ margin: 0;
+}
+
+.bullet-move {
+ animation: 0s linear slidein
+}
+
+@keyframes slidein {
+ 0% {
+ transform: translate3d(0, 0, 0)
+ }
+ 100% {
+ transform: translate3d(-2000px, 0, 0)
+ }
+}
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-barrage/utils.js b/miniprogram/miniprogram_npm/miniprogram-barrage/utils.js
new file mode 100644
index 00000000..e39a5e3d
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-barrage/utils.js
@@ -0,0 +1,67 @@
+// 获取字节长度,中文算2个字节
+function getStrLen(str) {
+ // eslint-disable-next-line no-control-regex
+ return str.replace(/[^\x00-\xff]/g, 'aa').length
+}
+
+// 截取指定字节长度的子串
+function substring(str, n) {
+ if (!str) return ''
+
+ const len = getStrLen(str)
+ if (n >= len) return str
+
+ let l = 0
+ let result = ''
+ for (let i = 0; i < str.length; i++) {
+ const ch = str.charAt(i)
+ // eslint-disable-next-line no-control-regex
+ l = /[^\x00-\xff]/i.test(ch) ? l + 2 : l + 1
+ result += ch
+ if (l >= n) break
+ }
+ return result
+}
+
+function getRandom(max = 10, min = 0) {
+ return Math.floor(Math.random() * (max - min) + min)
+}
+
+function getFontSize(font) {
+ const reg = /(\d+)(px)/i
+ const match = font.match(reg)
+ return (match && match[1]) || 10
+}
+
+function compareVersion(v1, v2) {
+ v1 = v1.split('.')
+ v2 = v2.split('.')
+ const len = Math.max(v1.length, v2.length)
+
+ while (v1.length < len) {
+ v1.push('0')
+ }
+ while (v2.length < len) {
+ v2.push('0')
+ }
+
+ for (let i = 0; i < len; i++) {
+ const num1 = parseInt(v1[i], 10)
+ const num2 = parseInt(v2[i], 10)
+
+ if (num1 > num2) {
+ return 1
+ } else if (num1 < num2) {
+ return -1
+ }
+ }
+ return 0
+}
+
+module.exports = {
+ getStrLen,
+ substring,
+ getRandom,
+ getFontSize,
+ compareVersion
+}
diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.d.ts b/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.d.ts
new file mode 100644
index 00000000..8ec8cb16
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.d.ts
@@ -0,0 +1,45 @@
+declare namespace recycleContext {
+ interface itemSize {
+ width: number;
+ height: number;
+ }
+
+ type Component = any;
+ type Page = any;
+
+ type itemSizeFunc = (item: T, index: number) => itemSize
+
+ interface options {
+ id: string;
+ dataKey: string;
+ page: Component | Page;
+ itemSize: itemSizeFunc | itemSize;
+ useInPage?: boolean;
+ root?: Page;
+ }
+
+ interface position {
+ left: number;
+ top: number;
+ width: number;
+ height: number;
+ }
+
+ interface RecycleContext {
+ append(list: T[], callback?: () => void): RecycleContext
+ appendList(list: T[], callback?: () => void): RecycleContext
+ splice(begin: number, deleteCount: number, appendList: T[], callback?: () => void): RecycleContext;
+ updateList(beginIndex: number, list: T[], callback?: () => void): RecycleContext
+ update(beginIndex: number, list: T[], callback?: () => void): RecycleContext
+ destroy(): RecycleContext
+ forceUpdate(callback: () => void, reinitSlot: boolean): RecycleContext
+ getBoundingClientRect(index: number | undefined): position | position[]
+ getScrollTop(): number;
+ transformRpx(rpx: number, addPxSuffix?: string): number;
+ getViewportItems(inViewportPx: number): T[]
+ getList(): T[]
+ }
+}
+declare function createRecycleContext(op: recycleContext.options): recycleContext.RecycleContext
+
+export = createRecycleContext;
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.js b/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.js
new file mode 100644
index 00000000..9293610a
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.js
@@ -0,0 +1,851 @@
+module.exports =
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // create a fake namespace object
+/******/ // mode & 1: value is a module id, require it
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = __webpack_require__(value);
+/******/ if(mode & 8) return value;
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ return ns;
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 2);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var isIPhone = false;
+var deviceWidth = void 0;
+var deviceDPR = void 0;
+var BASE_DEVICE_WIDTH = 750;
+var checkDeviceWidth = function checkDeviceWidth() {
+ var info = wx.getSystemInfoSync();
+ // console.log('info', info)
+ isIPhone = info.platform === 'ios';
+ var newDeviceWidth = info.screenWidth || 375;
+ var newDeviceDPR = info.pixelRatio || 2;
+
+ if (!isIPhone) {
+ // HACK switch width and height when landscape
+ // const newDeviceHeight = info.screenHeight || 375
+ // 暂时不处理转屏的情况
+ }
+
+ if (newDeviceWidth !== deviceWidth || newDeviceDPR !== deviceDPR) {
+ deviceWidth = newDeviceWidth;
+ deviceDPR = newDeviceDPR;
+ // console.info('Updated device width: ' + newDeviceWidth + 'px DPR ' + newDeviceDPR)
+ }
+};
+checkDeviceWidth();
+
+var eps = 1e-4;
+var transformByDPR = function transformByDPR(number) {
+ if (number === 0) {
+ return 0;
+ }
+ number = number / BASE_DEVICE_WIDTH * deviceWidth;
+ number = Math.floor(number + eps);
+ if (number === 0) {
+ if (deviceDPR === 1 || !isIPhone) {
+ return 1;
+ }
+ return 0.5;
+ }
+ return number;
+};
+
+var rpxRE = /([+-]?\d+(?:\.\d+)?)rpx/gi;
+// const inlineRpxRE = /(?::|\s|\(|\/)([+-]?\d+(?:\.\d+)?)rpx/g
+
+var transformRpx = function transformRpx(style, inline) {
+ if (typeof style !== 'string') {
+ return style;
+ }
+ var re = rpxRE;
+ return style.replace(re, function (match, num) {
+ return transformByDPR(Number(num)) + (inline ? 'px' : '');
+ });
+};
+
+module.exports = {
+ transformRpx: transformRpx
+};
+
+/***/ }),
+/* 1 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+module.exports = {};
+
+/***/ }),
+/* 2 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+/**
+ * recycle-view组件的api使用
+ * 提供wx.createRecycleContext进行管理功能
+ */
+var RecycleContext = __webpack_require__(3);
+
+/**
+ * @params options参数是object对象,展开的结构如下
+ id: recycle-view的id
+ dataKey: recycle-item的wx:for绑定的数据变量
+ page: recycle-view所在的页面或组件的实例
+ itemSize: 函数或者是Object对象,生成每个recycle-item的宽和高
+ * @return RecycleContext对象
+ */
+module.exports = function (options) {
+ return new RecycleContext(options);
+};
+
+/***/ }),
+/* 3 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+/* eslint complexity: ["error", {"max": 50}] */
+var recycleData = __webpack_require__(1);
+var recycleViewportChangeFunc = __webpack_require__(4);
+var transformRpx = __webpack_require__(0);
+
+var RECT_SIZE = 200;
+
+// eslint-disable-next-line no-complexity
+function RecycleContext(_ref) {
+ var _this = this;
+
+ var id = _ref.id,
+ dataKey = _ref.dataKey,
+ page = _ref.page,
+ itemSize = _ref.itemSize,
+ useInPage = _ref.useInPage,
+ placeholderClass = _ref.placeholderClass,
+ root = _ref.root;
+
+ if (!id || !dataKey || !page || !itemSize) {
+ throw new Error('parameter id, dataKey, page, itemSize is required');
+ }
+ if (typeof itemSize !== 'function' && (typeof itemSize === 'undefined' ? 'undefined' : _typeof(itemSize)) !== 'object') {
+ throw new Error('parameter itemSize must be function or object with key width and height');
+ }
+ if ((typeof itemSize === 'undefined' ? 'undefined' : _typeof(itemSize)) === 'object' && (!itemSize.width || !itemSize.height) && (!itemSize.props || !itemSize.queryClass || !itemSize.dataKey)) {
+ throw new Error('parameter itemSize must be function or object with key width and height');
+ }
+ this.id = id;
+ this.dataKey = dataKey;
+ this.page = page;
+ // 加root参数给useInPage单独使用
+ this.root = root;
+ this.placeholderClass = placeholderClass;
+ page._recycleViewportChange = recycleViewportChangeFunc;
+ this.comp = page.selectComponent('#' + id);
+ this.itemSize = itemSize;
+ this.itemSizeOpt = itemSize;
+ // if (!this.comp) {
+ // throw ` with id ${id} not found`
+ // }
+ this.useInPage = useInPage || false;
+ if (this.comp) {
+ this.comp.context = this;
+ this.comp.setPage(page);
+ this.comp.setUseInPage(this.useInPage);
+ }
+ if (this.useInPage && !this.root) {
+ throw new Error('parameter root is required when useInPage is true');
+ }
+ if (this.useInPage) {
+ this.oldPageScroll = this.root.onPageScroll;
+ // 重写onPageScroll事件
+ this.root.onPageScroll = function (e) {
+ // this.checkComp();
+ if (_this.comp) {
+ _this.comp._scrollViewDidScroll({
+ detail: {
+ scrollLeft: 0,
+ scrollTop: e.scrollTop
+ }
+ });
+ }
+ _this.oldPageScroll.apply(_this.root, [e]);
+ };
+ this.oldReachBottom = this.root.onReachBottom;
+ this.root.onReachBottom = function (e) {
+ if (_this.comp) {
+ _this.comp.triggerEvent('scrolltolower', {});
+ }
+ _this.oldReachBottom.apply(_this.root, [e]);
+ };
+ this.oldPullDownRefresh = this.root.onPullDownRefresh;
+ this.root.onPullDownRefresh = function (e) {
+ if (_this.comp) {
+ _this.comp.triggerEvent('scrolltoupper', {});
+ }
+ _this.oldPullDownRefresh.apply(_this.root, [e]);
+ };
+ }
+}
+RecycleContext.prototype.checkComp = function () {
+ if (!this.comp) {
+ this.comp = this.page.selectComponent('#' + this.id);
+ if (this.comp) {
+ this.comp.setUseInPage(this.useInPage);
+ this.comp.context = this;
+ this.comp.setPage(this.page);
+ } else {
+ throw new Error('the recycle-view correspond to this context is detached, pls create another RecycleContext');
+ }
+ }
+};
+RecycleContext.prototype.appendList = function (list, cb) {
+ this.checkComp();
+ var id = this.id;
+ var dataKey = this.dataKey;
+ if (!recycleData[id]) {
+ recycleData[id] = {
+ key: dataKey,
+ id: id,
+ list: list,
+ sizeMap: {},
+ sizeArray: []
+ };
+ } else {
+ recycleData[id].dataKey = dataKey;
+ recycleData[id].list = recycleData[id].list.concat(list);
+ }
+ this._forceRerender(id, cb);
+ return this;
+};
+RecycleContext.prototype._forceRerender = function (id, cb) {
+ this.isDataReady = true; // 首次调用说明数据已经ready了
+ // 动态计算高度并缓存
+ var that = this;
+ var allrect = null;
+ var parentRect = null;
+ var count = 0;
+
+ function setPlaceholderImage() {
+ if (!allrect || !parentRect) return;
+ var svgRects = [];
+ for (var i = 0; i < count; i++) {
+ svgRects.push({
+ left: allrect[i].left - parentRect.left,
+ top: allrect[i].top - parentRect.top,
+ width: allrect[i].width,
+ height: allrect[i].height
+ });
+ }
+ that.comp.setPlaceholderImage(svgRects, {
+ width: parentRect.width,
+ height: parentRect.height
+ });
+ }
+ function newcb() {
+ if (cb) {
+ cb();
+ }
+ // 计算placeholder, 只有在动态计算高度的时候才支持
+ if (that.autoCalculateSize && that.placeholderClass) {
+ var newQueryClass = [];
+ that.placeholderClass.forEach(function (item) {
+ newQueryClass.push('.' + that.itemSizeOpt.queryClass + ' .' + item);
+ });
+ // newQueryClass.push(`.` + that.itemSizeOpt.queryClass)
+ count = newQueryClass.length;
+ wx.createSelectorQuery().selectAll(newQueryClass.join(',')).boundingClientRect(function (rect) {
+ if (rect.length < count) return;
+ allrect = rect;
+ setPlaceholderImage();
+ }).exec();
+ wx.createSelectorQuery().select('.' + that.itemSizeOpt.queryClass).boundingClientRect(function (rect) {
+ parentRect = rect;
+ setPlaceholderImage();
+ }).exec();
+ }
+ }
+ if (Object.prototype.toString.call(this.itemSizeOpt) === '[object Object]' && this.itemSizeOpt && !this.itemSizeOpt.width) {
+ this._recalculateSizeByProp(recycleData[id].list, function (sizeData) {
+ recycleData[id].sizeMap = sizeData.map;
+ recycleData[id].sizeArray = sizeData.array;
+ // 触发强制渲染
+ that.comp.forceUpdate(newcb);
+ });
+ return;
+ }
+ var sizeData = this._recalculateSize(recycleData[id].list);
+ recycleData[id].sizeMap = sizeData.map;
+ // console.log('size is', sizeData.array, sizeData.map, 'totalHeight', sizeData.totalHeight)
+ // console.log('sizeArray', sizeData.array)
+ recycleData[id].sizeArray = sizeData.array;
+ // 触发强制渲染
+ this.comp.forceUpdate(cb);
+};
+function getValue(item, key) {
+ if (!key) return item;
+ if (typeof item[key] !== 'undefined') return item[key];
+ var keyItems = key.split('.');
+ for (var i = 0; i < keyItems.length; i++) {
+ item = item[keyItems[i]];
+ if (typeof item === 'undefined' || (typeof item === 'undefined' ? 'undefined' : _typeof(item)) === 'object' && !item) {
+ return undefined;
+ }
+ }
+ return item;
+}
+function getValues(item, keys) {
+ if (Object.prototype.toString.call(keys) !== '[object Array]') {
+ keys = [keys];
+ }
+ var vals = {};
+ for (var i = 0; i < keys.length; i++) {
+ vals[keys[i]] = getValue(item, keys[i]);
+ }
+ return vals;
+}
+function isArray(arr) {
+ return Object.prototype.toString.call(arr) === '[object Array]';
+}
+function isSamePureValue(item1, item2) {
+ if ((typeof item1 === 'undefined' ? 'undefined' : _typeof(item1)) !== (typeof item2 === 'undefined' ? 'undefined' : _typeof(item2))) return false;
+ if (isArray(item1) && isArray(item2)) {
+ if (item1.length !== item2.length) return false;
+ for (var i = 0; i < item1.length; i++) {
+ if (item1[i] !== item2[i]) return false;
+ }
+ return true;
+ }
+ return item1 === item2;
+}
+function isSameValue(item1, item2, keys) {
+ if (!isArray(keys)) {
+ keys = [keys];
+ }
+ for (var i = 0; i < keys.length; i++) {
+ if (!isSamePureValue(getValue(item1, keys[i]), getValue(item2, keys[i]))) return false;
+ }
+ return true;
+}
+RecycleContext.prototype._recalculateSizeByProp = function (list, cb) {
+ var itemSize = this.itemSizeOpt;
+ var propValueMap = this.propValueMap || [];
+ var calcNewItems = [];
+ var needCalcPropIndex = [];
+ if (itemSize.cacheKey) {
+ propValueMap = wx.getStorageSync(itemSize.cacheKey) || [];
+ // eslint-disable-next-line no-console
+ // console.log('[recycle-view] get itemSize from cache', propValueMap)
+ }
+ this.autoCalculateSize = true;
+ var item2PropValueMap = [];
+ for (var i = 0; i < list.length; i++) {
+ var item2PropValueIndex = propValueMap.length;
+ if (!propValueMap.length) {
+ var val = getValues(list[i], itemSize.props);
+ val.__index__ = i;
+ propValueMap.push(val);
+ calcNewItems.push(list[i]);
+ needCalcPropIndex.push(item2PropValueIndex);
+ item2PropValueMap.push({
+ index: i,
+ sizeIndex: item2PropValueIndex
+ });
+ continue;
+ }
+ var found = false;
+ for (var j = 0; j < propValueMap.length; j++) {
+ if (isSameValue(propValueMap[j], list[i], itemSize.props)) {
+ item2PropValueIndex = j;
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ var _val = getValues(list[i], itemSize.props);
+ _val.__index__ = i;
+ propValueMap.push(_val);
+ calcNewItems.push(list[i]);
+ needCalcPropIndex.push(item2PropValueIndex);
+ }
+ item2PropValueMap.push({
+ index: i,
+ sizeIndex: item2PropValueIndex
+ });
+ }
+ // this.item2PropValueMap = item2PropValueMap
+ this.propValueMap = propValueMap;
+ if (propValueMap.length > 10) {
+ // eslint-disable-next-line no-console
+ console.warn('[recycle-view] get itemSize count exceed maximum of 10, now got', propValueMap);
+ }
+ // console.log('itemsize', propValueMap, item2PropValueMap)
+ // 预先渲染
+ var that = this;
+ function newItemSize(item, index) {
+ var sizeIndex = item2PropValueMap[index];
+ if (!sizeIndex) {
+ // eslint-disable-next-line no-console
+ console.error('[recycle-view] auto calculate size array error, no map size found', item, index, item2PropValueMap);
+ throw new Error('[recycle-view] auto calculate size array error, no map size found');
+ }
+ var size = propValueMap[sizeIndex.sizeIndex];
+ if (!size) {
+ // eslint-disable-next-line no-console
+ console.log('[recycle-view] auto calculate size array error, no size found', item, index, sizeIndex, propValueMap);
+ throw new Error('[recycle-view] auto calculate size array error, no size found');
+ }
+ return {
+ width: size.width,
+ height: size.height
+ };
+ }
+ function sizeReady(rects) {
+ rects.forEach(function (rect, index) {
+ var propValueIndex = needCalcPropIndex[index];
+ propValueMap[propValueIndex].width = rect.width;
+ propValueMap[propValueIndex].height = rect.height;
+ });
+ that.itemSize = newItemSize;
+ var sizeData = that._recalculateSize(list);
+ if (itemSize.cacheKey) {
+ wx.setStorageSync(itemSize.cacheKey, propValueMap); // 把数据缓存起来
+ }
+ if (cb) {
+ cb(sizeData);
+ }
+ }
+ if (calcNewItems.length) {
+ var obj = {};
+ obj[itemSize.dataKey] = calcNewItems;
+ this.page.setData(obj, function () {
+ // wx.createSelectorQuery().select(itemSize.componentClass).boundingClientRect(rects => {
+ // compSize = rects;
+ // if (compSize && allItemSize) {
+ // sizeReady();
+ // }
+ // }).exec();
+ wx.createSelectorQuery().selectAll('.' + itemSize.queryClass).boundingClientRect(function (rects) {
+ sizeReady(rects);
+ }).exec();
+ });
+ } else {
+ that.itemSize = newItemSize;
+ var sizeData = that._recalculateSize(list);
+ if (cb) {
+ cb(sizeData);
+ }
+ }
+};
+// 当before和after这2个slot发生变化的时候调用一下此接口
+RecycleContext.prototype._recalculateSize = function (list) {
+ // 遍历所有的数据
+ // 应该最多就千量级的, 遍历没有问题
+ var sizeMap = {};
+ var func = this.itemSize;
+ var funcExist = typeof func === 'function';
+ var comp = this.comp;
+ var compData = comp.data;
+ var offsetLeft = 0;
+ var offsetTop = 0;
+ var line = 0;
+ var column = 0;
+ var sizeArray = [];
+ var listLen = list.length;
+ // 把整个页面拆分成200*200的很多个方格, 判断每个数据落在哪个方格上
+ for (var i = 0; i < listLen; i++) {
+ list[i].__index__ = i;
+ var itemSize = {};
+ // 获取到每一项的宽和高
+ if (funcExist) {
+ // 必须保证返回的每一行的高度一样
+ itemSize = func && func.call(this, list[i], i);
+ } else {
+ itemSize = {
+ width: func.width,
+ height: func.height
+ };
+ }
+ itemSize = Object.assign({}, itemSize);
+ sizeArray.push(itemSize);
+ // 判断数据落到哪个方格上
+ // 超过了宽度, 移动到下一行, 再根据高度判断是否需要移动到下一个方格
+ if (offsetLeft + itemSize.width > compData.width) {
+ column = 0;
+ offsetLeft = itemSize.width;
+ // Fixed issue #22
+ if (sizeArray.length >= 2) {
+ offsetTop += sizeArray[sizeArray.length - 2].height || 0; // 加上最后一个数据的高度
+ } else {
+ offsetTop += itemSize.height;
+ }
+ // offsetTop += sizeArray[sizeArray.length - 2].height // 加上最后一个数据的高度
+ // 根据高度判断是否需要移动到下一个方格
+ if (offsetTop >= RECT_SIZE * (line + 1)) {
+ // fix: 当区块比较大时,会缺失块区域信息
+ var lastIdx = i - 1;
+ var lastLine = line;
+
+ line += parseInt((offsetTop - RECT_SIZE * line) / RECT_SIZE, 10);
+
+ for (var idx = lastLine; idx < line; idx++) {
+ var _key = idx + '.' + column;
+ if (!sizeMap[_key]) {
+ sizeMap[_key] = [];
+ }
+ sizeMap[_key].push(lastIdx);
+ }
+ }
+
+ // 新起一行的元素, beforeHeight是前一个元素的beforeHeight和height相加
+ if (i === 0) {
+ itemSize.beforeHeight = 0;
+ } else {
+ var prevItemSize = sizeArray[sizeArray.length - 2];
+ itemSize.beforeHeight = prevItemSize.beforeHeight + prevItemSize.height;
+ }
+ } else {
+ if (offsetLeft >= RECT_SIZE * (column + 1)) {
+ column++;
+ }
+ offsetLeft += itemSize.width;
+ if (i === 0) {
+ itemSize.beforeHeight = 0;
+ } else {
+ // 同一行的元素, beforeHeight和前面一个元素的beforeHeight一样
+ itemSize.beforeHeight = sizeArray[sizeArray.length - 2].beforeHeight;
+ }
+ }
+ var key = line + '.' + column;
+ if (!sizeMap[key]) {
+ sizeMap[key] = [];
+ }
+ sizeMap[key].push(i);
+
+ // fix: 当区块比较大时,会缺失块区域信息
+ if (listLen - 1 === i && itemSize.height > RECT_SIZE) {
+ var _lastIdx = line;
+ offsetTop += itemSize.height;
+ line += parseInt((offsetTop - RECT_SIZE * line) / RECT_SIZE, 10);
+ for (var _idx = _lastIdx; _idx <= line; _idx++) {
+ var _key2 = _idx + '.' + column;
+ if (!sizeMap[_key2]) {
+ sizeMap[_key2] = [];
+ }
+ sizeMap[_key2].push(i);
+ }
+ }
+ }
+ // console.log('sizeMap', sizeMap)
+ var obj = {
+ array: sizeArray,
+ map: sizeMap,
+ totalHeight: sizeArray.length ? sizeArray[sizeArray.length - 1].beforeHeight + sizeArray[sizeArray.length - 1].height : 0
+ };
+ comp.setItemSize(obj);
+ return obj;
+};
+RecycleContext.prototype.deleteList = function (beginIndex, count, cb) {
+ this.checkComp();
+ var id = this.id;
+ if (!recycleData[id]) {
+ return this;
+ }
+ recycleData[id].list.splice(beginIndex, count);
+ this._forceRerender(id, cb);
+ return this;
+};
+RecycleContext.prototype.updateList = function (beginIndex, list, cb) {
+ this.checkComp();
+ var id = this.id;
+ if (!recycleData[id]) {
+ return this;
+ }
+ var len = recycleData[id].list.length;
+ for (var i = 0; i < list.length && beginIndex < len; i++) {
+ recycleData[id].list[beginIndex++] = list[i];
+ }
+ this._forceRerender(id, cb);
+ return this;
+};
+RecycleContext.prototype.update = RecycleContext.prototype.updateList;
+RecycleContext.prototype.splice = function (begin, deleteCount, appendList, cb) {
+ this.checkComp();
+ var id = this.id;
+ var dataKey = this.dataKey;
+ // begin是数组
+ if ((typeof begin === 'undefined' ? 'undefined' : _typeof(begin)) === 'object' && begin.length) {
+ cb = deleteCount;
+ appendList = begin;
+ }
+ if (typeof appendList === 'function') {
+ cb = appendList;
+ appendList = [];
+ }
+ if (!recycleData[id]) {
+ recycleData[id] = {
+ key: dataKey,
+ id: id,
+ list: appendList || [],
+ sizeMap: {},
+ sizeArray: []
+ };
+ } else {
+ recycleData[id].dataKey = dataKey;
+ var list = recycleData[id].list;
+ if (appendList && appendList.length) {
+ list.splice.apply(list, [begin, deleteCount].concat(appendList));
+ } else {
+ list.splice(begin, deleteCount);
+ }
+ }
+ this._forceRerender(id, cb);
+ return this;
+};
+
+RecycleContext.prototype.append = RecycleContext.prototype.appendList;
+
+RecycleContext.prototype.destroy = function () {
+ if (this.useInPage) {
+ this.page.onPullDownRefresh = this.oldPullDownRefresh;
+ this.page.onReachBottom = this.oldReachBottom;
+ this.page.onPageScroll = this.oldPageScroll;
+ this.oldPageScroll = this.oldReachBottom = this.oldPullDownRefresh = null;
+ }
+ this.page = null;
+ this.comp = null;
+ if (recycleData[this.id]) {
+ delete recycleData[this.id];
+ }
+ return this;
+};
+// 重新更新下页面的数据
+RecycleContext.prototype.forceUpdate = function (cb, reinitSlot) {
+ var _this2 = this;
+
+ this.checkComp();
+ if (reinitSlot) {
+ this.comp.reRender(function () {
+ _this2._forceRerender(_this2.id, cb);
+ });
+ } else {
+ this._forceRerender(this.id, cb);
+ }
+ return this;
+};
+RecycleContext.prototype.getBoundingClientRect = function (index) {
+ this.checkComp();
+ if (!recycleData[this.id]) {
+ return null;
+ }
+ var sizeArray = recycleData[this.id].sizeArray;
+ if (!sizeArray || !sizeArray.length) {
+ return null;
+ }
+ if (typeof index === 'undefined') {
+ var list = [];
+ for (var i = 0; i < sizeArray.length; i++) {
+ list.push({
+ left: 0,
+ top: sizeArray[i].beforeHeight,
+ width: sizeArray[i].width,
+ height: sizeArray[i].height
+ });
+ }
+ return list;
+ }
+ index = parseInt(index, 10);
+ if (index >= sizeArray.length || index < 0) return null;
+ return {
+ left: 0,
+ top: sizeArray[index].beforeHeight,
+ width: sizeArray[index].width,
+ height: sizeArray[index].height
+ };
+};
+RecycleContext.prototype.getScrollTop = function () {
+ this.checkComp();
+ return this.comp.currentScrollTop || 0;
+};
+// 将px转化为rpx
+RecycleContext.prototype.transformRpx = RecycleContext.transformRpx = function (str, addPxSuffix) {
+ if (typeof str === 'number') str += 'rpx';
+ return parseFloat(transformRpx.transformRpx(str, addPxSuffix));
+};
+RecycleContext.prototype.getViewportItems = function (inViewportPx) {
+ this.checkComp();
+ var indexes = this.comp.getIndexesInViewport(inViewportPx);
+ if (indexes.length <= 0) return [];
+ var viewportItems = [];
+ var list = recycleData[this.id].list;
+ for (var i = 0; i < indexes.length; i++) {
+ viewportItems.push(list[indexes[i]]);
+ }
+ return viewportItems;
+};
+RecycleContext.prototype.getTotalHeight = function () {
+ this.checkComp();
+ return this.comp.getTotalHeight();
+};
+// 返回完整的列表数据
+RecycleContext.prototype.getList = function () {
+ if (!recycleData[this.id]) {
+ return [];
+ }
+ return recycleData[this.id].list;
+};
+module.exports = RecycleContext;
+
+/***/ }),
+/* 4 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+/* eslint complexity: ["error", {"max": 50}] */
+var recycleData = __webpack_require__(1);
+
+module.exports = function (e, cb) {
+ var detail = e.detail;
+ // console.log('data change transfer use time', Date.now() - e.detail.timeStamp)
+ var newList = [];
+ var item = recycleData[detail.id];
+ // 边界值判断, 避免造成异常, 假设先调用了createRecycleContext, 然后再延迟2s调用append插入数据的情况
+ if (!item || !item.list) return;
+ var dataList = item.list;
+ var pos = detail.data;
+ var beginIndex = pos.beginIndex;
+ var endIndex = pos.endIndex;
+ item.pos = pos;
+ // 加ignoreBeginIndex和ignoreEndIndex
+ if (typeof beginIndex === 'undefined' || beginIndex === -1 || typeof endIndex === 'undefined' || endIndex === -1) {
+ newList = [];
+ } else {
+ var i = -1;
+ for (i = beginIndex; i < dataList.length && i <= endIndex; i++) {
+ if (i >= pos.ignoreBeginIndex && i <= pos.ignoreEndIndex) continue;
+ newList.push(dataList[i]);
+ }
+ }
+ var obj = {
+ // batchSetRecycleData: !this.data.batchSetRecycleData
+ };
+ obj[item.key] = newList;
+ var comp = this.selectComponent('#' + detail.id);
+ obj[comp.data.batchKey] = !this.data.batchSetRecycleData;
+ comp._setInnerBeforeAndAfterHeight({
+ beforeHeight: pos.minTop,
+ afterHeight: pos.afterHeight
+ });
+ this.setData(obj, function () {
+ if (typeof cb === 'function') {
+ cb();
+ }
+ });
+ // Fix #1
+ // 去掉了batchSetDataKey,支持一个页面内显示2个recycle-view
+ // const groupSetData = () => {
+ // this.setData(obj)
+ // comp._recycleInnerBatchDataChanged(() => {
+ // if (typeof cb === 'function') {
+ // cb()
+ // }
+ // })
+ // }
+ // if (typeof this.groupSetData === 'function') {
+ // this.groupSetData(groupSetData)
+ // } else {
+ // groupSetData()
+ // }
+};
+
+/***/ })
+/******/ ]);
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.js b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.js
new file mode 100644
index 00000000..062c2a95
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.js
@@ -0,0 +1,126 @@
+module.exports =
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // create a fake namespace object
+/******/ // mode & 1: value is a module id, require it
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = __webpack_require__(value);
+/******/ if(mode & 8) return value;
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ return ns;
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 5);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 5:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+// components/recycle-item/recycle-item.js
+Component({
+ relations: {
+ './recycle-view': {
+ type: 'parent', // 关联的目标节点应为子节点
+ linked: function linked() {}
+ }
+ },
+ /**
+ * 组件的属性列表
+ */
+ properties: {},
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ // height: 100
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ heightChange: function heightChange() {}
+ }
+});
+
+/***/ })
+
+/******/ });
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.json b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.json
new file mode 100644
index 00000000..e8cfaaf8
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxml b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxml
new file mode 100644
index 00000000..cbe93625
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxss b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxss
new file mode 100644
index 00000000..6e6d9067
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxss
@@ -0,0 +1,7 @@
+/* components/recycle-item/recycle-item.wxss */
+:host {
+ display: inline-block;
+}
+.wx-recycle-item {
+ height: 100%;
+}
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.js b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.js
new file mode 100644
index 00000000..9505d302
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.js
@@ -0,0 +1,925 @@
+module.exports =
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // create a fake namespace object
+/******/ // mode & 1: value is a module id, require it
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = __webpack_require__(value);
+/******/ if(mode & 8) return value;
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ return ns;
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 6);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var isIPhone = false;
+var deviceWidth = void 0;
+var deviceDPR = void 0;
+var BASE_DEVICE_WIDTH = 750;
+var checkDeviceWidth = function checkDeviceWidth() {
+ var info = wx.getSystemInfoSync();
+ // console.log('info', info)
+ isIPhone = info.platform === 'ios';
+ var newDeviceWidth = info.screenWidth || 375;
+ var newDeviceDPR = info.pixelRatio || 2;
+
+ if (!isIPhone) {
+ // HACK switch width and height when landscape
+ // const newDeviceHeight = info.screenHeight || 375
+ // 暂时不处理转屏的情况
+ }
+
+ if (newDeviceWidth !== deviceWidth || newDeviceDPR !== deviceDPR) {
+ deviceWidth = newDeviceWidth;
+ deviceDPR = newDeviceDPR;
+ // console.info('Updated device width: ' + newDeviceWidth + 'px DPR ' + newDeviceDPR)
+ }
+};
+checkDeviceWidth();
+
+var eps = 1e-4;
+var transformByDPR = function transformByDPR(number) {
+ if (number === 0) {
+ return 0;
+ }
+ number = number / BASE_DEVICE_WIDTH * deviceWidth;
+ number = Math.floor(number + eps);
+ if (number === 0) {
+ if (deviceDPR === 1 || !isIPhone) {
+ return 1;
+ }
+ return 0.5;
+ }
+ return number;
+};
+
+var rpxRE = /([+-]?\d+(?:\.\d+)?)rpx/gi;
+// const inlineRpxRE = /(?::|\s|\(|\/)([+-]?\d+(?:\.\d+)?)rpx/g
+
+var transformRpx = function transformRpx(style, inline) {
+ if (typeof style !== 'string') {
+ return style;
+ }
+ var re = rpxRE;
+ return style.replace(re, function (match, num) {
+ return transformByDPR(Number(num)) + (inline ? 'px' : '');
+ });
+};
+
+module.exports = {
+ transformRpx: transformRpx
+};
+
+/***/ }),
+
+/***/ 6:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+/* eslint complexity: ["error", {"max": 50}] */
+/* eslint-disable indent */
+var DEFAULT_SHOW_SCREENS = 4;
+var RECT_SIZE = 200;
+var systemInfo = wx.getSystemInfoSync();
+var DEBUG = false;
+var transformRpx = __webpack_require__(0).transformRpx;
+
+Component({
+ options: {
+ multipleSlots: true // 在组件定义时的选项中启用多slot支持
+ },
+ relations: {
+ '../recycle-item/recycle-item': {
+ type: 'child', // 关联的目标节点应为子节点
+ linked: function linked(target) {
+ // 检查第一个的尺寸就好了吧
+ if (!this._hasCheckSize) {
+ this._hasCheckSize = true;
+ var size = this.boundingClientRect(this._pos.beginIndex);
+ if (!size) {
+ return;
+ }
+ setTimeout(function () {
+ try {
+ target.createSelectorQuery().select('.wx-recycle-item').boundingClientRect(function (rect) {
+ if (rect && (rect.width !== size.width || rect.height !== size.height)) {
+ // eslint-disable-next-line no-console
+ console.warn('[recycle-view] the size in is not the same with param ' + ('itemSize, expect {width: ' + rect.width + ', height: ' + rect.height + '} but got ') + ('{width: ' + size.width + ', height: ' + size.height + '}'));
+ }
+ }).exec();
+ } catch (e) {
+ // do nothing
+ }
+ }, 10);
+ }
+ }
+ }
+ },
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ debug: {
+ type: Boolean,
+ value: false
+ },
+ scrollY: {
+ type: Boolean,
+ value: true
+ },
+ batch: {
+ type: Boolean,
+ value: false,
+ public: true,
+ observer: '_recycleInnerBatchDataChanged'
+ },
+ batchKey: {
+ type: String,
+ value: 'batchSetRecycleData',
+ public: true
+ },
+ scrollTop: {
+ type: Number,
+ value: 0,
+ public: true,
+ observer: '_scrollTopChanged',
+ observeAssignments: true
+ },
+ height: {
+ type: Number,
+ value: systemInfo.windowHeight,
+ public: true,
+ observer: '_heightChanged'
+ },
+ width: {
+ type: Number,
+ value: systemInfo.windowWidth,
+ public: true,
+ observer: '_widthChanged'
+ },
+ // 距顶部/左边多远时,触发bindscrolltoupper
+ upperThreshold: {
+ type: Number,
+ value: 50,
+ public: true
+ },
+ // 距底部/右边多远时,触发bindscrolltolower
+ lowerThreshold: {
+ type: Number,
+ value: 50,
+ public: true
+ },
+ scrollToIndex: {
+ type: Number,
+ public: true,
+ value: 0,
+ observer: '_scrollToIndexChanged',
+ observeAssignments: true
+ },
+ scrollWithAnimation: {
+ type: Boolean,
+ public: true,
+ value: false
+ },
+ enableBackToTop: {
+ type: Boolean,
+ public: true,
+ value: false
+ },
+ // 是否节流,默认是
+ throttle: {
+ type: Boolean,
+ public: true,
+ value: true
+ },
+ placeholderImage: {
+ type: String,
+ public: true,
+ value: ''
+ },
+ screen: { // 默认渲染多少屏的数据
+ type: Number,
+ public: true,
+ value: DEFAULT_SHOW_SCREENS
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ innerBeforeHeight: 0,
+ innerAfterHeight: 0,
+ innerScrollTop: 0,
+ innerScrollIntoView: '',
+ placeholderImageStr: '',
+ totalHeight: 0,
+ useInPage: false
+ },
+ attached: function attached() {
+ if (this.data.placeholderImage) {
+ this.setData({
+ placeholderImageStr: transformRpx(this.data.placeholderImage, true)
+ });
+ }
+ this.setItemSize({
+ array: [],
+ map: {},
+ totalHeight: 0
+ });
+ },
+ ready: function ready() {
+ var _this = this;
+
+ this._initPosition(function () {
+ _this._isReady = true; // DOM结构ready了
+ // 有一个更新的timer在了
+ if (_this._updateTimerId) return;
+
+ _this._scrollViewDidScroll({
+ detail: {
+ scrollLeft: _this._pos.left,
+ scrollTop: _this._pos.top,
+ ignoreScroll: true
+ }
+ }, true);
+ });
+ },
+ detached: function detached() {
+ this.page = null;
+ // 销毁对应的RecycleContext
+ if (this.context) {
+ this.context.destroy();
+ this.context = null;
+ }
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ _log: function _log() {
+ var _console;
+
+ if (!DEBUG && !this.data.debug) return;
+ var h = new Date();
+ var str = h.getHours() + ':' + h.getMinutes() + ':' + h.getSeconds() + '.' + h.getMilliseconds();
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ Array.prototype.splice.call(args, 0, 0, str);
+ // eslint-disable-next-line no-console
+ (_console = console).log.apply(_console, args);
+ },
+ _scrollToUpper: function _scrollToUpper(e) {
+ this.triggerEvent('scrolltoupper', e.detail);
+ },
+ _scrollToLower: function _scrollToLower(e) {
+ this.triggerEvent('scrolltolower', e.detail);
+ },
+ _beginToScroll: function _beginToScroll() {
+ if (!this._lastScrollTop) {
+ this._lastScrollTop = this._pos && (this._pos.top || 0);
+ }
+ },
+ _clearList: function _clearList(cb) {
+ this.currentScrollTop = 0;
+ this._lastScrollTop = 0;
+ var pos = this._pos;
+ pos.beginIndex = this._pos.endIndex = -1;
+ pos.afterHeight = pos.minTop = pos.maxTop = 0;
+ this.page._recycleViewportChange({
+ detail: {
+ data: pos,
+ id: this.id
+ }
+ }, cb);
+ },
+
+ // 判断RecycleContext是否Ready
+ _isValid: function _isValid() {
+ return this.page && this.context && this.context.isDataReady;
+ },
+
+ // eslint-disable-next-line no-complexity
+ _scrollViewDidScroll: function _scrollViewDidScroll(e, force) {
+ // 如果RecycleContext还没有初始化, 不做任何事情
+ if (!this._isValid()) {
+ return;
+ }
+ // 监测白屏时间
+ if (!e.detail.ignoreScroll) {
+ this.triggerEvent('scroll', e.detail);
+ }
+ this.currentScrollTop = e.detail.scrollTop;
+ // 高度为0的情况, 不做任何渲染逻辑
+ if (!this._pos.height || !this.sizeArray.length) {
+ // 没有任何数据的情况下, 直接清理所有的状态
+ this._clearList(e.detail.cb);
+ return;
+ }
+
+ // 在scrollWithAnimation动画最后会触发一次scroll事件, 这次scroll事件必须要被忽略
+ if (this._isScrollingWithAnimation) {
+ this._isScrollingWithAnimation = false;
+ return;
+ }
+ var pos = this._pos;
+ var that = this;
+ var scrollLeft = e.detail.scrollLeft;
+ var scrollTop = e.detail.scrollTop;
+ var scrollDistance = Math.abs(scrollTop - this._lastScrollTop);
+ if (!force && Math.abs(scrollTop - pos.top) < pos.height * 1.5) {
+ this._log('【not exceed height');
+ return;
+ }
+ this._lastScrollTop = scrollTop;
+ var SHOW_SCREENS = this.data.screen; // 固定4屏幕
+ this._log('SHOW_SCREENS', SHOW_SCREENS, scrollTop);
+ this._calcViewportIndexes(scrollLeft, scrollTop, function (beginIndex, endIndex, minTop, afterHeight, maxTop) {
+ that._log('scrollDistance', scrollDistance, 'indexes', beginIndex, endIndex);
+ // 渲染的数据不变
+ if (!force && pos.beginIndex === beginIndex && pos.endIndex === endIndex && pos.minTop === minTop && pos.afterHeight === afterHeight) {
+ that._log('------------is the same beginIndex and endIndex');
+ return;
+ }
+ // 如果这次渲染的范围比上一次的范围小,则忽略
+ that._log('【check】before setData, old pos is', pos.minTop, pos.maxTop, minTop, maxTop);
+ that._throttle = false;
+ pos.left = scrollLeft;
+ pos.top = scrollTop;
+ pos.beginIndex = beginIndex;
+ pos.endIndex = endIndex;
+ // console.log('render indexes', endIndex - beginIndex + 1, endIndex, beginIndex)
+ pos.minTop = minTop;
+ pos.maxTop = maxTop;
+ pos.afterHeight = afterHeight;
+ pos.ignoreBeginIndex = pos.ignoreEndIndex = -1;
+ that.page._recycleViewportChange({
+ detail: {
+ data: that._pos,
+ id: that.id
+ }
+ }, function () {
+ if (e.detail.cb) {
+ e.detail.cb();
+ }
+ });
+ });
+ },
+
+ // 计算在视窗内渲染的数据
+ _calcViewportIndexes: function _calcViewportIndexes(left, top, cb) {
+ var that = this;
+ // const st = +new Date
+ this._getBeforeSlotHeight(function () {
+ var _that$__calcViewportI = that.__calcViewportIndexes(left, top),
+ beginIndex = _that$__calcViewportI.beginIndex,
+ endIndex = _that$__calcViewportI.endIndex,
+ minTop = _that$__calcViewportI.minTop,
+ afterHeight = _that$__calcViewportI.afterHeight,
+ maxTop = _that$__calcViewportI.maxTop;
+
+ if (cb) {
+ cb(beginIndex, endIndex, minTop, afterHeight, maxTop);
+ }
+ });
+ },
+ _getBeforeSlotHeight: function _getBeforeSlotHeight(cb) {
+ if (typeof this.data.beforeSlotHeight !== 'undefined') {
+ if (cb) {
+ cb(this.data.beforeSlotHeight);
+ }
+ } else {
+ this.reRender(cb);
+ }
+ },
+ _getAfterSlotHeight: function _getAfterSlotHeight(cb) {
+ if (typeof this.data.afterSlotHeight !== 'undefined') {
+ if (cb) {
+ cb(this.data.afterSlotHeight);
+ }
+ // cb && cb(this.data.afterSlotHeight)
+ } else {
+ this.reRender(cb);
+ }
+ },
+ _getIndexes: function _getIndexes(minTop, maxTop) {
+ if (minTop === maxTop && maxTop === 0) {
+ return {
+ beginIndex: -1,
+ endIndex: -1
+ };
+ }
+ var startLine = Math.floor(minTop / RECT_SIZE);
+ var endLine = Math.ceil(maxTop / RECT_SIZE);
+ var rectEachLine = Math.floor(this.data.width / RECT_SIZE);
+ var beginIndex = void 0;
+ var endIndex = void 0;
+ var sizeMap = this.sizeMap;
+ for (var i = startLine; i <= endLine; i++) {
+ for (var col = 0; col < rectEachLine; col++) {
+ var key = i + '.' + col;
+ // 找到sizeMap里面的最小值和最大值即可
+ if (!sizeMap[key]) continue;
+ for (var j = 0; j < sizeMap[key].length; j++) {
+ if (typeof beginIndex === 'undefined') {
+ beginIndex = endIndex = sizeMap[key][j];
+ continue;
+ }
+ if (beginIndex > sizeMap[key][j]) {
+ beginIndex = sizeMap[key][j];
+ } else if (endIndex < sizeMap[key][j]) {
+ endIndex = sizeMap[key][j];
+ }
+ }
+ }
+ }
+ return {
+ beginIndex: beginIndex,
+ endIndex: endIndex
+ };
+ },
+ _isIndexValid: function _isIndexValid(beginIndex, endIndex) {
+ if (typeof beginIndex === 'undefined' || beginIndex === -1 || typeof endIndex === 'undefined' || endIndex === -1 || endIndex >= this.sizeArray.length) {
+ return false;
+ }
+ return true;
+ },
+ __calcViewportIndexes: function __calcViewportIndexes(left, top) {
+ if (!this.sizeArray.length) return {};
+ var pos = this._pos;
+ if (typeof left === 'undefined') {
+ left = pos.left;
+ }
+ if (typeof top === 'undefined') {
+ top = pos.top;
+ }
+ // top = Math.max(top, this.data.beforeSlotHeight)
+ var beforeSlotHeight = this.data.beforeSlotHeight || 0;
+ // 和direction无关了
+ var SHOW_SCREENS = this.data.screen;
+ var minTop = top - pos.height * SHOW_SCREENS - beforeSlotHeight;
+ var maxTop = top + pos.height * SHOW_SCREENS - beforeSlotHeight;
+ // maxTop或者是minTop超出了范围
+ if (maxTop > this.totalHeight) {
+ minTop -= maxTop - this.totalHeight;
+ maxTop = this.totalHeight;
+ }
+ if (minTop < beforeSlotHeight) {
+ maxTop += Math.min(beforeSlotHeight - minTop, this.totalHeight);
+ minTop = 0;
+ }
+ // 计算落在minTop和maxTop之间的方格有哪些
+ var indexObj = this._getIndexes(minTop, maxTop);
+ var beginIndex = indexObj.beginIndex;
+ var endIndex = indexObj.endIndex;
+ if (endIndex >= this.sizeArray.length) {
+ endIndex = this.sizeArray.length - 1;
+ }
+ // 校验一下beginIndex和endIndex的有效性,
+ if (!this._isIndexValid(beginIndex, endIndex)) {
+ return {
+ beginIndex: -1,
+ endIndex: -1,
+ minTop: 0,
+ afterHeight: 0,
+ maxTop: 0
+ };
+ }
+ // 计算白屏的默认占位的区域
+ var maxTopFull = this.sizeArray[endIndex].beforeHeight + this.sizeArray[endIndex].height;
+ var minTopFull = this.sizeArray[beginIndex].beforeHeight;
+
+ // console.log('render indexes', beginIndex, endIndex)
+ var afterHeight = this.totalHeight - maxTopFull;
+ return {
+ beginIndex: beginIndex,
+ endIndex: endIndex,
+ minTop: minTopFull, // 取整, beforeHeight的距离
+ afterHeight: afterHeight,
+ maxTop: maxTop
+ };
+ },
+ setItemSize: function setItemSize(size) {
+ this.sizeArray = size.array;
+ this.sizeMap = size.map;
+ if (size.totalHeight !== this.totalHeight) {
+ // console.log('---totalHeight is', size.totalHeight);
+ this.setData({
+ totalHeight: size.totalHeight,
+ useInPage: this.useInPage || false
+ });
+ }
+ this.totalHeight = size.totalHeight;
+ },
+ setList: function setList(key, newList) {
+ this._currentSetDataKey = key;
+ this._currentSetDataList = newList;
+ },
+ setPage: function setPage(page) {
+ this.page = page;
+ },
+ forceUpdate: function forceUpdate(cb, reInit) {
+ var _this2 = this;
+
+ if (!this._isReady) {
+ if (this._updateTimerId) {
+ // 合并多次的forceUpdate
+ clearTimeout(this._updateTimerId);
+ }
+ this._updateTimerId = setTimeout(function () {
+ _this2.forceUpdate(cb, reInit);
+ }, 10);
+ return;
+ }
+ this._updateTimerId = null;
+ var that = this;
+ if (reInit) {
+ this.reRender(function () {
+ that._scrollViewDidScroll({
+ detail: {
+ scrollLeft: that._pos.left,
+ scrollTop: that.currentScrollTop || that.data.scrollTop || 0,
+ ignoreScroll: true,
+ cb: cb
+ }
+ }, true);
+ });
+ } else {
+ this._scrollViewDidScroll({
+ detail: {
+ scrollLeft: that._pos.left,
+ scrollTop: that.currentScrollTop || that.data.scrollTop || 0,
+ ignoreScroll: true,
+ cb: cb
+ }
+ }, true);
+ }
+ },
+ _initPosition: function _initPosition(cb) {
+ var that = this;
+ that._pos = {
+ left: that.data.scrollLeft || 0,
+ top: that.data.scrollTop || 0,
+ width: this.data.width,
+ height: Math.max(500, this.data.height), // 一个屏幕的高度
+ direction: 0
+ };
+ this.reRender(cb);
+ },
+ _widthChanged: function _widthChanged(newVal) {
+ if (!this._isReady) return newVal;
+ this._pos.width = newVal;
+ this.forceUpdate();
+ return newVal;
+ },
+ _heightChanged: function _heightChanged(newVal) {
+ if (!this._isReady) return newVal;
+ this._pos.height = Math.max(500, newVal);
+ this.forceUpdate();
+ return newVal;
+ },
+ reRender: function reRender(cb) {
+ var _this3 = this;
+
+ var beforeSlotHeight = void 0;
+ var afterSlotHeight = void 0;
+ var that = this;
+ // const reRenderStart = Date.now()
+ function newCb() {
+ if (that._lastBeforeSlotHeight !== beforeSlotHeight || that._lastAfterSlotHeight !== afterSlotHeight) {
+ that.setData({
+ hasBeforeSlotHeight: true,
+ hasAfterSlotHeight: true,
+ beforeSlotHeight: beforeSlotHeight,
+ afterSlotHeight: afterSlotHeight
+ });
+ }
+ that._lastBeforeSlotHeight = beforeSlotHeight;
+ that._lastAfterSlotHeight = afterSlotHeight;
+ // console.log('_getBeforeSlotHeight use time', Date.now() - reRenderStart)
+ if (cb) {
+ cb();
+ }
+ }
+ // 重新渲染事件发生
+ var beforeReady = false;
+ var afterReady = false;
+ // fix:#16 确保获取slot节点实际高度
+ this.setData({
+ hasBeforeSlotHeight: false,
+ hasAfterSlotHeight: false
+ }, function () {
+ _this3.createSelectorQuery().select('.slot-before').boundingClientRect(function (rect) {
+ beforeSlotHeight = rect.height;
+ beforeReady = true;
+ if (afterReady) {
+ if (newCb) {
+ newCb();
+ }
+ }
+ }).exec();
+ _this3.createSelectorQuery().select('.slot-after').boundingClientRect(function (rect) {
+ afterSlotHeight = rect.height;
+ afterReady = true;
+ if (beforeReady) {
+ if (newCb) {
+ newCb();
+ }
+ }
+ }).exec();
+ });
+ },
+ _setInnerBeforeAndAfterHeight: function _setInnerBeforeAndAfterHeight(obj) {
+ if (typeof obj.beforeHeight !== 'undefined') {
+ this._tmpBeforeHeight = obj.beforeHeight;
+ }
+ if (obj.afterHeight) {
+ this._tmpAfterHeight = obj.afterHeight;
+ }
+ },
+ _recycleInnerBatchDataChanged: function _recycleInnerBatchDataChanged(cb) {
+ var _this4 = this;
+
+ if (typeof this._tmpBeforeHeight !== 'undefined') {
+ var setObj = {
+ innerBeforeHeight: this._tmpBeforeHeight || 0,
+ innerAfterHeight: this._tmpAfterHeight || 0
+ };
+ if (typeof this._tmpInnerScrollTop !== 'undefined') {
+ setObj.innerScrollTop = this._tmpInnerScrollTop;
+ }
+ var pageObj = {};
+ var hasPageData = false;
+ if (typeof this._currentSetDataKey !== 'undefined') {
+ pageObj[this._currentSetDataKey] = this._currentSetDataList;
+ hasPageData = true;
+ }
+ var saveScrollWithAnimation = this.data.scrollWithAnimation;
+ var groupSetData = function groupSetData() {
+ // 如果有分页数据的话
+ if (hasPageData) {
+ _this4.page.setData(pageObj);
+ }
+ _this4.setData(setObj, function () {
+ _this4.setData({
+ scrollWithAnimation: saveScrollWithAnimation
+ });
+ if (typeof cb === 'function') {
+ cb();
+ }
+ });
+ };
+ groupSetData();
+ delete this._currentSetDataKey;
+ delete this._currentSetDataList;
+ this._tmpBeforeHeight = undefined;
+ this._tmpAfterHeight = undefined;
+ this._tmpInnerScrollTop = undefined;
+ }
+ },
+ _renderByScrollTop: function _renderByScrollTop(scrollTop) {
+ // 先setData把目标位置的数据补齐
+ this._scrollViewDidScroll({
+ detail: {
+ scrollLeft: this._pos.scrollLeft,
+ scrollTop: scrollTop,
+ ignoreScroll: true
+ }
+ }, true);
+ if (this.data.scrollWithAnimation) {
+ this._isScrollingWithAnimation = true;
+ }
+ this.setData({
+ innerScrollTop: scrollTop
+ });
+ },
+ _scrollTopChanged: function _scrollTopChanged(newVal, oldVal) {
+ var _this5 = this;
+
+ // if (newVal === oldVal && newVal === 0) return
+ if (!this._isInitScrollTop && newVal === 0) {
+ this._isInitScrollTop = true;
+ return newVal;
+ }
+ this.currentScrollTop = newVal;
+ if (!this._isReady) {
+ if (this._scrollTopTimerId) {
+ clearTimeout(this._scrollTopTimerId);
+ }
+ this._scrollTopTimerId = setTimeout(function () {
+ _this5._scrollTopChanged(newVal, oldVal);
+ }, 10);
+ return newVal;
+ }
+ this._isInitScrollTop = true;
+ this._scrollTopTimerId = null;
+ // this._lastScrollTop = oldVal
+ if (typeof this._lastScrollTop === 'undefined') {
+ this._lastScrollTop = this.data.scrollTop;
+ }
+ // 滑动距离小于一个屏幕的高度, 直接setData
+ if (Math.abs(newVal - this._lastScrollTop) < this._pos.height) {
+ this.setData({
+ innerScrollTop: newVal
+ });
+ return newVal;
+ }
+ if (!this._isScrollTopChanged) {
+ // 首次的值需要延后一点执行才能生效
+ setTimeout(function () {
+ _this5._isScrollTopChanged = true;
+ _this5._renderByScrollTop(newVal);
+ }, 10);
+ } else {
+ this._renderByScrollTop(newVal);
+ }
+ return newVal;
+ },
+ _scrollToIndexChanged: function _scrollToIndexChanged(newVal, oldVal) {
+ var _this6 = this;
+
+ // if (newVal === oldVal && newVal === 0) return
+ // 首次滚动到0的不执行
+ if (!this._isInitScrollToIndex && newVal === 0) {
+ this._isInitScrollToIndex = true;
+ return newVal;
+ }
+ if (!this._isReady) {
+ if (this._scrollToIndexTimerId) {
+ clearTimeout(this._scrollToIndexTimerId);
+ }
+ this._scrollToIndexTimerId = setTimeout(function () {
+ _this6._scrollToIndexChanged(newVal, oldVal);
+ }, 10);
+ return newVal;
+ }
+ this._isInitScrollToIndex = true;
+ this._scrollToIndexTimerId = null;
+ if (typeof this._lastScrollTop === 'undefined') {
+ this._lastScrollTop = this.data.scrollTop;
+ }
+ var rect = this.boundingClientRect(newVal);
+ if (!rect) return newVal;
+ // console.log('rect top', rect, this.data.beforeSlotHeight)
+ var calScrollTop = rect.top + (this.data.beforeSlotHeight || 0);
+ this.currentScrollTop = calScrollTop;
+ if (Math.abs(calScrollTop - this._lastScrollTop) < this._pos.height) {
+ this.setData({
+ innerScrollTop: calScrollTop
+ });
+ return newVal;
+ }
+ if (!this._isScrollToIndexChanged) {
+ setTimeout(function () {
+ _this6._isScrollToIndexChanged = true;
+ _this6._renderByScrollTop(calScrollTop);
+ }, 10);
+ } else {
+ this._renderByScrollTop(calScrollTop);
+ }
+ return newVal;
+ },
+
+ // 提供给开发者使用的接口
+ boundingClientRect: function boundingClientRect(idx) {
+ if (idx < 0 || idx >= this.sizeArray.length) {
+ return null;
+ }
+ return {
+ left: 0,
+ top: this.sizeArray[idx].beforeHeight,
+ width: this.sizeArray[idx].width,
+ height: this.sizeArray[idx].height
+ };
+ },
+
+ // 获取当前出现在屏幕内数据项, 返回数据项组成的数组
+ // 参数inViewportPx表示当数据项至少有多少像素出现在屏幕内才算是出现在屏幕内,默认是1
+ getIndexesInViewport: function getIndexesInViewport(inViewportPx) {
+ if (!inViewportPx) {
+ inViewportPx = 1;
+ }
+ var scrollTop = this.currentScrollTop;
+ var minTop = scrollTop + inViewportPx;
+ if (minTop < 0) minTop = 0;
+ var maxTop = scrollTop + this.data.height - inViewportPx;
+ if (maxTop > this.totalHeight) maxTop = this.totalHeight;
+ var indexes = [];
+ for (var i = 0; i < this.sizeArray.length; i++) {
+ if (this.sizeArray[i].beforeHeight + this.sizeArray[i].height >= minTop && this.sizeArray[i].beforeHeight <= maxTop) {
+ indexes.push(i);
+ }
+ if (this.sizeArray[i].beforeHeight > maxTop) break;
+ }
+ return indexes;
+ },
+ getTotalHeight: function getTotalHeight() {
+ return this.totalHeight;
+ },
+ setUseInPage: function setUseInPage(useInPage) {
+ this.useInPage = useInPage;
+ },
+ setPlaceholderImage: function setPlaceholderImage(svgs, size) {
+ var fill = 'style=\'fill:rgb(204,204,204);\'';
+ var placeholderImages = ['data:image/svg+xml,%3Csvg height=\'' + size.height + '\' width=\'' + size.width + '\' xmlns=\'http://www.w3.org/2000/svg\'%3E'];
+ svgs.forEach(function (svg) {
+ placeholderImages.push('%3Crect width=\'' + svg.width + '\' x=\'' + svg.left + '\' height=\'' + svg.height + '\' y=\'' + svg.top + '\' ' + fill + ' /%3E');
+ });
+ placeholderImages.push('%3C/svg%3E');
+ this.setData({
+ placeholderImageStr: placeholderImages.join('')
+ });
+ }
+ }
+});
+
+/***/ })
+
+/******/ });
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.json b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.json
new file mode 100644
index 00000000..e8cfaaf8
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxml b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxml
new file mode 100644
index 00000000..f7d60639
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxss b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxss
new file mode 100644
index 00000000..033f08fb
--- /dev/null
+++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxss
@@ -0,0 +1,5 @@
+/* components/recycle-view/recycle-view.wxss */
+:host {
+ display: block;
+ width: 100%;
+}
diff --git a/miniprogram/miniprogram_npm/widget-ui/index.js b/miniprogram/miniprogram_npm/widget-ui/index.js
new file mode 100644
index 00000000..37e791dc
--- /dev/null
+++ b/miniprogram/miniprogram_npm/widget-ui/index.js
@@ -0,0 +1,12 @@
+module.exports = (function() {
+var __MODS__ = {};
+var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
+var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
+var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
+var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
+__DEFINE__(1591242034686, function(require, module, exports) {
+!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o=e();for(var r in o)("object"==typeof exports?exports:t)[r]=o[r]}}(this,(function(){return function(t){var e={};function o(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(r,i,function(e){return t[e]}.bind(null,i));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=0)}([function(t,e,o){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(o(1)),l=o(2),n=0,a=function(){function t(e){var o=this;void 0===e&&(e={}),this.parent=null,this.id=t.uuid(),this.style={},this.computedStyle={},this.lastComputedStyle={},this.children={},this.layoutBox={left:0,top:0,width:0,height:0},e=Object.assign(l.getDefaultStyle(),e),this.computedStyle=Object.assign(l.getDefaultStyle(),e),this.lastComputedStyle=Object.assign(l.getDefaultStyle(),e),Object.keys(e).forEach((function(t){Object.defineProperty(o.style,t,{configurable:!0,enumerable:!0,get:function(){return e[t]},set:function(r){r!==e[t]&&void 0!==r&&(o.lastComputedStyle=o.computedStyle[t],e[t]=r,o.computedStyle[t]=r,l.scalableStyles.includes(t)&&o.style.scale&&(o.computedStyle[t]=r*o.style.scale),"scale"===t&&l.scalableStyles.forEach((function(t){e[t]&&(o.computedStyle[t]=e[t]*r)})),"hidden"===t&&(r?l.layoutAffectedStyles.forEach((function(t){o.computedStyle[t]=0})):l.layoutAffectedStyles.forEach((function(t){o.computedStyle[t]=o.lastComputedStyle[t]}))))}})})),this.style.scale&&l.scalableStyles.forEach((function(t){if(o.style[t]){var e=o.style[t]*o.style.scale;o.computedStyle[t]=e}})),e.hidden&&l.layoutAffectedStyles.forEach((function(t){o.computedStyle[t]=0}))}return t.uuid=function(){return n++},t.prototype.getAbsolutePosition=function(t){if(!t)return this.getAbsolutePosition(this);if(!t.parent)return{left:0,top:0};var e=this.getAbsolutePosition(t.parent),o=e.left,r=e.top;return{left:o+t.layoutBox.left,top:r+t.layoutBox.top}},t.prototype.add=function(t){t.parent=this,this.children[t.id]=t},t.prototype.remove=function(t){var e=this;t?this.children[t.id]&&(t.remove(),delete this.children[t.id]):Object.keys(this.children).forEach((function(t){e.children[t].remove(),delete e.children[t]}))},t.prototype.getNodeTree=function(){var t=this;return{id:this.id,style:this.computedStyle,children:Object.keys(this.children).map((function(e){return t.children[e].getNodeTree()}))}},t.prototype.applyLayout=function(t){var e=this;["left","top","width","height"].forEach((function(o){t.layout&&"number"==typeof t.layout[o]&&(e.layoutBox[o]=t.layout[o],!e.parent||"left"!==o&&"top"!==o||(e.layoutBox[o]+=e.parent.layoutBox[o]))})),t.children.forEach((function(t){e.children[t.id].applyLayout(t)}))},t.prototype.layout=function(){var t=this.getNodeTree();i.default(t),this.applyLayout(t)},t}();e.default=a},function(t,e,o){o.r(e);var r=function(){var t,e="inherit",o="ltr",r="rtl",i="row",l="row-reverse",n="column",a="column-reverse",u="flex-start",d="center",s="flex-end",y="space-between",c="space-around",f="flex-start",h="center",p="flex-end",g="stretch",v="relative",m="absolute",b={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},x={row:"right","row-reverse":"left",column:"bottom","column-reverse":"top"},w={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},S={row:"width","row-reverse":"width",column:"height","column-reverse":"height"};function W(t){return void 0===t}function L(t){return t===i||t===l}function k(t,e){if(void 0!==t.style.marginStart&&L(e))return t.style.marginStart;var o=null;switch(e){case"row":o=t.style.marginLeft;break;case"row-reverse":o=t.style.marginRight;break;case"column":o=t.style.marginTop;break;case"column-reverse":o=t.style.marginBottom}return void 0!==o?o:void 0!==t.style.margin?t.style.margin:0}function j(t,e){if(void 0!==t.style.marginEnd&&L(e))return t.style.marginEnd;var o=null;switch(e){case"row":o=t.style.marginRight;break;case"row-reverse":o=t.style.marginLeft;break;case"column":o=t.style.marginBottom;break;case"column-reverse":o=t.style.marginTop}return null!=o?o:void 0!==t.style.margin?t.style.margin:0}function B(t,e){if(void 0!==t.style.borderStartWidth&&t.style.borderStartWidth>=0&&L(e))return t.style.borderStartWidth;var o=null;switch(e){case"row":o=t.style.borderLeftWidth;break;case"row-reverse":o=t.style.borderRightWidth;break;case"column":o=t.style.borderTopWidth;break;case"column-reverse":o=t.style.borderBottomWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function E(t,e){if(void 0!==t.style.borderEndWidth&&t.style.borderEndWidth>=0&&L(e))return t.style.borderEndWidth;var o=null;switch(e){case"row":o=t.style.borderRightWidth;break;case"row-reverse":o=t.style.borderLeftWidth;break;case"column":o=t.style.borderBottomWidth;break;case"column-reverse":o=t.style.borderTopWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function C(t,e){return function(t,e){if(void 0!==t.style.paddingStart&&t.style.paddingStart>=0&&L(e))return t.style.paddingStart;var o=null;switch(e){case"row":o=t.style.paddingLeft;break;case"row-reverse":o=t.style.paddingRight;break;case"column":o=t.style.paddingTop;break;case"column-reverse":o=t.style.paddingBottom}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+B(t,e)}function T(t,e){return function(t,e){if(void 0!==t.style.paddingEnd&&t.style.paddingEnd>=0&&L(e))return t.style.paddingEnd;var o=null;switch(e){case"row":o=t.style.paddingRight;break;case"row-reverse":o=t.style.paddingLeft;break;case"column":o=t.style.paddingBottom;break;case"column-reverse":o=t.style.paddingTop}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+E(t,e)}function O(t,e){return B(t,e)+E(t,e)}function _(t,e){return k(t,e)+j(t,e)}function R(t,e){return C(t,e)+T(t,e)}function A(t,e){return e.style.alignSelf?e.style.alignSelf:t.style.alignItems?t.style.alignItems:"stretch"}function P(t,e){if(e===r){if(t===i)return l;if(t===l)return i}return t}function D(t,e){return function(t){return t===n||t===a}(t)?P(i,e):n}function H(t){return t.style.position?t.style.position:"relative"}function M(t){return H(t)===v&&t.style.flex>0}function I(t,e){return t.layout[S[e]]+_(t,e)}function N(t,e){return void 0!==t.style[S[e]]&&t.style[S[e]]>=0}function F(t,e){return void 0!==t.style[e]}function q(t,e){return void 0!==t.style[e]?t.style[e]:0}function z(t,e,o){var r={row:t.style.minWidth,"row-reverse":t.style.minWidth,column:t.style.minHeight,"column-reverse":t.style.minHeight}[e],i={row:t.style.maxWidth,"row-reverse":t.style.maxWidth,column:t.style.maxHeight,"column-reverse":t.style.maxHeight}[e],l=o;return void 0!==i&&i>=0&&l>i&&(l=i),void 0!==r&&r>=0&&le?t:e}function G(t,e){void 0===t.layout[S[e]]&&N(t,e)&&(t.layout[S[e]]=U(z(t,e,t.style[S[e]]),R(t,e)))}function J(t,e,o){e.layout[x[o]]=t.layout[S[o]]-e.layout[S[o]]-e.layout[w[o]]}function K(t,e){return void 0!==t.style[b[e]]?q(t,b[e]):-q(t,x[e])}function Q(r,E,Q){var X=function(t,r){var i;return(i=t.style.direction?t.style.direction:e)===e&&(i=void 0===r?o:r),i}(r,Q),Y=P(function(t){return t.style.flexDirection?t.style.flexDirection:n}(r),X),Z=D(Y,X),$=P(i,X);G(r,Y),G(r,Z),r.layout.direction=X,r.layout[b[Y]]+=k(r,Y)+K(r,Y),r.layout[x[Y]]+=j(r,Y)+K(r,Y),r.layout[b[Z]]+=k(r,Z)+K(r,Z),r.layout[x[Z]]+=j(r,Z)+K(r,Z);var tt=r.children.length,et=R(r,$);if(function(t){return void 0!==t.style.measure}(r)){var ot=!W(r.layout[S[$]]),rt=t;rt=N(r,$)?r.style.width:ot?r.layout[S[$]]:E-_(r,$),rt-=et;var it=!N(r,$)&&!ot,lt=!N(r,n)&&W(r.layout[S[n]]);if(it||lt){var nt=r.style.measure(rt);it&&(r.layout.width=nt.width+et),lt&&(r.layout.height=nt.height+R(r,n))}if(0===tt)return}var at,ut,dt,st,yt=function(t){return"wrap"===t.style.flexWrap}(r),ct=function(t){return t.style.justifyContent?t.style.justifyContent:"flex-start"}(r),ft=C(r,Y),ht=C(r,Z),pt=R(r,Y),gt=R(r,Z),vt=!W(r.layout[S[Y]]),mt=!W(r.layout[S[Z]]),bt=L(Y),xt=null,wt=null,St=t;vt&&(St=r.layout[S[Y]]-pt);for(var Wt=0,Lt=0,kt=0,jt=0,Bt=0,Et=0;LtSt&&at!==Wt){Rt--,kt=1;break}At&&(H(dt)!==v||M(dt))&&(At=!1,Pt=at),Dt&&(H(dt)!==v||Xt!==g&&Xt!==f||W(dt.layout[S[Z]]))&&(Dt=!1,Ht=at),At&&(dt.layout[w[Y]]+=Nt,vt&&J(r,dt,Y),Nt+=I(dt,Y),Ft=U(Ft,z(dt,Z,I(dt,Z)))),Dt&&(dt.layout[w[Z]]+=jt+ht,mt&&J(r,dt,Z)),kt=0,Tt+=qt,Lt=at+1}var zt=0,Ut=0,Gt=0;if(Gt=vt?St-Tt:U(Tt,0)-Tt,0!==Ot){var Jt,Kt,Qt=Gt/_t;for(It=Mt;null!==It;)(Jt=Qt*It.style.flex+R(It,Y))!==(Kt=z(It,Y,Jt))&&(Gt-=Kt,_t-=It.style.flex),It=It.nextFlexChild;for((Qt=Gt/_t)<0&&(Qt=0),It=Mt;null!==It;)It.layout[S[Y]]=z(It,Y,Qt*It.style.flex+R(It,Y)),Ct=t,N(r,$)?Ct=r.layout[S[$]]-et:bt||(Ct=E-_(r,$)-et),V(It,Ct,X),dt=It,It=It.nextFlexChild,dt.nextFlexChild=null}else ct!==u&&(ct===d?zt=Gt/2:ct===s?zt=Gt:ct===y?(Gt=U(Gt,0),Ut=Ot+Rt-1!=0?Gt/(Ot+Rt-1):0):ct===c&&(zt=(Ut=Gt/(Ot+Rt))/2));for(Nt+=zt,at=Pt;at1&&mt){var $t=r.layout[S[Z]]-gt,te=$t-jt,ee=0,oe=ht,re=function(t){return t.style.alignContent?t.style.alignContent:"flex-start"}(r);re===p?oe+=te:re===h?oe+=te/2:re===g&&$t>jt&&(ee=te/Et);var ie=0;for(at=0;at=0&&L(e))return t.style.borderStartWidth;var o=null;switch(e){case\"row\":o=t.style.borderLeftWidth;break;case\"row-reverse\":o=t.style.borderRightWidth;break;case\"column\":o=t.style.borderTopWidth;break;case\"column-reverse\":o=t.style.borderBottomWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function E(t,e){if(void 0!==t.style.borderEndWidth&&t.style.borderEndWidth>=0&&L(e))return t.style.borderEndWidth;var o=null;switch(e){case\"row\":o=t.style.borderRightWidth;break;case\"row-reverse\":o=t.style.borderLeftWidth;break;case\"column\":o=t.style.borderBottomWidth;break;case\"column-reverse\":o=t.style.borderTopWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function C(t,e){return function(t,e){if(void 0!==t.style.paddingStart&&t.style.paddingStart>=0&&L(e))return t.style.paddingStart;var o=null;switch(e){case\"row\":o=t.style.paddingLeft;break;case\"row-reverse\":o=t.style.paddingRight;break;case\"column\":o=t.style.paddingTop;break;case\"column-reverse\":o=t.style.paddingBottom}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+B(t,e)}function T(t,e){return function(t,e){if(void 0!==t.style.paddingEnd&&t.style.paddingEnd>=0&&L(e))return t.style.paddingEnd;var o=null;switch(e){case\"row\":o=t.style.paddingRight;break;case\"row-reverse\":o=t.style.paddingLeft;break;case\"column\":o=t.style.paddingBottom;break;case\"column-reverse\":o=t.style.paddingTop}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+E(t,e)}function O(t,e){return B(t,e)+E(t,e)}function _(t,e){return k(t,e)+j(t,e)}function R(t,e){return C(t,e)+T(t,e)}function A(t,e){return e.style.alignSelf?e.style.alignSelf:t.style.alignItems?t.style.alignItems:\"stretch\"}function P(t,e){if(e===r){if(t===i)return l;if(t===l)return i}return t}function D(t,e){return function(t){return t===n||t===a}(t)?P(i,e):n}function H(t){return t.style.position?t.style.position:\"relative\"}function M(t){return H(t)===v&&t.style.flex>0}function I(t,e){return t.layout[S[e]]+_(t,e)}function N(t,e){return void 0!==t.style[S[e]]&&t.style[S[e]]>=0}function F(t,e){return void 0!==t.style[e]}function q(t,e){return void 0!==t.style[e]?t.style[e]:0}function z(t,e,o){var r={row:t.style.minWidth,\"row-reverse\":t.style.minWidth,column:t.style.minHeight,\"column-reverse\":t.style.minHeight}[e],i={row:t.style.maxWidth,\"row-reverse\":t.style.maxWidth,column:t.style.maxHeight,\"column-reverse\":t.style.maxHeight}[e],l=o;return void 0!==i&&i>=0&&l>i&&(l=i),void 0!==r&&r>=0&&le?t:e}function G(t,e){void 0===t.layout[S[e]]&&N(t,e)&&(t.layout[S[e]]=U(z(t,e,t.style[S[e]]),R(t,e)))}function J(t,e,o){e.layout[x[o]]=t.layout[S[o]]-e.layout[S[o]]-e.layout[w[o]]}function K(t,e){return void 0!==t.style[b[e]]?q(t,b[e]):-q(t,x[e])}function Q(r,E,Q){var X=function(t,r){var i;return(i=t.style.direction?t.style.direction:e)===e&&(i=void 0===r?o:r),i}(r,Q),Y=P(function(t){return t.style.flexDirection?t.style.flexDirection:n}(r),X),Z=D(Y,X),$=P(i,X);G(r,Y),G(r,Z),r.layout.direction=X,r.layout[b[Y]]+=k(r,Y)+K(r,Y),r.layout[x[Y]]+=j(r,Y)+K(r,Y),r.layout[b[Z]]+=k(r,Z)+K(r,Z),r.layout[x[Z]]+=j(r,Z)+K(r,Z);var tt=r.children.length,et=R(r,$);if(function(t){return void 0!==t.style.measure}(r)){var ot=!W(r.layout[S[$]]),rt=t;rt=N(r,$)?r.style.width:ot?r.layout[S[$]]:E-_(r,$),rt-=et;var it=!N(r,$)&&!ot,lt=!N(r,n)&&W(r.layout[S[n]]);if(it||lt){var nt=r.style.measure(rt);it&&(r.layout.width=nt.width+et),lt&&(r.layout.height=nt.height+R(r,n))}if(0===tt)return}var at,ut,dt,st,yt=function(t){return\"wrap\"===t.style.flexWrap}(r),ct=function(t){return t.style.justifyContent?t.style.justifyContent:\"flex-start\"}(r),ft=C(r,Y),ht=C(r,Z),pt=R(r,Y),gt=R(r,Z),vt=!W(r.layout[S[Y]]),mt=!W(r.layout[S[Z]]),bt=L(Y),xt=null,wt=null,St=t;vt&&(St=r.layout[S[Y]]-pt);for(var Wt=0,Lt=0,kt=0,jt=0,Bt=0,Et=0;LtSt&&at!==Wt){Rt--,kt=1;break}At&&(H(dt)!==v||M(dt))&&(At=!1,Pt=at),Dt&&(H(dt)!==v||Xt!==g&&Xt!==f||W(dt.layout[S[Z]]))&&(Dt=!1,Ht=at),At&&(dt.layout[w[Y]]+=Nt,vt&&J(r,dt,Y),Nt+=I(dt,Y),Ft=U(Ft,z(dt,Z,I(dt,Z)))),Dt&&(dt.layout[w[Z]]+=jt+ht,mt&&J(r,dt,Z)),kt=0,Tt+=qt,Lt=at+1}var zt=0,Ut=0,Gt=0;if(Gt=vt?St-Tt:U(Tt,0)-Tt,0!==Ot){var Jt,Kt,Qt=Gt/_t;for(It=Mt;null!==It;)(Jt=Qt*It.style.flex+R(It,Y))!==(Kt=z(It,Y,Jt))&&(Gt-=Kt,_t-=It.style.flex),It=It.nextFlexChild;for((Qt=Gt/_t)<0&&(Qt=0),It=Mt;null!==It;)It.layout[S[Y]]=z(It,Y,Qt*It.style.flex+R(It,Y)),Ct=t,N(r,$)?Ct=r.layout[S[$]]-et:bt||(Ct=E-_(r,$)-et),V(It,Ct,X),dt=It,It=It.nextFlexChild,dt.nextFlexChild=null}else ct!==u&&(ct===d?zt=Gt/2:ct===s?zt=Gt:ct===y?(Gt=U(Gt,0),Ut=Ot+Rt-1!=0?Gt/(Ot+Rt-1):0):ct===c&&(zt=(Ut=Gt/(Ot+Rt))/2));for(Nt+=zt,at=Pt;at1&&mt){var $t=r.layout[S[Z]]-gt,te=$t-jt,ee=0,oe=ht,re=function(t){return t.style.alignContent?t.style.alignContent:\"flex-start\"}(r);re===p?oe+=te:re===h?oe+=te/2:re===g&&$t>jt&&(ee=te/Et);var ie=0;for(at=0;at {
+ return (...args) => {
+ if (!this.inited) {
+ throw new error_1.CloudSDKError({
+ errMsg: 'Cloud API isn\'t enabled, please call init first\n' +
+ '请先调用 init 完成初始化后再调用其他云 API。init 方法可传入一个对象用于设置默认配置,详见文档。'
+ });
+ }
+ return func.apply(this, args);
+ };
+ };
+ this.exportAPI = {
+ version,
+ get DYNAMIC_CURRENT_ENV() {
+ const env = process.env.TCB_ENV || process.env.SCF_NAMESPACE;
+ if (env === 'local' && process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {
+ return symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;
+ }
+ return env || symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;
+ },
+ // @ts-ignore
+ init: this.init.bind(this),
+ // @ts-ignore
+ updateConfig: this.updateConfig.bind(this),
+ registerService: (serviceProvider) => {
+ this.registerService(serviceProvider.createService(this));
+ },
+ // @ts-ignore
+ createNewInstance: (config) => {
+ const instance = new Cloud();
+ instance.init(config);
+ return instance.exportAPI;
+ }
+ };
+ index_1.registerServices(this);
+ this.meta = {
+ session_id: (+new Date).toString()
+ };
+ this.config = {
+ env: {},
+ };
+ this.provider = provider_1.default();
+ this.exportAPI.logger = this.provider.api.logger;
+ }
+ getMetaData() {
+ return this.meta;
+ }
+ getAPIs() {
+ return Object.assign({}, this.exportAPI);
+ }
+ init(config = {}) {
+ if (this.inited)
+ return;
+ this.inited = true;
+ this.updateConfig(config);
+ }
+ updateConfig(config = {}) {
+ this.provider.init(Object.assign(Object.assign({}, config), { version: `wx-server-sdk/${version}` }));
+ const _config = Object.assign(Object.assign({}, config), { env: type_1.isObject(config.env) ? config.env : { default: config.env } });
+ this.config = _config;
+ }
+ registerService(service) {
+ this.services[service.name] = service;
+ if (service.getAPIs) {
+ const functions = service.getAPIs();
+ for (const name in functions) {
+ this.registerFunction(name, functions[name], service.initRequired);
+ }
+ }
+ else if (service.getNamespace) {
+ const { namespace, apis } = service.getNamespace();
+ this.exportAPI[namespace] = apis;
+ }
+ }
+ registerFunction(name, func, initRequired) {
+ this.exportAPI[name] = initRequired === false ? func : this.wrapCommonAPICheck(func);
+ }
+}
+exports.Cloud = Cloud;
+const cloud = new Cloud();
+exports.default = cloud;
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/index.ts":
+/*!*****************************************!*\
+ !*** ./src/api/cloud/provider/index.ts ***!
+ \*****************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const tcb_1 = __webpack_require__(/*! ./tcb */ "./src/api/cloud/provider/tcb/index.ts");
+var PROVIDER;
+(function (PROVIDER) {
+ PROVIDER[PROVIDER["TCB"] = 0] = "TCB";
+})(PROVIDER = exports.PROVIDER || (exports.PROVIDER = {}));
+function getProvider(provider = PROVIDER.TCB) {
+ switch (provider) {
+ default: {
+ return tcb_1.default;
+ }
+ }
+}
+exports.default = getProvider;
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/tcb/api/callFunction.ts":
+/*!********************************************************!*\
+ !*** ./src/api/cloud/provider/tcb/api/callFunction.ts ***!
+ \********************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts");
+const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+// const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms))
+async function callFunction(options, config) {
+ // await sleep()
+ /*
+ const res = await tcbRequest({
+ params: {
+ action: 'functions.invokeFunction',
+ function_name: options.name,
+ request_data: options.dataStr,
+ },
+ // TODO
+ timeout: 5 * 60 * 1000,
+ config: mergeConfig(tcb.config, config),
+ method: 'post',
+ headers: {
+ 'content-type': 'application/json'
+ }
+ })
+ */
+ const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));
+ const res = await tcbInstance.callFunction(options);
+ if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {
+ throw {
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: `requestID ${res.requestId}, ${res.message}`,
+ requestId: res.requestId,
+ };
+ }
+ else {
+ return {
+ result: res.result,
+ requestId: res.requestId,
+ };
+ }
+}
+exports.callFunction = callFunction;
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/tcb/api/callOpenAPI.ts":
+/*!*******************************************************!*\
+ !*** ./src/api/cloud/provider/tcb/api/callOpenAPI.ts ***!
+ \*******************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+// DEPRECATED
+Object.defineProperty(exports, "__esModule", { value: true });
+const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts");
+const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));
+async function callOpenAPI(options, config) {
+ await sleep();
+ // console.log('wx-server-sdk tcb.callWxOpenApi options: ', options)
+ const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));
+ const res = await tcbInstance.callWxOpenApi({
+ apiName: options.api,
+ requestData: options.data,
+ event: options.event,
+ });
+ // console.log('wx-server-sdk tcb.callWxOpenApi res: ', res)
+ if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {
+ throw {
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: res.message,
+ };
+ }
+ else {
+ return {
+ result: res.result,
+ };
+ }
+}
+exports.callOpenAPI = callOpenAPI;
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts":
+/*!*********************************************************!*\
+ !*** ./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts ***!
+ \*********************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts");
+const error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ "./src/config/error.config.ts");
+const error_1 = __webpack_require__(/*! ../../../../../utils/error */ "./src/utils/error.ts");
+const msg_1 = __webpack_require__(/*! ../../../../../utils/msg */ "./src/utils/msg.ts");
+const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+const openapi_1 = __webpack_require__(/*! ../../../../../protobuf/openapi */ "./src/protobuf/openapi.js");
+const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));
+async function callWXOpenAPI(options, config) {
+ await sleep();
+ let res;
+ try {
+ // console.log('wx-server-sdk tcb.callWxOpenApi options: ', options)
+ const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));
+ res = await tcbInstance.callCompatibleWxOpenApi({
+ apiName: options.api,
+ requestData: options.data,
+ });
+ // console.log('wx-server-sdk tcb.callWxOpenApi res: ', res)
+ }
+ catch (err) {
+ throw {
+ errCode: (err && err.code && error_config_1.TCB_ERR_CODE[err.code]) || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: (err && err.message) || err || 'empty error message',
+ };
+ }
+ if (!Buffer.isBuffer(res)) {
+ // is object
+ // must be error
+ // tcb must not return object
+ if (res.code && res.hasOwnProperty('message')) {
+ // tcb error
+ throw new error_1.CloudSDKError({
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: msg_1.apiFailMsg(options.api, res.message)
+ });
+ }
+ if (res.errcode) {
+ // wx error
+ throw new error_1.CloudSDKError({
+ errCode: res.errcode,
+ errMsg: msg_1.apiFailMsg(options.api, res.errmsg),
+ });
+ }
+ if (res.byteLength === 0) {
+ throw new error_1.CloudSDKError({
+ errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR,
+ errMsg: msg_1.apiFailMsg(options.api, `empty response`)
+ });
+ }
+ throw new error_1.CloudSDKError({
+ errCode: error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: msg_1.apiFailMsg(options.api, `unknown response ${res}`)
+ });
+ }
+ else {
+ // is buffer
+ let wxResp;
+ try {
+ wxResp = openapi_1.CommOpenApiResp.decode(res);
+ }
+ catch (decodeError) {
+ // fail to parse pb, may well be tcb error
+ let jsonParseResult;
+ try {
+ jsonParseResult = JSON.parse(res.toString());
+ }
+ catch (parseTCBRespError) {
+ // unknown error
+ throw new error_1.CloudSDKError({
+ errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR,
+ errMsg: msg_1.apiFailMsg(options.api, `unknown wx response received: ${decodeError}`)
+ });
+ }
+ if (jsonParseResult.code && jsonParseResult.hasOwnProperty('message')) {
+ // tcb error
+ throw new error_1.CloudSDKError({
+ errCode: error_config_1.TCB_ERR_CODE[jsonParseResult.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: msg_1.apiFailMsg(options.api, jsonParseResult.message)
+ });
+ }
+ else {
+ // unknown tcb error
+ throw new error_1.CloudSDKError({
+ errCode: error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: msg_1.apiFailMsg(options.api, JSON.stringify(jsonParseResult)),
+ });
+ }
+ }
+ if (wxResp) {
+ if (wxResp.errorCode) {
+ // wx system error, for example: no permission
+ throw new error_1.CloudSDKError({
+ errCode: error_config_2.ERR_CODE[error_config_2.ERR_CODE[wxResp.errorCode]] || wxResp.errorCode,
+ errMsg: `${error_config_2.ERR_CODE[error_config_2.ERR_CODE.WX_SYSTEM_ERROR]}: error code: ${wxResp.errorCode}`
+ });
+ }
+ }
+ else {
+ throw new error_1.CloudSDKError({
+ errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR,
+ errMsg: msg_1.apiFailMsg(options.api, `empty wx response buffer`)
+ });
+ }
+ return wxResp;
+ }
+}
+exports.callWXOpenAPI = callWXOpenAPI;
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/tcb/api/database.ts":
+/*!****************************************************!*\
+ !*** ./src/api/cloud/provider/tcb/api/database.ts ***!
+ \****************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const tcb = __webpack_require__(/*! tcb-admin-node */ "tcb-admin-node");
+const tcbRequest = __webpack_require__(/*! tcb-admin-node/src/utils/httpRequest */ "tcb-admin-node/src/utils/httpRequest");
+const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts");
+const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));
+const mergeConfig = (tcbConfig, config) => {
+ const ret = Object.assign({}, tcbConfig);
+ if (config.env) {
+ // @ts-ignore
+ ret.env = config.env;
+ }
+ return ret;
+};
+async function addDocument(options, config) {
+ // 不得已而 sleep(0),因为 tcb-admin-node 的 httpRequest 在返回 promise 之前竟然有逻辑可能抛错 !!!!!
+ await sleep();
+ const res = await tcbRequest({
+ params: {
+ action: 'database.addDocument',
+ _id: options._id,
+ collectionName: options.collectionName,
+ data: options.data,
+ },
+ config: mergeConfig(tcb.config, config),
+ method: 'post',
+ headers: {
+ 'content-type': 'application/json'
+ }
+ });
+ if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {
+ throw {
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: res.message,
+ };
+ }
+ else {
+ return {
+ _id: res.data._id,
+ requestId: res.requestId,
+ };
+ }
+}
+exports.addDocument = addDocument;
+async function queryDocument(options, config) {
+ await sleep();
+ const res = await tcbRequest({
+ params: Object.assign(Object.assign({}, options), { action: 'database.queryDocument', collectionName: options.collectionName }),
+ config: mergeConfig(tcb.config, config),
+ method: 'post',
+ headers: {
+ 'content-type': 'application/json'
+ }
+ });
+ if (res.code) {
+ throw {
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: res.message,
+ };
+ }
+ else {
+ return {
+ list: res.data.list || [],
+ limit: res.Limit,
+ offset: res.Offset,
+ total: res.TotalCount,
+ requestId: res.requestId,
+ };
+ }
+}
+exports.queryDocument = queryDocument;
+async function updateDocument(options, config) {
+ await sleep();
+ const res = await tcbRequest({
+ params: Object.assign(Object.assign({}, options), { action: 'database.updateDocument', collectionName: options.collectionName }),
+ config: mergeConfig(tcb.config, config),
+ method: 'post',
+ headers: {
+ 'content-type': 'application/json'
+ }
+ });
+ if (res.code) {
+ throw {
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: res.message,
+ };
+ }
+ else {
+ return {
+ updated: res.data.updated,
+ upsertedId: res.data.upserted_id,
+ requestId: res.requestId,
+ };
+ }
+}
+exports.updateDocument = updateDocument;
+async function removeDocument(options, config) {
+ await sleep();
+ const res = await tcbRequest({
+ params: Object.assign(Object.assign({}, options), { action: 'database.removeDocument', collectionName: options.collectionName }),
+ config: mergeConfig(tcb.config, config),
+ method: 'post',
+ headers: {
+ 'content-type': 'application/json'
+ }
+ });
+ if (res.code) {
+ throw {
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: res.message,
+ };
+ }
+ else {
+ return {
+ removed: res.deleted,
+ requestId: res.requestId,
+ };
+ }
+}
+exports.removeDocument = removeDocument;
+async function countDocument(options, config) {
+ await sleep();
+ const res = await tcbRequest({
+ params: Object.assign(Object.assign({}, options), { action: 'database.countDocument', collectionName: options.collectionName }),
+ config: mergeConfig(tcb.config, config),
+ method: 'post',
+ headers: {
+ 'content-type': 'application/json'
+ }
+ });
+ if (res.code) {
+ throw {
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: res.message,
+ };
+ }
+ else {
+ return {
+ total: res.data.total,
+ requestId: res.requestId,
+ };
+ }
+}
+exports.countDocument = countDocument;
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/tcb/api/deleteFile.ts":
+/*!******************************************************!*\
+ !*** ./src/api/cloud/provider/tcb/api/deleteFile.ts ***!
+ \******************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts");
+const error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ "./src/config/error.config.ts");
+const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));
+async function deleteFile(options, config) {
+ await sleep();
+ const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));
+ const res = await tcbInstance.deleteFile({
+ fileList: options.fileList
+ });
+ if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {
+ throw {
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: res.message,
+ };
+ }
+ else {
+ const fileList = (res.fileList || []).filter((s) => Boolean(s)).map((f) => {
+ if (f.code && error_config_1.TCB_ERR_CODE[f.code] !== 0) {
+ const code = error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR;
+ return {
+ fileID: f.fileID,
+ status: error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: error_config_2.ERR_CODE[code]
+ };
+ }
+ return {
+ fileID: f.fileID,
+ status: 0,
+ errMsg: 'ok',
+ };
+ });
+ //@ts-ignore
+ return {
+ fileList: fileList,
+ requestId: res.requestId,
+ };
+ }
+}
+exports.deleteFile = deleteFile;
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/tcb/api/downloadFile.ts":
+/*!********************************************************!*\
+ !*** ./src/api/cloud/provider/tcb/api/downloadFile.ts ***!
+ \********************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts");
+const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));
+async function downloadFile(options, config) {
+ await sleep();
+ const statusCode = 200;
+ const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));
+ const res = await tcbInstance.downloadFile({
+ fileID: options.fileID
+ });
+ if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {
+ throw {
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: res.message,
+ };
+ }
+ return {
+ statusCode: statusCode,
+ fileContent: res.fileContent,
+ };
+}
+exports.downloadFile = downloadFile;
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/tcb/api/getTempFileURL.ts":
+/*!**********************************************************!*\
+ !*** ./src/api/cloud/provider/tcb/api/getTempFileURL.ts ***!
+ \**********************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts");
+const error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ "./src/config/error.config.ts");
+const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));
+async function getTempFileURL(options, config) {
+ await sleep();
+ const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));
+ const res = await tcbInstance.getTempFileURL({
+ fileList: options.fileList,
+ });
+ if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {
+ throw {
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: res.message,
+ };
+ }
+ else {
+ const fileList = (res.fileList || []).filter((s) => Boolean(s)).map((f, i) => {
+ if (f.code && error_config_1.TCB_ERR_CODE[f.code] !== 0) {
+ const code = error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR;
+ return {
+ fileID: f.fileID,
+ status: error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: error_config_2.ERR_CODE[code],
+ maxAge: f.maxAge,
+ tempFileURL: '',
+ };
+ }
+ return {
+ fileID: f.fileID,
+ status: 0,
+ errMsg: 'ok',
+ maxAge: f.maxAge,
+ tempFileURL: f.tempFileURL,
+ };
+ });
+ return {
+ fileList: fileList,
+ requestId: res.requestId,
+ };
+ }
+}
+exports.getTempFileURL = getTempFileURL;
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/tcb/api/uploadFile.ts":
+/*!******************************************************!*\
+ !*** ./src/api/cloud/provider/tcb/api/uploadFile.ts ***!
+ \******************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts");
+const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));
+async function uploadFile(options, config) {
+ await sleep();
+ let statusCode = -1;
+ const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));
+ const res = await tcbInstance.uploadFile({
+ cloudPath: options.cloudPath,
+ fileContent: options.fileContent,
+ }, {
+ onResponseReceived(resp) {
+ statusCode = resp ? resp.statusCode : statusCode;
+ }
+ });
+ if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {
+ throw {
+ errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: res.message,
+ };
+ }
+ else {
+ //@ts-ignore
+ return {
+ fileID: res.fileID,
+ requestId: res.requestId,
+ statusCode,
+ };
+ }
+}
+exports.uploadFile = uploadFile;
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/tcb/config/error.config.ts":
+/*!***********************************************************!*\
+ !*** ./src/api/cloud/provider/tcb/config/error.config.ts ***!
+ \***********************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+// provider should also register the error codes in src/config/error.config.ts
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.TCB_ERR_CODE = {
+ // 通用
+ SUCCESS: 0,
+ SYS_ERR: -501001,
+ SERVER_TIMEOUT: -501002,
+ EXCEED_REQUEST_LIMIT: -501003,
+ EXCEED_CONCURRENT_REQUEST_LIMIT: -501004,
+ INVALIID_ENV: -501005,
+ INVALID_COMMON_PARAM: -501006,
+ INVALID_PARAM: -501007,
+ INVALID_REQUEST_SOURCE: -501008,
+ RESOURCE_NOT_INITIAL: -501009,
+ // 数据库
+ DATABASE_REQUEST_FAILED: -502001,
+ DATABASE_INVALID_OPERRATOR: -502002,
+ DATABASE_PERMISSION_DENIED: -502003,
+ DATABASE_COLLECTION_EXCEED_LIMIT: -502004,
+ DATABASE_COLLECTION_NOT_EXIST: -502005,
+ // 文件
+ STORAGE_REQUEST_FAIL: -503001,
+ STORAGE_EXCEED_AUTHORITY: -503002,
+ STORAGE_FILE_NONEXIST: -503003,
+ STORAGE_SIGN_PARAM_INVALID: -503004,
+ // 云函数
+ FUNCTIONS_REQUEST_FAIL: -504001,
+ FUNCTIONS_EXECUTE_FAIL: -504002,
+};
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/tcb/index.ts":
+/*!*********************************************!*\
+ !*** ./src/api/cloud/provider/tcb/index.ts ***!
+ \*********************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const tcb = __webpack_require__(/*! tcb-admin-node */ "tcb-admin-node");
+const tcbRequest = __webpack_require__(/*! tcb-admin-node/src/utils/httpRequest */ "tcb-admin-node/src/utils/httpRequest");
+const database_1 = __webpack_require__(/*! ./api/database */ "./src/api/cloud/provider/tcb/api/database.ts");
+const callFunction_1 = __webpack_require__(/*! ./api/callFunction */ "./src/api/cloud/provider/tcb/api/callFunction.ts");
+const downloadFile_1 = __webpack_require__(/*! ./api/downloadFile */ "./src/api/cloud/provider/tcb/api/downloadFile.ts");
+const uploadFile_1 = __webpack_require__(/*! ./api/uploadFile */ "./src/api/cloud/provider/tcb/api/uploadFile.ts");
+const deleteFile_1 = __webpack_require__(/*! ./api/deleteFile */ "./src/api/cloud/provider/tcb/api/deleteFile.ts");
+const getTempFileURL_1 = __webpack_require__(/*! ./api/getTempFileURL */ "./src/api/cloud/provider/tcb/api/getTempFileURL.ts");
+const callOpenAPI_1 = __webpack_require__(/*! ./api/callOpenAPI */ "./src/api/cloud/provider/tcb/api/callOpenAPI.ts");
+const callWXOpenAPI_1 = __webpack_require__(/*! ./api/callWXOpenAPI */ "./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts");
+const provider = {
+ // init
+ init: (config) => {
+ tcb.init(Object.assign(Object.assign({}, config), { isHttp: process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF' }));
+ },
+ get config() {
+ return tcb.config;
+ },
+ // request
+ sendRequest: async function (options) {
+ return tcbRequest(Object.assign({ config: tcb.config, params: options.data }, options));
+ },
+ // api
+ api: {
+ addDocument: database_1.addDocument,
+ queryDocument: database_1.queryDocument,
+ updateDocument: database_1.updateDocument,
+ removeDocument: database_1.removeDocument,
+ countDocument: database_1.countDocument,
+ callFunction: callFunction_1.callFunction,
+ downloadFile: downloadFile_1.downloadFile,
+ uploadFile: uploadFile_1.uploadFile,
+ deleteFile: deleteFile_1.deleteFile,
+ getTempFileURL: getTempFileURL_1.getTempFileURL,
+ callOpenAPI: callOpenAPI_1.callOpenAPI,
+ callWXOpenAPI: callWXOpenAPI_1.callWXOpenAPI,
+ logger: tcb.logger,
+ }
+};
+exports.default = provider;
+
+
+/***/ }),
+
+/***/ "./src/api/cloud/provider/tcb/utils/instance.ts":
+/*!******************************************************!*\
+ !*** ./src/api/cloud/provider/tcb/utils/instance.ts ***!
+ \******************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const tcb = __webpack_require__(/*! tcb-admin-node */ "tcb-admin-node");
+const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts");
+const symbol_config_1 = __webpack_require__(/*! config/symbol.config */ "./src/config/symbol.config.ts");
+exports.getInstance = (config = {}) => {
+ if (process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {
+ // @ts-ignore
+ const instance = tcb.init(Object.assign(Object.assign({}, config), { env: utils_1.translateEnv(config.env), isHttp: true }));
+ instance.config.secretId = undefined;
+ instance.config.secretKey = undefined;
+ instance.config.sessionToken = undefined;
+ return instance;
+ }
+ else {
+ // @ts-ignore
+ const instance = tcb.init(Object.assign(Object.assign({}, config), { env: utils_1.translateEnv(config.env) }));
+ instance.config.secretId = undefined;
+ instance.config.secretKey = undefined;
+ instance.config.sessionToken = undefined;
+ return instance;
+ }
+};
+exports.fixInstance = (instance, env) => {
+ instance = instance || tcb;
+ if (env) {
+ instance.config.envName = utils_1.translateEnv(env);
+ }
+ else if (instance.config.envName === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {
+ instance.config.envName = utils_1.translateEnv(instance.config.envName);
+ }
+ if (process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {
+ instance.config.secretId = undefined;
+ instance.config.secretKey = undefined;
+ instance.config.sessionToken = undefined;
+ instance.config.isHttp = true;
+ }
+};
+
+
+/***/ }),
+
+/***/ "./src/api/database/api/api.ts":
+/*!*************************************!*\
+ !*** ./src/api/database/api/api.ts ***!
+ \*************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const database_1 = __webpack_require__(/*! ./database */ "./src/api/database/api/database.ts");
+function getAPIs(cloud) {
+ return {
+ database: database_1.default.bind(null, cloud),
+ };
+}
+exports.getAPIs = getAPIs;
+
+
+/***/ }),
+
+/***/ "./src/api/database/api/database.ts":
+/*!******************************************!*\
+ !*** ./src/api/database/api/database.ts ***!
+ \******************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const collection_1 = __webpack_require__(/*! ./database/collection */ "./src/api/database/api/database/collection.ts");
+const transaction_1 = __webpack_require__(/*! ./database/transaction/transaction */ "./src/api/database/api/database/transaction/transaction.ts");
+const geo_1 = __webpack_require__(/*! ./database/geo/geo */ "./src/api/database/api/database/geo/geo.ts");
+const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts");
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const error_checker_1 = __webpack_require__(/*! ./database/helper/error-checker */ "./src/api/database/api/database/helper/error-checker.ts");
+const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts");
+const instance_1 = __webpack_require__(/*! ../../../api/cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+const symbol_config_1 = __webpack_require__(/*! config/symbol.config */ "./src/config/symbol.config.ts");
+function getDatabase(cloud, config) {
+ const Database = getDatabaseClass(cloud);
+ return new Database(config);
+}
+exports.default = getDatabase;
+const getDatabaseClass = (cloud) => {
+ return class Database {
+ constructor(config = {}) {
+ this.runTransaction = (run, retryTimes) => {
+ return transaction_1.runTransaction.call(this, run, retryTimes);
+ };
+ this.cloud = cloud;
+ this.config = config;
+ if (config.env) {
+ assert_1.assertType(config.env, 'string');
+ }
+ else if (cloud.config.env) {
+ if (cloud.config.env === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {
+ config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;
+ }
+ else if (cloud.config.env.database === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {
+ config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;
+ }
+ else if (!cloud.config.env.database && cloud.config.env.default === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {
+ config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;
+ }
+ }
+ this._instance = instance_1.getInstance(Object.assign(Object.assign({}, utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'database')), config));
+ this._db = this._instance.database();
+ this.command = this._db.command;
+ this.Geo = geo_1.initGeo(this._db.Geo);
+ this.serverDate = this._db.serverDate;
+ this.RegExp = this._db.RegExp;
+ }
+ collection(collectionName) {
+ return new collection_1.CollectionReference(this._db.collection(collectionName), collectionName, this);
+ }
+ startTransaction() {
+ return transaction_1.startTransaction.call(this);
+ }
+ async createCollection(collectionName) {
+ const apiName = 'createCollection';
+ try {
+ const result = await this._db.createCollection(collectionName);
+ error_checker_1.checkError(result);
+ return {
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ requestId: result.requestId,
+ };
+ }
+ catch (e) {
+ throw error_1.returnAsFinalCloudSDKError(e, apiName);
+ }
+ }
+ };
+};
+
+
+/***/ }),
+
+/***/ "./src/api/database/api/database/aggregate.ts":
+/*!****************************************************!*\
+ !*** ./src/api/database/api/database/aggregate.ts ***!
+ \****************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ "./src/api/database/api/database/helper/error-checker.ts");
+const instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+var ORDER_DIRECTION;
+(function (ORDER_DIRECTION) {
+ ORDER_DIRECTION["ASC"] = "asc";
+ ORDER_DIRECTION["DESC"] = "desc";
+})(ORDER_DIRECTION = exports.ORDER_DIRECTION || (exports.ORDER_DIRECTION = {}));
+class Aggregate {
+ constructor(_aggregate, collectionName, database) {
+ this._aggregate = _aggregate;
+ this.collectionName = collectionName;
+ this.database = database;
+ }
+ pushStage(stage, val) {
+ return new Aggregate(this._aggregate[stage](val), this.collectionName, this.database);
+ }
+ addFields(val) {
+ return this.pushStage('addFields', val);
+ }
+ bucket(val) {
+ return this.pushStage('bucket', val);
+ }
+ bucketAuto(val) {
+ return this.pushStage('bucketAuto', val);
+ }
+ collStats(val) {
+ return this.pushStage('collStats', val);
+ }
+ count(val) {
+ return this.pushStage('count', val);
+ }
+ facet(val) {
+ return this.pushStage('facet', val);
+ }
+ geoNear(val) {
+ return this.pushStage('geoNear', val);
+ }
+ graphLookup(val) {
+ return this.pushStage('graphLookup', val);
+ }
+ group(val) {
+ return this.pushStage('group', val);
+ }
+ indexStats() {
+ return this.pushStage('indexStats', {});
+ }
+ limit(val) {
+ return this.pushStage('limit', val);
+ }
+ lookup(val) {
+ return this.pushStage('lookup', val);
+ }
+ match(val) {
+ return this.pushStage('match', val);
+ }
+ out(val) {
+ return this.pushStage('out', val);
+ }
+ project(val) {
+ return this.pushStage('project', val);
+ }
+ redact(val) {
+ return this.pushStage('redact', val);
+ }
+ replaceRoot(val) {
+ return this.pushStage('replaceRoot', val);
+ }
+ sample(val) {
+ return this.pushStage('sample', val);
+ }
+ skip(val) {
+ return this.pushStage('skip', val);
+ }
+ sort(val) {
+ return this.pushStage('sort', val);
+ }
+ sortByCount(val) {
+ return this.pushStage('sortByCount', val);
+ }
+ unwind(val) {
+ return this.pushStage('unwind', val);
+ }
+ end() {
+ const apiName = 'collection.aggregate';
+ return new Promise(async (resolve, reject) => {
+ try {
+ instance_1.fixInstance(this.database._instance, this.database.config.env);
+ const result = await this._aggregate.end();
+ error_checker_1.checkError(result);
+ resolve({
+ list: result.data,
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ });
+ }
+ catch (err) {
+ reject(error_1.returnAsFinalCloudSDKError(err, apiName));
+ }
+ });
+ }
+}
+exports.Aggregate = Aggregate;
+
+
+/***/ }),
+
+/***/ "./src/api/database/api/database/collection.ts":
+/*!*****************************************************!*\
+ !*** ./src/api/database/api/database/collection.ts ***!
+ \*****************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const query_1 = __webpack_require__(/*! ./query */ "./src/api/database/api/database/query.ts");
+const document_1 = __webpack_require__(/*! ./document */ "./src/api/database/api/database/document.ts");
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts");
+const error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ "./src/api/database/api/database/helper/error-checker.ts");
+const instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+const aggregate_1 = __webpack_require__(/*! ./aggregate */ "./src/api/database/api/database/aggregate.ts");
+class CollectionReference extends query_1.Query {
+ constructor(_collection, collectionName, database) {
+ super(_collection, collectionName, database);
+ this._collection = _collection;
+ this.collectionName = collectionName;
+ this.database = database;
+ }
+ doc(docId) {
+ return new document_1.DocumentReference(this._collection.doc(docId), this, docId, this.database);
+ }
+ add(options) {
+ const apiName = 'collection.add';
+ return new Promise(async (resolve, reject) => {
+ try {
+ assert_1.assertType(options, {
+ data: 'object'
+ });
+ assert_1.assertObjectNotEmpty({
+ name: 'options.data',
+ target: options.data,
+ });
+ instance_1.fixInstance(this.database._instance, this.database.config.env);
+ const addResult = await this._collection.add(options.data);
+ error_checker_1.checkError(addResult);
+ resolve({
+ _id: addResult.id,
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ });
+ }
+ catch (err) {
+ reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));
+ }
+ });
+ }
+ aggregate() {
+ return new aggregate_1.Aggregate(this._collection.aggregate(), this.collectionName, this.database);
+ }
+}
+exports.CollectionReference = CollectionReference;
+
+
+/***/ }),
+
+/***/ "./src/api/database/api/database/document.ts":
+/*!***************************************************!*\
+ !*** ./src/api/database/api/database/document.ts ***!
+ \***************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts");
+const error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ "./src/api/database/api/database/helper/error-checker.ts");
+const instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+const GET_API_NAME = 'document.get';
+const UPDATE_API_NAME = 'document.update';
+const SET_API_NAME = 'document.set';
+const REMOVE_API_NAME = 'document.remove';
+class DocumentReference {
+ constructor(_document, collection, docId, database) {
+ this._document = _document;
+ this.collection = collection;
+ this.database = database;
+ this._id = docId;
+ }
+ field(object) {
+ assert_1.assertRequiredParam(object, 'object', 'field');
+ assert_1.assertType(object, 'object', 'field');
+ return new DocumentReference(this._document.field(object), this.collection, this._id, this.database);
+ }
+ get() {
+ return new Promise(async (resolve, reject) => {
+ try {
+ const throwOnNotFound = this.database.config.hasOwnProperty('throwOnNotFound') ? Boolean(this.database.config.throwOnNotFound) : true;
+ const _id = this._id;
+ instance_1.fixInstance(this.database._instance, this.database.config.env);
+ const queryResult = await this._document.get();
+ error_checker_1.checkError(queryResult);
+ // in normal doc.get, queryResult.data is array, in transaction, it is object instead
+ if (!queryResult.data || (Array.isArray(queryResult.data) && !queryResult.data.length)) {
+ if (throwOnNotFound) {
+ throw `document with _id ${_id} does not exist`;
+ }
+ else {
+ resolve({
+ data: null,
+ errMsg: msg_1.apiSuccessMsg(GET_API_NAME),
+ });
+ }
+ }
+ else {
+ resolve({
+ data: Array.isArray(queryResult.data) ? queryResult.data[0] : queryResult.data,
+ errMsg: msg_1.apiSuccessMsg(GET_API_NAME),
+ });
+ }
+ }
+ catch (err) {
+ reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), GET_API_NAME));
+ }
+ });
+ }
+ set(options) {
+ return new Promise(async (resolve, reject) => {
+ try {
+ assert_1.assertType(options, {
+ data: 'object',
+ });
+ assert_1.assertObjectNotEmpty({
+ name: 'options.data',
+ target: options.data,
+ });
+ const _id = this._id;
+ instance_1.fixInstance(this.database._instance, this.database.config.env);
+ const setResult = await this._document.set(options.data);
+ error_checker_1.checkError(setResult);
+ resolve({
+ _id,
+ errMsg: msg_1.apiSuccessMsg(SET_API_NAME),
+ stats: {
+ updated: setResult.updated,
+ created: setResult.upsertedId ? 1 : 0,
+ }
+ });
+ }
+ catch (err) {
+ reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), SET_API_NAME));
+ }
+ });
+ }
+ update(options) {
+ return new Promise(async (resolve, reject) => {
+ try {
+ assert_1.assertType(options, {
+ data: 'object',
+ });
+ assert_1.assertObjectNotEmpty({
+ name: 'options.data',
+ target: options.data,
+ });
+ instance_1.fixInstance(this.database._instance, this.database.config.env);
+ const updateResult = await this._document.update(options.data);
+ error_checker_1.checkError(updateResult);
+ resolve({
+ stats: {
+ updated: updateResult.updated,
+ },
+ errMsg: msg_1.apiSuccessMsg(UPDATE_API_NAME),
+ });
+ }
+ catch (err) {
+ reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), UPDATE_API_NAME));
+ }
+ });
+ }
+ remove(options) {
+ return new Promise(async (resolve, reject) => {
+ try {
+ instance_1.fixInstance(this.database._instance, this.database.config.env);
+ // normal doc.remove -> _doc.remove
+ // transaction doc.remove -> _doc.delete
+ const removeResult = await (this._document.remove ? this._document.remove() : this._document.delete());
+ error_checker_1.checkError(removeResult);
+ resolve({
+ stats: {
+ removed: removeResult.deleted || 0,
+ },
+ errMsg: msg_1.apiSuccessMsg(REMOVE_API_NAME),
+ });
+ }
+ catch (err) {
+ reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), REMOVE_API_NAME));
+ }
+ });
+ }
+}
+exports.DocumentReference = DocumentReference;
+
+
+/***/ }),
+
+/***/ "./src/api/database/api/database/geo/geo.ts":
+/*!**************************************************!*\
+ !*** ./src/api/database/api/database/geo/geo.ts ***!
+ \**************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.initGeo = (_geo) => {
+ const Geo = {};
+ for (const key in _geo) {
+ if (_geo.hasOwnProperty(key)) {
+ if (typeof _geo[key] === 'function') {
+ Geo[key] = function () {
+ return new _geo[key](...arguments);
+ };
+ }
+ else {
+ Geo[key] = _geo[key];
+ }
+ }
+ }
+ return Geo;
+};
+
+
+/***/ }),
+
+/***/ "./src/api/database/api/database/helper/error-checker.ts":
+/*!***************************************************************!*\
+ !*** ./src/api/database/api/database/helper/error-checker.ts ***!
+ \***************************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const error_config_1 = __webpack_require__(/*! api/cloud/provider/tcb/config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts");
+function checkError(tcbResult) {
+ if (tcbResult && tcbResult.code) {
+ throw error_1.returnAsCloudSDKError({
+ errCode: error_config_1.TCB_ERR_CODE[tcbResult.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: tcbResult.message,
+ });
+ }
+}
+exports.checkError = checkError;
+function maybeTransformError(maybeTcbError) {
+ if (maybeTcbError && maybeTcbError.code) {
+ return {
+ errCode: error_config_1.TCB_ERR_CODE[maybeTcbError.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,
+ errMsg: maybeTcbError.message,
+ };
+ }
+ return maybeTcbError;
+}
+exports.maybeTransformError = maybeTransformError;
+
+
+/***/ }),
+
+/***/ "./src/api/database/api/database/query.ts":
+/*!************************************************!*\
+ !*** ./src/api/database/api/database/query.ts ***!
+ \************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ "./src/api/database/api/database/helper/error-checker.ts");
+const instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+var ORDER_DIRECTION;
+(function (ORDER_DIRECTION) {
+ ORDER_DIRECTION["ASC"] = "asc";
+ ORDER_DIRECTION["DESC"] = "desc";
+})(ORDER_DIRECTION = exports.ORDER_DIRECTION || (exports.ORDER_DIRECTION = {}));
+class Query {
+ constructor(_query, collectionName, database) {
+ this._query = _query;
+ this.collectionName = collectionName;
+ this.database = database;
+ }
+ field(object) {
+ return new Query(this._query.field(object), this.collectionName, this.database);
+ }
+ where(condition) {
+ return new Query(this._query.where(condition), this.collectionName, this.database);
+ }
+ orderBy(fieldPath, order) {
+ return new Query(this._query.orderBy(fieldPath, order), this.collectionName, this.database);
+ }
+ limit(max) {
+ return new Query(this._query.limit(max), this.collectionName, this.database);
+ }
+ skip(offset) {
+ return new Query(this._query.skip(offset), this.collectionName, this.database);
+ }
+ get(options) {
+ const apiName = 'collection.get';
+ return new Promise(async (resolve, reject) => {
+ try {
+ instance_1.fixInstance(this.database._instance, this.database.config.env);
+ const queryResult = await this._query.get();
+ error_checker_1.checkError(queryResult);
+ resolve({
+ data: queryResult.data,
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ });
+ }
+ catch (err) {
+ reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));
+ }
+ });
+ }
+ update(options) {
+ const apiName = 'collection.update';
+ return new Promise(async (resolve, reject) => {
+ try {
+ assert_1.assertType(options, {
+ data: 'object',
+ });
+ assert_1.assertObjectNotEmpty({
+ name: 'options.data',
+ target: options.data,
+ });
+ instance_1.fixInstance(this.database._instance, this.database.config.env);
+ const updateResult = await this._query.update(options.data);
+ error_checker_1.checkError(updateResult);
+ resolve({
+ stats: {
+ updated: updateResult.updated || 0,
+ },
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ });
+ }
+ catch (err) {
+ reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));
+ }
+ });
+ }
+ remove(options) {
+ const apiName = 'collection.remove';
+ return new Promise(async (resolve, reject) => {
+ try {
+ instance_1.fixInstance(this.database._instance, this.database.config.env);
+ const removeResult = await this._query.remove();
+ error_checker_1.checkError(removeResult);
+ resolve({
+ stats: {
+ removed: removeResult.deleted,
+ },
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ });
+ }
+ catch (err) {
+ reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));
+ }
+ });
+ }
+ count(options) {
+ const apiName = 'collection.count';
+ return new Promise(async (resolve, reject) => {
+ try {
+ instance_1.fixInstance(this.database._instance, this.database.config.env);
+ const queryResult = await this._query.count();
+ error_checker_1.checkError(queryResult);
+ resolve({
+ total: queryResult.total,
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ });
+ }
+ catch (err) {
+ reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));
+ }
+ });
+ }
+}
+exports.Query = Query;
+
+
+/***/ }),
+
+/***/ "./src/api/database/api/database/transaction/transaction.ts":
+/*!******************************************************************!*\
+ !*** ./src/api/database/api/database/transaction/transaction.ts ***!
+ \******************************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const collection_1 = __webpack_require__(/*! ../collection */ "./src/api/database/api/database/collection.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const instance_1 = __webpack_require__(/*! ../../../../cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts");
+class Transaction {
+ constructor(transaction, db) {
+ this._transaction = transaction;
+ this._db = db;
+ }
+ async init() {
+ return this._transaction.init();
+ }
+ collection(collName) {
+ if (!collName) {
+ throw new Error('Collection name is required');
+ }
+ return new collection_1.CollectionReference(this._transaction.collection(collName), collName, this._db);
+ }
+ async commit() {
+ try {
+ return this._transaction.commit();
+ }
+ catch (e) {
+ throw error_1.returnAsFinalCloudSDKError(e, `transaction.commit`);
+ }
+ }
+ async rollback(reason) {
+ try {
+ return this._transaction.rollback(reason);
+ }
+ catch (e) {
+ throw error_1.returnAsFinalCloudSDKError(e, `transaction.rollback`);
+ }
+ }
+}
+exports.Transaction = Transaction;
+async function runTransaction(callback, times = 3) {
+ instance_1.fixInstance(this._instance, this.config.env);
+ return this._db.runTransaction((_transaction) => {
+ const transaction = new Transaction(_transaction, this);
+ return callback(transaction);
+ }, times);
+}
+exports.runTransaction = runTransaction;
+async function startTransaction() {
+ instance_1.fixInstance(this._instance, this.config.env);
+ const _transaction = await this._db.startTransaction();
+ return new Transaction(_transaction, this);
+}
+exports.startTransaction = startTransaction;
+
+
+/***/ }),
+
+/***/ "./src/api/database/index.ts":
+/*!***********************************!*\
+ !*** ./src/api/database/index.ts ***!
+ \***********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const api_1 = __webpack_require__(/*! ./api/api */ "./src/api/database/api/api.ts");
+exports.DATABASE_SERVICE_NAME = 'database';
+function createDatabaseService(cloud) {
+ return {
+ name: exports.DATABASE_SERVICE_NAME,
+ getAPIs: api_1.getAPIs.bind(null, cloud),
+ };
+}
+function registerService(cloud) {
+ cloud.registerService(createDatabaseService(cloud));
+}
+exports.registerService = registerService;
+
+
+/***/ }),
+
+/***/ "./src/api/functions/api/api.ts":
+/*!**************************************!*\
+ !*** ./src/api/functions/api/api.ts ***!
+ \**************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const callFunction_1 = __webpack_require__(/*! ./callFunction */ "./src/api/functions/api/callFunction.ts");
+function getAPIs(cloud) {
+ return {
+ callFunction: callFunction_1.default(cloud),
+ };
+}
+exports.getAPIs = getAPIs;
+
+
+/***/ }),
+
+/***/ "./src/api/functions/api/callFunction.ts":
+/*!***********************************************!*\
+ !*** ./src/api/functions/api/callFunction.ts ***!
+ \***********************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts");
+function getCallFunction(cloud) {
+ return function callFunction(options) {
+ const apiName = 'callFunction';
+ return new Promise(async (resolve, reject) => {
+ if (!options) {
+ return reject(error_1.returnAsFinalCloudSDKError({
+ errMsg: 'Params for callFunction must be an object instead of ' + typeof options,
+ }, apiName));
+ }
+ try {
+ assert_1.assertType(options, {
+ name: 'string'
+ });
+ if (options.hasOwnProperty('data')) {
+ assert_1.assertType(options, {
+ data: 'object'
+ });
+ }
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, apiName));
+ }
+ try {
+ const result = await cloud.provider.api.callFunction({
+ name: options.name,
+ data: options.data || {},
+ }, {
+ defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'functions'),
+ apiConfig: options.config,
+ });
+ let parsedResult = result.result;
+ try {
+ if (typeof parsedResult === 'string') {
+ parsedResult = JSON.parse(result.result);
+ }
+ }
+ catch (_) {
+ // no nothing
+ }
+ return resolve({
+ result: parsedResult,
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ requestID: result.requestId,
+ });
+ }
+ catch (e) {
+ const error = error_1.returnAsFinalCloudSDKError(e, apiName);
+ // @ts-ignore
+ error.requestID = e.requestID;
+ return reject(error);
+ }
+ });
+ };
+}
+exports.default = getCallFunction;
+
+
+/***/ }),
+
+/***/ "./src/api/functions/index.ts":
+/*!************************************!*\
+ !*** ./src/api/functions/index.ts ***!
+ \************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const api_1 = __webpack_require__(/*! ./api/api */ "./src/api/functions/api/api.ts");
+exports.FUNCTIONS_SERVICE_NAME = 'functions';
+function createFunctionsService(cloud) {
+ return {
+ name: exports.FUNCTIONS_SERVICE_NAME,
+ getAPIs: api_1.getAPIs.bind(null, cloud),
+ };
+}
+function registerService(cloud) {
+ cloud.registerService(createFunctionsService(cloud));
+}
+exports.registerService = registerService;
+
+
+/***/ }),
+
+/***/ "./src/api/index.ts":
+/*!**************************!*\
+ !*** ./src/api/index.ts ***!
+ \**************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const database_1 = __webpack_require__(/*! ./database */ "./src/api/database/index.ts");
+const storage_1 = __webpack_require__(/*! ./storage */ "./src/api/storage/index.ts");
+const functions_1 = __webpack_require__(/*! ./functions */ "./src/api/functions/index.ts");
+const open_1 = __webpack_require__(/*! ./open */ "./src/api/open/index.ts");
+const utils_1 = __webpack_require__(/*! ./utils */ "./src/api/utils/index.ts");
+const openapi_1 = __webpack_require__(/*! ./openapi */ "./src/api/openapi/index.ts");
+function registerServices(cloud) {
+ database_1.registerService(cloud);
+ storage_1.registerService(cloud);
+ functions_1.registerService(cloud);
+ open_1.registerService(cloud);
+ utils_1.registerService(cloud);
+ openapi_1.registerService(cloud);
+}
+exports.registerServices = registerServices;
+
+
+/***/ }),
+
+/***/ "./src/api/open/api/api.ts":
+/*!*********************************!*\
+ !*** ./src/api/open/api/api.ts ***!
+ \*********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const callOpenAPI_1 = __webpack_require__(/*! ./callOpenAPI */ "./src/api/open/api/callOpenAPI.ts");
+const getOpenData_1 = __webpack_require__(/*! ./getOpenData */ "./src/api/open/api/getOpenData.ts");
+const getVoIPSign_1 = __webpack_require__(/*! ./getVoIPSign */ "./src/api/open/api/getVoIPSign.ts");
+function getAPIs(cloud) {
+ return {
+ callOpenAPI: callOpenAPI_1.default(cloud),
+ getOpenData: getOpenData_1.default(cloud),
+ getVoIPSign: getVoIPSign_1.default(cloud),
+ };
+}
+exports.getAPIs = getAPIs;
+
+
+/***/ }),
+
+/***/ "./src/api/open/api/callOpenAPI.ts":
+/*!*****************************************!*\
+ !*** ./src/api/open/api/callOpenAPI.ts ***!
+ \*****************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+// THIS IS THE LEGACY CALLOPENAPI, TO BE DEPRECATED
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts");
+function getCallOpenAPI(cloud) {
+ return function callOpenAPI(options) {
+ const apiName = 'callOpenAPI';
+ return new Promise(async (resolve, reject) => {
+ if (!options) {
+ return reject(error_1.returnAsFinalCloudSDKError({
+ errMsg: 'Params for callOpenAPI must be an object instead of ' + typeof options,
+ }, apiName));
+ }
+ try {
+ assert_1.assertType(options, {
+ api: 'string'
+ });
+ if (options.data) {
+ assert_1.assertType(options, {
+ data: 'object'
+ });
+ }
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, apiName));
+ }
+ try {
+ const result = await cloud.provider.api.callOpenAPI({
+ api: options.api,
+ data: options.data || {},
+ }, {
+ defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),
+ apiConfig: options.config,
+ });
+ let parsedResult = result.result;
+ try {
+ if (typeof parsedResult === 'string') {
+ parsedResult = JSON.parse(result.result);
+ }
+ }
+ catch (_) {
+ // no nothing
+ }
+ return resolve({
+ result: parsedResult,
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ });
+ }
+ catch (e) {
+ const error = error_1.returnAsFinalCloudSDKError(e, apiName);
+ return reject(error);
+ }
+ });
+ };
+}
+exports.default = getCallOpenAPI;
+
+
+/***/ }),
+
+/***/ "./src/api/open/api/getOpenData.ts":
+/*!*****************************************!*\
+ !*** ./src/api/open/api/getOpenData.ts ***!
+ \*****************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ "./src/protobuf/openapi.js");
+const error_config_1 = __webpack_require__(/*! config/error.config */ "./src/config/error.config.ts");
+const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts");
+const API_NAME = 'getOpenData';
+function getGetOpenData(cloud) {
+ return function getOpenData(options) {
+ return new Promise(async (resolve, reject) => {
+ if (!options) {
+ return reject(error_1.returnAsFinalCloudSDKError({
+ errMsg: 'Params for getOpenData must be an object instead of ' + typeof options,
+ }, API_NAME));
+ }
+ try {
+ if (!options.list) {
+ throw new Error('list must be provided');
+ }
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, API_NAME));
+ }
+ try {
+ const getOpenDataReqBuffer = openapi_1.ApiGetOpenDataByCloudIdReq.encode({
+ cloudidList: options.list,
+ }).finish();
+ const svrkitData = {
+ apiName: 'ApiGetOpenDataByCloudId',
+ reqData: getOpenDataReqBuffer,
+ };
+ const pbMessage = openapi_1.CommApiData.encode({
+ apiType: openapi_1.CommApiData.ApiType.SVRKIT_API,
+ svrkitData,
+ }).finish();
+ const wxResp = await cloud.provider.api.callWXOpenAPI({
+ api: 'ApiGetOpenDataByCloudId',
+ data: Buffer.from(pbMessage),
+ }, {
+ defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),
+ apiConfig: options.config,
+ });
+ if (wxResp.svrkitErrorCode !== 0) {
+ throw {
+ errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,
+ errMsg: `internal svrkit error, code ${wxResp.svrkitErrorCode}`,
+ };
+ }
+ if (!wxResp.respData) {
+ throw {
+ errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,
+ errMsg: `internal svrkit error, empty respData`,
+ };
+ }
+ const pbRespMsg = openapi_1.ApiGetOpenDataByCloudIdResp.decode(wxResp.respData);
+ // const svrkitResponse = GetOpenDataRespMessage.toObject(pbRespMsg, {
+ // longs: String,
+ // })
+ const openDataList = pbRespMsg.dataList.map(item => {
+ if (!item.json) {
+ throw {
+ errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,
+ errMsg: `internal svrkit error, empty openData json field for ${item.cloudId}`,
+ };
+ }
+ return JSON.parse(item.json);
+ });
+ resolve({
+ list: openDataList,
+ errMsg: msg_1.apiSuccessMsg(API_NAME),
+ errCode: 0,
+ });
+ }
+ catch (e) {
+ const error = error_1.returnAsFinalCloudSDKError(e, API_NAME);
+ return reject(error);
+ }
+ });
+ };
+}
+exports.default = getGetOpenData;
+
+
+/***/ }),
+
+/***/ "./src/api/open/api/getVoIPSign.ts":
+/*!*****************************************!*\
+ !*** ./src/api/open/api/getVoIPSign.ts ***!
+ \*****************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ "./src/protobuf/openapi.js");
+const error_config_1 = __webpack_require__(/*! config/error.config */ "./src/config/error.config.ts");
+const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts");
+const API_NAME = 'getVoIPSign';
+function getGetVoIPSign(cloud) {
+ return function getVoIPSign(options) {
+ return new Promise(async (resolve, reject) => {
+ if (!options) {
+ return reject(error_1.returnAsFinalCloudSDKError({
+ errMsg: 'Params for getVoIPSign must be an object instead of ' + typeof options,
+ }, API_NAME));
+ }
+ try {
+ assert_1.assertType(options, {
+ groupId: 'string',
+ timestamp: 'number',
+ nonce: 'string',
+ });
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, API_NAME));
+ }
+ try {
+ const getVoIPSignReqBuffer = openapi_1.ApiVoipSignReq.encode({
+ groupId: options.groupId,
+ timestamp: options.timestamp,
+ nonce: options.nonce,
+ }).finish();
+ const svrkitData = {
+ apiName: 'ApiVoipSign',
+ reqData: getVoIPSignReqBuffer,
+ };
+ const pbMessage = openapi_1.CommApiData.encode({
+ apiType: openapi_1.CommApiData.ApiType.SVRKIT_API,
+ svrkitData,
+ }).finish();
+ const wxResp = await cloud.provider.api.callWXOpenAPI({
+ api: 'ApiVoipSign',
+ data: Buffer.from(pbMessage),
+ }, {
+ defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),
+ apiConfig: options.config,
+ });
+ if (wxResp.svrkitErrorCode !== 0) {
+ throw {
+ errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,
+ errMsg: `internal svrkit error, code ${wxResp.svrkitErrorCode}`,
+ };
+ }
+ if (!wxResp.respData) {
+ throw {
+ errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,
+ errMsg: `internal svrkit error, empty respData`,
+ };
+ }
+ const pbRespMsg = openapi_1.ApiVoipSignResp.decode(wxResp.respData);
+ resolve({
+ signature: pbRespMsg.signature,
+ errMsg: msg_1.apiSuccessMsg(API_NAME),
+ errCode: 0,
+ });
+ }
+ catch (e) {
+ const error = error_1.returnAsFinalCloudSDKError(e, API_NAME);
+ return reject(error);
+ }
+ });
+ };
+}
+exports.default = getGetVoIPSign;
+
+
+/***/ }),
+
+/***/ "./src/api/open/index.ts":
+/*!*******************************!*\
+ !*** ./src/api/open/index.ts ***!
+ \*******************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const api_1 = __webpack_require__(/*! ./api/api */ "./src/api/open/api/api.ts");
+const OPEN_SERVICE_NAME = 'open';
+function createOpenService(cloud) {
+ return {
+ name: OPEN_SERVICE_NAME,
+ getAPIs: api_1.getAPIs.bind(null, cloud),
+ };
+}
+function registerService(cloud) {
+ cloud.registerService(createOpenService(cloud));
+}
+exports.registerService = registerService;
+
+
+/***/ }),
+
+/***/ "./src/api/openapi/index.ts":
+/*!**********************************!*\
+ !*** ./src/api/openapi/index.ts ***!
+ \**********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const namespace_1 = __webpack_require__(/*! ./namespace */ "./src/api/openapi/namespace/index.ts");
+exports.OPENAPI_SERVICE_NAME = 'openapi';
+exports.OPENAPI_SERVICE_NAMESPACE_NAME = 'openapi';
+function createStorageService(cloud) {
+ return {
+ name: exports.OPENAPI_SERVICE_NAME,
+ getNamespace: () => {
+ return {
+ namespace: exports.OPENAPI_SERVICE_NAMESPACE_NAME,
+ apis: namespace_1.getAPIs(cloud),
+ };
+ },
+ };
+}
+function registerService(cloud) {
+ cloud.registerService(createStorageService(cloud));
+}
+exports.registerService = registerService;
+
+
+/***/ }),
+
+/***/ "./src/api/openapi/namespace/generic.ts":
+/*!**********************************************!*\
+ !*** ./src/api/openapi/namespace/generic.ts ***!
+ \**********************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ "./src/protobuf/openapi.js");
+const type_1 = __webpack_require__(/*! ../../../utils/type */ "./src/utils/type.ts");
+const error_1 = __webpack_require__(/*! ../../../utils/error */ "./src/utils/error.ts");
+const msg_1 = __webpack_require__(/*! ../../../utils/msg */ "./src/utils/msg.ts");
+const utils_1 = __webpack_require__(/*! ../../../utils/utils */ "./src/utils/utils.ts");
+const mimetype_1 = __webpack_require__(/*! ../../../utils/mimetype */ "./src/utils/mimetype.ts");
+const error_config_1 = __webpack_require__(/*! ../../../config/error.config */ "./src/config/error.config.ts");
+const functionIntrinsicProperties = new Set(Object.getOwnPropertyNames(Function.prototype));
+const getCallableObject = (options) => {
+ const f = function () { };
+ return new Proxy(f, {
+ get(target, prop) {
+ if (functionIntrinsicProperties.has(prop)) {
+ // @ts-ignore
+ return options.callable[prop];
+ }
+ else {
+ return getCallableObject(Object.assign(Object.assign({}, options), { paths: [...options.paths, prop] }));
+ }
+ },
+ apply(target, thisArg, args) {
+ return options.callable.call(thisArg, options, ...args);
+ },
+ });
+};
+const getProxyObject = (options) => {
+ const f = () => { };
+ const proxy = new Proxy(f, {
+ get(target, prop) {
+ return getCallableObject(Object.assign(Object.assign({}, options), { paths: [prop] }));
+ },
+ apply(target, thisArg, args) {
+ // set options
+ if (!args[0] || !type_1.isObject(args[0])) {
+ throw new Error('an options object is expected');
+ }
+ return getProxyObject(Object.assign(Object.assign({}, args[0]), {
+ // some options are not writable
+ callable: options.callable, paths: options.paths }));
+ }
+ });
+ return proxy;
+};
+function getGenericOpenAPI(cloud) {
+ const callable = (innerContext, data) => {
+ if (cloud.debug) {
+ console.log(`openapi.${innerContext.paths.join('.')} called with data:`, data);
+ }
+ const api = innerContext.paths.join('.');
+ return callWXOpenAPI({
+ api,
+ data,
+ convertCase: innerContext.convertCase,
+ });
+ };
+ return getProxyObject({
+ callable: cloud.wrapCommonAPICheck(callable),
+ paths: [],
+ });
+ async function callWXOpenAPI(options) {
+ const displayAPIName = `openapi.${options.api}`;
+ const shouldConvertCase = options.convertCase !== false;
+ try {
+ // convert camel case to snake case
+ const data = shouldConvertCase ? utils_1.convertCase(options.data, {
+ from: 'camelcase',
+ to: 'snakecase',
+ recursive: true,
+ }) : options.data;
+ // convert data to pb buffer
+ const pairs = [];
+ for (const key in data) {
+ const val = data[key];
+ // check whether it is a form-data item
+ if (type_1.isObject(val) && (val.contentType || val.content_type) && val.value && type_1.isBuffer(val.value)) {
+ const contentType = (val.contentType || val.content_type).toString();
+ const fileExtension = mimetype_1.mimeTypeToFileExtension(contentType);
+ if (!fileExtension) {
+ console.warn(`[${displayAPIName}] the input param ${key}.contentType is not a valid mime type`);
+ }
+ let filename = val.fileName;
+ if (!filename) {
+ filename = `${key}.${fileExtension || 'png'}`;
+ }
+ pairs.push({
+ key,
+ value: val.value,
+ contentType,
+ filename,
+ });
+ }
+ else {
+ const valStr = JSON.stringify(val);
+ if (valStr !== undefined) {
+ pairs.push({
+ key,
+ value: Buffer.from(valStr),
+ });
+ }
+ }
+ }
+ const pbMessage = openapi_1.CommApiData.encode({
+ apiType: openapi_1.CommApiData.ApiType.OPEN_API,
+ openapiData: {
+ pairs,
+ },
+ }).finish();
+ const wxResp = await cloud.provider.api.callWXOpenAPI({
+ api: options.api,
+ data: Buffer.from(pbMessage),
+ }, {
+ defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),
+ apiConfig: options.config,
+ });
+ let result;
+ if (wxResp) {
+ if (/(application\/json)|(text\/plain)/.test(wxResp.contentType)) {
+ // json response
+ // NOTICE: sometimes the wx sever, for no reason, returns a json with content-type text/plain, and we have to deal with it...
+ try {
+ result = JSON.parse(wxResp.respData.toString());
+ }
+ catch (parseWXRespJSONError) {
+ // wx server says it's a json but instead it is not a valid json
+ // if the content-type is text/plain and is not a valid json, we can safely return the string back
+ if (/text\/plain/.test(wxResp.contentType)) {
+ result = {
+ result: wxResp.respData.toString()
+ };
+ }
+ else {
+ // internal error
+ throw new error_1.CloudSDKError({
+ errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,
+ errMsg: msg_1.apiFailMsg(displayAPIName, `wechat server internal error, response body is invalid json: ${wxResp.respData.toString()}`)
+ });
+ }
+ }
+ if (result.errcode) {
+ // wx error
+ throw new error_1.CloudSDKError({
+ errCode: result.errcode,
+ errMsg: msg_1.apiFailMsg(displayAPIName, result.errmsg),
+ });
+ }
+ else {
+ delete result.errcode;
+ delete result.errmsg;
+ if (shouldConvertCase) {
+ // convert snake case to camel case
+ result = utils_1.convertCase(result, {
+ from: 'snakecase',
+ to: 'camelcase',
+ recursive: true,
+ });
+ }
+ }
+ }
+ else {
+ // buffer response
+ result = {
+ contentType: wxResp.contentType.trim(),
+ buffer: wxResp.respData,
+ };
+ }
+ }
+ else {
+ throw {
+ errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,
+ errMsg: `internal server error, empty resp buffer`,
+ };
+ }
+ return Object.assign(Object.assign({}, result), { errMsg: msg_1.apiSuccessMsg(displayAPIName), errCode: 0 });
+ }
+ catch (e) {
+ throw error_1.returnAsFinalCloudSDKError(e, displayAPIName);
+ }
+ }
+}
+exports.default = getGenericOpenAPI;
+
+
+/***/ }),
+
+/***/ "./src/api/openapi/namespace/index.ts":
+/*!********************************************!*\
+ !*** ./src/api/openapi/namespace/index.ts ***!
+ \********************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const generic_1 = __webpack_require__(/*! ./generic */ "./src/api/openapi/namespace/generic.ts");
+function getAPIs(cloud) {
+ return generic_1.default(cloud);
+}
+exports.getAPIs = getAPIs;
+
+
+/***/ }),
+
+/***/ "./src/api/storage/api/api.ts":
+/*!************************************!*\
+ !*** ./src/api/storage/api/api.ts ***!
+ \************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const uploadFile_1 = __webpack_require__(/*! ./uploadFile */ "./src/api/storage/api/uploadFile.ts");
+const downloadFile_1 = __webpack_require__(/*! ./downloadFile */ "./src/api/storage/api/downloadFile.ts");
+const getTempFileURL_1 = __webpack_require__(/*! ./getTempFileURL */ "./src/api/storage/api/getTempFileURL.ts");
+const deleteFile_1 = __webpack_require__(/*! ./deleteFile */ "./src/api/storage/api/deleteFile.ts");
+function getAPIs(cloud) {
+ return {
+ uploadFile: uploadFile_1.default(cloud),
+ downloadFile: downloadFile_1.default(cloud),
+ getTempFileURL: getTempFileURL_1.default(cloud),
+ deleteFile: deleteFile_1.default(cloud),
+ };
+}
+exports.getAPIs = getAPIs;
+
+
+/***/ }),
+
+/***/ "./src/api/storage/api/deleteFile.ts":
+/*!*******************************************!*\
+ !*** ./src/api/storage/api/deleteFile.ts ***!
+ \*******************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts");
+function getDeleteFile(cloud) {
+ return function deleteFile(options) {
+ const apiName = 'deleteFile';
+ return new Promise(async (resolve, reject) => {
+ if (!options) {
+ return reject(error_1.returnAsFinalCloudSDKError({
+ errMsg: 'Params for deleteFile must be an object instead of ' + typeof options,
+ }, apiName));
+ }
+ try {
+ assert_1.assertType(options, {
+ fileList: 'array'
+ });
+ options.fileList.forEach((f, i) => {
+ if (typeof f !== 'string') {
+ throw new Error(`Type of fileList[${i}] must be string instead of ${typeof f}`);
+ }
+ });
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, apiName));
+ }
+ try {
+ const result = await cloud.provider.api.deleteFile({
+ fileList: options.fileList
+ }, {
+ defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),
+ apiConfig: options.config,
+ });
+ return resolve({
+ fileList: result.fileList,
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ });
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, apiName));
+ }
+ });
+ };
+}
+exports.default = getDeleteFile;
+
+
+/***/ }),
+
+/***/ "./src/api/storage/api/downloadFile.ts":
+/*!*********************************************!*\
+ !*** ./src/api/storage/api/downloadFile.ts ***!
+ \*********************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts");
+function getDownloadFile(cloud) {
+ return function downloadFile(options) {
+ const apiName = 'downloadFile';
+ return new Promise(async (resolve, reject) => {
+ if (!options) {
+ return reject(error_1.returnAsFinalCloudSDKError({
+ errMsg: 'Params for downloadFile must be an object instead of ' + typeof options,
+ }, apiName));
+ }
+ try {
+ assert_1.assertType(options, {
+ fileID: 'string',
+ });
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, apiName));
+ }
+ try {
+ const result = await cloud.provider.api.downloadFile({
+ fileID: options.fileID,
+ }, {
+ defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),
+ apiConfig: options.config,
+ });
+ return resolve({
+ fileContent: result.fileContent,
+ statusCode: result.statusCode,
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ });
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, apiName));
+ }
+ });
+ };
+}
+exports.default = getDownloadFile;
+
+
+/***/ }),
+
+/***/ "./src/api/storage/api/getTempFileURL.ts":
+/*!***********************************************!*\
+ !*** ./src/api/storage/api/getTempFileURL.ts ***!
+ \***********************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts");
+function getGetTempFileURL(cloud) {
+ return function getTempFileURL(options) {
+ const apiName = 'getTempFileURL';
+ return new Promise(async (resolve, reject) => {
+ if (!options) {
+ return reject(error_1.returnAsFinalCloudSDKError({
+ errMsg: 'Params for getTempFileURL must be an object instead of ' + typeof options,
+ }, apiName));
+ }
+ try {
+ assert_1.assertType(options, {
+ fileList: 'array',
+ });
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, apiName));
+ }
+ try {
+ const result = await cloud.provider.api.getTempFileURL({
+ fileList: options.fileList,
+ }, {
+ defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),
+ apiConfig: options.config,
+ });
+ return resolve({
+ fileList: result.fileList,
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ });
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, apiName));
+ }
+ });
+ };
+}
+exports.default = getGetTempFileURL;
+
+
+/***/ }),
+
+/***/ "./src/api/storage/api/uploadFile.ts":
+/*!*******************************************!*\
+ !*** ./src/api/storage/api/uploadFile.ts ***!
+ \*******************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts");
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts");
+const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts");
+function getUploadFile(cloud) {
+ return function uploadFile(options) {
+ const apiName = 'uploadFile';
+ return new Promise(async (resolve, reject) => {
+ if (!options) {
+ return reject(error_1.returnAsFinalCloudSDKError({
+ errMsg: 'Params for uploadFile must be an object instead of ' + typeof options,
+ }, apiName));
+ }
+ try {
+ assert_1.assertType(options, {
+ cloudPath: 'string',
+ });
+ if (!options.fileContent) {
+ return reject(error_1.returnAsFinalCloudSDKError(new Error('Type of fileContent must be fs.ReadStream instead of ' + typeof options.fileContent), apiName));
+ }
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, apiName));
+ }
+ const header = options.header || {};
+ try {
+ const result = await cloud.provider.api.uploadFile({
+ fileContent: options.fileContent,
+ cloudPath: options.cloudPath,
+ header,
+ }, {
+ defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),
+ apiConfig: options.config,
+ });
+ return resolve({
+ fileID: result.fileID,
+ statusCode: result.statusCode,
+ errMsg: msg_1.apiSuccessMsg(apiName),
+ });
+ }
+ catch (e) {
+ return reject(error_1.returnAsFinalCloudSDKError(e, apiName));
+ }
+ });
+ };
+}
+exports.default = getUploadFile;
+
+
+/***/ }),
+
+/***/ "./src/api/storage/index.ts":
+/*!**********************************!*\
+ !*** ./src/api/storage/index.ts ***!
+ \**********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const api_1 = __webpack_require__(/*! ./api/api */ "./src/api/storage/api/api.ts");
+exports.STORAGE_SERVICE_NAME = 'storage';
+function createStorageService(cloud) {
+ return {
+ name: exports.STORAGE_SERVICE_NAME,
+ getAPIs: api_1.getAPIs.bind(null, cloud),
+ };
+}
+function registerService(cloud) {
+ cloud.registerService(createStorageService(cloud));
+}
+exports.registerService = registerService;
+
+
+/***/ }),
+
+/***/ "./src/api/utils/api/api.ts":
+/*!**********************************!*\
+ !*** ./src/api/utils/api/api.ts ***!
+ \**********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const getWXContext_1 = __webpack_require__(/*! ./getWXContext */ "./src/api/utils/api/getWXContext.ts");
+function getAPIs() {
+ return {
+ getWXContext: getWXContext_1.default,
+ };
+}
+exports.getAPIs = getAPIs;
+
+
+/***/ }),
+
+/***/ "./src/api/utils/api/getWXContext.ts":
+/*!*******************************************!*\
+ !*** ./src/api/utils/api/getWXContext.ts ***!
+ \*******************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts");
+const WX_PREFIX = 'WX_';
+const CONTEXT_KEYS_BLACKLIST = [
+ 'API_TOKEN',
+ 'TRIGGER_API_TOKEN_V0',
+];
+function isContextKeyInBlacklist(key) {
+ return CONTEXT_KEYS_BLACKLIST.some(v => v === key || (WX_PREFIX + v) === key);
+}
+exports.isContextKeyInBlacklist = isContextKeyInBlacklist;
+function isNumber(val) {
+ return /^[-]?\d+$/.test(val);
+}
+exports.isNumber = isNumber;
+function getWXContext() {
+ const apiName = 'getWXContext';
+ const wxContext = {};
+ if (!process.env.WX_CONTEXT_KEYS)
+ return wxContext;
+ try {
+ const contextKeys = process.env.WX_CONTEXT_KEYS.split(',');
+ for (const key of contextKeys) {
+ if (!key)
+ continue;
+ if (isContextKeyInBlacklist(key))
+ continue;
+ let val = process.env[key];
+ if (val === undefined)
+ continue;
+ if (isNumber(val)) {
+ val = parseInt(val);
+ }
+ if (key.startsWith(WX_PREFIX) && key.length > 3) {
+ wxContext[key.slice(3)] = val;
+ }
+ else {
+ wxContext[key] = val;
+ }
+ }
+ wxContext.ENV = process.env.TCB_ENV || process.env.SCF_NAMESPACE;
+ if (process.env.TCB_SOURCE) {
+ wxContext.SOURCE = process.env.TCB_SOURCE;
+ }
+ return wxContext;
+ }
+ catch (e) {
+ const error = error_1.returnAsFinalCloudSDKError(e, apiName);
+ throw error;
+ }
+}
+exports.default = getWXContext;
+
+
+/***/ }),
+
+/***/ "./src/api/utils/index.ts":
+/*!********************************!*\
+ !*** ./src/api/utils/index.ts ***!
+ \********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const api_1 = __webpack_require__(/*! ./api/api */ "./src/api/utils/api/api.ts");
+const UTILS_SERVICE_NAME = 'utils';
+function createUtilsService() {
+ return {
+ name: UTILS_SERVICE_NAME,
+ getAPIs: api_1.getAPIs,
+ initRequired: false,
+ };
+}
+function registerService(cloud) {
+ cloud.registerService(createUtilsService());
+}
+exports.registerService = registerService;
+
+
+/***/ }),
+
+/***/ "./src/config/error.config.ts":
+/*!************************************!*\
+ !*** ./src/config/error.config.ts ***!
+ \************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ERR_CODE = {
+ '-1': 'unknown error',
+ UNKNOWN_ERROR: -1,
+ // 以 6 开始的是由微信服务器侧产生的错误码
+ // 以 5 开始的是由腾讯云侧产生的错误码
+ // 以 4 开始的是本地 SDK 产生的错误
+ // 接下来两位表示具体业务类型:01通用,02数据库,03文件,04云函数
+ // 最后三位表示具体的错误
+ // 小程序 SDK 云函数
+ '-404001': 'empty call result',
+ SDK_FUNCTIONS_EMPTY_CALL_RESULT: -404001,
+ '-404002': 'empty event id',
+ SDK_FUNCTIONS_EMPTY_EVENT_ID: -404002,
+ '-404003': 'empty poll url',
+ SDK_FUNCTIONS_EMPTY_POLL_URL: -404003,
+ '-404004': 'empty poll result json',
+ SDK_FUNCTIONS_EMPTY_POLL_RESULT_JSON: -404004,
+ '-404005': 'exceed max poll retry',
+ SDK_FUNCTIONS_EXCEED_MAX_POLL_RETRY: -404005,
+ '-404006': 'empty poll result base resp',
+ SDK_FUNCTIONS_EMPTY_POLL_RESULT_BASE_RESP: -404006,
+ '-404007': 'error while polling for the result, poll result base resp ret %s',
+ SDK_FUNCTIONS_POLL_RESULT_BASE_RESP_RET_ABNORMAL: -404007,
+ '-404008': 'error while polling for the result, polling server return a status code of %s',
+ SDK_FUNCTIONS_POLL_RESULT_STATUS_CODE_ERROR: -404008,
+ '-404009': 'error while polling for the result: %s',
+ SDK_FUNCTIONS_POLL_ERROR: -404009,
+ // 微信服务器
+ '-601001': 'system error',
+ WX_SYSTEM_ERROR: -601001,
+ '-601002': 'system args error',
+ WX_SYSTEM_ARGS_ERROR: -601002,
+ '-601003': 'system network error',
+ WX_SYSTEM_NETWORK_ERROR: -601003,
+ '-604100': 'API not found',
+ WX_FUNCTIONS_SERVER_OPENAPI_NOT_FOUND: -604100,
+ '-604101': 'function has no permission to call this API',
+ WX_FUNCTIONS_SERVER_OPENAPI_NO_PERMISSION: -604101,
+ '-604102': 'call open API timeout',
+ WX_FUNCTIONS_SERVER_OPENAPI_TIMEOUT: -604102,
+ '-604103': 'call open API system error',
+ WX_FUNCTIONS_SERVER_OPENAPI_SYSTEM_ERROR: -604102,
+ // 腾讯云通用
+ '-501001': 'resource system error',
+ TCB_RESOURCE_SYSTEM_ERROR: -501001,
+ '-501002': 'resource server timeout',
+ TCB_RESOURCE_SERVER_TIMEOUT: -501002,
+ '-501003': 'exceed request limit',
+ TCB_EXCEED_REQUEST_LIMIT: -501003,
+ '-501004': 'exceed concurrent request limit',
+ TCB_EXCEED_CONCURRENT_REQUEST_LIMIT: -501004,
+ '-501005': 'invalid env',
+ TCB_INVALID_ENV: -501005,
+ '-501006': 'invalid common parameters',
+ TCB_INVALID_COMMON_PARAM: -501006,
+ '-501007': 'invalid parameters',
+ TCB_INVALID_PARAM: -501007,
+ '-501008': 'invalid request source',
+ TCB_INVALID_REQUEST_SOURCE: -501008,
+ '-501009': 'resource not initialized',
+ TCB_RESOURCE_NOT_INITIALIZED: -501009,
+ // 腾讯云数据库
+ '-502001': 'database request fail',
+ TCB_DB_REQUEST_FAIL: -502001,
+ '-502002': 'database invalid command',
+ TCB_DB_INVALID_COMMAND: -502002,
+ '-502003': 'database permission denied',
+ TCB_DB_PERMISSION_DENIED: -502003,
+ '-502004': 'database exceed collection limit',
+ TCB_DB_EXCEED_COLLECTION_LIMIT: -502004,
+ '-502005': 'database collection not exists',
+ TCB_DB_COLLECTION_NOT_EXISTS: -502005,
+ // 腾讯云文件管理
+ '-503001': 'storage request fail',
+ TCB_STORAGE_REQUEST_FAIL: -503001,
+ '-503002': 'storage permission denied',
+ TCB_STORAGE_PERMISSION_DENIED: -503002,
+ '-503003': 'storage file not exists',
+ TCB_STORAGE_FILE_NOT_EXISTS: -503003,
+ '-503004': 'storage invalid sign parameter',
+ TCB_STORAGE_INVALID_SIGN_PARAM: -503004,
+ // 腾讯云云函数
+ '-504001': 'functions request fail',
+ TCB_FUNCTIONS_REQUEST_FAIL: -504001,
+ '-504002': 'functions execute fail',
+ TCB_FUNCTIONS_EXEC_FAIL: -504002,
+};
+
+
+/***/ }),
+
+/***/ "./src/config/symbol.config.ts":
+/*!*************************************!*\
+ !*** ./src/config/symbol.config.ts ***!
+ \*************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SYMBOL_DYNAMIC_CURRENT_ENV = Symbol.for('DYNAMIC_CURRENT_ENV');
+
+
+/***/ }),
+
+/***/ "./src/index.ts":
+/*!**********************!*\
+ !*** ./src/index.ts ***!
+ \**********************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+const cloud_1 = __webpack_require__(/*! ./api/cloud */ "./src/api/cloud/index.ts");
+module.exports = cloud_1.default.exportAPI;
+
+
+/***/ }),
+
+/***/ "./src/protobuf/openapi.js":
+/*!*********************************!*\
+ !*** ./src/protobuf/openapi.js ***!
+ \*********************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
+
+
+var $protobuf = __webpack_require__(/*! protobufjs/minimal */ "protobufjs/minimal");
+
+// Common aliases
+var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
+
+// Exported root namespace
+var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
+
+$root.KeyValuePair = (function() {
+
+ /**
+ * Properties of a KeyValuePair.
+ * @exports IKeyValuePair
+ * @interface IKeyValuePair
+ * @property {string|null} [key] KeyValuePair key
+ * @property {Uint8Array|null} [value] KeyValuePair value
+ * @property {string|null} [contenttype] KeyValuePair contenttype
+ * @property {string|null} [filename] KeyValuePair filename
+ */
+
+ /**
+ * Constructs a new KeyValuePair.
+ * @exports KeyValuePair
+ * @classdesc Represents a KeyValuePair.
+ * @implements IKeyValuePair
+ * @constructor
+ * @param {IKeyValuePair=} [properties] Properties to set
+ */
+ function KeyValuePair(properties) {
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * KeyValuePair key.
+ * @member {string} key
+ * @memberof KeyValuePair
+ * @instance
+ */
+ KeyValuePair.prototype.key = "";
+
+ /**
+ * KeyValuePair value.
+ * @member {Uint8Array} value
+ * @memberof KeyValuePair
+ * @instance
+ */
+ KeyValuePair.prototype.value = $util.newBuffer([]);
+
+ /**
+ * KeyValuePair contenttype.
+ * @member {string} contenttype
+ * @memberof KeyValuePair
+ * @instance
+ */
+ KeyValuePair.prototype.contenttype = "";
+
+ /**
+ * KeyValuePair filename.
+ * @member {string} filename
+ * @memberof KeyValuePair
+ * @instance
+ */
+ KeyValuePair.prototype.filename = "";
+
+ /**
+ * Creates a new KeyValuePair instance using the specified properties.
+ * @function create
+ * @memberof KeyValuePair
+ * @static
+ * @param {IKeyValuePair=} [properties] Properties to set
+ * @returns {KeyValuePair} KeyValuePair instance
+ */
+ KeyValuePair.create = function create(properties) {
+ return new KeyValuePair(properties);
+ };
+
+ /**
+ * Encodes the specified KeyValuePair message. Does not implicitly {@link KeyValuePair.verify|verify} messages.
+ * @function encode
+ * @memberof KeyValuePair
+ * @static
+ * @param {IKeyValuePair} message KeyValuePair message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ KeyValuePair.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.key != null && message.hasOwnProperty("key"))
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);
+ if (message.value != null && message.hasOwnProperty("value"))
+ writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value);
+ if (message.contenttype != null && message.hasOwnProperty("contenttype"))
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.contenttype);
+ if (message.filename != null && message.hasOwnProperty("filename"))
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.filename);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified KeyValuePair message, length delimited. Does not implicitly {@link KeyValuePair.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof KeyValuePair
+ * @static
+ * @param {IKeyValuePair} message KeyValuePair message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ KeyValuePair.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a KeyValuePair message from the specified reader or buffer.
+ * @function decode
+ * @memberof KeyValuePair
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {KeyValuePair} KeyValuePair
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ KeyValuePair.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.KeyValuePair();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.key = reader.string();
+ break;
+ case 2:
+ message.value = reader.bytes();
+ break;
+ case 3:
+ message.contenttype = reader.string();
+ break;
+ case 4:
+ message.filename = reader.string();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a KeyValuePair message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof KeyValuePair
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {KeyValuePair} KeyValuePair
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ KeyValuePair.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a KeyValuePair message.
+ * @function verify
+ * @memberof KeyValuePair
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ KeyValuePair.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.key != null && message.hasOwnProperty("key"))
+ if (!$util.isString(message.key))
+ return "key: string expected";
+ if (message.value != null && message.hasOwnProperty("value"))
+ if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value)))
+ return "value: buffer expected";
+ if (message.contenttype != null && message.hasOwnProperty("contenttype"))
+ if (!$util.isString(message.contenttype))
+ return "contenttype: string expected";
+ if (message.filename != null && message.hasOwnProperty("filename"))
+ if (!$util.isString(message.filename))
+ return "filename: string expected";
+ return null;
+ };
+
+ /**
+ * Creates a KeyValuePair message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof KeyValuePair
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {KeyValuePair} KeyValuePair
+ */
+ KeyValuePair.fromObject = function fromObject(object) {
+ if (object instanceof $root.KeyValuePair)
+ return object;
+ var message = new $root.KeyValuePair();
+ if (object.key != null)
+ message.key = String(object.key);
+ if (object.value != null)
+ if (typeof object.value === "string")
+ $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);
+ else if (object.value.length)
+ message.value = object.value;
+ if (object.contenttype != null)
+ message.contenttype = String(object.contenttype);
+ if (object.filename != null)
+ message.filename = String(object.filename);
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a KeyValuePair message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof KeyValuePair
+ * @static
+ * @param {KeyValuePair} message KeyValuePair
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ KeyValuePair.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.defaults) {
+ object.key = "";
+ if (options.bytes === String)
+ object.value = "";
+ else {
+ object.value = [];
+ if (options.bytes !== Array)
+ object.value = $util.newBuffer(object.value);
+ }
+ object.contenttype = "";
+ object.filename = "";
+ }
+ if (message.key != null && message.hasOwnProperty("key"))
+ object.key = message.key;
+ if (message.value != null && message.hasOwnProperty("value"))
+ object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value;
+ if (message.contenttype != null && message.hasOwnProperty("contenttype"))
+ object.contenttype = message.contenttype;
+ if (message.filename != null && message.hasOwnProperty("filename"))
+ object.filename = message.filename;
+ return object;
+ };
+
+ /**
+ * Converts this KeyValuePair to JSON.
+ * @function toJSON
+ * @memberof KeyValuePair
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ KeyValuePair.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return KeyValuePair;
+})();
+
+$root.OpenApiData = (function() {
+
+ /**
+ * Properties of an OpenApiData.
+ * @exports IOpenApiData
+ * @interface IOpenApiData
+ * @property {Array.|null} [pairs] OpenApiData pairs
+ */
+
+ /**
+ * Constructs a new OpenApiData.
+ * @exports OpenApiData
+ * @classdesc Represents an OpenApiData.
+ * @implements IOpenApiData
+ * @constructor
+ * @param {IOpenApiData=} [properties] Properties to set
+ */
+ function OpenApiData(properties) {
+ this.pairs = [];
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * OpenApiData pairs.
+ * @member {Array.} pairs
+ * @memberof OpenApiData
+ * @instance
+ */
+ OpenApiData.prototype.pairs = $util.emptyArray;
+
+ /**
+ * Creates a new OpenApiData instance using the specified properties.
+ * @function create
+ * @memberof OpenApiData
+ * @static
+ * @param {IOpenApiData=} [properties] Properties to set
+ * @returns {OpenApiData} OpenApiData instance
+ */
+ OpenApiData.create = function create(properties) {
+ return new OpenApiData(properties);
+ };
+
+ /**
+ * Encodes the specified OpenApiData message. Does not implicitly {@link OpenApiData.verify|verify} messages.
+ * @function encode
+ * @memberof OpenApiData
+ * @static
+ * @param {IOpenApiData} message OpenApiData message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ OpenApiData.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.pairs != null && message.pairs.length)
+ for (var i = 0; i < message.pairs.length; ++i)
+ $root.KeyValuePair.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
+ return writer;
+ };
+
+ /**
+ * Encodes the specified OpenApiData message, length delimited. Does not implicitly {@link OpenApiData.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof OpenApiData
+ * @static
+ * @param {IOpenApiData} message OpenApiData message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ OpenApiData.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes an OpenApiData message from the specified reader or buffer.
+ * @function decode
+ * @memberof OpenApiData
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {OpenApiData} OpenApiData
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ OpenApiData.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.OpenApiData();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (!(message.pairs && message.pairs.length))
+ message.pairs = [];
+ message.pairs.push($root.KeyValuePair.decode(reader, reader.uint32()));
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes an OpenApiData message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof OpenApiData
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {OpenApiData} OpenApiData
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ OpenApiData.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies an OpenApiData message.
+ * @function verify
+ * @memberof OpenApiData
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ OpenApiData.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.pairs != null && message.hasOwnProperty("pairs")) {
+ if (!Array.isArray(message.pairs))
+ return "pairs: array expected";
+ for (var i = 0; i < message.pairs.length; ++i) {
+ var error = $root.KeyValuePair.verify(message.pairs[i]);
+ if (error)
+ return "pairs." + error;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Creates an OpenApiData message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof OpenApiData
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {OpenApiData} OpenApiData
+ */
+ OpenApiData.fromObject = function fromObject(object) {
+ if (object instanceof $root.OpenApiData)
+ return object;
+ var message = new $root.OpenApiData();
+ if (object.pairs) {
+ if (!Array.isArray(object.pairs))
+ throw TypeError(".OpenApiData.pairs: array expected");
+ message.pairs = [];
+ for (var i = 0; i < object.pairs.length; ++i) {
+ if (typeof object.pairs[i] !== "object")
+ throw TypeError(".OpenApiData.pairs: object expected");
+ message.pairs[i] = $root.KeyValuePair.fromObject(object.pairs[i]);
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from an OpenApiData message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof OpenApiData
+ * @static
+ * @param {OpenApiData} message OpenApiData
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ OpenApiData.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.pairs = [];
+ if (message.pairs && message.pairs.length) {
+ object.pairs = [];
+ for (var j = 0; j < message.pairs.length; ++j)
+ object.pairs[j] = $root.KeyValuePair.toObject(message.pairs[j], options);
+ }
+ return object;
+ };
+
+ /**
+ * Converts this OpenApiData to JSON.
+ * @function toJSON
+ * @memberof OpenApiData
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ OpenApiData.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return OpenApiData;
+})();
+
+$root.CommApiData = (function() {
+
+ /**
+ * Properties of a CommApiData.
+ * @exports ICommApiData
+ * @interface ICommApiData
+ * @property {CommApiData.ApiType|null} [apiType] CommApiData apiType
+ * @property {IOpenApiData|null} [openapiData] CommApiData openapiData
+ * @property {IInnerApiData|null} [innerData] CommApiData innerData
+ * @property {ISvrkitApiData|null} [svrkitData] CommApiData svrkitData
+ */
+
+ /**
+ * Constructs a new CommApiData.
+ * @exports CommApiData
+ * @classdesc Represents a CommApiData.
+ * @implements ICommApiData
+ * @constructor
+ * @param {ICommApiData=} [properties] Properties to set
+ */
+ function CommApiData(properties) {
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * CommApiData apiType.
+ * @member {CommApiData.ApiType} apiType
+ * @memberof CommApiData
+ * @instance
+ */
+ CommApiData.prototype.apiType = 0;
+
+ /**
+ * CommApiData openapiData.
+ * @member {IOpenApiData|null|undefined} openapiData
+ * @memberof CommApiData
+ * @instance
+ */
+ CommApiData.prototype.openapiData = null;
+
+ /**
+ * CommApiData innerData.
+ * @member {IInnerApiData|null|undefined} innerData
+ * @memberof CommApiData
+ * @instance
+ */
+ CommApiData.prototype.innerData = null;
+
+ /**
+ * CommApiData svrkitData.
+ * @member {ISvrkitApiData|null|undefined} svrkitData
+ * @memberof CommApiData
+ * @instance
+ */
+ CommApiData.prototype.svrkitData = null;
+
+ /**
+ * Creates a new CommApiData instance using the specified properties.
+ * @function create
+ * @memberof CommApiData
+ * @static
+ * @param {ICommApiData=} [properties] Properties to set
+ * @returns {CommApiData} CommApiData instance
+ */
+ CommApiData.create = function create(properties) {
+ return new CommApiData(properties);
+ };
+
+ /**
+ * Encodes the specified CommApiData message. Does not implicitly {@link CommApiData.verify|verify} messages.
+ * @function encode
+ * @memberof CommApiData
+ * @static
+ * @param {ICommApiData} message CommApiData message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ CommApiData.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.apiType != null && message.hasOwnProperty("apiType"))
+ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.apiType);
+ if (message.openapiData != null && message.hasOwnProperty("openapiData"))
+ $root.OpenApiData.encode(message.openapiData, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
+ if (message.innerData != null && message.hasOwnProperty("innerData"))
+ $root.InnerApiData.encode(message.innerData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
+ if (message.svrkitData != null && message.hasOwnProperty("svrkitData"))
+ $root.SvrkitApiData.encode(message.svrkitData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
+ return writer;
+ };
+
+ /**
+ * Encodes the specified CommApiData message, length delimited. Does not implicitly {@link CommApiData.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof CommApiData
+ * @static
+ * @param {ICommApiData} message CommApiData message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ CommApiData.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a CommApiData message from the specified reader or buffer.
+ * @function decode
+ * @memberof CommApiData
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {CommApiData} CommApiData
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ CommApiData.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CommApiData();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.apiType = reader.int32();
+ break;
+ case 2:
+ message.openapiData = $root.OpenApiData.decode(reader, reader.uint32());
+ break;
+ case 3:
+ message.innerData = $root.InnerApiData.decode(reader, reader.uint32());
+ break;
+ case 4:
+ message.svrkitData = $root.SvrkitApiData.decode(reader, reader.uint32());
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a CommApiData message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof CommApiData
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {CommApiData} CommApiData
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ CommApiData.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a CommApiData message.
+ * @function verify
+ * @memberof CommApiData
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ CommApiData.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.apiType != null && message.hasOwnProperty("apiType"))
+ switch (message.apiType) {
+ default:
+ return "apiType: enum value expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
+ if (message.openapiData != null && message.hasOwnProperty("openapiData")) {
+ var error = $root.OpenApiData.verify(message.openapiData);
+ if (error)
+ return "openapiData." + error;
+ }
+ if (message.innerData != null && message.hasOwnProperty("innerData")) {
+ var error = $root.InnerApiData.verify(message.innerData);
+ if (error)
+ return "innerData." + error;
+ }
+ if (message.svrkitData != null && message.hasOwnProperty("svrkitData")) {
+ var error = $root.SvrkitApiData.verify(message.svrkitData);
+ if (error)
+ return "svrkitData." + error;
+ }
+ return null;
+ };
+
+ /**
+ * Creates a CommApiData message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof CommApiData
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {CommApiData} CommApiData
+ */
+ CommApiData.fromObject = function fromObject(object) {
+ if (object instanceof $root.CommApiData)
+ return object;
+ var message = new $root.CommApiData();
+ switch (object.apiType) {
+ case "OPEN_API":
+ case 0:
+ message.apiType = 0;
+ break;
+ case "INNER_API":
+ case 1:
+ message.apiType = 1;
+ break;
+ case "SVRKIT_API":
+ case 2:
+ message.apiType = 2;
+ break;
+ }
+ if (object.openapiData != null) {
+ if (typeof object.openapiData !== "object")
+ throw TypeError(".CommApiData.openapiData: object expected");
+ message.openapiData = $root.OpenApiData.fromObject(object.openapiData);
+ }
+ if (object.innerData != null) {
+ if (typeof object.innerData !== "object")
+ throw TypeError(".CommApiData.innerData: object expected");
+ message.innerData = $root.InnerApiData.fromObject(object.innerData);
+ }
+ if (object.svrkitData != null) {
+ if (typeof object.svrkitData !== "object")
+ throw TypeError(".CommApiData.svrkitData: object expected");
+ message.svrkitData = $root.SvrkitApiData.fromObject(object.svrkitData);
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a CommApiData message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof CommApiData
+ * @static
+ * @param {CommApiData} message CommApiData
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ CommApiData.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.defaults) {
+ object.apiType = options.enums === String ? "OPEN_API" : 0;
+ object.openapiData = null;
+ object.innerData = null;
+ object.svrkitData = null;
+ }
+ if (message.apiType != null && message.hasOwnProperty("apiType"))
+ object.apiType = options.enums === String ? $root.CommApiData.ApiType[message.apiType] : message.apiType;
+ if (message.openapiData != null && message.hasOwnProperty("openapiData"))
+ object.openapiData = $root.OpenApiData.toObject(message.openapiData, options);
+ if (message.innerData != null && message.hasOwnProperty("innerData"))
+ object.innerData = $root.InnerApiData.toObject(message.innerData, options);
+ if (message.svrkitData != null && message.hasOwnProperty("svrkitData"))
+ object.svrkitData = $root.SvrkitApiData.toObject(message.svrkitData, options);
+ return object;
+ };
+
+ /**
+ * Converts this CommApiData to JSON.
+ * @function toJSON
+ * @memberof CommApiData
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ CommApiData.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ /**
+ * ApiType enum.
+ * @name CommApiData.ApiType
+ * @enum {string}
+ * @property {number} OPEN_API=0 OPEN_API value
+ * @property {number} INNER_API=1 INNER_API value
+ * @property {number} SVRKIT_API=2 SVRKIT_API value
+ */
+ CommApiData.ApiType = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[0] = "OPEN_API"] = 0;
+ values[valuesById[1] = "INNER_API"] = 1;
+ values[valuesById[2] = "SVRKIT_API"] = 2;
+ return values;
+ })();
+
+ return CommApiData;
+})();
+
+$root.CommOpenApiResp = (function() {
+
+ /**
+ * Properties of a CommOpenApiResp.
+ * @exports ICommOpenApiResp
+ * @interface ICommOpenApiResp
+ * @property {Uint8Array|null} [respData] CommOpenApiResp respData
+ * @property {string|null} [contentType] CommOpenApiResp contentType
+ * @property {number|null} [errorCode] CommOpenApiResp errorCode
+ * @property {number|null} [httpCode] CommOpenApiResp httpCode
+ * @property {Array.|null} [headers] CommOpenApiResp headers
+ * @property {number|null} [svrkitErrorCode] CommOpenApiResp svrkitErrorCode
+ */
+
+ /**
+ * Constructs a new CommOpenApiResp.
+ * @exports CommOpenApiResp
+ * @classdesc Represents a CommOpenApiResp.
+ * @implements ICommOpenApiResp
+ * @constructor
+ * @param {ICommOpenApiResp=} [properties] Properties to set
+ */
+ function CommOpenApiResp(properties) {
+ this.headers = [];
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * CommOpenApiResp respData.
+ * @member {Uint8Array} respData
+ * @memberof CommOpenApiResp
+ * @instance
+ */
+ CommOpenApiResp.prototype.respData = $util.newBuffer([]);
+
+ /**
+ * CommOpenApiResp contentType.
+ * @member {string} contentType
+ * @memberof CommOpenApiResp
+ * @instance
+ */
+ CommOpenApiResp.prototype.contentType = "";
+
+ /**
+ * CommOpenApiResp errorCode.
+ * @member {number} errorCode
+ * @memberof CommOpenApiResp
+ * @instance
+ */
+ CommOpenApiResp.prototype.errorCode = 0;
+
+ /**
+ * CommOpenApiResp httpCode.
+ * @member {number} httpCode
+ * @memberof CommOpenApiResp
+ * @instance
+ */
+ CommOpenApiResp.prototype.httpCode = 0;
+
+ /**
+ * CommOpenApiResp headers.
+ * @member {Array.} headers
+ * @memberof CommOpenApiResp
+ * @instance
+ */
+ CommOpenApiResp.prototype.headers = $util.emptyArray;
+
+ /**
+ * CommOpenApiResp svrkitErrorCode.
+ * @member {number} svrkitErrorCode
+ * @memberof CommOpenApiResp
+ * @instance
+ */
+ CommOpenApiResp.prototype.svrkitErrorCode = 0;
+
+ /**
+ * Creates a new CommOpenApiResp instance using the specified properties.
+ * @function create
+ * @memberof CommOpenApiResp
+ * @static
+ * @param {ICommOpenApiResp=} [properties] Properties to set
+ * @returns {CommOpenApiResp} CommOpenApiResp instance
+ */
+ CommOpenApiResp.create = function create(properties) {
+ return new CommOpenApiResp(properties);
+ };
+
+ /**
+ * Encodes the specified CommOpenApiResp message. Does not implicitly {@link CommOpenApiResp.verify|verify} messages.
+ * @function encode
+ * @memberof CommOpenApiResp
+ * @static
+ * @param {ICommOpenApiResp} message CommOpenApiResp message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ CommOpenApiResp.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.respData != null && message.hasOwnProperty("respData"))
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.respData);
+ if (message.contentType != null && message.hasOwnProperty("contentType"))
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.contentType);
+ if (message.errorCode != null && message.hasOwnProperty("errorCode"))
+ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCode);
+ if (message.httpCode != null && message.hasOwnProperty("httpCode"))
+ writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.httpCode);
+ if (message.headers != null && message.headers.length)
+ for (var i = 0; i < message.headers.length; ++i)
+ $root.HttpHeader.encode(message.headers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
+ if (message.svrkitErrorCode != null && message.hasOwnProperty("svrkitErrorCode"))
+ writer.uint32(/* id 6, wireType 0 =*/48).int32(message.svrkitErrorCode);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified CommOpenApiResp message, length delimited. Does not implicitly {@link CommOpenApiResp.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof CommOpenApiResp
+ * @static
+ * @param {ICommOpenApiResp} message CommOpenApiResp message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ CommOpenApiResp.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a CommOpenApiResp message from the specified reader or buffer.
+ * @function decode
+ * @memberof CommOpenApiResp
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {CommOpenApiResp} CommOpenApiResp
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ CommOpenApiResp.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CommOpenApiResp();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.respData = reader.bytes();
+ break;
+ case 2:
+ message.contentType = reader.string();
+ break;
+ case 3:
+ message.errorCode = reader.int32();
+ break;
+ case 4:
+ message.httpCode = reader.uint32();
+ break;
+ case 5:
+ if (!(message.headers && message.headers.length))
+ message.headers = [];
+ message.headers.push($root.HttpHeader.decode(reader, reader.uint32()));
+ break;
+ case 6:
+ message.svrkitErrorCode = reader.int32();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a CommOpenApiResp message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof CommOpenApiResp
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {CommOpenApiResp} CommOpenApiResp
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ CommOpenApiResp.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a CommOpenApiResp message.
+ * @function verify
+ * @memberof CommOpenApiResp
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ CommOpenApiResp.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.respData != null && message.hasOwnProperty("respData"))
+ if (!(message.respData && typeof message.respData.length === "number" || $util.isString(message.respData)))
+ return "respData: buffer expected";
+ if (message.contentType != null && message.hasOwnProperty("contentType"))
+ if (!$util.isString(message.contentType))
+ return "contentType: string expected";
+ if (message.errorCode != null && message.hasOwnProperty("errorCode"))
+ if (!$util.isInteger(message.errorCode))
+ return "errorCode: integer expected";
+ if (message.httpCode != null && message.hasOwnProperty("httpCode"))
+ if (!$util.isInteger(message.httpCode))
+ return "httpCode: integer expected";
+ if (message.headers != null && message.hasOwnProperty("headers")) {
+ if (!Array.isArray(message.headers))
+ return "headers: array expected";
+ for (var i = 0; i < message.headers.length; ++i) {
+ var error = $root.HttpHeader.verify(message.headers[i]);
+ if (error)
+ return "headers." + error;
+ }
+ }
+ if (message.svrkitErrorCode != null && message.hasOwnProperty("svrkitErrorCode"))
+ if (!$util.isInteger(message.svrkitErrorCode))
+ return "svrkitErrorCode: integer expected";
+ return null;
+ };
+
+ /**
+ * Creates a CommOpenApiResp message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof CommOpenApiResp
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {CommOpenApiResp} CommOpenApiResp
+ */
+ CommOpenApiResp.fromObject = function fromObject(object) {
+ if (object instanceof $root.CommOpenApiResp)
+ return object;
+ var message = new $root.CommOpenApiResp();
+ if (object.respData != null)
+ if (typeof object.respData === "string")
+ $util.base64.decode(object.respData, message.respData = $util.newBuffer($util.base64.length(object.respData)), 0);
+ else if (object.respData.length)
+ message.respData = object.respData;
+ if (object.contentType != null)
+ message.contentType = String(object.contentType);
+ if (object.errorCode != null)
+ message.errorCode = object.errorCode | 0;
+ if (object.httpCode != null)
+ message.httpCode = object.httpCode >>> 0;
+ if (object.headers) {
+ if (!Array.isArray(object.headers))
+ throw TypeError(".CommOpenApiResp.headers: array expected");
+ message.headers = [];
+ for (var i = 0; i < object.headers.length; ++i) {
+ if (typeof object.headers[i] !== "object")
+ throw TypeError(".CommOpenApiResp.headers: object expected");
+ message.headers[i] = $root.HttpHeader.fromObject(object.headers[i]);
+ }
+ }
+ if (object.svrkitErrorCode != null)
+ message.svrkitErrorCode = object.svrkitErrorCode | 0;
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a CommOpenApiResp message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof CommOpenApiResp
+ * @static
+ * @param {CommOpenApiResp} message CommOpenApiResp
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ CommOpenApiResp.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.headers = [];
+ if (options.defaults) {
+ if (options.bytes === String)
+ object.respData = "";
+ else {
+ object.respData = [];
+ if (options.bytes !== Array)
+ object.respData = $util.newBuffer(object.respData);
+ }
+ object.contentType = "";
+ object.errorCode = 0;
+ object.httpCode = 0;
+ object.svrkitErrorCode = 0;
+ }
+ if (message.respData != null && message.hasOwnProperty("respData"))
+ object.respData = options.bytes === String ? $util.base64.encode(message.respData, 0, message.respData.length) : options.bytes === Array ? Array.prototype.slice.call(message.respData) : message.respData;
+ if (message.contentType != null && message.hasOwnProperty("contentType"))
+ object.contentType = message.contentType;
+ if (message.errorCode != null && message.hasOwnProperty("errorCode"))
+ object.errorCode = message.errorCode;
+ if (message.httpCode != null && message.hasOwnProperty("httpCode"))
+ object.httpCode = message.httpCode;
+ if (message.headers && message.headers.length) {
+ object.headers = [];
+ for (var j = 0; j < message.headers.length; ++j)
+ object.headers[j] = $root.HttpHeader.toObject(message.headers[j], options);
+ }
+ if (message.svrkitErrorCode != null && message.hasOwnProperty("svrkitErrorCode"))
+ object.svrkitErrorCode = message.svrkitErrorCode;
+ return object;
+ };
+
+ /**
+ * Converts this CommOpenApiResp to JSON.
+ * @function toJSON
+ * @memberof CommOpenApiResp
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ CommOpenApiResp.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return CommOpenApiResp;
+})();
+
+$root.InnerApiData = (function() {
+
+ /**
+ * Properties of an InnerApiData.
+ * @exports IInnerApiData
+ * @interface IInnerApiData
+ * @property {number|null} [modid] InnerApiData modid
+ * @property {number|null} [cmdid] InnerApiData cmdid
+ * @property {string|null} [url] InnerApiData url
+ * @property {boolean|null} [useHttps] InnerApiData useHttps
+ * @property {HTTP_METHODS|null} [method] InnerApiData method
+ * @property {Array.|null} [headers] InnerApiData headers
+ * @property {Uint8Array|null} [body] InnerApiData body
+ */
+
+ /**
+ * Constructs a new InnerApiData.
+ * @exports InnerApiData
+ * @classdesc Represents an InnerApiData.
+ * @implements IInnerApiData
+ * @constructor
+ * @param {IInnerApiData=} [properties] Properties to set
+ */
+ function InnerApiData(properties) {
+ this.headers = [];
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * InnerApiData modid.
+ * @member {number} modid
+ * @memberof InnerApiData
+ * @instance
+ */
+ InnerApiData.prototype.modid = 0;
+
+ /**
+ * InnerApiData cmdid.
+ * @member {number} cmdid
+ * @memberof InnerApiData
+ * @instance
+ */
+ InnerApiData.prototype.cmdid = 0;
+
+ /**
+ * InnerApiData url.
+ * @member {string} url
+ * @memberof InnerApiData
+ * @instance
+ */
+ InnerApiData.prototype.url = "";
+
+ /**
+ * InnerApiData useHttps.
+ * @member {boolean} useHttps
+ * @memberof InnerApiData
+ * @instance
+ */
+ InnerApiData.prototype.useHttps = false;
+
+ /**
+ * InnerApiData method.
+ * @member {HTTP_METHODS} method
+ * @memberof InnerApiData
+ * @instance
+ */
+ InnerApiData.prototype.method = 1;
+
+ /**
+ * InnerApiData headers.
+ * @member {Array.} headers
+ * @memberof InnerApiData
+ * @instance
+ */
+ InnerApiData.prototype.headers = $util.emptyArray;
+
+ /**
+ * InnerApiData body.
+ * @member {Uint8Array} body
+ * @memberof InnerApiData
+ * @instance
+ */
+ InnerApiData.prototype.body = $util.newBuffer([]);
+
+ /**
+ * Creates a new InnerApiData instance using the specified properties.
+ * @function create
+ * @memberof InnerApiData
+ * @static
+ * @param {IInnerApiData=} [properties] Properties to set
+ * @returns {InnerApiData} InnerApiData instance
+ */
+ InnerApiData.create = function create(properties) {
+ return new InnerApiData(properties);
+ };
+
+ /**
+ * Encodes the specified InnerApiData message. Does not implicitly {@link InnerApiData.verify|verify} messages.
+ * @function encode
+ * @memberof InnerApiData
+ * @static
+ * @param {IInnerApiData} message InnerApiData message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ InnerApiData.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.modid != null && message.hasOwnProperty("modid"))
+ writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.modid);
+ if (message.cmdid != null && message.hasOwnProperty("cmdid"))
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.cmdid);
+ if (message.url != null && message.hasOwnProperty("url"))
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.url);
+ if (message.useHttps != null && message.hasOwnProperty("useHttps"))
+ writer.uint32(/* id 4, wireType 0 =*/32).bool(message.useHttps);
+ if (message.method != null && message.hasOwnProperty("method"))
+ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.method);
+ if (message.headers != null && message.headers.length)
+ for (var i = 0; i < message.headers.length; ++i)
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.headers[i]);
+ if (message.body != null && message.hasOwnProperty("body"))
+ writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.body);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified InnerApiData message, length delimited. Does not implicitly {@link InnerApiData.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof InnerApiData
+ * @static
+ * @param {IInnerApiData} message InnerApiData message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ InnerApiData.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes an InnerApiData message from the specified reader or buffer.
+ * @function decode
+ * @memberof InnerApiData
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {InnerApiData} InnerApiData
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ InnerApiData.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.InnerApiData();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.modid = reader.uint32();
+ break;
+ case 2:
+ message.cmdid = reader.uint32();
+ break;
+ case 3:
+ message.url = reader.string();
+ break;
+ case 4:
+ message.useHttps = reader.bool();
+ break;
+ case 5:
+ message.method = reader.int32();
+ break;
+ case 6:
+ if (!(message.headers && message.headers.length))
+ message.headers = [];
+ message.headers.push(reader.string());
+ break;
+ case 7:
+ message.body = reader.bytes();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes an InnerApiData message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof InnerApiData
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {InnerApiData} InnerApiData
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ InnerApiData.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies an InnerApiData message.
+ * @function verify
+ * @memberof InnerApiData
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ InnerApiData.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.modid != null && message.hasOwnProperty("modid"))
+ if (!$util.isInteger(message.modid))
+ return "modid: integer expected";
+ if (message.cmdid != null && message.hasOwnProperty("cmdid"))
+ if (!$util.isInteger(message.cmdid))
+ return "cmdid: integer expected";
+ if (message.url != null && message.hasOwnProperty("url"))
+ if (!$util.isString(message.url))
+ return "url: string expected";
+ if (message.useHttps != null && message.hasOwnProperty("useHttps"))
+ if (typeof message.useHttps !== "boolean")
+ return "useHttps: boolean expected";
+ if (message.method != null && message.hasOwnProperty("method"))
+ switch (message.method) {
+ default:
+ return "method: enum value expected";
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ break;
+ }
+ if (message.headers != null && message.hasOwnProperty("headers")) {
+ if (!Array.isArray(message.headers))
+ return "headers: array expected";
+ for (var i = 0; i < message.headers.length; ++i)
+ if (!$util.isString(message.headers[i]))
+ return "headers: string[] expected";
+ }
+ if (message.body != null && message.hasOwnProperty("body"))
+ if (!(message.body && typeof message.body.length === "number" || $util.isString(message.body)))
+ return "body: buffer expected";
+ return null;
+ };
+
+ /**
+ * Creates an InnerApiData message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof InnerApiData
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {InnerApiData} InnerApiData
+ */
+ InnerApiData.fromObject = function fromObject(object) {
+ if (object instanceof $root.InnerApiData)
+ return object;
+ var message = new $root.InnerApiData();
+ if (object.modid != null)
+ message.modid = object.modid >>> 0;
+ if (object.cmdid != null)
+ message.cmdid = object.cmdid >>> 0;
+ if (object.url != null)
+ message.url = String(object.url);
+ if (object.useHttps != null)
+ message.useHttps = Boolean(object.useHttps);
+ switch (object.method) {
+ case "HTTP_GET":
+ case 1:
+ message.method = 1;
+ break;
+ case "HTTP_POST":
+ case 2:
+ message.method = 2;
+ break;
+ case "HTTP_PUT":
+ case 3:
+ message.method = 3;
+ break;
+ case "HTTP_DELETE":
+ case 4:
+ message.method = 4;
+ break;
+ case "HTTP_HEAD":
+ case 5:
+ message.method = 5;
+ break;
+ case "HTTP_PATCH":
+ case 6:
+ message.method = 6;
+ break;
+ }
+ if (object.headers) {
+ if (!Array.isArray(object.headers))
+ throw TypeError(".InnerApiData.headers: array expected");
+ message.headers = [];
+ for (var i = 0; i < object.headers.length; ++i)
+ message.headers[i] = String(object.headers[i]);
+ }
+ if (object.body != null)
+ if (typeof object.body === "string")
+ $util.base64.decode(object.body, message.body = $util.newBuffer($util.base64.length(object.body)), 0);
+ else if (object.body.length)
+ message.body = object.body;
+ return message;
+ };
+
+ /**
+ * Creates a plain object from an InnerApiData message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof InnerApiData
+ * @static
+ * @param {InnerApiData} message InnerApiData
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ InnerApiData.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.headers = [];
+ if (options.defaults) {
+ object.modid = 0;
+ object.cmdid = 0;
+ object.url = "";
+ object.useHttps = false;
+ object.method = options.enums === String ? "HTTP_GET" : 1;
+ if (options.bytes === String)
+ object.body = "";
+ else {
+ object.body = [];
+ if (options.bytes !== Array)
+ object.body = $util.newBuffer(object.body);
+ }
+ }
+ if (message.modid != null && message.hasOwnProperty("modid"))
+ object.modid = message.modid;
+ if (message.cmdid != null && message.hasOwnProperty("cmdid"))
+ object.cmdid = message.cmdid;
+ if (message.url != null && message.hasOwnProperty("url"))
+ object.url = message.url;
+ if (message.useHttps != null && message.hasOwnProperty("useHttps"))
+ object.useHttps = message.useHttps;
+ if (message.method != null && message.hasOwnProperty("method"))
+ object.method = options.enums === String ? $root.HTTP_METHODS[message.method] : message.method;
+ if (message.headers && message.headers.length) {
+ object.headers = [];
+ for (var j = 0; j < message.headers.length; ++j)
+ object.headers[j] = message.headers[j];
+ }
+ if (message.body != null && message.hasOwnProperty("body"))
+ object.body = options.bytes === String ? $util.base64.encode(message.body, 0, message.body.length) : options.bytes === Array ? Array.prototype.slice.call(message.body) : message.body;
+ return object;
+ };
+
+ /**
+ * Converts this InnerApiData to JSON.
+ * @function toJSON
+ * @memberof InnerApiData
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ InnerApiData.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return InnerApiData;
+})();
+
+$root.SvrkitApiData = (function() {
+
+ /**
+ * Properties of a SvrkitApiData.
+ * @exports ISvrkitApiData
+ * @interface ISvrkitApiData
+ * @property {string|null} [apiName] SvrkitApiData apiName
+ * @property {Uint8Array|null} [reqData] SvrkitApiData reqData
+ */
+
+ /**
+ * Constructs a new SvrkitApiData.
+ * @exports SvrkitApiData
+ * @classdesc Represents a SvrkitApiData.
+ * @implements ISvrkitApiData
+ * @constructor
+ * @param {ISvrkitApiData=} [properties] Properties to set
+ */
+ function SvrkitApiData(properties) {
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * SvrkitApiData apiName.
+ * @member {string} apiName
+ * @memberof SvrkitApiData
+ * @instance
+ */
+ SvrkitApiData.prototype.apiName = "";
+
+ /**
+ * SvrkitApiData reqData.
+ * @member {Uint8Array} reqData
+ * @memberof SvrkitApiData
+ * @instance
+ */
+ SvrkitApiData.prototype.reqData = $util.newBuffer([]);
+
+ /**
+ * Creates a new SvrkitApiData instance using the specified properties.
+ * @function create
+ * @memberof SvrkitApiData
+ * @static
+ * @param {ISvrkitApiData=} [properties] Properties to set
+ * @returns {SvrkitApiData} SvrkitApiData instance
+ */
+ SvrkitApiData.create = function create(properties) {
+ return new SvrkitApiData(properties);
+ };
+
+ /**
+ * Encodes the specified SvrkitApiData message. Does not implicitly {@link SvrkitApiData.verify|verify} messages.
+ * @function encode
+ * @memberof SvrkitApiData
+ * @static
+ * @param {ISvrkitApiData} message SvrkitApiData message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ SvrkitApiData.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.apiName != null && message.hasOwnProperty("apiName"))
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.apiName);
+ if (message.reqData != null && message.hasOwnProperty("reqData"))
+ writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.reqData);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified SvrkitApiData message, length delimited. Does not implicitly {@link SvrkitApiData.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof SvrkitApiData
+ * @static
+ * @param {ISvrkitApiData} message SvrkitApiData message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ SvrkitApiData.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a SvrkitApiData message from the specified reader or buffer.
+ * @function decode
+ * @memberof SvrkitApiData
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {SvrkitApiData} SvrkitApiData
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ SvrkitApiData.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SvrkitApiData();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.apiName = reader.string();
+ break;
+ case 2:
+ message.reqData = reader.bytes();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a SvrkitApiData message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof SvrkitApiData
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {SvrkitApiData} SvrkitApiData
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ SvrkitApiData.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a SvrkitApiData message.
+ * @function verify
+ * @memberof SvrkitApiData
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ SvrkitApiData.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.apiName != null && message.hasOwnProperty("apiName"))
+ if (!$util.isString(message.apiName))
+ return "apiName: string expected";
+ if (message.reqData != null && message.hasOwnProperty("reqData"))
+ if (!(message.reqData && typeof message.reqData.length === "number" || $util.isString(message.reqData)))
+ return "reqData: buffer expected";
+ return null;
+ };
+
+ /**
+ * Creates a SvrkitApiData message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof SvrkitApiData
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {SvrkitApiData} SvrkitApiData
+ */
+ SvrkitApiData.fromObject = function fromObject(object) {
+ if (object instanceof $root.SvrkitApiData)
+ return object;
+ var message = new $root.SvrkitApiData();
+ if (object.apiName != null)
+ message.apiName = String(object.apiName);
+ if (object.reqData != null)
+ if (typeof object.reqData === "string")
+ $util.base64.decode(object.reqData, message.reqData = $util.newBuffer($util.base64.length(object.reqData)), 0);
+ else if (object.reqData.length)
+ message.reqData = object.reqData;
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a SvrkitApiData message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof SvrkitApiData
+ * @static
+ * @param {SvrkitApiData} message SvrkitApiData
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ SvrkitApiData.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.defaults) {
+ object.apiName = "";
+ if (options.bytes === String)
+ object.reqData = "";
+ else {
+ object.reqData = [];
+ if (options.bytes !== Array)
+ object.reqData = $util.newBuffer(object.reqData);
+ }
+ }
+ if (message.apiName != null && message.hasOwnProperty("apiName"))
+ object.apiName = message.apiName;
+ if (message.reqData != null && message.hasOwnProperty("reqData"))
+ object.reqData = options.bytes === String ? $util.base64.encode(message.reqData, 0, message.reqData.length) : options.bytes === Array ? Array.prototype.slice.call(message.reqData) : message.reqData;
+ return object;
+ };
+
+ /**
+ * Converts this SvrkitApiData to JSON.
+ * @function toJSON
+ * @memberof SvrkitApiData
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ SvrkitApiData.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return SvrkitApiData;
+})();
+
+/**
+ * HTTP_METHODS enum.
+ * @exports HTTP_METHODS
+ * @enum {string}
+ * @property {number} HTTP_GET=1 HTTP_GET value
+ * @property {number} HTTP_POST=2 HTTP_POST value
+ * @property {number} HTTP_PUT=3 HTTP_PUT value
+ * @property {number} HTTP_DELETE=4 HTTP_DELETE value
+ * @property {number} HTTP_HEAD=5 HTTP_HEAD value
+ * @property {number} HTTP_PATCH=6 HTTP_PATCH value
+ */
+$root.HTTP_METHODS = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[1] = "HTTP_GET"] = 1;
+ values[valuesById[2] = "HTTP_POST"] = 2;
+ values[valuesById[3] = "HTTP_PUT"] = 3;
+ values[valuesById[4] = "HTTP_DELETE"] = 4;
+ values[valuesById[5] = "HTTP_HEAD"] = 5;
+ values[valuesById[6] = "HTTP_PATCH"] = 6;
+ return values;
+})();
+
+$root.HttpHeader = (function() {
+
+ /**
+ * Properties of a HttpHeader.
+ * @exports IHttpHeader
+ * @interface IHttpHeader
+ * @property {string|null} [key] HttpHeader key
+ * @property {string|null} [value] HttpHeader value
+ */
+
+ /**
+ * Constructs a new HttpHeader.
+ * @exports HttpHeader
+ * @classdesc Represents a HttpHeader.
+ * @implements IHttpHeader
+ * @constructor
+ * @param {IHttpHeader=} [properties] Properties to set
+ */
+ function HttpHeader(properties) {
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * HttpHeader key.
+ * @member {string} key
+ * @memberof HttpHeader
+ * @instance
+ */
+ HttpHeader.prototype.key = "";
+
+ /**
+ * HttpHeader value.
+ * @member {string} value
+ * @memberof HttpHeader
+ * @instance
+ */
+ HttpHeader.prototype.value = "";
+
+ /**
+ * Creates a new HttpHeader instance using the specified properties.
+ * @function create
+ * @memberof HttpHeader
+ * @static
+ * @param {IHttpHeader=} [properties] Properties to set
+ * @returns {HttpHeader} HttpHeader instance
+ */
+ HttpHeader.create = function create(properties) {
+ return new HttpHeader(properties);
+ };
+
+ /**
+ * Encodes the specified HttpHeader message. Does not implicitly {@link HttpHeader.verify|verify} messages.
+ * @function encode
+ * @memberof HttpHeader
+ * @static
+ * @param {IHttpHeader} message HttpHeader message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ HttpHeader.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.key != null && message.hasOwnProperty("key"))
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);
+ if (message.value != null && message.hasOwnProperty("value"))
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.value);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified HttpHeader message, length delimited. Does not implicitly {@link HttpHeader.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof HttpHeader
+ * @static
+ * @param {IHttpHeader} message HttpHeader message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ HttpHeader.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a HttpHeader message from the specified reader or buffer.
+ * @function decode
+ * @memberof HttpHeader
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {HttpHeader} HttpHeader
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ HttpHeader.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.HttpHeader();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.key = reader.string();
+ break;
+ case 2:
+ message.value = reader.string();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a HttpHeader message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof HttpHeader
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {HttpHeader} HttpHeader
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ HttpHeader.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a HttpHeader message.
+ * @function verify
+ * @memberof HttpHeader
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ HttpHeader.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.key != null && message.hasOwnProperty("key"))
+ if (!$util.isString(message.key))
+ return "key: string expected";
+ if (message.value != null && message.hasOwnProperty("value"))
+ if (!$util.isString(message.value))
+ return "value: string expected";
+ return null;
+ };
+
+ /**
+ * Creates a HttpHeader message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof HttpHeader
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {HttpHeader} HttpHeader
+ */
+ HttpHeader.fromObject = function fromObject(object) {
+ if (object instanceof $root.HttpHeader)
+ return object;
+ var message = new $root.HttpHeader();
+ if (object.key != null)
+ message.key = String(object.key);
+ if (object.value != null)
+ message.value = String(object.value);
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a HttpHeader message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof HttpHeader
+ * @static
+ * @param {HttpHeader} message HttpHeader
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ HttpHeader.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.defaults) {
+ object.key = "";
+ object.value = "";
+ }
+ if (message.key != null && message.hasOwnProperty("key"))
+ object.key = message.key;
+ if (message.value != null && message.hasOwnProperty("value"))
+ object.value = message.value;
+ return object;
+ };
+
+ /**
+ * Converts this HttpHeader to JSON.
+ * @function toJSON
+ * @memberof HttpHeader
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ HttpHeader.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return HttpHeader;
+})();
+
+$root.ApiGetOpenDataByCloudIdReq = (function() {
+
+ /**
+ * Properties of an ApiGetOpenDataByCloudIdReq.
+ * @exports IApiGetOpenDataByCloudIdReq
+ * @interface IApiGetOpenDataByCloudIdReq
+ * @property {Array.|null} [cloudidList] ApiGetOpenDataByCloudIdReq cloudidList
+ */
+
+ /**
+ * Constructs a new ApiGetOpenDataByCloudIdReq.
+ * @exports ApiGetOpenDataByCloudIdReq
+ * @classdesc Represents an ApiGetOpenDataByCloudIdReq.
+ * @implements IApiGetOpenDataByCloudIdReq
+ * @constructor
+ * @param {IApiGetOpenDataByCloudIdReq=} [properties] Properties to set
+ */
+ function ApiGetOpenDataByCloudIdReq(properties) {
+ this.cloudidList = [];
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * ApiGetOpenDataByCloudIdReq cloudidList.
+ * @member {Array.} cloudidList
+ * @memberof ApiGetOpenDataByCloudIdReq
+ * @instance
+ */
+ ApiGetOpenDataByCloudIdReq.prototype.cloudidList = $util.emptyArray;
+
+ /**
+ * Creates a new ApiGetOpenDataByCloudIdReq instance using the specified properties.
+ * @function create
+ * @memberof ApiGetOpenDataByCloudIdReq
+ * @static
+ * @param {IApiGetOpenDataByCloudIdReq=} [properties] Properties to set
+ * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq instance
+ */
+ ApiGetOpenDataByCloudIdReq.create = function create(properties) {
+ return new ApiGetOpenDataByCloudIdReq(properties);
+ };
+
+ /**
+ * Encodes the specified ApiGetOpenDataByCloudIdReq message. Does not implicitly {@link ApiGetOpenDataByCloudIdReq.verify|verify} messages.
+ * @function encode
+ * @memberof ApiGetOpenDataByCloudIdReq
+ * @static
+ * @param {IApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ApiGetOpenDataByCloudIdReq.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.cloudidList != null && message.cloudidList.length)
+ for (var i = 0; i < message.cloudidList.length; ++i)
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.cloudidList[i]);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified ApiGetOpenDataByCloudIdReq message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdReq.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof ApiGetOpenDataByCloudIdReq
+ * @static
+ * @param {IApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ApiGetOpenDataByCloudIdReq.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes an ApiGetOpenDataByCloudIdReq message from the specified reader or buffer.
+ * @function decode
+ * @memberof ApiGetOpenDataByCloudIdReq
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ApiGetOpenDataByCloudIdReq.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdReq();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 2:
+ if (!(message.cloudidList && message.cloudidList.length))
+ message.cloudidList = [];
+ message.cloudidList.push(reader.string());
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes an ApiGetOpenDataByCloudIdReq message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof ApiGetOpenDataByCloudIdReq
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ApiGetOpenDataByCloudIdReq.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies an ApiGetOpenDataByCloudIdReq message.
+ * @function verify
+ * @memberof ApiGetOpenDataByCloudIdReq
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ ApiGetOpenDataByCloudIdReq.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.cloudidList != null && message.hasOwnProperty("cloudidList")) {
+ if (!Array.isArray(message.cloudidList))
+ return "cloudidList: array expected";
+ for (var i = 0; i < message.cloudidList.length; ++i)
+ if (!$util.isString(message.cloudidList[i]))
+ return "cloudidList: string[] expected";
+ }
+ return null;
+ };
+
+ /**
+ * Creates an ApiGetOpenDataByCloudIdReq message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof ApiGetOpenDataByCloudIdReq
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq
+ */
+ ApiGetOpenDataByCloudIdReq.fromObject = function fromObject(object) {
+ if (object instanceof $root.ApiGetOpenDataByCloudIdReq)
+ return object;
+ var message = new $root.ApiGetOpenDataByCloudIdReq();
+ if (object.cloudidList) {
+ if (!Array.isArray(object.cloudidList))
+ throw TypeError(".ApiGetOpenDataByCloudIdReq.cloudidList: array expected");
+ message.cloudidList = [];
+ for (var i = 0; i < object.cloudidList.length; ++i)
+ message.cloudidList[i] = String(object.cloudidList[i]);
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from an ApiGetOpenDataByCloudIdReq message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof ApiGetOpenDataByCloudIdReq
+ * @static
+ * @param {ApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ ApiGetOpenDataByCloudIdReq.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.cloudidList = [];
+ if (message.cloudidList && message.cloudidList.length) {
+ object.cloudidList = [];
+ for (var j = 0; j < message.cloudidList.length; ++j)
+ object.cloudidList[j] = message.cloudidList[j];
+ }
+ return object;
+ };
+
+ /**
+ * Converts this ApiGetOpenDataByCloudIdReq to JSON.
+ * @function toJSON
+ * @memberof ApiGetOpenDataByCloudIdReq
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ ApiGetOpenDataByCloudIdReq.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return ApiGetOpenDataByCloudIdReq;
+})();
+
+$root.ApiGetOpenDataByCloudIdResp = (function() {
+
+ /**
+ * Properties of an ApiGetOpenDataByCloudIdResp.
+ * @exports IApiGetOpenDataByCloudIdResp
+ * @interface IApiGetOpenDataByCloudIdResp
+ * @property {Array.|null} [dataList] ApiGetOpenDataByCloudIdResp dataList
+ */
+
+ /**
+ * Constructs a new ApiGetOpenDataByCloudIdResp.
+ * @exports ApiGetOpenDataByCloudIdResp
+ * @classdesc Represents an ApiGetOpenDataByCloudIdResp.
+ * @implements IApiGetOpenDataByCloudIdResp
+ * @constructor
+ * @param {IApiGetOpenDataByCloudIdResp=} [properties] Properties to set
+ */
+ function ApiGetOpenDataByCloudIdResp(properties) {
+ this.dataList = [];
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * ApiGetOpenDataByCloudIdResp dataList.
+ * @member {Array.} dataList
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @instance
+ */
+ ApiGetOpenDataByCloudIdResp.prototype.dataList = $util.emptyArray;
+
+ /**
+ * Creates a new ApiGetOpenDataByCloudIdResp instance using the specified properties.
+ * @function create
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @static
+ * @param {IApiGetOpenDataByCloudIdResp=} [properties] Properties to set
+ * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp instance
+ */
+ ApiGetOpenDataByCloudIdResp.create = function create(properties) {
+ return new ApiGetOpenDataByCloudIdResp(properties);
+ };
+
+ /**
+ * Encodes the specified ApiGetOpenDataByCloudIdResp message. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.verify|verify} messages.
+ * @function encode
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @static
+ * @param {IApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ApiGetOpenDataByCloudIdResp.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.dataList != null && message.dataList.length)
+ for (var i = 0; i < message.dataList.length; ++i)
+ $root.ApiGetOpenDataByCloudIdResp.OpDataItem.encode(message.dataList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
+ return writer;
+ };
+
+ /**
+ * Encodes the specified ApiGetOpenDataByCloudIdResp message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @static
+ * @param {IApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ApiGetOpenDataByCloudIdResp.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes an ApiGetOpenDataByCloudIdResp message from the specified reader or buffer.
+ * @function decode
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ApiGetOpenDataByCloudIdResp.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdResp();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (!(message.dataList && message.dataList.length))
+ message.dataList = [];
+ message.dataList.push($root.ApiGetOpenDataByCloudIdResp.OpDataItem.decode(reader, reader.uint32()));
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes an ApiGetOpenDataByCloudIdResp message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ApiGetOpenDataByCloudIdResp.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies an ApiGetOpenDataByCloudIdResp message.
+ * @function verify
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ ApiGetOpenDataByCloudIdResp.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.dataList != null && message.hasOwnProperty("dataList")) {
+ if (!Array.isArray(message.dataList))
+ return "dataList: array expected";
+ for (var i = 0; i < message.dataList.length; ++i) {
+ var error = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.verify(message.dataList[i]);
+ if (error)
+ return "dataList." + error;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Creates an ApiGetOpenDataByCloudIdResp message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp
+ */
+ ApiGetOpenDataByCloudIdResp.fromObject = function fromObject(object) {
+ if (object instanceof $root.ApiGetOpenDataByCloudIdResp)
+ return object;
+ var message = new $root.ApiGetOpenDataByCloudIdResp();
+ if (object.dataList) {
+ if (!Array.isArray(object.dataList))
+ throw TypeError(".ApiGetOpenDataByCloudIdResp.dataList: array expected");
+ message.dataList = [];
+ for (var i = 0; i < object.dataList.length; ++i) {
+ if (typeof object.dataList[i] !== "object")
+ throw TypeError(".ApiGetOpenDataByCloudIdResp.dataList: object expected");
+ message.dataList[i] = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.fromObject(object.dataList[i]);
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from an ApiGetOpenDataByCloudIdResp message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @static
+ * @param {ApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ ApiGetOpenDataByCloudIdResp.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.dataList = [];
+ if (message.dataList && message.dataList.length) {
+ object.dataList = [];
+ for (var j = 0; j < message.dataList.length; ++j)
+ object.dataList[j] = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.toObject(message.dataList[j], options);
+ }
+ return object;
+ };
+
+ /**
+ * Converts this ApiGetOpenDataByCloudIdResp to JSON.
+ * @function toJSON
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ ApiGetOpenDataByCloudIdResp.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ ApiGetOpenDataByCloudIdResp.OpDataItem = (function() {
+
+ /**
+ * Properties of an OpDataItem.
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @interface IOpDataItem
+ * @property {string|null} [cloudId] OpDataItem cloudId
+ * @property {string|null} [json] OpDataItem json
+ */
+
+ /**
+ * Constructs a new OpDataItem.
+ * @memberof ApiGetOpenDataByCloudIdResp
+ * @classdesc Represents an OpDataItem.
+ * @implements IOpDataItem
+ * @constructor
+ * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem=} [properties] Properties to set
+ */
+ function OpDataItem(properties) {
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * OpDataItem cloudId.
+ * @member {string} cloudId
+ * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem
+ * @instance
+ */
+ OpDataItem.prototype.cloudId = "";
+
+ /**
+ * OpDataItem json.
+ * @member {string} json
+ * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem
+ * @instance
+ */
+ OpDataItem.prototype.json = "";
+
+ /**
+ * Creates a new OpDataItem instance using the specified properties.
+ * @function create
+ * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem
+ * @static
+ * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem=} [properties] Properties to set
+ * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem instance
+ */
+ OpDataItem.create = function create(properties) {
+ return new OpDataItem(properties);
+ };
+
+ /**
+ * Encodes the specified OpDataItem message. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.OpDataItem.verify|verify} messages.
+ * @function encode
+ * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem
+ * @static
+ * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem} message OpDataItem message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ OpDataItem.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.cloudId != null && message.hasOwnProperty("cloudId"))
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudId);
+ if (message.json != null && message.hasOwnProperty("json"))
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.json);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified OpDataItem message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.OpDataItem.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem
+ * @static
+ * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem} message OpDataItem message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ OpDataItem.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes an OpDataItem message from the specified reader or buffer.
+ * @function decode
+ * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ OpDataItem.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdResp.OpDataItem();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.cloudId = reader.string();
+ break;
+ case 2:
+ message.json = reader.string();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes an OpDataItem message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ OpDataItem.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies an OpDataItem message.
+ * @function verify
+ * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ OpDataItem.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.cloudId != null && message.hasOwnProperty("cloudId"))
+ if (!$util.isString(message.cloudId))
+ return "cloudId: string expected";
+ if (message.json != null && message.hasOwnProperty("json"))
+ if (!$util.isString(message.json))
+ return "json: string expected";
+ return null;
+ };
+
+ /**
+ * Creates an OpDataItem message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem
+ */
+ OpDataItem.fromObject = function fromObject(object) {
+ if (object instanceof $root.ApiGetOpenDataByCloudIdResp.OpDataItem)
+ return object;
+ var message = new $root.ApiGetOpenDataByCloudIdResp.OpDataItem();
+ if (object.cloudId != null)
+ message.cloudId = String(object.cloudId);
+ if (object.json != null)
+ message.json = String(object.json);
+ return message;
+ };
+
+ /**
+ * Creates a plain object from an OpDataItem message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem
+ * @static
+ * @param {ApiGetOpenDataByCloudIdResp.OpDataItem} message OpDataItem
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ OpDataItem.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.defaults) {
+ object.cloudId = "";
+ object.json = "";
+ }
+ if (message.cloudId != null && message.hasOwnProperty("cloudId"))
+ object.cloudId = message.cloudId;
+ if (message.json != null && message.hasOwnProperty("json"))
+ object.json = message.json;
+ return object;
+ };
+
+ /**
+ * Converts this OpDataItem to JSON.
+ * @function toJSON
+ * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ OpDataItem.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return OpDataItem;
+ })();
+
+ return ApiGetOpenDataByCloudIdResp;
+})();
+
+$root.ApiVoipSignReq = (function() {
+
+ /**
+ * Properties of an ApiVoipSignReq.
+ * @exports IApiVoipSignReq
+ * @interface IApiVoipSignReq
+ * @property {string|null} [groupId] ApiVoipSignReq groupId
+ * @property {number|null} [timestamp] ApiVoipSignReq timestamp
+ * @property {string|null} [nonce] ApiVoipSignReq nonce
+ */
+
+ /**
+ * Constructs a new ApiVoipSignReq.
+ * @exports ApiVoipSignReq
+ * @classdesc Represents an ApiVoipSignReq.
+ * @implements IApiVoipSignReq
+ * @constructor
+ * @param {IApiVoipSignReq=} [properties] Properties to set
+ */
+ function ApiVoipSignReq(properties) {
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * ApiVoipSignReq groupId.
+ * @member {string} groupId
+ * @memberof ApiVoipSignReq
+ * @instance
+ */
+ ApiVoipSignReq.prototype.groupId = "";
+
+ /**
+ * ApiVoipSignReq timestamp.
+ * @member {number} timestamp
+ * @memberof ApiVoipSignReq
+ * @instance
+ */
+ ApiVoipSignReq.prototype.timestamp = 0;
+
+ /**
+ * ApiVoipSignReq nonce.
+ * @member {string} nonce
+ * @memberof ApiVoipSignReq
+ * @instance
+ */
+ ApiVoipSignReq.prototype.nonce = "";
+
+ /**
+ * Creates a new ApiVoipSignReq instance using the specified properties.
+ * @function create
+ * @memberof ApiVoipSignReq
+ * @static
+ * @param {IApiVoipSignReq=} [properties] Properties to set
+ * @returns {ApiVoipSignReq} ApiVoipSignReq instance
+ */
+ ApiVoipSignReq.create = function create(properties) {
+ return new ApiVoipSignReq(properties);
+ };
+
+ /**
+ * Encodes the specified ApiVoipSignReq message. Does not implicitly {@link ApiVoipSignReq.verify|verify} messages.
+ * @function encode
+ * @memberof ApiVoipSignReq
+ * @static
+ * @param {IApiVoipSignReq} message ApiVoipSignReq message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ApiVoipSignReq.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.groupId != null && message.hasOwnProperty("groupId"))
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupId);
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
+ writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.timestamp);
+ if (message.nonce != null && message.hasOwnProperty("nonce"))
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.nonce);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified ApiVoipSignReq message, length delimited. Does not implicitly {@link ApiVoipSignReq.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof ApiVoipSignReq
+ * @static
+ * @param {IApiVoipSignReq} message ApiVoipSignReq message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ApiVoipSignReq.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes an ApiVoipSignReq message from the specified reader or buffer.
+ * @function decode
+ * @memberof ApiVoipSignReq
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {ApiVoipSignReq} ApiVoipSignReq
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ApiVoipSignReq.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiVoipSignReq();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 2:
+ message.groupId = reader.string();
+ break;
+ case 3:
+ message.timestamp = reader.uint32();
+ break;
+ case 4:
+ message.nonce = reader.string();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes an ApiVoipSignReq message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof ApiVoipSignReq
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {ApiVoipSignReq} ApiVoipSignReq
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ApiVoipSignReq.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies an ApiVoipSignReq message.
+ * @function verify
+ * @memberof ApiVoipSignReq
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ ApiVoipSignReq.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.groupId != null && message.hasOwnProperty("groupId"))
+ if (!$util.isString(message.groupId))
+ return "groupId: string expected";
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
+ if (!$util.isInteger(message.timestamp))
+ return "timestamp: integer expected";
+ if (message.nonce != null && message.hasOwnProperty("nonce"))
+ if (!$util.isString(message.nonce))
+ return "nonce: string expected";
+ return null;
+ };
+
+ /**
+ * Creates an ApiVoipSignReq message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof ApiVoipSignReq
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {ApiVoipSignReq} ApiVoipSignReq
+ */
+ ApiVoipSignReq.fromObject = function fromObject(object) {
+ if (object instanceof $root.ApiVoipSignReq)
+ return object;
+ var message = new $root.ApiVoipSignReq();
+ if (object.groupId != null)
+ message.groupId = String(object.groupId);
+ if (object.timestamp != null)
+ message.timestamp = object.timestamp >>> 0;
+ if (object.nonce != null)
+ message.nonce = String(object.nonce);
+ return message;
+ };
+
+ /**
+ * Creates a plain object from an ApiVoipSignReq message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof ApiVoipSignReq
+ * @static
+ * @param {ApiVoipSignReq} message ApiVoipSignReq
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ ApiVoipSignReq.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.defaults) {
+ object.groupId = "";
+ object.timestamp = 0;
+ object.nonce = "";
+ }
+ if (message.groupId != null && message.hasOwnProperty("groupId"))
+ object.groupId = message.groupId;
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
+ object.timestamp = message.timestamp;
+ if (message.nonce != null && message.hasOwnProperty("nonce"))
+ object.nonce = message.nonce;
+ return object;
+ };
+
+ /**
+ * Converts this ApiVoipSignReq to JSON.
+ * @function toJSON
+ * @memberof ApiVoipSignReq
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ ApiVoipSignReq.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return ApiVoipSignReq;
+})();
+
+$root.ApiVoipSignResp = (function() {
+
+ /**
+ * Properties of an ApiVoipSignResp.
+ * @exports IApiVoipSignResp
+ * @interface IApiVoipSignResp
+ * @property {string|null} [signature] ApiVoipSignResp signature
+ */
+
+ /**
+ * Constructs a new ApiVoipSignResp.
+ * @exports ApiVoipSignResp
+ * @classdesc Represents an ApiVoipSignResp.
+ * @implements IApiVoipSignResp
+ * @constructor
+ * @param {IApiVoipSignResp=} [properties] Properties to set
+ */
+ function ApiVoipSignResp(properties) {
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * ApiVoipSignResp signature.
+ * @member {string} signature
+ * @memberof ApiVoipSignResp
+ * @instance
+ */
+ ApiVoipSignResp.prototype.signature = "";
+
+ /**
+ * Creates a new ApiVoipSignResp instance using the specified properties.
+ * @function create
+ * @memberof ApiVoipSignResp
+ * @static
+ * @param {IApiVoipSignResp=} [properties] Properties to set
+ * @returns {ApiVoipSignResp} ApiVoipSignResp instance
+ */
+ ApiVoipSignResp.create = function create(properties) {
+ return new ApiVoipSignResp(properties);
+ };
+
+ /**
+ * Encodes the specified ApiVoipSignResp message. Does not implicitly {@link ApiVoipSignResp.verify|verify} messages.
+ * @function encode
+ * @memberof ApiVoipSignResp
+ * @static
+ * @param {IApiVoipSignResp} message ApiVoipSignResp message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ApiVoipSignResp.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.signature != null && message.hasOwnProperty("signature"))
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.signature);
+ return writer;
+ };
+
+ /**
+ * Encodes the specified ApiVoipSignResp message, length delimited. Does not implicitly {@link ApiVoipSignResp.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof ApiVoipSignResp
+ * @static
+ * @param {IApiVoipSignResp} message ApiVoipSignResp message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ ApiVoipSignResp.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes an ApiVoipSignResp message from the specified reader or buffer.
+ * @function decode
+ * @memberof ApiVoipSignResp
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {ApiVoipSignResp} ApiVoipSignResp
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ApiVoipSignResp.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiVoipSignResp();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.signature = reader.string();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes an ApiVoipSignResp message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof ApiVoipSignResp
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {ApiVoipSignResp} ApiVoipSignResp
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ ApiVoipSignResp.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies an ApiVoipSignResp message.
+ * @function verify
+ * @memberof ApiVoipSignResp
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ ApiVoipSignResp.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.signature != null && message.hasOwnProperty("signature"))
+ if (!$util.isString(message.signature))
+ return "signature: string expected";
+ return null;
+ };
+
+ /**
+ * Creates an ApiVoipSignResp message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof ApiVoipSignResp
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {ApiVoipSignResp} ApiVoipSignResp
+ */
+ ApiVoipSignResp.fromObject = function fromObject(object) {
+ if (object instanceof $root.ApiVoipSignResp)
+ return object;
+ var message = new $root.ApiVoipSignResp();
+ if (object.signature != null)
+ message.signature = String(object.signature);
+ return message;
+ };
+
+ /**
+ * Creates a plain object from an ApiVoipSignResp message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof ApiVoipSignResp
+ * @static
+ * @param {ApiVoipSignResp} message ApiVoipSignResp
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ ApiVoipSignResp.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.defaults)
+ object.signature = "";
+ if (message.signature != null && message.hasOwnProperty("signature"))
+ object.signature = message.signature;
+ return object;
+ };
+
+ /**
+ * Converts this ApiVoipSignResp to JSON.
+ * @function toJSON
+ * @memberof ApiVoipSignResp
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ ApiVoipSignResp.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ return ApiVoipSignResp;
+})();
+
+module.exports = $root;
+
+
+/***/ }),
+
+/***/ "./src/utils/assert.ts":
+/*!*****************************!*\
+ !*** ./src/utils/assert.ts ***!
+ \*****************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const type_1 = __webpack_require__(/*! ./type */ "./src/utils/type.ts");
+const error_1 = __webpack_require__(/*! ./error */ "./src/utils/error.ts");
+const error_config_1 = __webpack_require__(/*! config/error.config */ "./src/config/error.config.ts");
+function sameType(input, ref, name) {
+ function sameTypeImpl(input, ref, name) {
+ const inputType = type_1.getType(input);
+ const refType = type_1.getType(ref);
+ if (inputType !== refType) {
+ return `${name} should be ${refType} instead of ${inputType}; `;
+ }
+ let errors = '';
+ switch (inputType) {
+ case 'object': {
+ for (const key in ref) {
+ errors += sameTypeImpl(input[key], ref[key], `${name}.${key}`);
+ }
+ break;
+ }
+ case 'array': {
+ for (let i = 0; i < ref.length; i++) {
+ errors += sameTypeImpl(input[i], ref[i], `${name}[${i}]`);
+ }
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ return errors;
+ }
+ const error = sameTypeImpl(input, ref, name);
+ return {
+ passed: !error,
+ reason: error,
+ };
+}
+exports.sameType = sameType;
+function validType(input, ref, name = 'parameter') {
+ function validTypeImpl(input, ref, name) {
+ const inputType = type_1.getType(input);
+ const refType = type_1.getType(ref);
+ if (refType === 'string') {
+ if (inputType !== ref) {
+ return `${name} should be ${ref} instead of ${inputType};`;
+ }
+ return '';
+ }
+ else {
+ if (inputType !== refType) {
+ return `${name} should be ${refType} instead of ${inputType}; `;
+ }
+ let errors = '';
+ switch (inputType) {
+ case 'object': {
+ for (const key in ref) {
+ errors += validTypeImpl(input[key], ref[key], `${name}.${key}`);
+ }
+ break;
+ }
+ case 'array': {
+ for (let i = 0; i < ref.length; i++) {
+ errors += validTypeImpl(input[i], ref[i], `${name}[${i}]`);
+ }
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ return errors;
+ }
+ }
+ const error = validTypeImpl(input, ref, name);
+ return {
+ passed: !error,
+ reason: error,
+ };
+}
+exports.validType = validType;
+function validObjectOptionalType(input, ref, name = 'parameter') {
+ function validImpl(input, ref, name) {
+ const inputType = type_1.getType(input);
+ const refType = type_1.getType(ref);
+ if (refType !== 'object')
+ return '';
+ if (inputType === 'object') {
+ for (const key in input) {
+ const val = input[key];
+ if (val === undefined || key === null) {
+ continue;
+ }
+ const assertResult = validType(val, ref[key], `${name}.${key}`);
+ return assertResult.passed ? '' : assertResult.reason;
+ }
+ }
+ else {
+ return `${name} should be object instead of ${inputType}`;
+ }
+ return '';
+ }
+ const error = validImpl(input, ref, name);
+ return {
+ passed: !error,
+ reason: error,
+ };
+}
+exports.validObjectOptionalType = validObjectOptionalType;
+function assertType(param, ref, name = 'parameter', ErrorClass = error_1.CloudSDKError) {
+ // check param validity
+ let paramCheckResult = validType(param, ref, name);
+ if (!paramCheckResult.passed) {
+ throw new ErrorClass({
+ errMsg: paramCheckResult.reason,
+ });
+ }
+}
+exports.assertType = assertType;
+function assertObjectOptionalType(param, ref, name = 'parameter', ErrorClass = error_1.CloudSDKError) {
+ // check param validity
+ let paramCheckResult = validObjectOptionalType(param, ref, name);
+ if (!paramCheckResult.passed) {
+ throw new ErrorClass({
+ errMsg: paramCheckResult.reason,
+ });
+ }
+}
+exports.assertObjectOptionalType = assertObjectOptionalType;
+function assertRequiredParam(param, name, funcName, ErrorClass = error_1.CloudSDKError) {
+ if (param === undefined || param === null) {
+ throw new ErrorClass({
+ errMsg: `parameter ${name} of function ${funcName} must be provided`,
+ });
+ }
+}
+exports.assertRequiredParam = assertRequiredParam;
+function assertObjectNotEmpty({ target, name, ErrorClass = error_1.CloudSDKError }) {
+ if (Object.keys(target).length === 0) {
+ throw new ErrorClass({
+ errCode: error_config_1.ERR_CODE.SDK_API_PARAMETER_ERROR,
+ errMsg: `${name} must not be empty`
+ });
+ }
+}
+exports.assertObjectNotEmpty = assertObjectNotEmpty;
+/*
+export function constructTypeRef(typeDef: any): any {
+
+ const type = getType(typeDef)
+
+ switch(type) {
+ case 'string': {
+ return ''
+ }
+ case 'number': {
+
+ }
+ }
+
+}
+*/
+
+
+/***/ }),
+
+/***/ "./src/utils/error.ts":
+/*!****************************!*\
+ !*** ./src/utils/error.ts ***!
+ \****************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const type_1 = __webpack_require__(/*! ./type */ "./src/utils/type.ts");
+const msg_1 = __webpack_require__(/*! ./msg */ "./src/utils/msg.ts");
+const error_config_1 = __webpack_require__(/*! config/error.config */ "./src/config/error.config.ts");
+class CloudSDKError extends Error {
+ constructor(options) {
+ super(options.errMsg);
+ this.errCode = -1;
+ Object.defineProperties(this, {
+ message: {
+ get() {
+ return `errCode: ${this.errCode} ${error_config_1.ERR_CODE[this.errCode] || ''} | errMsg: ` + this.errMsg;
+ },
+ set(msg) {
+ this.errMsg = msg;
+ }
+ }
+ });
+ this.errCode = options.errCode || -1;
+ this.errMsg = options.errMsg;
+ }
+ get message() {
+ return `errCode: ${this.errCode} | errMsg: ` + this.errMsg;
+ }
+ set message(msg) {
+ this.errMsg = msg;
+ }
+}
+exports.CloudSDKError = CloudSDKError;
+function createError({ errCode = 1, errMsg = '', errClass = CloudSDKError, } = {}) {
+ return new errClass({
+ errCode,
+ errMsg,
+ });
+}
+exports.createError = createError;
+function isSDKError(error) {
+ return error && (error instanceof Error) && type_1.isString(error.errMsg);
+}
+exports.isSDKError = isSDKError;
+function returnAsCloudSDKError(err, appendMsg = '') {
+ if (err) {
+ if (isSDKError(err)) {
+ if (appendMsg) {
+ err.errMsg += '; ' + appendMsg;
+ }
+ return err;
+ }
+ const errCode = err ? err.errCode : undefined;
+ const errMsg = (err && err.errMsg || err.toString() || 'unknown error') + '; ' + appendMsg;
+ return new CloudSDKError({
+ errCode,
+ errMsg,
+ });
+ }
+ return new CloudSDKError({
+ errMsg: appendMsg
+ });
+}
+exports.returnAsCloudSDKError = returnAsCloudSDKError;
+function returnAsFinalCloudSDKError(err, apiName) {
+ if (err && isSDKError(err)) {
+ return err;
+ }
+ const e = returnAsCloudSDKError(err, `at ${apiName} api; `);
+ e.errMsg = msg_1.apiFailMsg(apiName, e.errMsg);
+ return e;
+}
+exports.returnAsFinalCloudSDKError = returnAsFinalCloudSDKError;
+
+
+/***/ }),
+
+/***/ "./src/utils/mimetype.ts":
+/*!*******************************!*\
+ !*** ./src/utils/mimetype.ts ***!
+ \*******************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const mimeDB = __webpack_require__(/*! mime-db */ "mime-db");
+exports.mimeTypeToFileExtension = (mimeType, defaultExtension) => {
+ const mime = mimeDB[mimeType];
+ if (mime && mime.extensions && mime.extensions.length) {
+ return mime.extensions[0];
+ }
+ else {
+ return defaultExtension;
+ }
+};
+
+
+/***/ }),
+
+/***/ "./src/utils/msg.ts":
+/*!**************************!*\
+ !*** ./src/utils/msg.ts ***!
+ \**************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+function apiSuccessMsg(apiName) {
+ return `${apiName}:ok`;
+}
+exports.apiSuccessMsg = apiSuccessMsg;
+function apiCancelMsg(apiName, msg) {
+ return `${apiName}:cancel ${msg}`;
+}
+exports.apiCancelMsg = apiCancelMsg;
+function apiFailMsg(apiName, msg) {
+ return `${apiName}:fail ${msg}`;
+}
+exports.apiFailMsg = apiFailMsg;
+
+
+/***/ }),
+
+/***/ "./src/utils/symbol.ts":
+/*!*****************************!*\
+ !*** ./src/utils/symbol.ts ***!
+ \*****************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const _symbols = [];
+const __internalMark__ = {};
+class HiddenSymbol {
+ constructor(target) {
+ Object.defineProperties(this, {
+ target: {
+ enumerable: false,
+ writable: false,
+ configurable: false,
+ value: target,
+ },
+ });
+ }
+}
+class InternalSymbol extends HiddenSymbol {
+ constructor(target, __mark__) {
+ if (__mark__ !== __internalMark__) {
+ throw new TypeError('InternalSymbol cannot be constructed with new operator');
+ }
+ super(target);
+ }
+ static for(target) {
+ for (let i = 0, len = _symbols.length; i < len; i++) {
+ if (_symbols[i].target === target) {
+ return _symbols[i].instance;
+ }
+ }
+ const symbol = new InternalSymbol(target, __internalMark__);
+ _symbols.push({
+ target,
+ instance: symbol,
+ });
+ return symbol;
+ }
+}
+exports.InternalSymbol = InternalSymbol;
+exports.default = InternalSymbol;
+
+
+/***/ }),
+
+/***/ "./src/utils/type.ts":
+/*!***************************!*\
+ !*** ./src/utils/type.ts ***!
+ \***************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const symbol_1 = __webpack_require__(/*! ./symbol */ "./src/utils/symbol.ts");
+exports.getType = (x) => Object.prototype.toString.call(x).slice(8, -1).toLowerCase();
+exports.isObject = (x) => exports.getType(x) === 'object';
+exports.isString = (x) => exports.getType(x) === 'string';
+exports.isNumber = (x) => exports.getType(x) === 'number';
+exports.isPromise = (x) => exports.getType(x) === 'promise';
+exports.isFunction = (x) => typeof x === 'function';
+exports.isArray = (x) => Array.isArray(x);
+exports.isDate = (x) => exports.getType(x) === 'date';
+exports.isBuffer = (x) => Buffer.isBuffer(x);
+exports.isInternalObject = (x) => x && (x._internalType instanceof symbol_1.InternalSymbol);
+exports.isPlainObject = (obj) => {
+ if (typeof obj !== 'object' || obj === null)
+ return false;
+ let proto = obj;
+ while (Object.getPrototypeOf(proto) !== null) {
+ proto = Object.getPrototypeOf(proto);
+ }
+ return Object.getPrototypeOf(obj) === proto;
+};
+
+
+/***/ }),
+
+/***/ "./src/utils/utils.ts":
+/*!****************************!*\
+ !*** ./src/utils/utils.ts ***!
+ \****************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const type_1 = __webpack_require__(/*! ./type */ "./src/utils/type.ts");
+const symbol_config_1 = __webpack_require__(/*! config/symbol.config */ "./src/config/symbol.config.ts");
+exports.convertCase = (input, options) => {
+ const { from, to, recursive } = options;
+ if (type_1.isString(input)) {
+ if (from === 'camelcase' && to === 'snakecase') {
+ return input.replace(/[A-Z]/g, (match, ind) => `${ind ? '_' : ''}${match.toLowerCase()}`);
+ }
+ else if (from === 'snakecase' && to === 'camelcase') {
+ return input.replace(/_[a-z]/g, (match, ind) => `${match[1].toUpperCase()}`);
+ }
+ }
+ else if (type_1.isObject(input)) {
+ return convertObject(input);
+ }
+ else if (type_1.isArray(input)) {
+ const array = [];
+ for (const item of input) {
+ if (type_1.isObject(item)) {
+ array.push(convertObject(item));
+ }
+ else if (type_1.isArray(item)) {
+ if (options.recursive) {
+ array.push(exports.convertCase(item, options));
+ }
+ else {
+ array.push(item);
+ }
+ }
+ else {
+ array.push(item);
+ }
+ }
+ return array;
+ }
+ else
+ return input;
+ function convertObject(input) {
+ const data = Object.assign({}, input);
+ for (const key in data) {
+ const val = recursive && (type_1.isObject(data[key]) || type_1.isArray(data[key])) ? exports.convertCase(data[key], options) : data[key];
+ const convertedKey = exports.convertCase(key, options);
+ data[convertedKey] = val;
+ if (convertedKey !== key) {
+ delete data[key];
+ }
+ }
+ return data;
+ }
+};
+exports.isSCFEnvReady = () => Boolean(process.env.TCB_ENV);
+exports.translateEnv = (env) => {
+ if (!env) {
+ return undefined;
+ }
+ if (env === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {
+ env = process.env.TCB_ENV || process.env.SCF_NAMESPACE;
+ }
+ // in scf local debug, we should not use 'local' as env in api invocation
+ if (env === 'local' && process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {
+ return undefined;
+ }
+ return env;
+};
+exports.getEnvFromCloudConfig = (config, serviceName = 'default') => {
+ const env = config.env[serviceName] || config.env.default;
+ return exports.translateEnv(env);
+};
+exports.getEnvFromAPIConfig = (apiConfig, cloudConfig, serviceName = 'default') => {
+ if (apiConfig && apiConfig.env) {
+ return exports.translateEnv(apiConfig.env);
+ }
+ return exports.getEnvFromCloudConfig(cloudConfig, serviceName);
+};
+exports.getServiceConfigFromDefaultConfig = (defaultConfig, serviceName = 'default') => {
+ return Object.assign(Object.assign({}, defaultConfig), { env: exports.getEnvFromCloudConfig(defaultConfig, serviceName) });
+};
+exports.getMergedAPIConfig = (defaultConfig, newConfig, serviceName = 'default') => {
+ const merged = Object.assign(Object.assign({}, defaultConfig), newConfig);
+ if (newConfig && newConfig.env) {
+ merged.env = exports.translateEnv(newConfig.env);
+ }
+ else {
+ merged.env = exports.getEnvFromCloudConfig(defaultConfig, serviceName);
+ }
+ return merged;
+};
+
+
+/***/ }),
+
+/***/ "mime-db":
+/*!**************************!*\
+ !*** external "mime-db" ***!
+ \**************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
+
+module.exports = require("mime-db");
+
+/***/ }),
+
+/***/ "protobufjs/minimal":
+/*!*************************************!*\
+ !*** external "protobufjs/minimal" ***!
+ \*************************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
+
+module.exports = require("protobufjs/minimal");
+
+/***/ }),
+
+/***/ "tcb-admin-node":
+/*!*********************************!*\
+ !*** external "tcb-admin-node" ***!
+ \*********************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
+
+module.exports = require("tcb-admin-node");
+
+/***/ }),
+
+/***/ "tcb-admin-node/src/utils/httpRequest":
+/*!*******************************************************!*\
+ !*** external "tcb-admin-node/src/utils/httpRequest" ***!
+ \*******************************************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
+
+module.exports = require("tcb-admin-node/src/utils/httpRequest");
+
+/***/ })
+
+/******/ });
+}, function(modId) {var map = {"./package.json":1587547894850}; return __REQUIRE__(map[modId], modId); })
+__DEFINE__(1587547894850, function(require, module, exports) {
+module.exports = {
+ "_from": "wx-server-sdk@latest",
+ "_id": "wx-server-sdk@1.8.3",
+ "_inBundle": false,
+ "_integrity": "sha1-VE9wCQJ0RCKFzQBdf0i7tt+wAow=",
+ "_location": "/wx-server-sdk",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "tag",
+ "registry": true,
+ "raw": "wx-server-sdk@latest",
+ "name": "wx-server-sdk",
+ "escapedName": "wx-server-sdk",
+ "rawSpec": "latest",
+ "saveSpec": null,
+ "fetchSpec": "latest"
+ },
+ "_requiredBy": [
+ "#USER",
+ "/"
+ ],
+ "_resolved": "https://registry.npm.taobao.org/wx-server-sdk/download/wx-server-sdk-1.8.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwx-server-sdk%2Fdownload%2Fwx-server-sdk-1.8.3.tgz",
+ "_shasum": "544f70090274442285cd005d7f48bbb6dfb0028c",
+ "_spec": "wx-server-sdk@latest",
+ "_where": "/Users/romchung/Wechat-Miniprogram/miniprogram-demo/cloudfunctions/wxContext",
+ "author": {
+ "name": "wechat mini program team"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "protobufjs": "6.8.8",
+ "tcb-admin-node": "1.22.0",
+ "tslib": "^1.9.3"
+ },
+ "deprecated": false,
+ "description": "mini program cloud server sdk",
+ "homepage": "https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html",
+ "license": "MIT",
+ "main": "index.js",
+ "name": "wx-server-sdk",
+ "types": "index.d.ts",
+ "version": "1.8.3"
+}
+
+}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
+return __REQUIRE__(1587547894849);
+})()
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/wx-server-sdk/index.js.map b/miniprogram/miniprogram_npm/wx-server-sdk/index.js.map
new file mode 100644
index 00000000..65e5d39f
--- /dev/null
+++ b/miniprogram/miniprogram_npm/wx-server-sdk/index.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["index.js","package.json"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["module.exports =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./src/api/cloud/index.ts\":\n/*!********************************!*\\\n !*** ./src/api/cloud/index.ts ***!\n \\********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst provider_1 = __webpack_require__(/*! ./provider */ \"./src/api/cloud/provider/index.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst type_1 = __webpack_require__(/*! utils/type */ \"./src/utils/type.ts\");\nconst index_1 = __webpack_require__(/*! ../index */ \"./src/api/index.ts\");\nconst symbol_config_1 = __webpack_require__(/*! config/symbol.config */ \"./src/config/symbol.config.ts\");\n// @ts-ignore\nconst { version } = require('./package.json');\nclass Cloud {\n constructor() {\n this.inited = false;\n this.services = {};\n this.debug = false;\n this.wrapCommonAPICheck = (func) => {\n return (...args) => {\n if (!this.inited) {\n throw new error_1.CloudSDKError({\n errMsg: 'Cloud API isn\\'t enabled, please call init first\\n' +\n '请先调用 init 完成初始化后再调用其他云 API。init 方法可传入一个对象用于设置默认配置,详见文档。'\n });\n }\n return func.apply(this, args);\n };\n };\n this.exportAPI = {\n version,\n get DYNAMIC_CURRENT_ENV() {\n const env = process.env.TCB_ENV || process.env.SCF_NAMESPACE;\n if (env === 'local' && process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {\n return symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;\n }\n return env || symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;\n },\n // @ts-ignore\n init: this.init.bind(this),\n // @ts-ignore\n updateConfig: this.updateConfig.bind(this),\n registerService: (serviceProvider) => {\n this.registerService(serviceProvider.createService(this));\n },\n // @ts-ignore\n createNewInstance: (config) => {\n const instance = new Cloud();\n instance.init(config);\n return instance.exportAPI;\n }\n };\n index_1.registerServices(this);\n this.meta = {\n session_id: (+new Date).toString()\n };\n this.config = {\n env: {},\n };\n this.provider = provider_1.default();\n this.exportAPI.logger = this.provider.api.logger;\n }\n getMetaData() {\n return this.meta;\n }\n getAPIs() {\n return Object.assign({}, this.exportAPI);\n }\n init(config = {}) {\n if (this.inited)\n return;\n this.inited = true;\n this.updateConfig(config);\n }\n updateConfig(config = {}) {\n this.provider.init(Object.assign(Object.assign({}, config), { version: `wx-server-sdk/${version}` }));\n const _config = Object.assign(Object.assign({}, config), { env: type_1.isObject(config.env) ? config.env : { default: config.env } });\n this.config = _config;\n }\n registerService(service) {\n this.services[service.name] = service;\n if (service.getAPIs) {\n const functions = service.getAPIs();\n for (const name in functions) {\n this.registerFunction(name, functions[name], service.initRequired);\n }\n }\n else if (service.getNamespace) {\n const { namespace, apis } = service.getNamespace();\n this.exportAPI[namespace] = apis;\n }\n }\n registerFunction(name, func, initRequired) {\n this.exportAPI[name] = initRequired === false ? func : this.wrapCommonAPICheck(func);\n }\n}\nexports.Cloud = Cloud;\nconst cloud = new Cloud();\nexports.default = cloud;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/index.ts\":\n/*!*****************************************!*\\\n !*** ./src/api/cloud/provider/index.ts ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tcb_1 = __webpack_require__(/*! ./tcb */ \"./src/api/cloud/provider/tcb/index.ts\");\nvar PROVIDER;\n(function (PROVIDER) {\n PROVIDER[PROVIDER[\"TCB\"] = 0] = \"TCB\";\n})(PROVIDER = exports.PROVIDER || (exports.PROVIDER = {}));\nfunction getProvider(provider = PROVIDER.TCB) {\n switch (provider) {\n default: {\n return tcb_1.default;\n }\n }\n}\nexports.default = getProvider;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/callFunction.ts\":\n/*!********************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/callFunction.ts ***!\n \\********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\n// const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms))\nasync function callFunction(options, config) {\n // await sleep()\n /*\n const res = await tcbRequest({\n params: {\n action: 'functions.invokeFunction',\n function_name: options.name,\n request_data: options.dataStr,\n },\n // TODO\n timeout: 5 * 60 * 1000,\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n })\n */\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.callFunction(options);\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: `requestID ${res.requestId}, ${res.message}`,\n requestId: res.requestId,\n };\n }\n else {\n return {\n result: res.result,\n requestId: res.requestId,\n };\n }\n}\nexports.callFunction = callFunction;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/callOpenAPI.ts\":\n/*!*******************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/callOpenAPI.ts ***!\n \\*******************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\n// DEPRECATED\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function callOpenAPI(options, config) {\n await sleep();\n // console.log('wx-server-sdk tcb.callWxOpenApi options: ', options)\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.callWxOpenApi({\n apiName: options.api,\n requestData: options.data,\n event: options.event,\n });\n // console.log('wx-server-sdk tcb.callWxOpenApi res: ', res)\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n result: res.result,\n };\n }\n}\nexports.callOpenAPI = callOpenAPI;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts\":\n/*!*********************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts ***!\n \\*********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ \"./src/config/error.config.ts\");\nconst error_1 = __webpack_require__(/*! ../../../../../utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! ../../../../../utils/msg */ \"./src/utils/msg.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst openapi_1 = __webpack_require__(/*! ../../../../../protobuf/openapi */ \"./src/protobuf/openapi.js\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function callWXOpenAPI(options, config) {\n await sleep();\n let res;\n try {\n // console.log('wx-server-sdk tcb.callWxOpenApi options: ', options)\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n res = await tcbInstance.callCompatibleWxOpenApi({\n apiName: options.api,\n requestData: options.data,\n });\n // console.log('wx-server-sdk tcb.callWxOpenApi res: ', res)\n }\n catch (err) {\n throw {\n errCode: (err && err.code && error_config_1.TCB_ERR_CODE[err.code]) || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: (err && err.message) || err || 'empty error message',\n };\n }\n if (!Buffer.isBuffer(res)) {\n // is object\n // must be error\n // tcb must not return object\n if (res.code && res.hasOwnProperty('message')) {\n // tcb error\n throw new error_1.CloudSDKError({\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: msg_1.apiFailMsg(options.api, res.message)\n });\n }\n if (res.errcode) {\n // wx error\n throw new error_1.CloudSDKError({\n errCode: res.errcode,\n errMsg: msg_1.apiFailMsg(options.api, res.errmsg),\n });\n }\n if (res.byteLength === 0) {\n throw new error_1.CloudSDKError({\n errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: msg_1.apiFailMsg(options.api, `empty response`)\n });\n }\n throw new error_1.CloudSDKError({\n errCode: error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: msg_1.apiFailMsg(options.api, `unknown response ${res}`)\n });\n }\n else {\n // is buffer\n let wxResp;\n try {\n wxResp = openapi_1.CommOpenApiResp.decode(res);\n }\n catch (decodeError) {\n // fail to parse pb, may well be tcb error\n let jsonParseResult;\n try {\n jsonParseResult = JSON.parse(res.toString());\n }\n catch (parseTCBRespError) {\n // unknown error\n throw new error_1.CloudSDKError({\n errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: msg_1.apiFailMsg(options.api, `unknown wx response received: ${decodeError}`)\n });\n }\n if (jsonParseResult.code && jsonParseResult.hasOwnProperty('message')) {\n // tcb error\n throw new error_1.CloudSDKError({\n errCode: error_config_1.TCB_ERR_CODE[jsonParseResult.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: msg_1.apiFailMsg(options.api, jsonParseResult.message)\n });\n }\n else {\n // unknown tcb error\n throw new error_1.CloudSDKError({\n errCode: error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: msg_1.apiFailMsg(options.api, JSON.stringify(jsonParseResult)),\n });\n }\n }\n if (wxResp) {\n if (wxResp.errorCode) {\n // wx system error, for example: no permission\n throw new error_1.CloudSDKError({\n errCode: error_config_2.ERR_CODE[error_config_2.ERR_CODE[wxResp.errorCode]] || wxResp.errorCode,\n errMsg: `${error_config_2.ERR_CODE[error_config_2.ERR_CODE.WX_SYSTEM_ERROR]}: error code: ${wxResp.errorCode}`\n });\n }\n }\n else {\n throw new error_1.CloudSDKError({\n errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: msg_1.apiFailMsg(options.api, `empty wx response buffer`)\n });\n }\n return wxResp;\n }\n}\nexports.callWXOpenAPI = callWXOpenAPI;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/database.ts\":\n/*!****************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/database.ts ***!\n \\****************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tcb = __webpack_require__(/*! tcb-admin-node */ \"tcb-admin-node\");\nconst tcbRequest = __webpack_require__(/*! tcb-admin-node/src/utils/httpRequest */ \"tcb-admin-node/src/utils/httpRequest\");\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nconst mergeConfig = (tcbConfig, config) => {\n const ret = Object.assign({}, tcbConfig);\n if (config.env) {\n // @ts-ignore\n ret.env = config.env;\n }\n return ret;\n};\nasync function addDocument(options, config) {\n // 不得已而 sleep(0),因为 tcb-admin-node 的 httpRequest 在返回 promise 之前竟然有逻辑可能抛错 !!!!!\n await sleep();\n const res = await tcbRequest({\n params: {\n action: 'database.addDocument',\n _id: options._id,\n collectionName: options.collectionName,\n data: options.data,\n },\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n });\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n _id: res.data._id,\n requestId: res.requestId,\n };\n }\n}\nexports.addDocument = addDocument;\nasync function queryDocument(options, config) {\n await sleep();\n const res = await tcbRequest({\n params: Object.assign(Object.assign({}, options), { action: 'database.queryDocument', collectionName: options.collectionName }),\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n });\n if (res.code) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n list: res.data.list || [],\n limit: res.Limit,\n offset: res.Offset,\n total: res.TotalCount,\n requestId: res.requestId,\n };\n }\n}\nexports.queryDocument = queryDocument;\nasync function updateDocument(options, config) {\n await sleep();\n const res = await tcbRequest({\n params: Object.assign(Object.assign({}, options), { action: 'database.updateDocument', collectionName: options.collectionName }),\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n });\n if (res.code) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n updated: res.data.updated,\n upsertedId: res.data.upserted_id,\n requestId: res.requestId,\n };\n }\n}\nexports.updateDocument = updateDocument;\nasync function removeDocument(options, config) {\n await sleep();\n const res = await tcbRequest({\n params: Object.assign(Object.assign({}, options), { action: 'database.removeDocument', collectionName: options.collectionName }),\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n });\n if (res.code) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n removed: res.deleted,\n requestId: res.requestId,\n };\n }\n}\nexports.removeDocument = removeDocument;\nasync function countDocument(options, config) {\n await sleep();\n const res = await tcbRequest({\n params: Object.assign(Object.assign({}, options), { action: 'database.countDocument', collectionName: options.collectionName }),\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n });\n if (res.code) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n total: res.data.total,\n requestId: res.requestId,\n };\n }\n}\nexports.countDocument = countDocument;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/deleteFile.ts\":\n/*!******************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/deleteFile.ts ***!\n \\******************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ \"./src/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function deleteFile(options, config) {\n await sleep();\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.deleteFile({\n fileList: options.fileList\n });\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n const fileList = (res.fileList || []).filter((s) => Boolean(s)).map((f) => {\n if (f.code && error_config_1.TCB_ERR_CODE[f.code] !== 0) {\n const code = error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR;\n return {\n fileID: f.fileID,\n status: error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: error_config_2.ERR_CODE[code]\n };\n }\n return {\n fileID: f.fileID,\n status: 0,\n errMsg: 'ok',\n };\n });\n //@ts-ignore\n return {\n fileList: fileList,\n requestId: res.requestId,\n };\n }\n}\nexports.deleteFile = deleteFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/downloadFile.ts\":\n/*!********************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/downloadFile.ts ***!\n \\********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function downloadFile(options, config) {\n await sleep();\n const statusCode = 200;\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.downloadFile({\n fileID: options.fileID\n });\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n return {\n statusCode: statusCode,\n fileContent: res.fileContent,\n };\n}\nexports.downloadFile = downloadFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/getTempFileURL.ts\":\n/*!**********************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/getTempFileURL.ts ***!\n \\**********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ \"./src/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function getTempFileURL(options, config) {\n await sleep();\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.getTempFileURL({\n fileList: options.fileList,\n });\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n const fileList = (res.fileList || []).filter((s) => Boolean(s)).map((f, i) => {\n if (f.code && error_config_1.TCB_ERR_CODE[f.code] !== 0) {\n const code = error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR;\n return {\n fileID: f.fileID,\n status: error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: error_config_2.ERR_CODE[code],\n maxAge: f.maxAge,\n tempFileURL: '',\n };\n }\n return {\n fileID: f.fileID,\n status: 0,\n errMsg: 'ok',\n maxAge: f.maxAge,\n tempFileURL: f.tempFileURL,\n };\n });\n return {\n fileList: fileList,\n requestId: res.requestId,\n };\n }\n}\nexports.getTempFileURL = getTempFileURL;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/uploadFile.ts\":\n/*!******************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/uploadFile.ts ***!\n \\******************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function uploadFile(options, config) {\n await sleep();\n let statusCode = -1;\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.uploadFile({\n cloudPath: options.cloudPath,\n fileContent: options.fileContent,\n }, {\n onResponseReceived(resp) {\n statusCode = resp ? resp.statusCode : statusCode;\n }\n });\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n //@ts-ignore\n return {\n fileID: res.fileID,\n requestId: res.requestId,\n statusCode,\n };\n }\n}\nexports.uploadFile = uploadFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/config/error.config.ts\":\n/*!***********************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/config/error.config.ts ***!\n \\***********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\n// provider should also register the error codes in src/config/error.config.ts\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TCB_ERR_CODE = {\n // 通用\n SUCCESS: 0,\n SYS_ERR: -501001,\n SERVER_TIMEOUT: -501002,\n EXCEED_REQUEST_LIMIT: -501003,\n EXCEED_CONCURRENT_REQUEST_LIMIT: -501004,\n INVALIID_ENV: -501005,\n INVALID_COMMON_PARAM: -501006,\n INVALID_PARAM: -501007,\n INVALID_REQUEST_SOURCE: -501008,\n RESOURCE_NOT_INITIAL: -501009,\n // 数据库\n DATABASE_REQUEST_FAILED: -502001,\n DATABASE_INVALID_OPERRATOR: -502002,\n DATABASE_PERMISSION_DENIED: -502003,\n DATABASE_COLLECTION_EXCEED_LIMIT: -502004,\n DATABASE_COLLECTION_NOT_EXIST: -502005,\n // 文件\n STORAGE_REQUEST_FAIL: -503001,\n STORAGE_EXCEED_AUTHORITY: -503002,\n STORAGE_FILE_NONEXIST: -503003,\n STORAGE_SIGN_PARAM_INVALID: -503004,\n // 云函数\n FUNCTIONS_REQUEST_FAIL: -504001,\n FUNCTIONS_EXECUTE_FAIL: -504002,\n};\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/index.ts\":\n/*!*********************************************!*\\\n !*** ./src/api/cloud/provider/tcb/index.ts ***!\n \\*********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tcb = __webpack_require__(/*! tcb-admin-node */ \"tcb-admin-node\");\nconst tcbRequest = __webpack_require__(/*! tcb-admin-node/src/utils/httpRequest */ \"tcb-admin-node/src/utils/httpRequest\");\nconst database_1 = __webpack_require__(/*! ./api/database */ \"./src/api/cloud/provider/tcb/api/database.ts\");\nconst callFunction_1 = __webpack_require__(/*! ./api/callFunction */ \"./src/api/cloud/provider/tcb/api/callFunction.ts\");\nconst downloadFile_1 = __webpack_require__(/*! ./api/downloadFile */ \"./src/api/cloud/provider/tcb/api/downloadFile.ts\");\nconst uploadFile_1 = __webpack_require__(/*! ./api/uploadFile */ \"./src/api/cloud/provider/tcb/api/uploadFile.ts\");\nconst deleteFile_1 = __webpack_require__(/*! ./api/deleteFile */ \"./src/api/cloud/provider/tcb/api/deleteFile.ts\");\nconst getTempFileURL_1 = __webpack_require__(/*! ./api/getTempFileURL */ \"./src/api/cloud/provider/tcb/api/getTempFileURL.ts\");\nconst callOpenAPI_1 = __webpack_require__(/*! ./api/callOpenAPI */ \"./src/api/cloud/provider/tcb/api/callOpenAPI.ts\");\nconst callWXOpenAPI_1 = __webpack_require__(/*! ./api/callWXOpenAPI */ \"./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts\");\nconst provider = {\n // init\n init: (config) => {\n tcb.init(Object.assign(Object.assign({}, config), { isHttp: process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF' }));\n },\n get config() {\n return tcb.config;\n },\n // request\n sendRequest: async function (options) {\n return tcbRequest(Object.assign({ config: tcb.config, params: options.data }, options));\n },\n // api\n api: {\n addDocument: database_1.addDocument,\n queryDocument: database_1.queryDocument,\n updateDocument: database_1.updateDocument,\n removeDocument: database_1.removeDocument,\n countDocument: database_1.countDocument,\n callFunction: callFunction_1.callFunction,\n downloadFile: downloadFile_1.downloadFile,\n uploadFile: uploadFile_1.uploadFile,\n deleteFile: deleteFile_1.deleteFile,\n getTempFileURL: getTempFileURL_1.getTempFileURL,\n callOpenAPI: callOpenAPI_1.callOpenAPI,\n callWXOpenAPI: callWXOpenAPI_1.callWXOpenAPI,\n logger: tcb.logger,\n }\n};\nexports.default = provider;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/utils/instance.ts\":\n/*!******************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/utils/instance.ts ***!\n \\******************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tcb = __webpack_require__(/*! tcb-admin-node */ \"tcb-admin-node\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nconst symbol_config_1 = __webpack_require__(/*! config/symbol.config */ \"./src/config/symbol.config.ts\");\nexports.getInstance = (config = {}) => {\n if (process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {\n // @ts-ignore\n const instance = tcb.init(Object.assign(Object.assign({}, config), { env: utils_1.translateEnv(config.env), isHttp: true }));\n instance.config.secretId = undefined;\n instance.config.secretKey = undefined;\n instance.config.sessionToken = undefined;\n return instance;\n }\n else {\n // @ts-ignore\n const instance = tcb.init(Object.assign(Object.assign({}, config), { env: utils_1.translateEnv(config.env) }));\n instance.config.secretId = undefined;\n instance.config.secretKey = undefined;\n instance.config.sessionToken = undefined;\n return instance;\n }\n};\nexports.fixInstance = (instance, env) => {\n instance = instance || tcb;\n if (env) {\n instance.config.envName = utils_1.translateEnv(env);\n }\n else if (instance.config.envName === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {\n instance.config.envName = utils_1.translateEnv(instance.config.envName);\n }\n if (process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {\n instance.config.secretId = undefined;\n instance.config.secretKey = undefined;\n instance.config.sessionToken = undefined;\n instance.config.isHttp = true;\n }\n};\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/api.ts\":\n/*!*************************************!*\\\n !*** ./src/api/database/api/api.ts ***!\n \\*************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst database_1 = __webpack_require__(/*! ./database */ \"./src/api/database/api/database.ts\");\nfunction getAPIs(cloud) {\n return {\n database: database_1.default.bind(null, cloud),\n };\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database.ts\":\n/*!******************************************!*\\\n !*** ./src/api/database/api/database.ts ***!\n \\******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst collection_1 = __webpack_require__(/*! ./database/collection */ \"./src/api/database/api/database/collection.ts\");\nconst transaction_1 = __webpack_require__(/*! ./database/transaction/transaction */ \"./src/api/database/api/database/transaction/transaction.ts\");\nconst geo_1 = __webpack_require__(/*! ./database/geo/geo */ \"./src/api/database/api/database/geo/geo.ts\");\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst error_checker_1 = __webpack_require__(/*! ./database/helper/error-checker */ \"./src/api/database/api/database/helper/error-checker.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../api/cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst symbol_config_1 = __webpack_require__(/*! config/symbol.config */ \"./src/config/symbol.config.ts\");\nfunction getDatabase(cloud, config) {\n const Database = getDatabaseClass(cloud);\n return new Database(config);\n}\nexports.default = getDatabase;\nconst getDatabaseClass = (cloud) => {\n return class Database {\n constructor(config = {}) {\n this.runTransaction = (run, retryTimes) => {\n return transaction_1.runTransaction.call(this, run, retryTimes);\n };\n this.cloud = cloud;\n this.config = config;\n if (config.env) {\n assert_1.assertType(config.env, 'string');\n }\n else if (cloud.config.env) {\n if (cloud.config.env === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {\n config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;\n }\n else if (cloud.config.env.database === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {\n config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;\n }\n else if (!cloud.config.env.database && cloud.config.env.default === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {\n config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;\n }\n }\n this._instance = instance_1.getInstance(Object.assign(Object.assign({}, utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'database')), config));\n this._db = this._instance.database();\n this.command = this._db.command;\n this.Geo = geo_1.initGeo(this._db.Geo);\n this.serverDate = this._db.serverDate;\n this.RegExp = this._db.RegExp;\n }\n collection(collectionName) {\n return new collection_1.CollectionReference(this._db.collection(collectionName), collectionName, this);\n }\n startTransaction() {\n return transaction_1.startTransaction.call(this);\n }\n async createCollection(collectionName) {\n const apiName = 'createCollection';\n try {\n const result = await this._db.createCollection(collectionName);\n error_checker_1.checkError(result);\n return {\n errMsg: msg_1.apiSuccessMsg(apiName),\n requestId: result.requestId,\n };\n }\n catch (e) {\n throw error_1.returnAsFinalCloudSDKError(e, apiName);\n }\n }\n };\n};\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/aggregate.ts\":\n/*!****************************************************!*\\\n !*** ./src/api/database/api/database/aggregate.ts ***!\n \\****************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ \"./src/api/database/api/database/helper/error-checker.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nvar ORDER_DIRECTION;\n(function (ORDER_DIRECTION) {\n ORDER_DIRECTION[\"ASC\"] = \"asc\";\n ORDER_DIRECTION[\"DESC\"] = \"desc\";\n})(ORDER_DIRECTION = exports.ORDER_DIRECTION || (exports.ORDER_DIRECTION = {}));\nclass Aggregate {\n constructor(_aggregate, collectionName, database) {\n this._aggregate = _aggregate;\n this.collectionName = collectionName;\n this.database = database;\n }\n pushStage(stage, val) {\n return new Aggregate(this._aggregate[stage](val), this.collectionName, this.database);\n }\n addFields(val) {\n return this.pushStage('addFields', val);\n }\n bucket(val) {\n return this.pushStage('bucket', val);\n }\n bucketAuto(val) {\n return this.pushStage('bucketAuto', val);\n }\n collStats(val) {\n return this.pushStage('collStats', val);\n }\n count(val) {\n return this.pushStage('count', val);\n }\n facet(val) {\n return this.pushStage('facet', val);\n }\n geoNear(val) {\n return this.pushStage('geoNear', val);\n }\n graphLookup(val) {\n return this.pushStage('graphLookup', val);\n }\n group(val) {\n return this.pushStage('group', val);\n }\n indexStats() {\n return this.pushStage('indexStats', {});\n }\n limit(val) {\n return this.pushStage('limit', val);\n }\n lookup(val) {\n return this.pushStage('lookup', val);\n }\n match(val) {\n return this.pushStage('match', val);\n }\n out(val) {\n return this.pushStage('out', val);\n }\n project(val) {\n return this.pushStage('project', val);\n }\n redact(val) {\n return this.pushStage('redact', val);\n }\n replaceRoot(val) {\n return this.pushStage('replaceRoot', val);\n }\n sample(val) {\n return this.pushStage('sample', val);\n }\n skip(val) {\n return this.pushStage('skip', val);\n }\n sort(val) {\n return this.pushStage('sort', val);\n }\n sortByCount(val) {\n return this.pushStage('sortByCount', val);\n }\n unwind(val) {\n return this.pushStage('unwind', val);\n }\n end() {\n const apiName = 'collection.aggregate';\n return new Promise(async (resolve, reject) => {\n try {\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const result = await this._aggregate.end();\n error_checker_1.checkError(result);\n resolve({\n list: result.data,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(err, apiName));\n }\n });\n }\n}\nexports.Aggregate = Aggregate;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/collection.ts\":\n/*!*****************************************************!*\\\n !*** ./src/api/database/api/database/collection.ts ***!\n \\*****************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst query_1 = __webpack_require__(/*! ./query */ \"./src/api/database/api/database/query.ts\");\nconst document_1 = __webpack_require__(/*! ./document */ \"./src/api/database/api/database/document.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ \"./src/api/database/api/database/helper/error-checker.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst aggregate_1 = __webpack_require__(/*! ./aggregate */ \"./src/api/database/api/database/aggregate.ts\");\nclass CollectionReference extends query_1.Query {\n constructor(_collection, collectionName, database) {\n super(_collection, collectionName, database);\n this._collection = _collection;\n this.collectionName = collectionName;\n this.database = database;\n }\n doc(docId) {\n return new document_1.DocumentReference(this._collection.doc(docId), this, docId, this.database);\n }\n add(options) {\n const apiName = 'collection.add';\n return new Promise(async (resolve, reject) => {\n try {\n assert_1.assertType(options, {\n data: 'object'\n });\n assert_1.assertObjectNotEmpty({\n name: 'options.data',\n target: options.data,\n });\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const addResult = await this._collection.add(options.data);\n error_checker_1.checkError(addResult);\n resolve({\n _id: addResult.id,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));\n }\n });\n }\n aggregate() {\n return new aggregate_1.Aggregate(this._collection.aggregate(), this.collectionName, this.database);\n }\n}\nexports.CollectionReference = CollectionReference;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/document.ts\":\n/*!***************************************************!*\\\n !*** ./src/api/database/api/database/document.ts ***!\n \\***************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ \"./src/api/database/api/database/helper/error-checker.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst GET_API_NAME = 'document.get';\nconst UPDATE_API_NAME = 'document.update';\nconst SET_API_NAME = 'document.set';\nconst REMOVE_API_NAME = 'document.remove';\nclass DocumentReference {\n constructor(_document, collection, docId, database) {\n this._document = _document;\n this.collection = collection;\n this.database = database;\n this._id = docId;\n }\n field(object) {\n assert_1.assertRequiredParam(object, 'object', 'field');\n assert_1.assertType(object, 'object', 'field');\n return new DocumentReference(this._document.field(object), this.collection, this._id, this.database);\n }\n get() {\n return new Promise(async (resolve, reject) => {\n try {\n const throwOnNotFound = this.database.config.hasOwnProperty('throwOnNotFound') ? Boolean(this.database.config.throwOnNotFound) : true;\n const _id = this._id;\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const queryResult = await this._document.get();\n error_checker_1.checkError(queryResult);\n // in normal doc.get, queryResult.data is array, in transaction, it is object instead\n if (!queryResult.data || (Array.isArray(queryResult.data) && !queryResult.data.length)) {\n if (throwOnNotFound) {\n throw `document with _id ${_id} does not exist`;\n }\n else {\n resolve({\n data: null,\n errMsg: msg_1.apiSuccessMsg(GET_API_NAME),\n });\n }\n }\n else {\n resolve({\n data: Array.isArray(queryResult.data) ? queryResult.data[0] : queryResult.data,\n errMsg: msg_1.apiSuccessMsg(GET_API_NAME),\n });\n }\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), GET_API_NAME));\n }\n });\n }\n set(options) {\n return new Promise(async (resolve, reject) => {\n try {\n assert_1.assertType(options, {\n data: 'object',\n });\n assert_1.assertObjectNotEmpty({\n name: 'options.data',\n target: options.data,\n });\n const _id = this._id;\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const setResult = await this._document.set(options.data);\n error_checker_1.checkError(setResult);\n resolve({\n _id,\n errMsg: msg_1.apiSuccessMsg(SET_API_NAME),\n stats: {\n updated: setResult.updated,\n created: setResult.upsertedId ? 1 : 0,\n }\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), SET_API_NAME));\n }\n });\n }\n update(options) {\n return new Promise(async (resolve, reject) => {\n try {\n assert_1.assertType(options, {\n data: 'object',\n });\n assert_1.assertObjectNotEmpty({\n name: 'options.data',\n target: options.data,\n });\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const updateResult = await this._document.update(options.data);\n error_checker_1.checkError(updateResult);\n resolve({\n stats: {\n updated: updateResult.updated,\n },\n errMsg: msg_1.apiSuccessMsg(UPDATE_API_NAME),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), UPDATE_API_NAME));\n }\n });\n }\n remove(options) {\n return new Promise(async (resolve, reject) => {\n try {\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n // normal doc.remove -> _doc.remove\n // transaction doc.remove -> _doc.delete\n const removeResult = await (this._document.remove ? this._document.remove() : this._document.delete());\n error_checker_1.checkError(removeResult);\n resolve({\n stats: {\n removed: removeResult.deleted || 0,\n },\n errMsg: msg_1.apiSuccessMsg(REMOVE_API_NAME),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), REMOVE_API_NAME));\n }\n });\n }\n}\nexports.DocumentReference = DocumentReference;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/geo/geo.ts\":\n/*!**************************************************!*\\\n !*** ./src/api/database/api/database/geo/geo.ts ***!\n \\**************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.initGeo = (_geo) => {\n const Geo = {};\n for (const key in _geo) {\n if (_geo.hasOwnProperty(key)) {\n if (typeof _geo[key] === 'function') {\n Geo[key] = function () {\n return new _geo[key](...arguments);\n };\n }\n else {\n Geo[key] = _geo[key];\n }\n }\n }\n return Geo;\n};\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/helper/error-checker.ts\":\n/*!***************************************************************!*\\\n !*** ./src/api/database/api/database/helper/error-checker.ts ***!\n \\***************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst error_config_1 = __webpack_require__(/*! api/cloud/provider/tcb/config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nfunction checkError(tcbResult) {\n if (tcbResult && tcbResult.code) {\n throw error_1.returnAsCloudSDKError({\n errCode: error_config_1.TCB_ERR_CODE[tcbResult.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: tcbResult.message,\n });\n }\n}\nexports.checkError = checkError;\nfunction maybeTransformError(maybeTcbError) {\n if (maybeTcbError && maybeTcbError.code) {\n return {\n errCode: error_config_1.TCB_ERR_CODE[maybeTcbError.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: maybeTcbError.message,\n };\n }\n return maybeTcbError;\n}\nexports.maybeTransformError = maybeTransformError;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/query.ts\":\n/*!************************************************!*\\\n !*** ./src/api/database/api/database/query.ts ***!\n \\************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ \"./src/api/database/api/database/helper/error-checker.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nvar ORDER_DIRECTION;\n(function (ORDER_DIRECTION) {\n ORDER_DIRECTION[\"ASC\"] = \"asc\";\n ORDER_DIRECTION[\"DESC\"] = \"desc\";\n})(ORDER_DIRECTION = exports.ORDER_DIRECTION || (exports.ORDER_DIRECTION = {}));\nclass Query {\n constructor(_query, collectionName, database) {\n this._query = _query;\n this.collectionName = collectionName;\n this.database = database;\n }\n field(object) {\n return new Query(this._query.field(object), this.collectionName, this.database);\n }\n where(condition) {\n return new Query(this._query.where(condition), this.collectionName, this.database);\n }\n orderBy(fieldPath, order) {\n return new Query(this._query.orderBy(fieldPath, order), this.collectionName, this.database);\n }\n limit(max) {\n return new Query(this._query.limit(max), this.collectionName, this.database);\n }\n skip(offset) {\n return new Query(this._query.skip(offset), this.collectionName, this.database);\n }\n get(options) {\n const apiName = 'collection.get';\n return new Promise(async (resolve, reject) => {\n try {\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const queryResult = await this._query.get();\n error_checker_1.checkError(queryResult);\n resolve({\n data: queryResult.data,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));\n }\n });\n }\n update(options) {\n const apiName = 'collection.update';\n return new Promise(async (resolve, reject) => {\n try {\n assert_1.assertType(options, {\n data: 'object',\n });\n assert_1.assertObjectNotEmpty({\n name: 'options.data',\n target: options.data,\n });\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const updateResult = await this._query.update(options.data);\n error_checker_1.checkError(updateResult);\n resolve({\n stats: {\n updated: updateResult.updated || 0,\n },\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));\n }\n });\n }\n remove(options) {\n const apiName = 'collection.remove';\n return new Promise(async (resolve, reject) => {\n try {\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const removeResult = await this._query.remove();\n error_checker_1.checkError(removeResult);\n resolve({\n stats: {\n removed: removeResult.deleted,\n },\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));\n }\n });\n }\n count(options) {\n const apiName = 'collection.count';\n return new Promise(async (resolve, reject) => {\n try {\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const queryResult = await this._query.count();\n error_checker_1.checkError(queryResult);\n resolve({\n total: queryResult.total,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));\n }\n });\n }\n}\nexports.Query = Query;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/transaction/transaction.ts\":\n/*!******************************************************************!*\\\n !*** ./src/api/database/api/database/transaction/transaction.ts ***!\n \\******************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst collection_1 = __webpack_require__(/*! ../collection */ \"./src/api/database/api/database/collection.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../../cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nclass Transaction {\n constructor(transaction, db) {\n this._transaction = transaction;\n this._db = db;\n }\n async init() {\n return this._transaction.init();\n }\n collection(collName) {\n if (!collName) {\n throw new Error('Collection name is required');\n }\n return new collection_1.CollectionReference(this._transaction.collection(collName), collName, this._db);\n }\n async commit() {\n try {\n return this._transaction.commit();\n }\n catch (e) {\n throw error_1.returnAsFinalCloudSDKError(e, `transaction.commit`);\n }\n }\n async rollback(reason) {\n try {\n return this._transaction.rollback(reason);\n }\n catch (e) {\n throw error_1.returnAsFinalCloudSDKError(e, `transaction.rollback`);\n }\n }\n}\nexports.Transaction = Transaction;\nasync function runTransaction(callback, times = 3) {\n instance_1.fixInstance(this._instance, this.config.env);\n return this._db.runTransaction((_transaction) => {\n const transaction = new Transaction(_transaction, this);\n return callback(transaction);\n }, times);\n}\nexports.runTransaction = runTransaction;\nasync function startTransaction() {\n instance_1.fixInstance(this._instance, this.config.env);\n const _transaction = await this._db.startTransaction();\n return new Transaction(_transaction, this);\n}\nexports.startTransaction = startTransaction;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/index.ts\":\n/*!***********************************!*\\\n !*** ./src/api/database/index.ts ***!\n \\***********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst api_1 = __webpack_require__(/*! ./api/api */ \"./src/api/database/api/api.ts\");\nexports.DATABASE_SERVICE_NAME = 'database';\nfunction createDatabaseService(cloud) {\n return {\n name: exports.DATABASE_SERVICE_NAME,\n getAPIs: api_1.getAPIs.bind(null, cloud),\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createDatabaseService(cloud));\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/api/functions/api/api.ts\":\n/*!**************************************!*\\\n !*** ./src/api/functions/api/api.ts ***!\n \\**************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst callFunction_1 = __webpack_require__(/*! ./callFunction */ \"./src/api/functions/api/callFunction.ts\");\nfunction getAPIs(cloud) {\n return {\n callFunction: callFunction_1.default(cloud),\n };\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/functions/api/callFunction.ts\":\n/*!***********************************************!*\\\n !*** ./src/api/functions/api/callFunction.ts ***!\n \\***********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getCallFunction(cloud) {\n return function callFunction(options) {\n const apiName = 'callFunction';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for callFunction must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n name: 'string'\n });\n if (options.hasOwnProperty('data')) {\n assert_1.assertType(options, {\n data: 'object'\n });\n }\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n try {\n const result = await cloud.provider.api.callFunction({\n name: options.name,\n data: options.data || {},\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'functions'),\n apiConfig: options.config,\n });\n let parsedResult = result.result;\n try {\n if (typeof parsedResult === 'string') {\n parsedResult = JSON.parse(result.result);\n }\n }\n catch (_) {\n // no nothing\n }\n return resolve({\n result: parsedResult,\n errMsg: msg_1.apiSuccessMsg(apiName),\n requestID: result.requestId,\n });\n }\n catch (e) {\n const error = error_1.returnAsFinalCloudSDKError(e, apiName);\n // @ts-ignore\n error.requestID = e.requestID;\n return reject(error);\n }\n });\n };\n}\nexports.default = getCallFunction;\n\n\n/***/ }),\n\n/***/ \"./src/api/functions/index.ts\":\n/*!************************************!*\\\n !*** ./src/api/functions/index.ts ***!\n \\************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst api_1 = __webpack_require__(/*! ./api/api */ \"./src/api/functions/api/api.ts\");\nexports.FUNCTIONS_SERVICE_NAME = 'functions';\nfunction createFunctionsService(cloud) {\n return {\n name: exports.FUNCTIONS_SERVICE_NAME,\n getAPIs: api_1.getAPIs.bind(null, cloud),\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createFunctionsService(cloud));\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/api/index.ts\":\n/*!**************************!*\\\n !*** ./src/api/index.ts ***!\n \\**************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst database_1 = __webpack_require__(/*! ./database */ \"./src/api/database/index.ts\");\nconst storage_1 = __webpack_require__(/*! ./storage */ \"./src/api/storage/index.ts\");\nconst functions_1 = __webpack_require__(/*! ./functions */ \"./src/api/functions/index.ts\");\nconst open_1 = __webpack_require__(/*! ./open */ \"./src/api/open/index.ts\");\nconst utils_1 = __webpack_require__(/*! ./utils */ \"./src/api/utils/index.ts\");\nconst openapi_1 = __webpack_require__(/*! ./openapi */ \"./src/api/openapi/index.ts\");\nfunction registerServices(cloud) {\n database_1.registerService(cloud);\n storage_1.registerService(cloud);\n functions_1.registerService(cloud);\n open_1.registerService(cloud);\n utils_1.registerService(cloud);\n openapi_1.registerService(cloud);\n}\nexports.registerServices = registerServices;\n\n\n/***/ }),\n\n/***/ \"./src/api/open/api/api.ts\":\n/*!*********************************!*\\\n !*** ./src/api/open/api/api.ts ***!\n \\*********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst callOpenAPI_1 = __webpack_require__(/*! ./callOpenAPI */ \"./src/api/open/api/callOpenAPI.ts\");\nconst getOpenData_1 = __webpack_require__(/*! ./getOpenData */ \"./src/api/open/api/getOpenData.ts\");\nconst getVoIPSign_1 = __webpack_require__(/*! ./getVoIPSign */ \"./src/api/open/api/getVoIPSign.ts\");\nfunction getAPIs(cloud) {\n return {\n callOpenAPI: callOpenAPI_1.default(cloud),\n getOpenData: getOpenData_1.default(cloud),\n getVoIPSign: getVoIPSign_1.default(cloud),\n };\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/open/api/callOpenAPI.ts\":\n/*!*****************************************!*\\\n !*** ./src/api/open/api/callOpenAPI.ts ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\n// THIS IS THE LEGACY CALLOPENAPI, TO BE DEPRECATED\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getCallOpenAPI(cloud) {\n return function callOpenAPI(options) {\n const apiName = 'callOpenAPI';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for callOpenAPI must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n api: 'string'\n });\n if (options.data) {\n assert_1.assertType(options, {\n data: 'object'\n });\n }\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n try {\n const result = await cloud.provider.api.callOpenAPI({\n api: options.api,\n data: options.data || {},\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),\n apiConfig: options.config,\n });\n let parsedResult = result.result;\n try {\n if (typeof parsedResult === 'string') {\n parsedResult = JSON.parse(result.result);\n }\n }\n catch (_) {\n // no nothing\n }\n return resolve({\n result: parsedResult,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (e) {\n const error = error_1.returnAsFinalCloudSDKError(e, apiName);\n return reject(error);\n }\n });\n };\n}\nexports.default = getCallOpenAPI;\n\n\n/***/ }),\n\n/***/ \"./src/api/open/api/getOpenData.ts\":\n/*!*****************************************!*\\\n !*** ./src/api/open/api/getOpenData.ts ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ \"./src/protobuf/openapi.js\");\nconst error_config_1 = __webpack_require__(/*! config/error.config */ \"./src/config/error.config.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nconst API_NAME = 'getOpenData';\nfunction getGetOpenData(cloud) {\n return function getOpenData(options) {\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for getOpenData must be an object instead of ' + typeof options,\n }, API_NAME));\n }\n try {\n if (!options.list) {\n throw new Error('list must be provided');\n }\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, API_NAME));\n }\n try {\n const getOpenDataReqBuffer = openapi_1.ApiGetOpenDataByCloudIdReq.encode({\n cloudidList: options.list,\n }).finish();\n const svrkitData = {\n apiName: 'ApiGetOpenDataByCloudId',\n reqData: getOpenDataReqBuffer,\n };\n const pbMessage = openapi_1.CommApiData.encode({\n apiType: openapi_1.CommApiData.ApiType.SVRKIT_API,\n svrkitData,\n }).finish();\n const wxResp = await cloud.provider.api.callWXOpenAPI({\n api: 'ApiGetOpenDataByCloudId',\n data: Buffer.from(pbMessage),\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),\n apiConfig: options.config,\n });\n if (wxResp.svrkitErrorCode !== 0) {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal svrkit error, code ${wxResp.svrkitErrorCode}`,\n };\n }\n if (!wxResp.respData) {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal svrkit error, empty respData`,\n };\n }\n const pbRespMsg = openapi_1.ApiGetOpenDataByCloudIdResp.decode(wxResp.respData);\n // const svrkitResponse = GetOpenDataRespMessage.toObject(pbRespMsg, {\n // longs: String,\n // })\n const openDataList = pbRespMsg.dataList.map(item => {\n if (!item.json) {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal svrkit error, empty openData json field for ${item.cloudId}`,\n };\n }\n return JSON.parse(item.json);\n });\n resolve({\n list: openDataList,\n errMsg: msg_1.apiSuccessMsg(API_NAME),\n errCode: 0,\n });\n }\n catch (e) {\n const error = error_1.returnAsFinalCloudSDKError(e, API_NAME);\n return reject(error);\n }\n });\n };\n}\nexports.default = getGetOpenData;\n\n\n/***/ }),\n\n/***/ \"./src/api/open/api/getVoIPSign.ts\":\n/*!*****************************************!*\\\n !*** ./src/api/open/api/getVoIPSign.ts ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ \"./src/protobuf/openapi.js\");\nconst error_config_1 = __webpack_require__(/*! config/error.config */ \"./src/config/error.config.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nconst API_NAME = 'getVoIPSign';\nfunction getGetVoIPSign(cloud) {\n return function getVoIPSign(options) {\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for getVoIPSign must be an object instead of ' + typeof options,\n }, API_NAME));\n }\n try {\n assert_1.assertType(options, {\n groupId: 'string',\n timestamp: 'number',\n nonce: 'string',\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, API_NAME));\n }\n try {\n const getVoIPSignReqBuffer = openapi_1.ApiVoipSignReq.encode({\n groupId: options.groupId,\n timestamp: options.timestamp,\n nonce: options.nonce,\n }).finish();\n const svrkitData = {\n apiName: 'ApiVoipSign',\n reqData: getVoIPSignReqBuffer,\n };\n const pbMessage = openapi_1.CommApiData.encode({\n apiType: openapi_1.CommApiData.ApiType.SVRKIT_API,\n svrkitData,\n }).finish();\n const wxResp = await cloud.provider.api.callWXOpenAPI({\n api: 'ApiVoipSign',\n data: Buffer.from(pbMessage),\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),\n apiConfig: options.config,\n });\n if (wxResp.svrkitErrorCode !== 0) {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal svrkit error, code ${wxResp.svrkitErrorCode}`,\n };\n }\n if (!wxResp.respData) {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal svrkit error, empty respData`,\n };\n }\n const pbRespMsg = openapi_1.ApiVoipSignResp.decode(wxResp.respData);\n resolve({\n signature: pbRespMsg.signature,\n errMsg: msg_1.apiSuccessMsg(API_NAME),\n errCode: 0,\n });\n }\n catch (e) {\n const error = error_1.returnAsFinalCloudSDKError(e, API_NAME);\n return reject(error);\n }\n });\n };\n}\nexports.default = getGetVoIPSign;\n\n\n/***/ }),\n\n/***/ \"./src/api/open/index.ts\":\n/*!*******************************!*\\\n !*** ./src/api/open/index.ts ***!\n \\*******************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst api_1 = __webpack_require__(/*! ./api/api */ \"./src/api/open/api/api.ts\");\nconst OPEN_SERVICE_NAME = 'open';\nfunction createOpenService(cloud) {\n return {\n name: OPEN_SERVICE_NAME,\n getAPIs: api_1.getAPIs.bind(null, cloud),\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createOpenService(cloud));\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/api/openapi/index.ts\":\n/*!**********************************!*\\\n !*** ./src/api/openapi/index.ts ***!\n \\**********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst namespace_1 = __webpack_require__(/*! ./namespace */ \"./src/api/openapi/namespace/index.ts\");\nexports.OPENAPI_SERVICE_NAME = 'openapi';\nexports.OPENAPI_SERVICE_NAMESPACE_NAME = 'openapi';\nfunction createStorageService(cloud) {\n return {\n name: exports.OPENAPI_SERVICE_NAME,\n getNamespace: () => {\n return {\n namespace: exports.OPENAPI_SERVICE_NAMESPACE_NAME,\n apis: namespace_1.getAPIs(cloud),\n };\n },\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createStorageService(cloud));\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/api/openapi/namespace/generic.ts\":\n/*!**********************************************!*\\\n !*** ./src/api/openapi/namespace/generic.ts ***!\n \\**********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ \"./src/protobuf/openapi.js\");\nconst type_1 = __webpack_require__(/*! ../../../utils/type */ \"./src/utils/type.ts\");\nconst error_1 = __webpack_require__(/*! ../../../utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! ../../../utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! ../../../utils/utils */ \"./src/utils/utils.ts\");\nconst mimetype_1 = __webpack_require__(/*! ../../../utils/mimetype */ \"./src/utils/mimetype.ts\");\nconst error_config_1 = __webpack_require__(/*! ../../../config/error.config */ \"./src/config/error.config.ts\");\nconst functionIntrinsicProperties = new Set(Object.getOwnPropertyNames(Function.prototype));\nconst getCallableObject = (options) => {\n const f = function () { };\n return new Proxy(f, {\n get(target, prop) {\n if (functionIntrinsicProperties.has(prop)) {\n // @ts-ignore\n return options.callable[prop];\n }\n else {\n return getCallableObject(Object.assign(Object.assign({}, options), { paths: [...options.paths, prop] }));\n }\n },\n apply(target, thisArg, args) {\n return options.callable.call(thisArg, options, ...args);\n },\n });\n};\nconst getProxyObject = (options) => {\n const f = () => { };\n const proxy = new Proxy(f, {\n get(target, prop) {\n return getCallableObject(Object.assign(Object.assign({}, options), { paths: [prop] }));\n },\n apply(target, thisArg, args) {\n // set options\n if (!args[0] || !type_1.isObject(args[0])) {\n throw new Error('an options object is expected');\n }\n return getProxyObject(Object.assign(Object.assign({}, args[0]), { \n // some options are not writable\n callable: options.callable, paths: options.paths }));\n }\n });\n return proxy;\n};\nfunction getGenericOpenAPI(cloud) {\n const callable = (innerContext, data) => {\n if (cloud.debug) {\n console.log(`openapi.${innerContext.paths.join('.')} called with data:`, data);\n }\n const api = innerContext.paths.join('.');\n return callWXOpenAPI({\n api,\n data,\n convertCase: innerContext.convertCase,\n });\n };\n return getProxyObject({\n callable: cloud.wrapCommonAPICheck(callable),\n paths: [],\n });\n async function callWXOpenAPI(options) {\n const displayAPIName = `openapi.${options.api}`;\n const shouldConvertCase = options.convertCase !== false;\n try {\n // convert camel case to snake case\n const data = shouldConvertCase ? utils_1.convertCase(options.data, {\n from: 'camelcase',\n to: 'snakecase',\n recursive: true,\n }) : options.data;\n // convert data to pb buffer\n const pairs = [];\n for (const key in data) {\n const val = data[key];\n // check whether it is a form-data item\n if (type_1.isObject(val) && (val.contentType || val.content_type) && val.value && type_1.isBuffer(val.value)) {\n const contentType = (val.contentType || val.content_type).toString();\n const fileExtension = mimetype_1.mimeTypeToFileExtension(contentType);\n if (!fileExtension) {\n console.warn(`[${displayAPIName}] the input param ${key}.contentType is not a valid mime type`);\n }\n let filename = val.fileName;\n if (!filename) {\n filename = `${key}.${fileExtension || 'png'}`;\n }\n pairs.push({\n key,\n value: val.value,\n contentType,\n filename,\n });\n }\n else {\n const valStr = JSON.stringify(val);\n if (valStr !== undefined) {\n pairs.push({\n key,\n value: Buffer.from(valStr),\n });\n }\n }\n }\n const pbMessage = openapi_1.CommApiData.encode({\n apiType: openapi_1.CommApiData.ApiType.OPEN_API,\n openapiData: {\n pairs,\n },\n }).finish();\n const wxResp = await cloud.provider.api.callWXOpenAPI({\n api: options.api,\n data: Buffer.from(pbMessage),\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),\n apiConfig: options.config,\n });\n let result;\n if (wxResp) {\n if (/(application\\/json)|(text\\/plain)/.test(wxResp.contentType)) {\n // json response\n // NOTICE: sometimes the wx sever, for no reason, returns a json with content-type text/plain, and we have to deal with it...\n try {\n result = JSON.parse(wxResp.respData.toString());\n }\n catch (parseWXRespJSONError) {\n // wx server says it's a json but instead it is not a valid json\n // if the content-type is text/plain and is not a valid json, we can safely return the string back\n if (/text\\/plain/.test(wxResp.contentType)) {\n result = {\n result: wxResp.respData.toString()\n };\n }\n else {\n // internal error\n throw new error_1.CloudSDKError({\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: msg_1.apiFailMsg(displayAPIName, `wechat server internal error, response body is invalid json: ${wxResp.respData.toString()}`)\n });\n }\n }\n if (result.errcode) {\n // wx error\n throw new error_1.CloudSDKError({\n errCode: result.errcode,\n errMsg: msg_1.apiFailMsg(displayAPIName, result.errmsg),\n });\n }\n else {\n delete result.errcode;\n delete result.errmsg;\n if (shouldConvertCase) {\n // convert snake case to camel case\n result = utils_1.convertCase(result, {\n from: 'snakecase',\n to: 'camelcase',\n recursive: true,\n });\n }\n }\n }\n else {\n // buffer response\n result = {\n contentType: wxResp.contentType.trim(),\n buffer: wxResp.respData,\n };\n }\n }\n else {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal server error, empty resp buffer`,\n };\n }\n return Object.assign(Object.assign({}, result), { errMsg: msg_1.apiSuccessMsg(displayAPIName), errCode: 0 });\n }\n catch (e) {\n throw error_1.returnAsFinalCloudSDKError(e, displayAPIName);\n }\n }\n}\nexports.default = getGenericOpenAPI;\n\n\n/***/ }),\n\n/***/ \"./src/api/openapi/namespace/index.ts\":\n/*!********************************************!*\\\n !*** ./src/api/openapi/namespace/index.ts ***!\n \\********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst generic_1 = __webpack_require__(/*! ./generic */ \"./src/api/openapi/namespace/generic.ts\");\nfunction getAPIs(cloud) {\n return generic_1.default(cloud);\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/api/api.ts\":\n/*!************************************!*\\\n !*** ./src/api/storage/api/api.ts ***!\n \\************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst uploadFile_1 = __webpack_require__(/*! ./uploadFile */ \"./src/api/storage/api/uploadFile.ts\");\nconst downloadFile_1 = __webpack_require__(/*! ./downloadFile */ \"./src/api/storage/api/downloadFile.ts\");\nconst getTempFileURL_1 = __webpack_require__(/*! ./getTempFileURL */ \"./src/api/storage/api/getTempFileURL.ts\");\nconst deleteFile_1 = __webpack_require__(/*! ./deleteFile */ \"./src/api/storage/api/deleteFile.ts\");\nfunction getAPIs(cloud) {\n return {\n uploadFile: uploadFile_1.default(cloud),\n downloadFile: downloadFile_1.default(cloud),\n getTempFileURL: getTempFileURL_1.default(cloud),\n deleteFile: deleteFile_1.default(cloud),\n };\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/api/deleteFile.ts\":\n/*!*******************************************!*\\\n !*** ./src/api/storage/api/deleteFile.ts ***!\n \\*******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getDeleteFile(cloud) {\n return function deleteFile(options) {\n const apiName = 'deleteFile';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for deleteFile must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n fileList: 'array'\n });\n options.fileList.forEach((f, i) => {\n if (typeof f !== 'string') {\n throw new Error(`Type of fileList[${i}] must be string instead of ${typeof f}`);\n }\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n try {\n const result = await cloud.provider.api.deleteFile({\n fileList: options.fileList\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),\n apiConfig: options.config,\n });\n return resolve({\n fileList: result.fileList,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n });\n };\n}\nexports.default = getDeleteFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/api/downloadFile.ts\":\n/*!*********************************************!*\\\n !*** ./src/api/storage/api/downloadFile.ts ***!\n \\*********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getDownloadFile(cloud) {\n return function downloadFile(options) {\n const apiName = 'downloadFile';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for downloadFile must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n fileID: 'string',\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n try {\n const result = await cloud.provider.api.downloadFile({\n fileID: options.fileID,\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),\n apiConfig: options.config,\n });\n return resolve({\n fileContent: result.fileContent,\n statusCode: result.statusCode,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n });\n };\n}\nexports.default = getDownloadFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/api/getTempFileURL.ts\":\n/*!***********************************************!*\\\n !*** ./src/api/storage/api/getTempFileURL.ts ***!\n \\***********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getGetTempFileURL(cloud) {\n return function getTempFileURL(options) {\n const apiName = 'getTempFileURL';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for getTempFileURL must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n fileList: 'array',\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n try {\n const result = await cloud.provider.api.getTempFileURL({\n fileList: options.fileList,\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),\n apiConfig: options.config,\n });\n return resolve({\n fileList: result.fileList,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n });\n };\n}\nexports.default = getGetTempFileURL;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/api/uploadFile.ts\":\n/*!*******************************************!*\\\n !*** ./src/api/storage/api/uploadFile.ts ***!\n \\*******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getUploadFile(cloud) {\n return function uploadFile(options) {\n const apiName = 'uploadFile';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for uploadFile must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n cloudPath: 'string',\n });\n if (!options.fileContent) {\n return reject(error_1.returnAsFinalCloudSDKError(new Error('Type of fileContent must be fs.ReadStream instead of ' + typeof options.fileContent), apiName));\n }\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n const header = options.header || {};\n try {\n const result = await cloud.provider.api.uploadFile({\n fileContent: options.fileContent,\n cloudPath: options.cloudPath,\n header,\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),\n apiConfig: options.config,\n });\n return resolve({\n fileID: result.fileID,\n statusCode: result.statusCode,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n });\n };\n}\nexports.default = getUploadFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/index.ts\":\n/*!**********************************!*\\\n !*** ./src/api/storage/index.ts ***!\n \\**********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst api_1 = __webpack_require__(/*! ./api/api */ \"./src/api/storage/api/api.ts\");\nexports.STORAGE_SERVICE_NAME = 'storage';\nfunction createStorageService(cloud) {\n return {\n name: exports.STORAGE_SERVICE_NAME,\n getAPIs: api_1.getAPIs.bind(null, cloud),\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createStorageService(cloud));\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/api/utils/api/api.ts\":\n/*!**********************************!*\\\n !*** ./src/api/utils/api/api.ts ***!\n \\**********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst getWXContext_1 = __webpack_require__(/*! ./getWXContext */ \"./src/api/utils/api/getWXContext.ts\");\nfunction getAPIs() {\n return {\n getWXContext: getWXContext_1.default,\n };\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/utils/api/getWXContext.ts\":\n/*!*******************************************!*\\\n !*** ./src/api/utils/api/getWXContext.ts ***!\n \\*******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst WX_PREFIX = 'WX_';\nconst CONTEXT_KEYS_BLACKLIST = [\n 'API_TOKEN',\n 'TRIGGER_API_TOKEN_V0',\n];\nfunction isContextKeyInBlacklist(key) {\n return CONTEXT_KEYS_BLACKLIST.some(v => v === key || (WX_PREFIX + v) === key);\n}\nexports.isContextKeyInBlacklist = isContextKeyInBlacklist;\nfunction isNumber(val) {\n return /^[-]?\\d+$/.test(val);\n}\nexports.isNumber = isNumber;\nfunction getWXContext() {\n const apiName = 'getWXContext';\n const wxContext = {};\n if (!process.env.WX_CONTEXT_KEYS)\n return wxContext;\n try {\n const contextKeys = process.env.WX_CONTEXT_KEYS.split(',');\n for (const key of contextKeys) {\n if (!key)\n continue;\n if (isContextKeyInBlacklist(key))\n continue;\n let val = process.env[key];\n if (val === undefined)\n continue;\n if (isNumber(val)) {\n val = parseInt(val);\n }\n if (key.startsWith(WX_PREFIX) && key.length > 3) {\n wxContext[key.slice(3)] = val;\n }\n else {\n wxContext[key] = val;\n }\n }\n wxContext.ENV = process.env.TCB_ENV || process.env.SCF_NAMESPACE;\n if (process.env.TCB_SOURCE) {\n wxContext.SOURCE = process.env.TCB_SOURCE;\n }\n return wxContext;\n }\n catch (e) {\n const error = error_1.returnAsFinalCloudSDKError(e, apiName);\n throw error;\n }\n}\nexports.default = getWXContext;\n\n\n/***/ }),\n\n/***/ \"./src/api/utils/index.ts\":\n/*!********************************!*\\\n !*** ./src/api/utils/index.ts ***!\n \\********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst api_1 = __webpack_require__(/*! ./api/api */ \"./src/api/utils/api/api.ts\");\nconst UTILS_SERVICE_NAME = 'utils';\nfunction createUtilsService() {\n return {\n name: UTILS_SERVICE_NAME,\n getAPIs: api_1.getAPIs,\n initRequired: false,\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createUtilsService());\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/config/error.config.ts\":\n/*!************************************!*\\\n !*** ./src/config/error.config.ts ***!\n \\************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERR_CODE = {\n '-1': 'unknown error',\n UNKNOWN_ERROR: -1,\n // 以 6 开始的是由微信服务器侧产生的错误码\n // 以 5 开始的是由腾讯云侧产生的错误码\n // 以 4 开始的是本地 SDK 产生的错误\n // 接下来两位表示具体业务类型:01通用,02数据库,03文件,04云函数\n // 最后三位表示具体的错误\n // 小程序 SDK 云函数\n '-404001': 'empty call result',\n SDK_FUNCTIONS_EMPTY_CALL_RESULT: -404001,\n '-404002': 'empty event id',\n SDK_FUNCTIONS_EMPTY_EVENT_ID: -404002,\n '-404003': 'empty poll url',\n SDK_FUNCTIONS_EMPTY_POLL_URL: -404003,\n '-404004': 'empty poll result json',\n SDK_FUNCTIONS_EMPTY_POLL_RESULT_JSON: -404004,\n '-404005': 'exceed max poll retry',\n SDK_FUNCTIONS_EXCEED_MAX_POLL_RETRY: -404005,\n '-404006': 'empty poll result base resp',\n SDK_FUNCTIONS_EMPTY_POLL_RESULT_BASE_RESP: -404006,\n '-404007': 'error while polling for the result, poll result base resp ret %s',\n SDK_FUNCTIONS_POLL_RESULT_BASE_RESP_RET_ABNORMAL: -404007,\n '-404008': 'error while polling for the result, polling server return a status code of %s',\n SDK_FUNCTIONS_POLL_RESULT_STATUS_CODE_ERROR: -404008,\n '-404009': 'error while polling for the result: %s',\n SDK_FUNCTIONS_POLL_ERROR: -404009,\n // 微信服务器\n '-601001': 'system error',\n WX_SYSTEM_ERROR: -601001,\n '-601002': 'system args error',\n WX_SYSTEM_ARGS_ERROR: -601002,\n '-601003': 'system network error',\n WX_SYSTEM_NETWORK_ERROR: -601003,\n '-604100': 'API not found',\n WX_FUNCTIONS_SERVER_OPENAPI_NOT_FOUND: -604100,\n '-604101': 'function has no permission to call this API',\n WX_FUNCTIONS_SERVER_OPENAPI_NO_PERMISSION: -604101,\n '-604102': 'call open API timeout',\n WX_FUNCTIONS_SERVER_OPENAPI_TIMEOUT: -604102,\n '-604103': 'call open API system error',\n WX_FUNCTIONS_SERVER_OPENAPI_SYSTEM_ERROR: -604102,\n // 腾讯云通用\n '-501001': 'resource system error',\n TCB_RESOURCE_SYSTEM_ERROR: -501001,\n '-501002': 'resource server timeout',\n TCB_RESOURCE_SERVER_TIMEOUT: -501002,\n '-501003': 'exceed request limit',\n TCB_EXCEED_REQUEST_LIMIT: -501003,\n '-501004': 'exceed concurrent request limit',\n TCB_EXCEED_CONCURRENT_REQUEST_LIMIT: -501004,\n '-501005': 'invalid env',\n TCB_INVALID_ENV: -501005,\n '-501006': 'invalid common parameters',\n TCB_INVALID_COMMON_PARAM: -501006,\n '-501007': 'invalid parameters',\n TCB_INVALID_PARAM: -501007,\n '-501008': 'invalid request source',\n TCB_INVALID_REQUEST_SOURCE: -501008,\n '-501009': 'resource not initialized',\n TCB_RESOURCE_NOT_INITIALIZED: -501009,\n // 腾讯云数据库\n '-502001': 'database request fail',\n TCB_DB_REQUEST_FAIL: -502001,\n '-502002': 'database invalid command',\n TCB_DB_INVALID_COMMAND: -502002,\n '-502003': 'database permission denied',\n TCB_DB_PERMISSION_DENIED: -502003,\n '-502004': 'database exceed collection limit',\n TCB_DB_EXCEED_COLLECTION_LIMIT: -502004,\n '-502005': 'database collection not exists',\n TCB_DB_COLLECTION_NOT_EXISTS: -502005,\n // 腾讯云文件管理\n '-503001': 'storage request fail',\n TCB_STORAGE_REQUEST_FAIL: -503001,\n '-503002': 'storage permission denied',\n TCB_STORAGE_PERMISSION_DENIED: -503002,\n '-503003': 'storage file not exists',\n TCB_STORAGE_FILE_NOT_EXISTS: -503003,\n '-503004': 'storage invalid sign parameter',\n TCB_STORAGE_INVALID_SIGN_PARAM: -503004,\n // 腾讯云云函数\n '-504001': 'functions request fail',\n TCB_FUNCTIONS_REQUEST_FAIL: -504001,\n '-504002': 'functions execute fail',\n TCB_FUNCTIONS_EXEC_FAIL: -504002,\n};\n\n\n/***/ }),\n\n/***/ \"./src/config/symbol.config.ts\":\n/*!*************************************!*\\\n !*** ./src/config/symbol.config.ts ***!\n \\*************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SYMBOL_DYNAMIC_CURRENT_ENV = Symbol.for('DYNAMIC_CURRENT_ENV');\n\n\n/***/ }),\n\n/***/ \"./src/index.ts\":\n/*!**********************!*\\\n !*** ./src/index.ts ***!\n \\**********************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nconst cloud_1 = __webpack_require__(/*! ./api/cloud */ \"./src/api/cloud/index.ts\");\nmodule.exports = cloud_1.default.exportAPI;\n\n\n/***/ }),\n\n/***/ \"./src/protobuf/openapi.js\":\n/*!*********************************!*\\\n !*** ./src/protobuf/openapi.js ***!\n \\*********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\n\nvar $protobuf = __webpack_require__(/*! protobufjs/minimal */ \"protobufjs/minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots[\"default\"] || ($protobuf.roots[\"default\"] = {});\n\n$root.KeyValuePair = (function() {\n\n /**\n * Properties of a KeyValuePair.\n * @exports IKeyValuePair\n * @interface IKeyValuePair\n * @property {string|null} [key] KeyValuePair key\n * @property {Uint8Array|null} [value] KeyValuePair value\n * @property {string|null} [contenttype] KeyValuePair contenttype\n * @property {string|null} [filename] KeyValuePair filename\n */\n\n /**\n * Constructs a new KeyValuePair.\n * @exports KeyValuePair\n * @classdesc Represents a KeyValuePair.\n * @implements IKeyValuePair\n * @constructor\n * @param {IKeyValuePair=} [properties] Properties to set\n */\n function KeyValuePair(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * KeyValuePair key.\n * @member {string} key\n * @memberof KeyValuePair\n * @instance\n */\n KeyValuePair.prototype.key = \"\";\n\n /**\n * KeyValuePair value.\n * @member {Uint8Array} value\n * @memberof KeyValuePair\n * @instance\n */\n KeyValuePair.prototype.value = $util.newBuffer([]);\n\n /**\n * KeyValuePair contenttype.\n * @member {string} contenttype\n * @memberof KeyValuePair\n * @instance\n */\n KeyValuePair.prototype.contenttype = \"\";\n\n /**\n * KeyValuePair filename.\n * @member {string} filename\n * @memberof KeyValuePair\n * @instance\n */\n KeyValuePair.prototype.filename = \"\";\n\n /**\n * Creates a new KeyValuePair instance using the specified properties.\n * @function create\n * @memberof KeyValuePair\n * @static\n * @param {IKeyValuePair=} [properties] Properties to set\n * @returns {KeyValuePair} KeyValuePair instance\n */\n KeyValuePair.create = function create(properties) {\n return new KeyValuePair(properties);\n };\n\n /**\n * Encodes the specified KeyValuePair message. Does not implicitly {@link KeyValuePair.verify|verify} messages.\n * @function encode\n * @memberof KeyValuePair\n * @static\n * @param {IKeyValuePair} message KeyValuePair message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n KeyValuePair.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.key != null && message.hasOwnProperty(\"key\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);\n if (message.value != null && message.hasOwnProperty(\"value\"))\n writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value);\n if (message.contenttype != null && message.hasOwnProperty(\"contenttype\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.contenttype);\n if (message.filename != null && message.hasOwnProperty(\"filename\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.filename);\n return writer;\n };\n\n /**\n * Encodes the specified KeyValuePair message, length delimited. Does not implicitly {@link KeyValuePair.verify|verify} messages.\n * @function encodeDelimited\n * @memberof KeyValuePair\n * @static\n * @param {IKeyValuePair} message KeyValuePair message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n KeyValuePair.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a KeyValuePair message from the specified reader or buffer.\n * @function decode\n * @memberof KeyValuePair\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {KeyValuePair} KeyValuePair\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n KeyValuePair.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.KeyValuePair();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.key = reader.string();\n break;\n case 2:\n message.value = reader.bytes();\n break;\n case 3:\n message.contenttype = reader.string();\n break;\n case 4:\n message.filename = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a KeyValuePair message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof KeyValuePair\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {KeyValuePair} KeyValuePair\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n KeyValuePair.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a KeyValuePair message.\n * @function verify\n * @memberof KeyValuePair\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n KeyValuePair.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.key != null && message.hasOwnProperty(\"key\"))\n if (!$util.isString(message.key))\n return \"key: string expected\";\n if (message.value != null && message.hasOwnProperty(\"value\"))\n if (!(message.value && typeof message.value.length === \"number\" || $util.isString(message.value)))\n return \"value: buffer expected\";\n if (message.contenttype != null && message.hasOwnProperty(\"contenttype\"))\n if (!$util.isString(message.contenttype))\n return \"contenttype: string expected\";\n if (message.filename != null && message.hasOwnProperty(\"filename\"))\n if (!$util.isString(message.filename))\n return \"filename: string expected\";\n return null;\n };\n\n /**\n * Creates a KeyValuePair message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof KeyValuePair\n * @static\n * @param {Object.} object Plain object\n * @returns {KeyValuePair} KeyValuePair\n */\n KeyValuePair.fromObject = function fromObject(object) {\n if (object instanceof $root.KeyValuePair)\n return object;\n var message = new $root.KeyValuePair();\n if (object.key != null)\n message.key = String(object.key);\n if (object.value != null)\n if (typeof object.value === \"string\")\n $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);\n else if (object.value.length)\n message.value = object.value;\n if (object.contenttype != null)\n message.contenttype = String(object.contenttype);\n if (object.filename != null)\n message.filename = String(object.filename);\n return message;\n };\n\n /**\n * Creates a plain object from a KeyValuePair message. Also converts values to other types if specified.\n * @function toObject\n * @memberof KeyValuePair\n * @static\n * @param {KeyValuePair} message KeyValuePair\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n KeyValuePair.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.key = \"\";\n if (options.bytes === String)\n object.value = \"\";\n else {\n object.value = [];\n if (options.bytes !== Array)\n object.value = $util.newBuffer(object.value);\n }\n object.contenttype = \"\";\n object.filename = \"\";\n }\n if (message.key != null && message.hasOwnProperty(\"key\"))\n object.key = message.key;\n if (message.value != null && message.hasOwnProperty(\"value\"))\n object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value;\n if (message.contenttype != null && message.hasOwnProperty(\"contenttype\"))\n object.contenttype = message.contenttype;\n if (message.filename != null && message.hasOwnProperty(\"filename\"))\n object.filename = message.filename;\n return object;\n };\n\n /**\n * Converts this KeyValuePair to JSON.\n * @function toJSON\n * @memberof KeyValuePair\n * @instance\n * @returns {Object.} JSON object\n */\n KeyValuePair.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return KeyValuePair;\n})();\n\n$root.OpenApiData = (function() {\n\n /**\n * Properties of an OpenApiData.\n * @exports IOpenApiData\n * @interface IOpenApiData\n * @property {Array.|null} [pairs] OpenApiData pairs\n */\n\n /**\n * Constructs a new OpenApiData.\n * @exports OpenApiData\n * @classdesc Represents an OpenApiData.\n * @implements IOpenApiData\n * @constructor\n * @param {IOpenApiData=} [properties] Properties to set\n */\n function OpenApiData(properties) {\n this.pairs = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * OpenApiData pairs.\n * @member {Array.} pairs\n * @memberof OpenApiData\n * @instance\n */\n OpenApiData.prototype.pairs = $util.emptyArray;\n\n /**\n * Creates a new OpenApiData instance using the specified properties.\n * @function create\n * @memberof OpenApiData\n * @static\n * @param {IOpenApiData=} [properties] Properties to set\n * @returns {OpenApiData} OpenApiData instance\n */\n OpenApiData.create = function create(properties) {\n return new OpenApiData(properties);\n };\n\n /**\n * Encodes the specified OpenApiData message. Does not implicitly {@link OpenApiData.verify|verify} messages.\n * @function encode\n * @memberof OpenApiData\n * @static\n * @param {IOpenApiData} message OpenApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OpenApiData.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.pairs != null && message.pairs.length)\n for (var i = 0; i < message.pairs.length; ++i)\n $root.KeyValuePair.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified OpenApiData message, length delimited. Does not implicitly {@link OpenApiData.verify|verify} messages.\n * @function encodeDelimited\n * @memberof OpenApiData\n * @static\n * @param {IOpenApiData} message OpenApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OpenApiData.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an OpenApiData message from the specified reader or buffer.\n * @function decode\n * @memberof OpenApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {OpenApiData} OpenApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OpenApiData.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.OpenApiData();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (!(message.pairs && message.pairs.length))\n message.pairs = [];\n message.pairs.push($root.KeyValuePair.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an OpenApiData message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof OpenApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {OpenApiData} OpenApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OpenApiData.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an OpenApiData message.\n * @function verify\n * @memberof OpenApiData\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n OpenApiData.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.pairs != null && message.hasOwnProperty(\"pairs\")) {\n if (!Array.isArray(message.pairs))\n return \"pairs: array expected\";\n for (var i = 0; i < message.pairs.length; ++i) {\n var error = $root.KeyValuePair.verify(message.pairs[i]);\n if (error)\n return \"pairs.\" + error;\n }\n }\n return null;\n };\n\n /**\n * Creates an OpenApiData message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof OpenApiData\n * @static\n * @param {Object.} object Plain object\n * @returns {OpenApiData} OpenApiData\n */\n OpenApiData.fromObject = function fromObject(object) {\n if (object instanceof $root.OpenApiData)\n return object;\n var message = new $root.OpenApiData();\n if (object.pairs) {\n if (!Array.isArray(object.pairs))\n throw TypeError(\".OpenApiData.pairs: array expected\");\n message.pairs = [];\n for (var i = 0; i < object.pairs.length; ++i) {\n if (typeof object.pairs[i] !== \"object\")\n throw TypeError(\".OpenApiData.pairs: object expected\");\n message.pairs[i] = $root.KeyValuePair.fromObject(object.pairs[i]);\n }\n }\n return message;\n };\n\n /**\n * Creates a plain object from an OpenApiData message. Also converts values to other types if specified.\n * @function toObject\n * @memberof OpenApiData\n * @static\n * @param {OpenApiData} message OpenApiData\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n OpenApiData.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.pairs = [];\n if (message.pairs && message.pairs.length) {\n object.pairs = [];\n for (var j = 0; j < message.pairs.length; ++j)\n object.pairs[j] = $root.KeyValuePair.toObject(message.pairs[j], options);\n }\n return object;\n };\n\n /**\n * Converts this OpenApiData to JSON.\n * @function toJSON\n * @memberof OpenApiData\n * @instance\n * @returns {Object.} JSON object\n */\n OpenApiData.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return OpenApiData;\n})();\n\n$root.CommApiData = (function() {\n\n /**\n * Properties of a CommApiData.\n * @exports ICommApiData\n * @interface ICommApiData\n * @property {CommApiData.ApiType|null} [apiType] CommApiData apiType\n * @property {IOpenApiData|null} [openapiData] CommApiData openapiData\n * @property {IInnerApiData|null} [innerData] CommApiData innerData\n * @property {ISvrkitApiData|null} [svrkitData] CommApiData svrkitData\n */\n\n /**\n * Constructs a new CommApiData.\n * @exports CommApiData\n * @classdesc Represents a CommApiData.\n * @implements ICommApiData\n * @constructor\n * @param {ICommApiData=} [properties] Properties to set\n */\n function CommApiData(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * CommApiData apiType.\n * @member {CommApiData.ApiType} apiType\n * @memberof CommApiData\n * @instance\n */\n CommApiData.prototype.apiType = 0;\n\n /**\n * CommApiData openapiData.\n * @member {IOpenApiData|null|undefined} openapiData\n * @memberof CommApiData\n * @instance\n */\n CommApiData.prototype.openapiData = null;\n\n /**\n * CommApiData innerData.\n * @member {IInnerApiData|null|undefined} innerData\n * @memberof CommApiData\n * @instance\n */\n CommApiData.prototype.innerData = null;\n\n /**\n * CommApiData svrkitData.\n * @member {ISvrkitApiData|null|undefined} svrkitData\n * @memberof CommApiData\n * @instance\n */\n CommApiData.prototype.svrkitData = null;\n\n /**\n * Creates a new CommApiData instance using the specified properties.\n * @function create\n * @memberof CommApiData\n * @static\n * @param {ICommApiData=} [properties] Properties to set\n * @returns {CommApiData} CommApiData instance\n */\n CommApiData.create = function create(properties) {\n return new CommApiData(properties);\n };\n\n /**\n * Encodes the specified CommApiData message. Does not implicitly {@link CommApiData.verify|verify} messages.\n * @function encode\n * @memberof CommApiData\n * @static\n * @param {ICommApiData} message CommApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommApiData.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.apiType != null && message.hasOwnProperty(\"apiType\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.apiType);\n if (message.openapiData != null && message.hasOwnProperty(\"openapiData\"))\n $root.OpenApiData.encode(message.openapiData, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.innerData != null && message.hasOwnProperty(\"innerData\"))\n $root.InnerApiData.encode(message.innerData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n if (message.svrkitData != null && message.hasOwnProperty(\"svrkitData\"))\n $root.SvrkitApiData.encode(message.svrkitData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified CommApiData message, length delimited. Does not implicitly {@link CommApiData.verify|verify} messages.\n * @function encodeDelimited\n * @memberof CommApiData\n * @static\n * @param {ICommApiData} message CommApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommApiData.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a CommApiData message from the specified reader or buffer.\n * @function decode\n * @memberof CommApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {CommApiData} CommApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommApiData.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CommApiData();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.apiType = reader.int32();\n break;\n case 2:\n message.openapiData = $root.OpenApiData.decode(reader, reader.uint32());\n break;\n case 3:\n message.innerData = $root.InnerApiData.decode(reader, reader.uint32());\n break;\n case 4:\n message.svrkitData = $root.SvrkitApiData.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a CommApiData message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof CommApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {CommApiData} CommApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommApiData.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a CommApiData message.\n * @function verify\n * @memberof CommApiData\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CommApiData.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.apiType != null && message.hasOwnProperty(\"apiType\"))\n switch (message.apiType) {\n default:\n return \"apiType: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.openapiData != null && message.hasOwnProperty(\"openapiData\")) {\n var error = $root.OpenApiData.verify(message.openapiData);\n if (error)\n return \"openapiData.\" + error;\n }\n if (message.innerData != null && message.hasOwnProperty(\"innerData\")) {\n var error = $root.InnerApiData.verify(message.innerData);\n if (error)\n return \"innerData.\" + error;\n }\n if (message.svrkitData != null && message.hasOwnProperty(\"svrkitData\")) {\n var error = $root.SvrkitApiData.verify(message.svrkitData);\n if (error)\n return \"svrkitData.\" + error;\n }\n return null;\n };\n\n /**\n * Creates a CommApiData message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof CommApiData\n * @static\n * @param {Object.} object Plain object\n * @returns {CommApiData} CommApiData\n */\n CommApiData.fromObject = function fromObject(object) {\n if (object instanceof $root.CommApiData)\n return object;\n var message = new $root.CommApiData();\n switch (object.apiType) {\n case \"OPEN_API\":\n case 0:\n message.apiType = 0;\n break;\n case \"INNER_API\":\n case 1:\n message.apiType = 1;\n break;\n case \"SVRKIT_API\":\n case 2:\n message.apiType = 2;\n break;\n }\n if (object.openapiData != null) {\n if (typeof object.openapiData !== \"object\")\n throw TypeError(\".CommApiData.openapiData: object expected\");\n message.openapiData = $root.OpenApiData.fromObject(object.openapiData);\n }\n if (object.innerData != null) {\n if (typeof object.innerData !== \"object\")\n throw TypeError(\".CommApiData.innerData: object expected\");\n message.innerData = $root.InnerApiData.fromObject(object.innerData);\n }\n if (object.svrkitData != null) {\n if (typeof object.svrkitData !== \"object\")\n throw TypeError(\".CommApiData.svrkitData: object expected\");\n message.svrkitData = $root.SvrkitApiData.fromObject(object.svrkitData);\n }\n return message;\n };\n\n /**\n * Creates a plain object from a CommApiData message. Also converts values to other types if specified.\n * @function toObject\n * @memberof CommApiData\n * @static\n * @param {CommApiData} message CommApiData\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CommApiData.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.apiType = options.enums === String ? \"OPEN_API\" : 0;\n object.openapiData = null;\n object.innerData = null;\n object.svrkitData = null;\n }\n if (message.apiType != null && message.hasOwnProperty(\"apiType\"))\n object.apiType = options.enums === String ? $root.CommApiData.ApiType[message.apiType] : message.apiType;\n if (message.openapiData != null && message.hasOwnProperty(\"openapiData\"))\n object.openapiData = $root.OpenApiData.toObject(message.openapiData, options);\n if (message.innerData != null && message.hasOwnProperty(\"innerData\"))\n object.innerData = $root.InnerApiData.toObject(message.innerData, options);\n if (message.svrkitData != null && message.hasOwnProperty(\"svrkitData\"))\n object.svrkitData = $root.SvrkitApiData.toObject(message.svrkitData, options);\n return object;\n };\n\n /**\n * Converts this CommApiData to JSON.\n * @function toJSON\n * @memberof CommApiData\n * @instance\n * @returns {Object.} JSON object\n */\n CommApiData.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * ApiType enum.\n * @name CommApiData.ApiType\n * @enum {string}\n * @property {number} OPEN_API=0 OPEN_API value\n * @property {number} INNER_API=1 INNER_API value\n * @property {number} SVRKIT_API=2 SVRKIT_API value\n */\n CommApiData.ApiType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"OPEN_API\"] = 0;\n values[valuesById[1] = \"INNER_API\"] = 1;\n values[valuesById[2] = \"SVRKIT_API\"] = 2;\n return values;\n })();\n\n return CommApiData;\n})();\n\n$root.CommOpenApiResp = (function() {\n\n /**\n * Properties of a CommOpenApiResp.\n * @exports ICommOpenApiResp\n * @interface ICommOpenApiResp\n * @property {Uint8Array|null} [respData] CommOpenApiResp respData\n * @property {string|null} [contentType] CommOpenApiResp contentType\n * @property {number|null} [errorCode] CommOpenApiResp errorCode\n * @property {number|null} [httpCode] CommOpenApiResp httpCode\n * @property {Array.|null} [headers] CommOpenApiResp headers\n * @property {number|null} [svrkitErrorCode] CommOpenApiResp svrkitErrorCode\n */\n\n /**\n * Constructs a new CommOpenApiResp.\n * @exports CommOpenApiResp\n * @classdesc Represents a CommOpenApiResp.\n * @implements ICommOpenApiResp\n * @constructor\n * @param {ICommOpenApiResp=} [properties] Properties to set\n */\n function CommOpenApiResp(properties) {\n this.headers = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * CommOpenApiResp respData.\n * @member {Uint8Array} respData\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.respData = $util.newBuffer([]);\n\n /**\n * CommOpenApiResp contentType.\n * @member {string} contentType\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.contentType = \"\";\n\n /**\n * CommOpenApiResp errorCode.\n * @member {number} errorCode\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.errorCode = 0;\n\n /**\n * CommOpenApiResp httpCode.\n * @member {number} httpCode\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.httpCode = 0;\n\n /**\n * CommOpenApiResp headers.\n * @member {Array.} headers\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.headers = $util.emptyArray;\n\n /**\n * CommOpenApiResp svrkitErrorCode.\n * @member {number} svrkitErrorCode\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.svrkitErrorCode = 0;\n\n /**\n * Creates a new CommOpenApiResp instance using the specified properties.\n * @function create\n * @memberof CommOpenApiResp\n * @static\n * @param {ICommOpenApiResp=} [properties] Properties to set\n * @returns {CommOpenApiResp} CommOpenApiResp instance\n */\n CommOpenApiResp.create = function create(properties) {\n return new CommOpenApiResp(properties);\n };\n\n /**\n * Encodes the specified CommOpenApiResp message. Does not implicitly {@link CommOpenApiResp.verify|verify} messages.\n * @function encode\n * @memberof CommOpenApiResp\n * @static\n * @param {ICommOpenApiResp} message CommOpenApiResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommOpenApiResp.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.respData != null && message.hasOwnProperty(\"respData\"))\n writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.respData);\n if (message.contentType != null && message.hasOwnProperty(\"contentType\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.contentType);\n if (message.errorCode != null && message.hasOwnProperty(\"errorCode\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCode);\n if (message.httpCode != null && message.hasOwnProperty(\"httpCode\"))\n writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.httpCode);\n if (message.headers != null && message.headers.length)\n for (var i = 0; i < message.headers.length; ++i)\n $root.HttpHeader.encode(message.headers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.svrkitErrorCode != null && message.hasOwnProperty(\"svrkitErrorCode\"))\n writer.uint32(/* id 6, wireType 0 =*/48).int32(message.svrkitErrorCode);\n return writer;\n };\n\n /**\n * Encodes the specified CommOpenApiResp message, length delimited. Does not implicitly {@link CommOpenApiResp.verify|verify} messages.\n * @function encodeDelimited\n * @memberof CommOpenApiResp\n * @static\n * @param {ICommOpenApiResp} message CommOpenApiResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommOpenApiResp.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a CommOpenApiResp message from the specified reader or buffer.\n * @function decode\n * @memberof CommOpenApiResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {CommOpenApiResp} CommOpenApiResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommOpenApiResp.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CommOpenApiResp();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.respData = reader.bytes();\n break;\n case 2:\n message.contentType = reader.string();\n break;\n case 3:\n message.errorCode = reader.int32();\n break;\n case 4:\n message.httpCode = reader.uint32();\n break;\n case 5:\n if (!(message.headers && message.headers.length))\n message.headers = [];\n message.headers.push($root.HttpHeader.decode(reader, reader.uint32()));\n break;\n case 6:\n message.svrkitErrorCode = reader.int32();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a CommOpenApiResp message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof CommOpenApiResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {CommOpenApiResp} CommOpenApiResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommOpenApiResp.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a CommOpenApiResp message.\n * @function verify\n * @memberof CommOpenApiResp\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CommOpenApiResp.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.respData != null && message.hasOwnProperty(\"respData\"))\n if (!(message.respData && typeof message.respData.length === \"number\" || $util.isString(message.respData)))\n return \"respData: buffer expected\";\n if (message.contentType != null && message.hasOwnProperty(\"contentType\"))\n if (!$util.isString(message.contentType))\n return \"contentType: string expected\";\n if (message.errorCode != null && message.hasOwnProperty(\"errorCode\"))\n if (!$util.isInteger(message.errorCode))\n return \"errorCode: integer expected\";\n if (message.httpCode != null && message.hasOwnProperty(\"httpCode\"))\n if (!$util.isInteger(message.httpCode))\n return \"httpCode: integer expected\";\n if (message.headers != null && message.hasOwnProperty(\"headers\")) {\n if (!Array.isArray(message.headers))\n return \"headers: array expected\";\n for (var i = 0; i < message.headers.length; ++i) {\n var error = $root.HttpHeader.verify(message.headers[i]);\n if (error)\n return \"headers.\" + error;\n }\n }\n if (message.svrkitErrorCode != null && message.hasOwnProperty(\"svrkitErrorCode\"))\n if (!$util.isInteger(message.svrkitErrorCode))\n return \"svrkitErrorCode: integer expected\";\n return null;\n };\n\n /**\n * Creates a CommOpenApiResp message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof CommOpenApiResp\n * @static\n * @param {Object.} object Plain object\n * @returns {CommOpenApiResp} CommOpenApiResp\n */\n CommOpenApiResp.fromObject = function fromObject(object) {\n if (object instanceof $root.CommOpenApiResp)\n return object;\n var message = new $root.CommOpenApiResp();\n if (object.respData != null)\n if (typeof object.respData === \"string\")\n $util.base64.decode(object.respData, message.respData = $util.newBuffer($util.base64.length(object.respData)), 0);\n else if (object.respData.length)\n message.respData = object.respData;\n if (object.contentType != null)\n message.contentType = String(object.contentType);\n if (object.errorCode != null)\n message.errorCode = object.errorCode | 0;\n if (object.httpCode != null)\n message.httpCode = object.httpCode >>> 0;\n if (object.headers) {\n if (!Array.isArray(object.headers))\n throw TypeError(\".CommOpenApiResp.headers: array expected\");\n message.headers = [];\n for (var i = 0; i < object.headers.length; ++i) {\n if (typeof object.headers[i] !== \"object\")\n throw TypeError(\".CommOpenApiResp.headers: object expected\");\n message.headers[i] = $root.HttpHeader.fromObject(object.headers[i]);\n }\n }\n if (object.svrkitErrorCode != null)\n message.svrkitErrorCode = object.svrkitErrorCode | 0;\n return message;\n };\n\n /**\n * Creates a plain object from a CommOpenApiResp message. Also converts values to other types if specified.\n * @function toObject\n * @memberof CommOpenApiResp\n * @static\n * @param {CommOpenApiResp} message CommOpenApiResp\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CommOpenApiResp.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.headers = [];\n if (options.defaults) {\n if (options.bytes === String)\n object.respData = \"\";\n else {\n object.respData = [];\n if (options.bytes !== Array)\n object.respData = $util.newBuffer(object.respData);\n }\n object.contentType = \"\";\n object.errorCode = 0;\n object.httpCode = 0;\n object.svrkitErrorCode = 0;\n }\n if (message.respData != null && message.hasOwnProperty(\"respData\"))\n object.respData = options.bytes === String ? $util.base64.encode(message.respData, 0, message.respData.length) : options.bytes === Array ? Array.prototype.slice.call(message.respData) : message.respData;\n if (message.contentType != null && message.hasOwnProperty(\"contentType\"))\n object.contentType = message.contentType;\n if (message.errorCode != null && message.hasOwnProperty(\"errorCode\"))\n object.errorCode = message.errorCode;\n if (message.httpCode != null && message.hasOwnProperty(\"httpCode\"))\n object.httpCode = message.httpCode;\n if (message.headers && message.headers.length) {\n object.headers = [];\n for (var j = 0; j < message.headers.length; ++j)\n object.headers[j] = $root.HttpHeader.toObject(message.headers[j], options);\n }\n if (message.svrkitErrorCode != null && message.hasOwnProperty(\"svrkitErrorCode\"))\n object.svrkitErrorCode = message.svrkitErrorCode;\n return object;\n };\n\n /**\n * Converts this CommOpenApiResp to JSON.\n * @function toJSON\n * @memberof CommOpenApiResp\n * @instance\n * @returns {Object.} JSON object\n */\n CommOpenApiResp.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return CommOpenApiResp;\n})();\n\n$root.InnerApiData = (function() {\n\n /**\n * Properties of an InnerApiData.\n * @exports IInnerApiData\n * @interface IInnerApiData\n * @property {number|null} [modid] InnerApiData modid\n * @property {number|null} [cmdid] InnerApiData cmdid\n * @property {string|null} [url] InnerApiData url\n * @property {boolean|null} [useHttps] InnerApiData useHttps\n * @property {HTTP_METHODS|null} [method] InnerApiData method\n * @property {Array.|null} [headers] InnerApiData headers\n * @property {Uint8Array|null} [body] InnerApiData body\n */\n\n /**\n * Constructs a new InnerApiData.\n * @exports InnerApiData\n * @classdesc Represents an InnerApiData.\n * @implements IInnerApiData\n * @constructor\n * @param {IInnerApiData=} [properties] Properties to set\n */\n function InnerApiData(properties) {\n this.headers = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * InnerApiData modid.\n * @member {number} modid\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.modid = 0;\n\n /**\n * InnerApiData cmdid.\n * @member {number} cmdid\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.cmdid = 0;\n\n /**\n * InnerApiData url.\n * @member {string} url\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.url = \"\";\n\n /**\n * InnerApiData useHttps.\n * @member {boolean} useHttps\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.useHttps = false;\n\n /**\n * InnerApiData method.\n * @member {HTTP_METHODS} method\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.method = 1;\n\n /**\n * InnerApiData headers.\n * @member {Array.} headers\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.headers = $util.emptyArray;\n\n /**\n * InnerApiData body.\n * @member {Uint8Array} body\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.body = $util.newBuffer([]);\n\n /**\n * Creates a new InnerApiData instance using the specified properties.\n * @function create\n * @memberof InnerApiData\n * @static\n * @param {IInnerApiData=} [properties] Properties to set\n * @returns {InnerApiData} InnerApiData instance\n */\n InnerApiData.create = function create(properties) {\n return new InnerApiData(properties);\n };\n\n /**\n * Encodes the specified InnerApiData message. Does not implicitly {@link InnerApiData.verify|verify} messages.\n * @function encode\n * @memberof InnerApiData\n * @static\n * @param {IInnerApiData} message InnerApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n InnerApiData.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.modid != null && message.hasOwnProperty(\"modid\"))\n writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.modid);\n if (message.cmdid != null && message.hasOwnProperty(\"cmdid\"))\n writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.cmdid);\n if (message.url != null && message.hasOwnProperty(\"url\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.url);\n if (message.useHttps != null && message.hasOwnProperty(\"useHttps\"))\n writer.uint32(/* id 4, wireType 0 =*/32).bool(message.useHttps);\n if (message.method != null && message.hasOwnProperty(\"method\"))\n writer.uint32(/* id 5, wireType 0 =*/40).int32(message.method);\n if (message.headers != null && message.headers.length)\n for (var i = 0; i < message.headers.length; ++i)\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.headers[i]);\n if (message.body != null && message.hasOwnProperty(\"body\"))\n writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.body);\n return writer;\n };\n\n /**\n * Encodes the specified InnerApiData message, length delimited. Does not implicitly {@link InnerApiData.verify|verify} messages.\n * @function encodeDelimited\n * @memberof InnerApiData\n * @static\n * @param {IInnerApiData} message InnerApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n InnerApiData.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an InnerApiData message from the specified reader or buffer.\n * @function decode\n * @memberof InnerApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {InnerApiData} InnerApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n InnerApiData.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.InnerApiData();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.modid = reader.uint32();\n break;\n case 2:\n message.cmdid = reader.uint32();\n break;\n case 3:\n message.url = reader.string();\n break;\n case 4:\n message.useHttps = reader.bool();\n break;\n case 5:\n message.method = reader.int32();\n break;\n case 6:\n if (!(message.headers && message.headers.length))\n message.headers = [];\n message.headers.push(reader.string());\n break;\n case 7:\n message.body = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an InnerApiData message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof InnerApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {InnerApiData} InnerApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n InnerApiData.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an InnerApiData message.\n * @function verify\n * @memberof InnerApiData\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n InnerApiData.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.modid != null && message.hasOwnProperty(\"modid\"))\n if (!$util.isInteger(message.modid))\n return \"modid: integer expected\";\n if (message.cmdid != null && message.hasOwnProperty(\"cmdid\"))\n if (!$util.isInteger(message.cmdid))\n return \"cmdid: integer expected\";\n if (message.url != null && message.hasOwnProperty(\"url\"))\n if (!$util.isString(message.url))\n return \"url: string expected\";\n if (message.useHttps != null && message.hasOwnProperty(\"useHttps\"))\n if (typeof message.useHttps !== \"boolean\")\n return \"useHttps: boolean expected\";\n if (message.method != null && message.hasOwnProperty(\"method\"))\n switch (message.method) {\n default:\n return \"method: enum value expected\";\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n break;\n }\n if (message.headers != null && message.hasOwnProperty(\"headers\")) {\n if (!Array.isArray(message.headers))\n return \"headers: array expected\";\n for (var i = 0; i < message.headers.length; ++i)\n if (!$util.isString(message.headers[i]))\n return \"headers: string[] expected\";\n }\n if (message.body != null && message.hasOwnProperty(\"body\"))\n if (!(message.body && typeof message.body.length === \"number\" || $util.isString(message.body)))\n return \"body: buffer expected\";\n return null;\n };\n\n /**\n * Creates an InnerApiData message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof InnerApiData\n * @static\n * @param {Object.} object Plain object\n * @returns {InnerApiData} InnerApiData\n */\n InnerApiData.fromObject = function fromObject(object) {\n if (object instanceof $root.InnerApiData)\n return object;\n var message = new $root.InnerApiData();\n if (object.modid != null)\n message.modid = object.modid >>> 0;\n if (object.cmdid != null)\n message.cmdid = object.cmdid >>> 0;\n if (object.url != null)\n message.url = String(object.url);\n if (object.useHttps != null)\n message.useHttps = Boolean(object.useHttps);\n switch (object.method) {\n case \"HTTP_GET\":\n case 1:\n message.method = 1;\n break;\n case \"HTTP_POST\":\n case 2:\n message.method = 2;\n break;\n case \"HTTP_PUT\":\n case 3:\n message.method = 3;\n break;\n case \"HTTP_DELETE\":\n case 4:\n message.method = 4;\n break;\n case \"HTTP_HEAD\":\n case 5:\n message.method = 5;\n break;\n case \"HTTP_PATCH\":\n case 6:\n message.method = 6;\n break;\n }\n if (object.headers) {\n if (!Array.isArray(object.headers))\n throw TypeError(\".InnerApiData.headers: array expected\");\n message.headers = [];\n for (var i = 0; i < object.headers.length; ++i)\n message.headers[i] = String(object.headers[i]);\n }\n if (object.body != null)\n if (typeof object.body === \"string\")\n $util.base64.decode(object.body, message.body = $util.newBuffer($util.base64.length(object.body)), 0);\n else if (object.body.length)\n message.body = object.body;\n return message;\n };\n\n /**\n * Creates a plain object from an InnerApiData message. Also converts values to other types if specified.\n * @function toObject\n * @memberof InnerApiData\n * @static\n * @param {InnerApiData} message InnerApiData\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n InnerApiData.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.headers = [];\n if (options.defaults) {\n object.modid = 0;\n object.cmdid = 0;\n object.url = \"\";\n object.useHttps = false;\n object.method = options.enums === String ? \"HTTP_GET\" : 1;\n if (options.bytes === String)\n object.body = \"\";\n else {\n object.body = [];\n if (options.bytes !== Array)\n object.body = $util.newBuffer(object.body);\n }\n }\n if (message.modid != null && message.hasOwnProperty(\"modid\"))\n object.modid = message.modid;\n if (message.cmdid != null && message.hasOwnProperty(\"cmdid\"))\n object.cmdid = message.cmdid;\n if (message.url != null && message.hasOwnProperty(\"url\"))\n object.url = message.url;\n if (message.useHttps != null && message.hasOwnProperty(\"useHttps\"))\n object.useHttps = message.useHttps;\n if (message.method != null && message.hasOwnProperty(\"method\"))\n object.method = options.enums === String ? $root.HTTP_METHODS[message.method] : message.method;\n if (message.headers && message.headers.length) {\n object.headers = [];\n for (var j = 0; j < message.headers.length; ++j)\n object.headers[j] = message.headers[j];\n }\n if (message.body != null && message.hasOwnProperty(\"body\"))\n object.body = options.bytes === String ? $util.base64.encode(message.body, 0, message.body.length) : options.bytes === Array ? Array.prototype.slice.call(message.body) : message.body;\n return object;\n };\n\n /**\n * Converts this InnerApiData to JSON.\n * @function toJSON\n * @memberof InnerApiData\n * @instance\n * @returns {Object.} JSON object\n */\n InnerApiData.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return InnerApiData;\n})();\n\n$root.SvrkitApiData = (function() {\n\n /**\n * Properties of a SvrkitApiData.\n * @exports ISvrkitApiData\n * @interface ISvrkitApiData\n * @property {string|null} [apiName] SvrkitApiData apiName\n * @property {Uint8Array|null} [reqData] SvrkitApiData reqData\n */\n\n /**\n * Constructs a new SvrkitApiData.\n * @exports SvrkitApiData\n * @classdesc Represents a SvrkitApiData.\n * @implements ISvrkitApiData\n * @constructor\n * @param {ISvrkitApiData=} [properties] Properties to set\n */\n function SvrkitApiData(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * SvrkitApiData apiName.\n * @member {string} apiName\n * @memberof SvrkitApiData\n * @instance\n */\n SvrkitApiData.prototype.apiName = \"\";\n\n /**\n * SvrkitApiData reqData.\n * @member {Uint8Array} reqData\n * @memberof SvrkitApiData\n * @instance\n */\n SvrkitApiData.prototype.reqData = $util.newBuffer([]);\n\n /**\n * Creates a new SvrkitApiData instance using the specified properties.\n * @function create\n * @memberof SvrkitApiData\n * @static\n * @param {ISvrkitApiData=} [properties] Properties to set\n * @returns {SvrkitApiData} SvrkitApiData instance\n */\n SvrkitApiData.create = function create(properties) {\n return new SvrkitApiData(properties);\n };\n\n /**\n * Encodes the specified SvrkitApiData message. Does not implicitly {@link SvrkitApiData.verify|verify} messages.\n * @function encode\n * @memberof SvrkitApiData\n * @static\n * @param {ISvrkitApiData} message SvrkitApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SvrkitApiData.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.apiName != null && message.hasOwnProperty(\"apiName\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.apiName);\n if (message.reqData != null && message.hasOwnProperty(\"reqData\"))\n writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.reqData);\n return writer;\n };\n\n /**\n * Encodes the specified SvrkitApiData message, length delimited. Does not implicitly {@link SvrkitApiData.verify|verify} messages.\n * @function encodeDelimited\n * @memberof SvrkitApiData\n * @static\n * @param {ISvrkitApiData} message SvrkitApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SvrkitApiData.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a SvrkitApiData message from the specified reader or buffer.\n * @function decode\n * @memberof SvrkitApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {SvrkitApiData} SvrkitApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SvrkitApiData.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SvrkitApiData();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.apiName = reader.string();\n break;\n case 2:\n message.reqData = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a SvrkitApiData message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof SvrkitApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {SvrkitApiData} SvrkitApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SvrkitApiData.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a SvrkitApiData message.\n * @function verify\n * @memberof SvrkitApiData\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n SvrkitApiData.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.apiName != null && message.hasOwnProperty(\"apiName\"))\n if (!$util.isString(message.apiName))\n return \"apiName: string expected\";\n if (message.reqData != null && message.hasOwnProperty(\"reqData\"))\n if (!(message.reqData && typeof message.reqData.length === \"number\" || $util.isString(message.reqData)))\n return \"reqData: buffer expected\";\n return null;\n };\n\n /**\n * Creates a SvrkitApiData message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof SvrkitApiData\n * @static\n * @param {Object.} object Plain object\n * @returns {SvrkitApiData} SvrkitApiData\n */\n SvrkitApiData.fromObject = function fromObject(object) {\n if (object instanceof $root.SvrkitApiData)\n return object;\n var message = new $root.SvrkitApiData();\n if (object.apiName != null)\n message.apiName = String(object.apiName);\n if (object.reqData != null)\n if (typeof object.reqData === \"string\")\n $util.base64.decode(object.reqData, message.reqData = $util.newBuffer($util.base64.length(object.reqData)), 0);\n else if (object.reqData.length)\n message.reqData = object.reqData;\n return message;\n };\n\n /**\n * Creates a plain object from a SvrkitApiData message. Also converts values to other types if specified.\n * @function toObject\n * @memberof SvrkitApiData\n * @static\n * @param {SvrkitApiData} message SvrkitApiData\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n SvrkitApiData.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.apiName = \"\";\n if (options.bytes === String)\n object.reqData = \"\";\n else {\n object.reqData = [];\n if (options.bytes !== Array)\n object.reqData = $util.newBuffer(object.reqData);\n }\n }\n if (message.apiName != null && message.hasOwnProperty(\"apiName\"))\n object.apiName = message.apiName;\n if (message.reqData != null && message.hasOwnProperty(\"reqData\"))\n object.reqData = options.bytes === String ? $util.base64.encode(message.reqData, 0, message.reqData.length) : options.bytes === Array ? Array.prototype.slice.call(message.reqData) : message.reqData;\n return object;\n };\n\n /**\n * Converts this SvrkitApiData to JSON.\n * @function toJSON\n * @memberof SvrkitApiData\n * @instance\n * @returns {Object.} JSON object\n */\n SvrkitApiData.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return SvrkitApiData;\n})();\n\n/**\n * HTTP_METHODS enum.\n * @exports HTTP_METHODS\n * @enum {string}\n * @property {number} HTTP_GET=1 HTTP_GET value\n * @property {number} HTTP_POST=2 HTTP_POST value\n * @property {number} HTTP_PUT=3 HTTP_PUT value\n * @property {number} HTTP_DELETE=4 HTTP_DELETE value\n * @property {number} HTTP_HEAD=5 HTTP_HEAD value\n * @property {number} HTTP_PATCH=6 HTTP_PATCH value\n */\n$root.HTTP_METHODS = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[1] = \"HTTP_GET\"] = 1;\n values[valuesById[2] = \"HTTP_POST\"] = 2;\n values[valuesById[3] = \"HTTP_PUT\"] = 3;\n values[valuesById[4] = \"HTTP_DELETE\"] = 4;\n values[valuesById[5] = \"HTTP_HEAD\"] = 5;\n values[valuesById[6] = \"HTTP_PATCH\"] = 6;\n return values;\n})();\n\n$root.HttpHeader = (function() {\n\n /**\n * Properties of a HttpHeader.\n * @exports IHttpHeader\n * @interface IHttpHeader\n * @property {string|null} [key] HttpHeader key\n * @property {string|null} [value] HttpHeader value\n */\n\n /**\n * Constructs a new HttpHeader.\n * @exports HttpHeader\n * @classdesc Represents a HttpHeader.\n * @implements IHttpHeader\n * @constructor\n * @param {IHttpHeader=} [properties] Properties to set\n */\n function HttpHeader(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * HttpHeader key.\n * @member {string} key\n * @memberof HttpHeader\n * @instance\n */\n HttpHeader.prototype.key = \"\";\n\n /**\n * HttpHeader value.\n * @member {string} value\n * @memberof HttpHeader\n * @instance\n */\n HttpHeader.prototype.value = \"\";\n\n /**\n * Creates a new HttpHeader instance using the specified properties.\n * @function create\n * @memberof HttpHeader\n * @static\n * @param {IHttpHeader=} [properties] Properties to set\n * @returns {HttpHeader} HttpHeader instance\n */\n HttpHeader.create = function create(properties) {\n return new HttpHeader(properties);\n };\n\n /**\n * Encodes the specified HttpHeader message. Does not implicitly {@link HttpHeader.verify|verify} messages.\n * @function encode\n * @memberof HttpHeader\n * @static\n * @param {IHttpHeader} message HttpHeader message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n HttpHeader.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.key != null && message.hasOwnProperty(\"key\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);\n if (message.value != null && message.hasOwnProperty(\"value\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.value);\n return writer;\n };\n\n /**\n * Encodes the specified HttpHeader message, length delimited. Does not implicitly {@link HttpHeader.verify|verify} messages.\n * @function encodeDelimited\n * @memberof HttpHeader\n * @static\n * @param {IHttpHeader} message HttpHeader message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n HttpHeader.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a HttpHeader message from the specified reader or buffer.\n * @function decode\n * @memberof HttpHeader\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {HttpHeader} HttpHeader\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n HttpHeader.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.HttpHeader();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.key = reader.string();\n break;\n case 2:\n message.value = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a HttpHeader message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof HttpHeader\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {HttpHeader} HttpHeader\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n HttpHeader.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a HttpHeader message.\n * @function verify\n * @memberof HttpHeader\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n HttpHeader.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.key != null && message.hasOwnProperty(\"key\"))\n if (!$util.isString(message.key))\n return \"key: string expected\";\n if (message.value != null && message.hasOwnProperty(\"value\"))\n if (!$util.isString(message.value))\n return \"value: string expected\";\n return null;\n };\n\n /**\n * Creates a HttpHeader message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof HttpHeader\n * @static\n * @param {Object.} object Plain object\n * @returns {HttpHeader} HttpHeader\n */\n HttpHeader.fromObject = function fromObject(object) {\n if (object instanceof $root.HttpHeader)\n return object;\n var message = new $root.HttpHeader();\n if (object.key != null)\n message.key = String(object.key);\n if (object.value != null)\n message.value = String(object.value);\n return message;\n };\n\n /**\n * Creates a plain object from a HttpHeader message. Also converts values to other types if specified.\n * @function toObject\n * @memberof HttpHeader\n * @static\n * @param {HttpHeader} message HttpHeader\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n HttpHeader.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.key = \"\";\n object.value = \"\";\n }\n if (message.key != null && message.hasOwnProperty(\"key\"))\n object.key = message.key;\n if (message.value != null && message.hasOwnProperty(\"value\"))\n object.value = message.value;\n return object;\n };\n\n /**\n * Converts this HttpHeader to JSON.\n * @function toJSON\n * @memberof HttpHeader\n * @instance\n * @returns {Object.} JSON object\n */\n HttpHeader.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return HttpHeader;\n})();\n\n$root.ApiGetOpenDataByCloudIdReq = (function() {\n\n /**\n * Properties of an ApiGetOpenDataByCloudIdReq.\n * @exports IApiGetOpenDataByCloudIdReq\n * @interface IApiGetOpenDataByCloudIdReq\n * @property {Array.|null} [cloudidList] ApiGetOpenDataByCloudIdReq cloudidList\n */\n\n /**\n * Constructs a new ApiGetOpenDataByCloudIdReq.\n * @exports ApiGetOpenDataByCloudIdReq\n * @classdesc Represents an ApiGetOpenDataByCloudIdReq.\n * @implements IApiGetOpenDataByCloudIdReq\n * @constructor\n * @param {IApiGetOpenDataByCloudIdReq=} [properties] Properties to set\n */\n function ApiGetOpenDataByCloudIdReq(properties) {\n this.cloudidList = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * ApiGetOpenDataByCloudIdReq cloudidList.\n * @member {Array.} cloudidList\n * @memberof ApiGetOpenDataByCloudIdReq\n * @instance\n */\n ApiGetOpenDataByCloudIdReq.prototype.cloudidList = $util.emptyArray;\n\n /**\n * Creates a new ApiGetOpenDataByCloudIdReq instance using the specified properties.\n * @function create\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {IApiGetOpenDataByCloudIdReq=} [properties] Properties to set\n * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq instance\n */\n ApiGetOpenDataByCloudIdReq.create = function create(properties) {\n return new ApiGetOpenDataByCloudIdReq(properties);\n };\n\n /**\n * Encodes the specified ApiGetOpenDataByCloudIdReq message. Does not implicitly {@link ApiGetOpenDataByCloudIdReq.verify|verify} messages.\n * @function encode\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {IApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiGetOpenDataByCloudIdReq.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.cloudidList != null && message.cloudidList.length)\n for (var i = 0; i < message.cloudidList.length; ++i)\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.cloudidList[i]);\n return writer;\n };\n\n /**\n * Encodes the specified ApiGetOpenDataByCloudIdReq message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdReq.verify|verify} messages.\n * @function encodeDelimited\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {IApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiGetOpenDataByCloudIdReq.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an ApiGetOpenDataByCloudIdReq message from the specified reader or buffer.\n * @function decode\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiGetOpenDataByCloudIdReq.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdReq();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2:\n if (!(message.cloudidList && message.cloudidList.length))\n message.cloudidList = [];\n message.cloudidList.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an ApiGetOpenDataByCloudIdReq message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiGetOpenDataByCloudIdReq.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an ApiGetOpenDataByCloudIdReq message.\n * @function verify\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ApiGetOpenDataByCloudIdReq.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.cloudidList != null && message.hasOwnProperty(\"cloudidList\")) {\n if (!Array.isArray(message.cloudidList))\n return \"cloudidList: array expected\";\n for (var i = 0; i < message.cloudidList.length; ++i)\n if (!$util.isString(message.cloudidList[i]))\n return \"cloudidList: string[] expected\";\n }\n return null;\n };\n\n /**\n * Creates an ApiGetOpenDataByCloudIdReq message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {Object.} object Plain object\n * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq\n */\n ApiGetOpenDataByCloudIdReq.fromObject = function fromObject(object) {\n if (object instanceof $root.ApiGetOpenDataByCloudIdReq)\n return object;\n var message = new $root.ApiGetOpenDataByCloudIdReq();\n if (object.cloudidList) {\n if (!Array.isArray(object.cloudidList))\n throw TypeError(\".ApiGetOpenDataByCloudIdReq.cloudidList: array expected\");\n message.cloudidList = [];\n for (var i = 0; i < object.cloudidList.length; ++i)\n message.cloudidList[i] = String(object.cloudidList[i]);\n }\n return message;\n };\n\n /**\n * Creates a plain object from an ApiGetOpenDataByCloudIdReq message. Also converts values to other types if specified.\n * @function toObject\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {ApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ApiGetOpenDataByCloudIdReq.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.cloudidList = [];\n if (message.cloudidList && message.cloudidList.length) {\n object.cloudidList = [];\n for (var j = 0; j < message.cloudidList.length; ++j)\n object.cloudidList[j] = message.cloudidList[j];\n }\n return object;\n };\n\n /**\n * Converts this ApiGetOpenDataByCloudIdReq to JSON.\n * @function toJSON\n * @memberof ApiGetOpenDataByCloudIdReq\n * @instance\n * @returns {Object.} JSON object\n */\n ApiGetOpenDataByCloudIdReq.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ApiGetOpenDataByCloudIdReq;\n})();\n\n$root.ApiGetOpenDataByCloudIdResp = (function() {\n\n /**\n * Properties of an ApiGetOpenDataByCloudIdResp.\n * @exports IApiGetOpenDataByCloudIdResp\n * @interface IApiGetOpenDataByCloudIdResp\n * @property {Array.|null} [dataList] ApiGetOpenDataByCloudIdResp dataList\n */\n\n /**\n * Constructs a new ApiGetOpenDataByCloudIdResp.\n * @exports ApiGetOpenDataByCloudIdResp\n * @classdesc Represents an ApiGetOpenDataByCloudIdResp.\n * @implements IApiGetOpenDataByCloudIdResp\n * @constructor\n * @param {IApiGetOpenDataByCloudIdResp=} [properties] Properties to set\n */\n function ApiGetOpenDataByCloudIdResp(properties) {\n this.dataList = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * ApiGetOpenDataByCloudIdResp dataList.\n * @member {Array.} dataList\n * @memberof ApiGetOpenDataByCloudIdResp\n * @instance\n */\n ApiGetOpenDataByCloudIdResp.prototype.dataList = $util.emptyArray;\n\n /**\n * Creates a new ApiGetOpenDataByCloudIdResp instance using the specified properties.\n * @function create\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {IApiGetOpenDataByCloudIdResp=} [properties] Properties to set\n * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp instance\n */\n ApiGetOpenDataByCloudIdResp.create = function create(properties) {\n return new ApiGetOpenDataByCloudIdResp(properties);\n };\n\n /**\n * Encodes the specified ApiGetOpenDataByCloudIdResp message. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.verify|verify} messages.\n * @function encode\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {IApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiGetOpenDataByCloudIdResp.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.dataList != null && message.dataList.length)\n for (var i = 0; i < message.dataList.length; ++i)\n $root.ApiGetOpenDataByCloudIdResp.OpDataItem.encode(message.dataList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified ApiGetOpenDataByCloudIdResp message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.verify|verify} messages.\n * @function encodeDelimited\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {IApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiGetOpenDataByCloudIdResp.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an ApiGetOpenDataByCloudIdResp message from the specified reader or buffer.\n * @function decode\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiGetOpenDataByCloudIdResp.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdResp();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (!(message.dataList && message.dataList.length))\n message.dataList = [];\n message.dataList.push($root.ApiGetOpenDataByCloudIdResp.OpDataItem.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an ApiGetOpenDataByCloudIdResp message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiGetOpenDataByCloudIdResp.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an ApiGetOpenDataByCloudIdResp message.\n * @function verify\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ApiGetOpenDataByCloudIdResp.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.dataList != null && message.hasOwnProperty(\"dataList\")) {\n if (!Array.isArray(message.dataList))\n return \"dataList: array expected\";\n for (var i = 0; i < message.dataList.length; ++i) {\n var error = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.verify(message.dataList[i]);\n if (error)\n return \"dataList.\" + error;\n }\n }\n return null;\n };\n\n /**\n * Creates an ApiGetOpenDataByCloudIdResp message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {Object.} object Plain object\n * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp\n */\n ApiGetOpenDataByCloudIdResp.fromObject = function fromObject(object) {\n if (object instanceof $root.ApiGetOpenDataByCloudIdResp)\n return object;\n var message = new $root.ApiGetOpenDataByCloudIdResp();\n if (object.dataList) {\n if (!Array.isArray(object.dataList))\n throw TypeError(\".ApiGetOpenDataByCloudIdResp.dataList: array expected\");\n message.dataList = [];\n for (var i = 0; i < object.dataList.length; ++i) {\n if (typeof object.dataList[i] !== \"object\")\n throw TypeError(\".ApiGetOpenDataByCloudIdResp.dataList: object expected\");\n message.dataList[i] = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.fromObject(object.dataList[i]);\n }\n }\n return message;\n };\n\n /**\n * Creates a plain object from an ApiGetOpenDataByCloudIdResp message. Also converts values to other types if specified.\n * @function toObject\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {ApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ApiGetOpenDataByCloudIdResp.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.dataList = [];\n if (message.dataList && message.dataList.length) {\n object.dataList = [];\n for (var j = 0; j < message.dataList.length; ++j)\n object.dataList[j] = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.toObject(message.dataList[j], options);\n }\n return object;\n };\n\n /**\n * Converts this ApiGetOpenDataByCloudIdResp to JSON.\n * @function toJSON\n * @memberof ApiGetOpenDataByCloudIdResp\n * @instance\n * @returns {Object.} JSON object\n */\n ApiGetOpenDataByCloudIdResp.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n ApiGetOpenDataByCloudIdResp.OpDataItem = (function() {\n\n /**\n * Properties of an OpDataItem.\n * @memberof ApiGetOpenDataByCloudIdResp\n * @interface IOpDataItem\n * @property {string|null} [cloudId] OpDataItem cloudId\n * @property {string|null} [json] OpDataItem json\n */\n\n /**\n * Constructs a new OpDataItem.\n * @memberof ApiGetOpenDataByCloudIdResp\n * @classdesc Represents an OpDataItem.\n * @implements IOpDataItem\n * @constructor\n * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem=} [properties] Properties to set\n */\n function OpDataItem(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * OpDataItem cloudId.\n * @member {string} cloudId\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @instance\n */\n OpDataItem.prototype.cloudId = \"\";\n\n /**\n * OpDataItem json.\n * @member {string} json\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @instance\n */\n OpDataItem.prototype.json = \"\";\n\n /**\n * Creates a new OpDataItem instance using the specified properties.\n * @function create\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem=} [properties] Properties to set\n * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem instance\n */\n OpDataItem.create = function create(properties) {\n return new OpDataItem(properties);\n };\n\n /**\n * Encodes the specified OpDataItem message. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.OpDataItem.verify|verify} messages.\n * @function encode\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem} message OpDataItem message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OpDataItem.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.cloudId != null && message.hasOwnProperty(\"cloudId\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudId);\n if (message.json != null && message.hasOwnProperty(\"json\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.json);\n return writer;\n };\n\n /**\n * Encodes the specified OpDataItem message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.OpDataItem.verify|verify} messages.\n * @function encodeDelimited\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem} message OpDataItem message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OpDataItem.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an OpDataItem message from the specified reader or buffer.\n * @function decode\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OpDataItem.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdResp.OpDataItem();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.cloudId = reader.string();\n break;\n case 2:\n message.json = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an OpDataItem message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OpDataItem.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an OpDataItem message.\n * @function verify\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n OpDataItem.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.cloudId != null && message.hasOwnProperty(\"cloudId\"))\n if (!$util.isString(message.cloudId))\n return \"cloudId: string expected\";\n if (message.json != null && message.hasOwnProperty(\"json\"))\n if (!$util.isString(message.json))\n return \"json: string expected\";\n return null;\n };\n\n /**\n * Creates an OpDataItem message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {Object.} object Plain object\n * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem\n */\n OpDataItem.fromObject = function fromObject(object) {\n if (object instanceof $root.ApiGetOpenDataByCloudIdResp.OpDataItem)\n return object;\n var message = new $root.ApiGetOpenDataByCloudIdResp.OpDataItem();\n if (object.cloudId != null)\n message.cloudId = String(object.cloudId);\n if (object.json != null)\n message.json = String(object.json);\n return message;\n };\n\n /**\n * Creates a plain object from an OpDataItem message. Also converts values to other types if specified.\n * @function toObject\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {ApiGetOpenDataByCloudIdResp.OpDataItem} message OpDataItem\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n OpDataItem.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.cloudId = \"\";\n object.json = \"\";\n }\n if (message.cloudId != null && message.hasOwnProperty(\"cloudId\"))\n object.cloudId = message.cloudId;\n if (message.json != null && message.hasOwnProperty(\"json\"))\n object.json = message.json;\n return object;\n };\n\n /**\n * Converts this OpDataItem to JSON.\n * @function toJSON\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @instance\n * @returns {Object.} JSON object\n */\n OpDataItem.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return OpDataItem;\n })();\n\n return ApiGetOpenDataByCloudIdResp;\n})();\n\n$root.ApiVoipSignReq = (function() {\n\n /**\n * Properties of an ApiVoipSignReq.\n * @exports IApiVoipSignReq\n * @interface IApiVoipSignReq\n * @property {string|null} [groupId] ApiVoipSignReq groupId\n * @property {number|null} [timestamp] ApiVoipSignReq timestamp\n * @property {string|null} [nonce] ApiVoipSignReq nonce\n */\n\n /**\n * Constructs a new ApiVoipSignReq.\n * @exports ApiVoipSignReq\n * @classdesc Represents an ApiVoipSignReq.\n * @implements IApiVoipSignReq\n * @constructor\n * @param {IApiVoipSignReq=} [properties] Properties to set\n */\n function ApiVoipSignReq(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * ApiVoipSignReq groupId.\n * @member {string} groupId\n * @memberof ApiVoipSignReq\n * @instance\n */\n ApiVoipSignReq.prototype.groupId = \"\";\n\n /**\n * ApiVoipSignReq timestamp.\n * @member {number} timestamp\n * @memberof ApiVoipSignReq\n * @instance\n */\n ApiVoipSignReq.prototype.timestamp = 0;\n\n /**\n * ApiVoipSignReq nonce.\n * @member {string} nonce\n * @memberof ApiVoipSignReq\n * @instance\n */\n ApiVoipSignReq.prototype.nonce = \"\";\n\n /**\n * Creates a new ApiVoipSignReq instance using the specified properties.\n * @function create\n * @memberof ApiVoipSignReq\n * @static\n * @param {IApiVoipSignReq=} [properties] Properties to set\n * @returns {ApiVoipSignReq} ApiVoipSignReq instance\n */\n ApiVoipSignReq.create = function create(properties) {\n return new ApiVoipSignReq(properties);\n };\n\n /**\n * Encodes the specified ApiVoipSignReq message. Does not implicitly {@link ApiVoipSignReq.verify|verify} messages.\n * @function encode\n * @memberof ApiVoipSignReq\n * @static\n * @param {IApiVoipSignReq} message ApiVoipSignReq message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiVoipSignReq.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.groupId != null && message.hasOwnProperty(\"groupId\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupId);\n if (message.timestamp != null && message.hasOwnProperty(\"timestamp\"))\n writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.timestamp);\n if (message.nonce != null && message.hasOwnProperty(\"nonce\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.nonce);\n return writer;\n };\n\n /**\n * Encodes the specified ApiVoipSignReq message, length delimited. Does not implicitly {@link ApiVoipSignReq.verify|verify} messages.\n * @function encodeDelimited\n * @memberof ApiVoipSignReq\n * @static\n * @param {IApiVoipSignReq} message ApiVoipSignReq message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiVoipSignReq.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an ApiVoipSignReq message from the specified reader or buffer.\n * @function decode\n * @memberof ApiVoipSignReq\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {ApiVoipSignReq} ApiVoipSignReq\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiVoipSignReq.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiVoipSignReq();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2:\n message.groupId = reader.string();\n break;\n case 3:\n message.timestamp = reader.uint32();\n break;\n case 4:\n message.nonce = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an ApiVoipSignReq message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof ApiVoipSignReq\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {ApiVoipSignReq} ApiVoipSignReq\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiVoipSignReq.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an ApiVoipSignReq message.\n * @function verify\n * @memberof ApiVoipSignReq\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ApiVoipSignReq.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.groupId != null && message.hasOwnProperty(\"groupId\"))\n if (!$util.isString(message.groupId))\n return \"groupId: string expected\";\n if (message.timestamp != null && message.hasOwnProperty(\"timestamp\"))\n if (!$util.isInteger(message.timestamp))\n return \"timestamp: integer expected\";\n if (message.nonce != null && message.hasOwnProperty(\"nonce\"))\n if (!$util.isString(message.nonce))\n return \"nonce: string expected\";\n return null;\n };\n\n /**\n * Creates an ApiVoipSignReq message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof ApiVoipSignReq\n * @static\n * @param {Object.} object Plain object\n * @returns {ApiVoipSignReq} ApiVoipSignReq\n */\n ApiVoipSignReq.fromObject = function fromObject(object) {\n if (object instanceof $root.ApiVoipSignReq)\n return object;\n var message = new $root.ApiVoipSignReq();\n if (object.groupId != null)\n message.groupId = String(object.groupId);\n if (object.timestamp != null)\n message.timestamp = object.timestamp >>> 0;\n if (object.nonce != null)\n message.nonce = String(object.nonce);\n return message;\n };\n\n /**\n * Creates a plain object from an ApiVoipSignReq message. Also converts values to other types if specified.\n * @function toObject\n * @memberof ApiVoipSignReq\n * @static\n * @param {ApiVoipSignReq} message ApiVoipSignReq\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ApiVoipSignReq.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.groupId = \"\";\n object.timestamp = 0;\n object.nonce = \"\";\n }\n if (message.groupId != null && message.hasOwnProperty(\"groupId\"))\n object.groupId = message.groupId;\n if (message.timestamp != null && message.hasOwnProperty(\"timestamp\"))\n object.timestamp = message.timestamp;\n if (message.nonce != null && message.hasOwnProperty(\"nonce\"))\n object.nonce = message.nonce;\n return object;\n };\n\n /**\n * Converts this ApiVoipSignReq to JSON.\n * @function toJSON\n * @memberof ApiVoipSignReq\n * @instance\n * @returns {Object.} JSON object\n */\n ApiVoipSignReq.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ApiVoipSignReq;\n})();\n\n$root.ApiVoipSignResp = (function() {\n\n /**\n * Properties of an ApiVoipSignResp.\n * @exports IApiVoipSignResp\n * @interface IApiVoipSignResp\n * @property {string|null} [signature] ApiVoipSignResp signature\n */\n\n /**\n * Constructs a new ApiVoipSignResp.\n * @exports ApiVoipSignResp\n * @classdesc Represents an ApiVoipSignResp.\n * @implements IApiVoipSignResp\n * @constructor\n * @param {IApiVoipSignResp=} [properties] Properties to set\n */\n function ApiVoipSignResp(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * ApiVoipSignResp signature.\n * @member {string} signature\n * @memberof ApiVoipSignResp\n * @instance\n */\n ApiVoipSignResp.prototype.signature = \"\";\n\n /**\n * Creates a new ApiVoipSignResp instance using the specified properties.\n * @function create\n * @memberof ApiVoipSignResp\n * @static\n * @param {IApiVoipSignResp=} [properties] Properties to set\n * @returns {ApiVoipSignResp} ApiVoipSignResp instance\n */\n ApiVoipSignResp.create = function create(properties) {\n return new ApiVoipSignResp(properties);\n };\n\n /**\n * Encodes the specified ApiVoipSignResp message. Does not implicitly {@link ApiVoipSignResp.verify|verify} messages.\n * @function encode\n * @memberof ApiVoipSignResp\n * @static\n * @param {IApiVoipSignResp} message ApiVoipSignResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiVoipSignResp.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.signature != null && message.hasOwnProperty(\"signature\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.signature);\n return writer;\n };\n\n /**\n * Encodes the specified ApiVoipSignResp message, length delimited. Does not implicitly {@link ApiVoipSignResp.verify|verify} messages.\n * @function encodeDelimited\n * @memberof ApiVoipSignResp\n * @static\n * @param {IApiVoipSignResp} message ApiVoipSignResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiVoipSignResp.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an ApiVoipSignResp message from the specified reader or buffer.\n * @function decode\n * @memberof ApiVoipSignResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {ApiVoipSignResp} ApiVoipSignResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiVoipSignResp.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiVoipSignResp();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.signature = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an ApiVoipSignResp message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof ApiVoipSignResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {ApiVoipSignResp} ApiVoipSignResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiVoipSignResp.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an ApiVoipSignResp message.\n * @function verify\n * @memberof ApiVoipSignResp\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ApiVoipSignResp.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.signature != null && message.hasOwnProperty(\"signature\"))\n if (!$util.isString(message.signature))\n return \"signature: string expected\";\n return null;\n };\n\n /**\n * Creates an ApiVoipSignResp message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof ApiVoipSignResp\n * @static\n * @param {Object.} object Plain object\n * @returns {ApiVoipSignResp} ApiVoipSignResp\n */\n ApiVoipSignResp.fromObject = function fromObject(object) {\n if (object instanceof $root.ApiVoipSignResp)\n return object;\n var message = new $root.ApiVoipSignResp();\n if (object.signature != null)\n message.signature = String(object.signature);\n return message;\n };\n\n /**\n * Creates a plain object from an ApiVoipSignResp message. Also converts values to other types if specified.\n * @function toObject\n * @memberof ApiVoipSignResp\n * @static\n * @param {ApiVoipSignResp} message ApiVoipSignResp\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ApiVoipSignResp.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.signature = \"\";\n if (message.signature != null && message.hasOwnProperty(\"signature\"))\n object.signature = message.signature;\n return object;\n };\n\n /**\n * Converts this ApiVoipSignResp to JSON.\n * @function toJSON\n * @memberof ApiVoipSignResp\n * @instance\n * @returns {Object.} JSON object\n */\n ApiVoipSignResp.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ApiVoipSignResp;\n})();\n\nmodule.exports = $root;\n\n\n/***/ }),\n\n/***/ \"./src/utils/assert.ts\":\n/*!*****************************!*\\\n !*** ./src/utils/assert.ts ***!\n \\*****************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst type_1 = __webpack_require__(/*! ./type */ \"./src/utils/type.ts\");\nconst error_1 = __webpack_require__(/*! ./error */ \"./src/utils/error.ts\");\nconst error_config_1 = __webpack_require__(/*! config/error.config */ \"./src/config/error.config.ts\");\nfunction sameType(input, ref, name) {\n function sameTypeImpl(input, ref, name) {\n const inputType = type_1.getType(input);\n const refType = type_1.getType(ref);\n if (inputType !== refType) {\n return `${name} should be ${refType} instead of ${inputType}; `;\n }\n let errors = '';\n switch (inputType) {\n case 'object': {\n for (const key in ref) {\n errors += sameTypeImpl(input[key], ref[key], `${name}.${key}`);\n }\n break;\n }\n case 'array': {\n for (let i = 0; i < ref.length; i++) {\n errors += sameTypeImpl(input[i], ref[i], `${name}[${i}]`);\n }\n break;\n }\n default: {\n break;\n }\n }\n return errors;\n }\n const error = sameTypeImpl(input, ref, name);\n return {\n passed: !error,\n reason: error,\n };\n}\nexports.sameType = sameType;\nfunction validType(input, ref, name = 'parameter') {\n function validTypeImpl(input, ref, name) {\n const inputType = type_1.getType(input);\n const refType = type_1.getType(ref);\n if (refType === 'string') {\n if (inputType !== ref) {\n return `${name} should be ${ref} instead of ${inputType};`;\n }\n return '';\n }\n else {\n if (inputType !== refType) {\n return `${name} should be ${refType} instead of ${inputType}; `;\n }\n let errors = '';\n switch (inputType) {\n case 'object': {\n for (const key in ref) {\n errors += validTypeImpl(input[key], ref[key], `${name}.${key}`);\n }\n break;\n }\n case 'array': {\n for (let i = 0; i < ref.length; i++) {\n errors += validTypeImpl(input[i], ref[i], `${name}[${i}]`);\n }\n break;\n }\n default: {\n break;\n }\n }\n return errors;\n }\n }\n const error = validTypeImpl(input, ref, name);\n return {\n passed: !error,\n reason: error,\n };\n}\nexports.validType = validType;\nfunction validObjectOptionalType(input, ref, name = 'parameter') {\n function validImpl(input, ref, name) {\n const inputType = type_1.getType(input);\n const refType = type_1.getType(ref);\n if (refType !== 'object')\n return '';\n if (inputType === 'object') {\n for (const key in input) {\n const val = input[key];\n if (val === undefined || key === null) {\n continue;\n }\n const assertResult = validType(val, ref[key], `${name}.${key}`);\n return assertResult.passed ? '' : assertResult.reason;\n }\n }\n else {\n return `${name} should be object instead of ${inputType}`;\n }\n return '';\n }\n const error = validImpl(input, ref, name);\n return {\n passed: !error,\n reason: error,\n };\n}\nexports.validObjectOptionalType = validObjectOptionalType;\nfunction assertType(param, ref, name = 'parameter', ErrorClass = error_1.CloudSDKError) {\n // check param validity\n let paramCheckResult = validType(param, ref, name);\n if (!paramCheckResult.passed) {\n throw new ErrorClass({\n errMsg: paramCheckResult.reason,\n });\n }\n}\nexports.assertType = assertType;\nfunction assertObjectOptionalType(param, ref, name = 'parameter', ErrorClass = error_1.CloudSDKError) {\n // check param validity\n let paramCheckResult = validObjectOptionalType(param, ref, name);\n if (!paramCheckResult.passed) {\n throw new ErrorClass({\n errMsg: paramCheckResult.reason,\n });\n }\n}\nexports.assertObjectOptionalType = assertObjectOptionalType;\nfunction assertRequiredParam(param, name, funcName, ErrorClass = error_1.CloudSDKError) {\n if (param === undefined || param === null) {\n throw new ErrorClass({\n errMsg: `parameter ${name} of function ${funcName} must be provided`,\n });\n }\n}\nexports.assertRequiredParam = assertRequiredParam;\nfunction assertObjectNotEmpty({ target, name, ErrorClass = error_1.CloudSDKError }) {\n if (Object.keys(target).length === 0) {\n throw new ErrorClass({\n errCode: error_config_1.ERR_CODE.SDK_API_PARAMETER_ERROR,\n errMsg: `${name} must not be empty`\n });\n }\n}\nexports.assertObjectNotEmpty = assertObjectNotEmpty;\n/*\nexport function constructTypeRef(typeDef: any): any {\n\n const type = getType(typeDef)\n\n switch(type) {\n case 'string': {\n return ''\n }\n case 'number': {\n\n }\n }\n\n}\n*/ \n\n\n/***/ }),\n\n/***/ \"./src/utils/error.ts\":\n/*!****************************!*\\\n !*** ./src/utils/error.ts ***!\n \\****************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst type_1 = __webpack_require__(/*! ./type */ \"./src/utils/type.ts\");\nconst msg_1 = __webpack_require__(/*! ./msg */ \"./src/utils/msg.ts\");\nconst error_config_1 = __webpack_require__(/*! config/error.config */ \"./src/config/error.config.ts\");\nclass CloudSDKError extends Error {\n constructor(options) {\n super(options.errMsg);\n this.errCode = -1;\n Object.defineProperties(this, {\n message: {\n get() {\n return `errCode: ${this.errCode} ${error_config_1.ERR_CODE[this.errCode] || ''} | errMsg: ` + this.errMsg;\n },\n set(msg) {\n this.errMsg = msg;\n }\n }\n });\n this.errCode = options.errCode || -1;\n this.errMsg = options.errMsg;\n }\n get message() {\n return `errCode: ${this.errCode} | errMsg: ` + this.errMsg;\n }\n set message(msg) {\n this.errMsg = msg;\n }\n}\nexports.CloudSDKError = CloudSDKError;\nfunction createError({ errCode = 1, errMsg = '', errClass = CloudSDKError, } = {}) {\n return new errClass({\n errCode,\n errMsg,\n });\n}\nexports.createError = createError;\nfunction isSDKError(error) {\n return error && (error instanceof Error) && type_1.isString(error.errMsg);\n}\nexports.isSDKError = isSDKError;\nfunction returnAsCloudSDKError(err, appendMsg = '') {\n if (err) {\n if (isSDKError(err)) {\n if (appendMsg) {\n err.errMsg += '; ' + appendMsg;\n }\n return err;\n }\n const errCode = err ? err.errCode : undefined;\n const errMsg = (err && err.errMsg || err.toString() || 'unknown error') + '; ' + appendMsg;\n return new CloudSDKError({\n errCode,\n errMsg,\n });\n }\n return new CloudSDKError({\n errMsg: appendMsg\n });\n}\nexports.returnAsCloudSDKError = returnAsCloudSDKError;\nfunction returnAsFinalCloudSDKError(err, apiName) {\n if (err && isSDKError(err)) {\n return err;\n }\n const e = returnAsCloudSDKError(err, `at ${apiName} api; `);\n e.errMsg = msg_1.apiFailMsg(apiName, e.errMsg);\n return e;\n}\nexports.returnAsFinalCloudSDKError = returnAsFinalCloudSDKError;\n\n\n/***/ }),\n\n/***/ \"./src/utils/mimetype.ts\":\n/*!*******************************!*\\\n !*** ./src/utils/mimetype.ts ***!\n \\*******************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst mimeDB = __webpack_require__(/*! mime-db */ \"mime-db\");\nexports.mimeTypeToFileExtension = (mimeType, defaultExtension) => {\n const mime = mimeDB[mimeType];\n if (mime && mime.extensions && mime.extensions.length) {\n return mime.extensions[0];\n }\n else {\n return defaultExtension;\n }\n};\n\n\n/***/ }),\n\n/***/ \"./src/utils/msg.ts\":\n/*!**************************!*\\\n !*** ./src/utils/msg.ts ***!\n \\**************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction apiSuccessMsg(apiName) {\n return `${apiName}:ok`;\n}\nexports.apiSuccessMsg = apiSuccessMsg;\nfunction apiCancelMsg(apiName, msg) {\n return `${apiName}:cancel ${msg}`;\n}\nexports.apiCancelMsg = apiCancelMsg;\nfunction apiFailMsg(apiName, msg) {\n return `${apiName}:fail ${msg}`;\n}\nexports.apiFailMsg = apiFailMsg;\n\n\n/***/ }),\n\n/***/ \"./src/utils/symbol.ts\":\n/*!*****************************!*\\\n !*** ./src/utils/symbol.ts ***!\n \\*****************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst _symbols = [];\nconst __internalMark__ = {};\nclass HiddenSymbol {\n constructor(target) {\n Object.defineProperties(this, {\n target: {\n enumerable: false,\n writable: false,\n configurable: false,\n value: target,\n },\n });\n }\n}\nclass InternalSymbol extends HiddenSymbol {\n constructor(target, __mark__) {\n if (__mark__ !== __internalMark__) {\n throw new TypeError('InternalSymbol cannot be constructed with new operator');\n }\n super(target);\n }\n static for(target) {\n for (let i = 0, len = _symbols.length; i < len; i++) {\n if (_symbols[i].target === target) {\n return _symbols[i].instance;\n }\n }\n const symbol = new InternalSymbol(target, __internalMark__);\n _symbols.push({\n target,\n instance: symbol,\n });\n return symbol;\n }\n}\nexports.InternalSymbol = InternalSymbol;\nexports.default = InternalSymbol;\n\n\n/***/ }),\n\n/***/ \"./src/utils/type.ts\":\n/*!***************************!*\\\n !*** ./src/utils/type.ts ***!\n \\***************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst symbol_1 = __webpack_require__(/*! ./symbol */ \"./src/utils/symbol.ts\");\nexports.getType = (x) => Object.prototype.toString.call(x).slice(8, -1).toLowerCase();\nexports.isObject = (x) => exports.getType(x) === 'object';\nexports.isString = (x) => exports.getType(x) === 'string';\nexports.isNumber = (x) => exports.getType(x) === 'number';\nexports.isPromise = (x) => exports.getType(x) === 'promise';\nexports.isFunction = (x) => typeof x === 'function';\nexports.isArray = (x) => Array.isArray(x);\nexports.isDate = (x) => exports.getType(x) === 'date';\nexports.isBuffer = (x) => Buffer.isBuffer(x);\nexports.isInternalObject = (x) => x && (x._internalType instanceof symbol_1.InternalSymbol);\nexports.isPlainObject = (obj) => {\n if (typeof obj !== 'object' || obj === null)\n return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto;\n};\n\n\n/***/ }),\n\n/***/ \"./src/utils/utils.ts\":\n/*!****************************!*\\\n !*** ./src/utils/utils.ts ***!\n \\****************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst type_1 = __webpack_require__(/*! ./type */ \"./src/utils/type.ts\");\nconst symbol_config_1 = __webpack_require__(/*! config/symbol.config */ \"./src/config/symbol.config.ts\");\nexports.convertCase = (input, options) => {\n const { from, to, recursive } = options;\n if (type_1.isString(input)) {\n if (from === 'camelcase' && to === 'snakecase') {\n return input.replace(/[A-Z]/g, (match, ind) => `${ind ? '_' : ''}${match.toLowerCase()}`);\n }\n else if (from === 'snakecase' && to === 'camelcase') {\n return input.replace(/_[a-z]/g, (match, ind) => `${match[1].toUpperCase()}`);\n }\n }\n else if (type_1.isObject(input)) {\n return convertObject(input);\n }\n else if (type_1.isArray(input)) {\n const array = [];\n for (const item of input) {\n if (type_1.isObject(item)) {\n array.push(convertObject(item));\n }\n else if (type_1.isArray(item)) {\n if (options.recursive) {\n array.push(exports.convertCase(item, options));\n }\n else {\n array.push(item);\n }\n }\n else {\n array.push(item);\n }\n }\n return array;\n }\n else\n return input;\n function convertObject(input) {\n const data = Object.assign({}, input);\n for (const key in data) {\n const val = recursive && (type_1.isObject(data[key]) || type_1.isArray(data[key])) ? exports.convertCase(data[key], options) : data[key];\n const convertedKey = exports.convertCase(key, options);\n data[convertedKey] = val;\n if (convertedKey !== key) {\n delete data[key];\n }\n }\n return data;\n }\n};\nexports.isSCFEnvReady = () => Boolean(process.env.TCB_ENV);\nexports.translateEnv = (env) => {\n if (!env) {\n return undefined;\n }\n if (env === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {\n env = process.env.TCB_ENV || process.env.SCF_NAMESPACE;\n }\n // in scf local debug, we should not use 'local' as env in api invocation\n if (env === 'local' && process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {\n return undefined;\n }\n return env;\n};\nexports.getEnvFromCloudConfig = (config, serviceName = 'default') => {\n const env = config.env[serviceName] || config.env.default;\n return exports.translateEnv(env);\n};\nexports.getEnvFromAPIConfig = (apiConfig, cloudConfig, serviceName = 'default') => {\n if (apiConfig && apiConfig.env) {\n return exports.translateEnv(apiConfig.env);\n }\n return exports.getEnvFromCloudConfig(cloudConfig, serviceName);\n};\nexports.getServiceConfigFromDefaultConfig = (defaultConfig, serviceName = 'default') => {\n return Object.assign(Object.assign({}, defaultConfig), { env: exports.getEnvFromCloudConfig(defaultConfig, serviceName) });\n};\nexports.getMergedAPIConfig = (defaultConfig, newConfig, serviceName = 'default') => {\n const merged = Object.assign(Object.assign({}, defaultConfig), newConfig);\n if (newConfig && newConfig.env) {\n merged.env = exports.translateEnv(newConfig.env);\n }\n else {\n merged.env = exports.getEnvFromCloudConfig(defaultConfig, serviceName);\n }\n return merged;\n};\n\n\n/***/ }),\n\n/***/ \"mime-db\":\n/*!**************************!*\\\n !*** external \"mime-db\" ***!\n \\**************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"mime-db\");\n\n/***/ }),\n\n/***/ \"protobufjs/minimal\":\n/*!*************************************!*\\\n !*** external \"protobufjs/minimal\" ***!\n \\*************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"protobufjs/minimal\");\n\n/***/ }),\n\n/***/ \"tcb-admin-node\":\n/*!*********************************!*\\\n !*** external \"tcb-admin-node\" ***!\n \\*********************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"tcb-admin-node\");\n\n/***/ }),\n\n/***/ \"tcb-admin-node/src/utils/httpRequest\":\n/*!*******************************************************!*\\\n !*** external \"tcb-admin-node/src/utils/httpRequest\" ***!\n \\*******************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"tcb-admin-node/src/utils/httpRequest\");\n\n/***/ })\n\n/******/ });","module.exports = {\n \"_from\": \"wx-server-sdk@latest\",\n \"_id\": \"wx-server-sdk@1.8.3\",\n \"_inBundle\": false,\n \"_integrity\": \"sha1-VE9wCQJ0RCKFzQBdf0i7tt+wAow=\",\n \"_location\": \"/wx-server-sdk\",\n \"_phantomChildren\": {},\n \"_requested\": {\n \"type\": \"tag\",\n \"registry\": true,\n \"raw\": \"wx-server-sdk@latest\",\n \"name\": \"wx-server-sdk\",\n \"escapedName\": \"wx-server-sdk\",\n \"rawSpec\": \"latest\",\n \"saveSpec\": null,\n \"fetchSpec\": \"latest\"\n },\n \"_requiredBy\": [\n \"#USER\",\n \"/\"\n ],\n \"_resolved\": \"https://registry.npm.taobao.org/wx-server-sdk/download/wx-server-sdk-1.8.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwx-server-sdk%2Fdownload%2Fwx-server-sdk-1.8.3.tgz\",\n \"_shasum\": \"544f70090274442285cd005d7f48bbb6dfb0028c\",\n \"_spec\": \"wx-server-sdk@latest\",\n \"_where\": \"/Users/romchung/Wechat-Miniprogram/miniprogram-demo/cloudfunctions/wxContext\",\n \"author\": {\n \"name\": \"wechat mini program team\"\n },\n \"bundleDependencies\": false,\n \"dependencies\": {\n \"protobufjs\": \"6.8.8\",\n \"tcb-admin-node\": \"1.22.0\",\n \"tslib\": \"^1.9.3\"\n },\n \"deprecated\": false,\n \"description\": \"mini program cloud server sdk\",\n \"homepage\": \"https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html\",\n \"license\": \"MIT\",\n \"main\": \"index.js\",\n \"name\": \"wx-server-sdk\",\n \"types\": \"index.d.ts\",\n \"version\": \"1.8.3\"\n}\n"]}
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/wxml-to-canvas/index.js b/miniprogram/miniprogram_npm/wxml-to-canvas/index.js
new file mode 100644
index 00000000..2a4f21e5
--- /dev/null
+++ b/miniprogram/miniprogram_npm/wxml-to-canvas/index.js
@@ -0,0 +1,779 @@
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory();
+ else if(typeof define === 'function' && define.amd)
+ define([], factory);
+ else {
+ var a = factory();
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
+ }
+})(window, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // create a fake namespace object
+/******/ // mode & 1: value is a module id, require it
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = __webpack_require__(value);
+/******/ if(mode & 8) return value;
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ return ns;
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 1);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports) {
+
+const hex = (color) => {
+ let result = null
+
+ if (/^#/.test(color) && (color.length === 7 || color.length === 9)) {
+ return color
+ // eslint-disable-next-line no-cond-assign
+ } else if ((result = /^(rgb|rgba)\((.+)\)/.exec(color)) !== null) {
+ return '#' + result[2].split(',').map((part, index) => {
+ part = part.trim()
+ part = index === 3 ? Math.floor(parseFloat(part) * 255) : parseInt(part, 10)
+ part = part.toString(16)
+ if (part.length === 1) {
+ part = '0' + part
+ }
+ return part
+ }).join('')
+ } else {
+ return '#00000000'
+ }
+}
+
+const splitLineToCamelCase = (str) => str.split('-').map((part, index) => {
+ if (index === 0) {
+ return part
+ }
+ return part[0].toUpperCase() + part.slice(1)
+}).join('')
+
+const compareVersion = (v1, v2) => {
+ v1 = v1.split('.')
+ v2 = v2.split('.')
+ const len = Math.max(v1.length, v2.length)
+ while (v1.length < len) {
+ v1.push('0')
+ }
+ while (v2.length < len) {
+ v2.push('0')
+ }
+ for (let i = 0; i < len; i++) {
+ const num1 = parseInt(v1[i], 10)
+ const num2 = parseInt(v2[i], 10)
+
+ if (num1 > num2) {
+ return 1
+ } else if (num1 < num2) {
+ return -1
+ }
+ }
+
+ return 0
+}
+
+module.exports = {
+ hex,
+ splitLineToCamelCase,
+ compareVersion
+}
+
+
+/***/ }),
+/* 1 */
+/***/ (function(module, exports, __webpack_require__) {
+
+
+const xmlParse = __webpack_require__(2)
+const {Widget} = __webpack_require__(3)
+const {Draw} = __webpack_require__(5)
+const {compareVersion} = __webpack_require__(0)
+
+const canvasId = 'weui-canvas'
+
+Component({
+ properties: {
+ width: {
+ type: Number,
+ value: 400
+ },
+ height: {
+ type: Number,
+ value: 300
+ }
+ },
+ data: {
+ use2dCanvas: false, // 2.9.2 后可用canvas 2d 接口
+ },
+ lifetimes: {
+ attached() {
+ const {SDKVersion, pixelRatio: dpr} = wx.getSystemInfoSync()
+ const use2dCanvas = compareVersion(SDKVersion, '2.9.2') >= 0
+ this.dpr = dpr
+ this.setData({use2dCanvas}, () => {
+ if (use2dCanvas) {
+ const query = this.createSelectorQuery()
+ query.select(`#${canvasId}`)
+ .fields({node: true, size: true})
+ .exec(res => {
+ const canvas = res[0].node
+ const ctx = canvas.getContext('2d')
+ canvas.width = res[0].width * dpr
+ canvas.height = res[0].height * dpr
+ ctx.scale(dpr, dpr)
+ this.ctx = ctx
+ this.canvas = canvas
+ })
+ } else {
+ this.ctx = wx.createCanvasContext(canvasId, this)
+ }
+ })
+ }
+ },
+ methods: {
+ async renderToCanvas(args) {
+ const {wxml, style} = args
+ const ctx = this.ctx
+ const canvas = this.canvas
+ const use2dCanvas = this.data.use2dCanvas
+
+ if (use2dCanvas && !canvas) {
+ return Promise.reject(new Error('renderToCanvas: fail canvas has not been created'))
+ }
+
+ ctx.clearRect(0, 0, this.data.width, this.data.height)
+ const {root: xom} = xmlParse(wxml)
+
+ const widget = new Widget(xom, style)
+ const container = widget.init()
+ this.boundary = {
+ top: container.layoutBox.top,
+ left: container.layoutBox.left,
+ width: container.computedStyle.width,
+ height: container.computedStyle.height,
+ }
+ const draw = new Draw(ctx, canvas, use2dCanvas)
+ await draw.drawNode(container)
+
+ if (!use2dCanvas) {
+ await this.canvasDraw(ctx)
+ }
+ return Promise.resolve(container)
+ },
+
+ canvasDraw(ctx, reserve) {
+ return new Promise(resolve => {
+ ctx.draw(reserve, () => {
+ resolve()
+ })
+ })
+ },
+
+ canvasToTempFilePath(args = {}) {
+ const use2dCanvas = this.data.use2dCanvas
+
+ return new Promise((resolve, reject) => {
+ const {
+ top, left, width, height
+ } = this.boundary
+
+ const copyArgs = {
+ x: left,
+ y: top,
+ width,
+ height,
+ destWidth: width * this.dpr,
+ destHeight: height * this.dpr,
+ canvasId,
+ fileType: args.fileType || 'png',
+ quality: args.quality || 1,
+ success: resolve,
+ fail: reject
+ }
+
+ if (use2dCanvas) {
+ delete copyArgs.canvasId
+ copyArgs.canvas = this.canvas
+ }
+ wx.canvasToTempFilePath(copyArgs, this)
+ })
+ }
+ }
+})
+
+
+/***/ }),
+/* 2 */
+/***/ (function(module, exports) {
+
+
+/**
+ * Module dependencies.
+ */
+
+
+/**
+ * Expose `parse`.
+ */
+
+
+/**
+ * Parse the given string of `xml`.
+ *
+ * @param {String} xml
+ * @return {Object}
+ * @api public
+ */
+
+function parse(xml) {
+ xml = xml.trim()
+
+ // strip comments
+ xml = xml.replace(//g, '')
+
+ return document()
+
+ /**
+ * XML document.
+ */
+
+ function document() {
+ return {
+ declaration: declaration(),
+ root: tag()
+ }
+ }
+
+ /**
+ * Declaration.
+ */
+
+ function declaration() {
+ const m = match(/^<\?xml\s*/)
+ if (!m) return
+
+ // tag
+ const node = {
+ attributes: {}
+ }
+
+ // attributes
+ while (!(eos() || is('?>'))) {
+ const attr = attribute()
+ if (!attr) return node
+ node.attributes[attr.name] = attr.value
+ }
+
+ match(/\?>\s*/)
+
+ return node
+ }
+
+ /**
+ * Tag.
+ */
+
+ function tag() {
+ const m = match(/^<([\w-:.]+)\s*/)
+ if (!m) return
+
+ // name
+ const node = {
+ name: m[1],
+ attributes: {},
+ children: []
+ }
+
+ // attributes
+ while (!(eos() || is('>') || is('?>') || is('/>'))) {
+ const attr = attribute()
+ if (!attr) return node
+ node.attributes[attr.name] = attr.value
+ }
+
+ // self closing tag
+ if (match(/^\s*\/>\s*/)) {
+ return node
+ }
+
+ match(/\??>\s*/)
+
+ // content
+ node.content = content()
+
+ // children
+ let child
+ while (child = tag()) {
+ node.children.push(child)
+ }
+
+ // closing
+ match(/^<\/[\w-:.]+>\s*/)
+
+ return node
+ }
+
+ /**
+ * Text content.
+ */
+
+ function content() {
+ const m = match(/^([^<]*)/)
+ if (m) return m[1]
+ return ''
+ }
+
+ /**
+ * Attribute.
+ */
+
+ function attribute() {
+ const m = match(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/)
+ if (!m) return
+ return {name: m[1], value: strip(m[2])}
+ }
+
+ /**
+ * Strip quotes from `val`.
+ */
+
+ function strip(val) {
+ return val.replace(/^['"]|['"]$/g, '')
+ }
+
+ /**
+ * Match `re` and advance the string.
+ */
+
+ function match(re) {
+ const m = xml.match(re)
+ if (!m) return
+ xml = xml.slice(m[0].length)
+ return m
+ }
+
+ /**
+ * End-of-source.
+ */
+
+ function eos() {
+ return xml.length == 0
+ }
+
+ /**
+ * Check for `prefix`.
+ */
+
+ function is(prefix) {
+ return xml.indexOf(prefix) == 0
+ }
+}
+
+module.exports = parse
+
+
+/***/ }),
+/* 3 */
+/***/ (function(module, exports, __webpack_require__) {
+
+const Block = __webpack_require__(4)
+const {splitLineToCamelCase} = __webpack_require__(0)
+
+class Element extends Block {
+ constructor(prop) {
+ super(prop.style)
+ this.name = prop.name
+ this.attributes = prop.attributes
+ }
+}
+
+
+class Widget {
+ constructor(xom, style) {
+ this.xom = xom
+ this.style = style
+
+ this.inheritProps = ['fontSize', 'lineHeight', 'textAlign', 'verticalAlign', 'color']
+ }
+
+ init() {
+ this.container = this.create(this.xom)
+ this.container.layout()
+
+ this.inheritStyle(this.container)
+ return this.container
+ }
+
+ // 继承父节点的样式
+ inheritStyle(node) {
+ const parent = node.parent || null
+ const children = node.children || {}
+ const computedStyle = node.computedStyle
+
+ if (parent) {
+ this.inheritProps.forEach(prop => {
+ computedStyle[prop] = computedStyle[prop] || parent.computedStyle[prop]
+ })
+ }
+
+ Object.values(children).forEach(child => {
+ this.inheritStyle(child)
+ })
+ }
+
+ create(node) {
+ let classNames = (node.attributes.class || '').split(' ')
+ classNames = classNames.map(item => splitLineToCamelCase(item.trim()))
+ const style = {}
+ classNames.forEach(item => {
+ Object.assign(style, this.style[item] || {})
+ })
+
+ const args = {name: node.name, style}
+
+ const attrs = Object.keys(node.attributes)
+ const attributes = {}
+ for (const attr of attrs) {
+ const value = node.attributes[attr]
+ const CamelAttr = splitLineToCamelCase(attr)
+
+ if (value === '' || value === 'true') {
+ attributes[CamelAttr] = true
+ } else if (value === 'false') {
+ attributes[CamelAttr] = false
+ } else {
+ attributes[CamelAttr] = value
+ }
+ }
+ attributes.text = node.content
+ args.attributes = attributes
+ const element = new Element(args)
+ node.children.forEach(childNode => {
+ const childElement = this.create(childNode)
+ element.add(childElement)
+ })
+ return element
+ }
+}
+
+module.exports = {Widget}
+
+
+/***/ }),
+/* 4 */
+/***/ (function(module, exports) {
+
+module.exports = require("widget-ui");
+
+/***/ }),
+/* 5 */
+/***/ (function(module, exports) {
+
+class Draw {
+ constructor(context, canvas, use2dCanvas = false) {
+ this.ctx = context
+ this.canvas = canvas || null
+ this.use2dCanvas = use2dCanvas
+ }
+
+ roundRect(x, y, w, h, r, fill = true, stroke = false) {
+ if (r < 0) return
+ const ctx = this.ctx
+
+ ctx.beginPath()
+ ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 3 / 2)
+ ctx.arc(x + w - r, y + r, r, Math.PI * 3 / 2, 0)
+ ctx.arc(x + w - r, y + h - r, r, 0, Math.PI / 2)
+ ctx.arc(x + r, y + h - r, r, Math.PI / 2, Math.PI)
+ ctx.lineTo(x, y + r)
+ if (stroke) ctx.stroke()
+ if (fill) ctx.fill()
+ }
+
+ drawView(box, style) {
+ const ctx = this.ctx
+ const {
+ left: x, top: y, width: w, height: h
+ } = box
+ const {
+ borderRadius = 0,
+ borderWidth = 0,
+ borderColor,
+ color = '#000',
+ backgroundColor = 'transparent',
+ } = style
+ ctx.save()
+ // 外环
+ if (borderWidth > 0) {
+ ctx.fillStyle = borderColor || color
+ this.roundRect(x, y, w, h, borderRadius)
+ }
+
+ // 内环
+ ctx.fillStyle = backgroundColor
+ const innerWidth = w - 2 * borderWidth
+ const innerHeight = h - 2 * borderWidth
+ const innerRadius = borderRadius - borderWidth >= 0 ? borderRadius - borderWidth : 0
+ this.roundRect(x + borderWidth, y + borderWidth, innerWidth, innerHeight, innerRadius)
+ ctx.restore()
+ }
+
+ async drawImage(img, box, style) {
+ await new Promise((resolve, reject) => {
+ const ctx = this.ctx
+ const canvas = this.canvas
+
+ const {
+ borderRadius = 0
+ } = style
+ const {
+ left: x, top: y, width: w, height: h
+ } = box
+ ctx.save()
+ this.roundRect(x, y, w, h, borderRadius, false, false)
+ ctx.clip()
+
+ const _drawImage = (img) => {
+ if (this.use2dCanvas) {
+ const Image = canvas.createImage()
+ Image.onload = () => {
+ ctx.drawImage(Image, x, y, w, h)
+ ctx.restore()
+ resolve()
+ }
+ Image.onerror = () => { reject(new Error(`createImage fail: ${img}`)) }
+ Image.src = img
+ } else {
+ ctx.drawImage(img, x, y, w, h)
+ ctx.restore()
+ resolve()
+ }
+ }
+
+ const isTempFile = /^wxfile:\/\//.test(img)
+ const isNetworkFile = /^https?:\/\//.test(img)
+
+ if (isTempFile) {
+ _drawImage(img)
+ } else if (isNetworkFile) {
+ wx.downloadFile({
+ url: img,
+ success(res) {
+ if (res.statusCode === 200) {
+ _drawImage(res.tempFilePath)
+ } else {
+ reject(new Error(`downloadFile:fail ${img}`))
+ }
+ },
+ fail() {
+ reject(new Error(`downloadFile:fail ${img}`))
+ }
+ })
+ } else {
+ reject(new Error(`image format error: ${img}`))
+ }
+ })
+ }
+
+ // eslint-disable-next-line complexity
+ drawText(text, box, style) {
+ const ctx = this.ctx
+ let {
+ left: x, top: y, width: w, height: h
+ } = box
+ let {
+ color = '#000',
+ lineHeight = '1.4em',
+ fontSize = 14,
+ textAlign = 'left',
+ verticalAlign = 'top',
+ backgroundColor = 'transparent'
+ } = style
+
+ if (typeof lineHeight === 'string') { // 2em
+ lineHeight = Math.ceil(parseFloat(lineHeight.replace('em')) * fontSize)
+ }
+ if (!text || (lineHeight > h)) return
+
+ ctx.save()
+ ctx.textBaseline = 'top'
+ ctx.font = `${fontSize}px sans-serif`
+ ctx.textAlign = textAlign
+
+ // 背景色
+ ctx.fillStyle = backgroundColor
+ this.roundRect(x, y, w, h, 0)
+
+ // 文字颜色
+ ctx.fillStyle = color
+
+ // 水平布局
+ switch (textAlign) {
+ case 'left':
+ break
+ case 'center':
+ x += 0.5 * w
+ break
+ case 'right':
+ x += w
+ break
+ default: break
+ }
+
+ const textWidth = ctx.measureText(text).width
+ const actualHeight = Math.ceil(textWidth / w) * lineHeight
+ let paddingTop = Math.ceil((h - actualHeight) / 2)
+ if (paddingTop < 0) paddingTop = 0
+
+ // 垂直布局
+ switch (verticalAlign) {
+ case 'top':
+ break
+ case 'middle':
+ y += paddingTop
+ break
+ case 'bottom':
+ y += 2 * paddingTop
+ break
+ default: break
+ }
+
+ const inlinePaddingTop = Math.ceil((lineHeight - fontSize) / 2)
+
+ // 不超过一行
+ if (textWidth <= w) {
+ ctx.fillText(text, x, y + inlinePaddingTop)
+ return
+ }
+
+ // 多行文本
+ const chars = text.split('')
+ const _y = y
+
+ // 逐行绘制
+ let line = ''
+ for (const ch of chars) {
+ const testLine = line + ch
+ const testWidth = ctx.measureText(testLine).width
+
+ if (testWidth > w) {
+ ctx.fillText(line, x, y + inlinePaddingTop)
+ y += lineHeight
+ line = ch
+ if ((y + lineHeight) > (_y + h)) break
+ } else {
+ line = testLine
+ }
+ }
+
+ // 避免溢出
+ if ((y + lineHeight) <= (_y + h)) {
+ ctx.fillText(line, x, y + inlinePaddingTop)
+ }
+ ctx.restore()
+ }
+
+ async drawNode(element) {
+ const {layoutBox, computedStyle, name} = element
+ const {src, text} = element.attributes
+ if (name === 'view') {
+ this.drawView(layoutBox, computedStyle)
+ } else if (name === 'image') {
+ await this.drawImage(src, layoutBox, computedStyle)
+ } else if (name === 'text') {
+ this.drawText(text, layoutBox, computedStyle)
+ }
+ const childs = Object.values(element.children)
+ for (const child of childs) {
+ await this.drawNode(child)
+ }
+ }
+}
+
+
+module.exports = {
+ Draw
+}
+
+
+/***/ })
+/******/ ]);
+});
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/wxml-to-canvas/index.json b/miniprogram/miniprogram_npm/wxml-to-canvas/index.json
new file mode 100644
index 00000000..e8cfaaf8
--- /dev/null
+++ b/miniprogram/miniprogram_npm/wxml-to-canvas/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/miniprogram_npm/wxml-to-canvas/index.wxml b/miniprogram/miniprogram_npm/wxml-to-canvas/index.wxml
new file mode 100644
index 00000000..a0010adc
--- /dev/null
+++ b/miniprogram/miniprogram_npm/wxml-to-canvas/index.wxml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/miniprogram/page/API/pages/custom-service/custom-service.wxss b/miniprogram/miniprogram_npm/wxml-to-canvas/index.wxss
similarity index 100%
rename from miniprogram/page/API/pages/custom-service/custom-service.wxss
rename to miniprogram/miniprogram_npm/wxml-to-canvas/index.wxss
diff --git a/miniprogram/miniprogram_npm/wxml-to-canvas/utils.js b/miniprogram/miniprogram_npm/wxml-to-canvas/utils.js
new file mode 100644
index 00000000..c3cf7d73
--- /dev/null
+++ b/miniprogram/miniprogram_npm/wxml-to-canvas/utils.js
@@ -0,0 +1,57 @@
+const hex = (color) => {
+ let result = null
+
+ if (/^#/.test(color) && (color.length === 7 || color.length === 9)) {
+ return color
+ // eslint-disable-next-line no-cond-assign
+ } else if ((result = /^(rgb|rgba)\((.+)\)/.exec(color)) !== null) {
+ return '#' + result[2].split(',').map((part, index) => {
+ part = part.trim()
+ part = index === 3 ? Math.floor(parseFloat(part) * 255) : parseInt(part, 10)
+ part = part.toString(16)
+ if (part.length === 1) {
+ part = '0' + part
+ }
+ return part
+ }).join('')
+ } else {
+ return '#00000000'
+ }
+}
+
+const splitLineToCamelCase = (str) => str.split('-').map((part, index) => {
+ if (index === 0) {
+ return part
+ }
+ return part[0].toUpperCase() + part.slice(1)
+}).join('')
+
+const compareVersion = (v1, v2) => {
+ v1 = v1.split('.')
+ v2 = v2.split('.')
+ const len = Math.max(v1.length, v2.length)
+ while (v1.length < len) {
+ v1.push('0')
+ }
+ while (v2.length < len) {
+ v2.push('0')
+ }
+ for (let i = 0; i < len; i++) {
+ const num1 = parseInt(v1[i], 10)
+ const num2 = parseInt(v2[i], 10)
+
+ if (num1 > num2) {
+ return 1
+ } else if (num1 < num2) {
+ return -1
+ }
+ }
+
+ return 0
+}
+
+module.exports = {
+ hex,
+ splitLineToCamelCase,
+ compareVersion
+}
diff --git a/miniprogram/package.json b/miniprogram/package.json
new file mode 100644
index 00000000..a5081aca
--- /dev/null
+++ b/miniprogram/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "miniprogram",
+ "version": "1.0.0",
+ "description": "",
+ "main": "app.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "miniprogram-barrage": "^1.1.0",
+ "miniprogram-recycle-view": "^0.1.5",
+ "wxml-to-canvas": "^1.1.1"
+ }
+}
diff --git a/miniprogram/page/API/pages/action-sheet/action-sheet.js b/miniprogram/packageAPI/pages/action-sheet/action-sheet.js
similarity index 81%
rename from miniprogram/page/API/pages/action-sheet/action-sheet.js
rename to miniprogram/packageAPI/pages/action-sheet/action-sheet.js
index 93a99670..0386e335 100644
--- a/miniprogram/page/API/pages/action-sheet/action-sheet.js
+++ b/miniprogram/packageAPI/pages/action-sheet/action-sheet.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '操作菜单',
- path: 'page/API/pages/action-sheet/action-sheet'
+ path: 'packageAPI/pages/action-sheet/action-sheet'
}
},
diff --git a/miniprogram/page/API/pages/action-sheet/action-sheet.json b/miniprogram/packageAPI/pages/action-sheet/action-sheet.json
similarity index 100%
rename from miniprogram/page/API/pages/action-sheet/action-sheet.json
rename to miniprogram/packageAPI/pages/action-sheet/action-sheet.json
diff --git a/miniprogram/page/API/pages/action-sheet/action-sheet.wxml b/miniprogram/packageAPI/pages/action-sheet/action-sheet.wxml
similarity index 100%
rename from miniprogram/page/API/pages/action-sheet/action-sheet.wxml
rename to miniprogram/packageAPI/pages/action-sheet/action-sheet.wxml
diff --git a/miniprogram/page/API/pages/action-sheet/action-sheet.wxss b/miniprogram/packageAPI/pages/action-sheet/action-sheet.wxss
similarity index 100%
rename from miniprogram/page/API/pages/action-sheet/action-sheet.wxss
rename to miniprogram/packageAPI/pages/action-sheet/action-sheet.wxss
diff --git a/miniprogram/page/API/pages/add-contact/add-contact.js b/miniprogram/packageAPI/pages/add-contact/add-contact.js
similarity index 87%
rename from miniprogram/page/API/pages/add-contact/add-contact.js
rename to miniprogram/packageAPI/pages/add-contact/add-contact.js
index 7c867501..111cc610 100644
--- a/miniprogram/page/API/pages/add-contact/add-contact.js
+++ b/miniprogram/packageAPI/pages/add-contact/add-contact.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '新增联系人',
- path: 'page/API/pages/add-contact/add-contact'
+ path: 'packageAPI/pages/add-contact/add-contact'
}
},
diff --git a/miniprogram/page/API/pages/add-contact/add-contact.json b/miniprogram/packageAPI/pages/add-contact/add-contact.json
similarity index 100%
rename from miniprogram/page/API/pages/add-contact/add-contact.json
rename to miniprogram/packageAPI/pages/add-contact/add-contact.json
diff --git a/miniprogram/page/API/pages/add-contact/add-contact.wxml b/miniprogram/packageAPI/pages/add-contact/add-contact.wxml
similarity index 100%
rename from miniprogram/page/API/pages/add-contact/add-contact.wxml
rename to miniprogram/packageAPI/pages/add-contact/add-contact.wxml
diff --git a/miniprogram/page/API/pages/add-contact/add-contact.wxss b/miniprogram/packageAPI/pages/add-contact/add-contact.wxss
similarity index 100%
rename from miniprogram/page/API/pages/add-contact/add-contact.wxss
rename to miniprogram/packageAPI/pages/add-contact/add-contact.wxss
diff --git a/miniprogram/packageAPI/pages/animation/animation.js b/miniprogram/packageAPI/pages/animation/animation.js
new file mode 100644
index 00000000..cdad2809
--- /dev/null
+++ b/miniprogram/packageAPI/pages/animation/animation.js
@@ -0,0 +1,46 @@
+Page({
+ onShareAppMessage() {
+ return {
+ title: '动画',
+ path: 'package/API/pages/animation/animation',
+ containerStyle1: '',
+
+ }
+ },
+ data: {
+ canIUse: true,
+ },
+ onLoad() {
+ const canIUse = this.animate !== undefined
+ if(!canIUse) {
+ wx.showModal({
+ title: '微信版本过低,暂不支持本功能',
+ })
+ this.setData({
+ canIUse,
+ })
+ }
+ },
+
+ change: function () {
+ this.animate('#container1', [
+ { opacity: 1.0, rotate: 0, backgroundColor: '#FF0000' },
+ { opacity: 0.5, rotate: 45, backgroundColor: '#00FF00', offset: 0.9},
+ { opacity: 0.0, rotate: 90, backgroundColor: '#FF0000' },
+ ], 5000, function () {
+ this.clearAnimation('#container1', { opacity: true, rotate: true }, function () {
+ console.log("清除了#container上的动画属性")
+ })
+ }.bind(this))
+ this.animate('.block1', [
+ { scale: [1, 1], rotate: 0, ease: 'ease-out' },
+ { scale: [1.5, 1.5], rotate: 45, ease: 'ease-in', offset: 0.9},
+ { scale: [2, 2], rotate: 90},
+ ], 5000, function () {
+ this.clearAnimation('.block1', { scale: true, rotate: true}, function () {
+ console.log("清除了.block1上的动画属性")
+ })
+ }.bind(this)
+ )
+ },
+})
diff --git a/miniprogram/page/API/pages/animation/animation.json b/miniprogram/packageAPI/pages/animation/animation.json
similarity index 100%
rename from miniprogram/page/API/pages/animation/animation.json
rename to miniprogram/packageAPI/pages/animation/animation.json
diff --git a/miniprogram/packageAPI/pages/animation/animation.wxml b/miniprogram/packageAPI/pages/animation/animation.wxml
new file mode 100644
index 00000000..461926db
--- /dev/null
+++ b/miniprogram/packageAPI/pages/animation/animation.wxml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+ 关键帧动画\n\n从小程序基础库 2.9.0 开始支持一种更友好的动画创建方式,用于代替旧的 wx.createAnimation
+
+
+
+ 示例超链接
+ 示例文本
+
+
+
+
+
+
diff --git a/miniprogram/page/API/pages/animation/animation.wxss b/miniprogram/packageAPI/pages/animation/animation.wxss
similarity index 89%
rename from miniprogram/page/API/pages/animation/animation.wxss
rename to miniprogram/packageAPI/pages/animation/animation.wxss
index 9b55be96..2a5052d7 100644
--- a/miniprogram/page/API/pages/animation/animation.wxss
+++ b/miniprogram/packageAPI/pages/animation/animation.wxss
@@ -28,3 +28,8 @@
.animation-button-reset {
width: 620rpx;
}
+
+.btn-row {
+ display: flex;
+ justify-content: space-between;
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/audio/audio.js b/miniprogram/packageAPI/pages/audio/audio.js
new file mode 100644
index 00000000..9cdf0b35
--- /dev/null
+++ b/miniprogram/packageAPI/pages/audio/audio.js
@@ -0,0 +1,29 @@
+Page({
+ onShareAppMessage() {
+ return {
+ title: 'Audio',
+ path: 'packageAPI/pages/audio/audio'
+ }
+ },
+ onReady (e) {
+ // 使用 wx.createAudioContext 获取 audio 上下文 context
+ this.audioCtx = wx.createAudioContext('myAudio')
+ this.audioCtx.setSrc('https://dldir1.qq.com/music/release/upload/t_mm_file_publish/2339610.m4a')
+ this.audioCtx.play()
+ },
+ data: {
+ src: ''
+ },
+ audioPlay () {
+ this.audioCtx.play()
+ },
+ audioPause () {
+ this.audioCtx.pause()
+ },
+ audio14 () {
+ this.audioCtx.seek(14)
+ },
+ audioStart () {
+ this.audioCtx.seek(0)
+ }
+})
diff --git a/miniprogram/packageAPI/pages/audio/audio.json b/miniprogram/packageAPI/pages/audio/audio.json
new file mode 100644
index 00000000..5a7443c0
--- /dev/null
+++ b/miniprogram/packageAPI/pages/audio/audio.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "音频"
+
+}
diff --git a/miniprogram/packageAPI/pages/audio/audio.wxml b/miniprogram/packageAPI/pages/audio/audio.wxml
new file mode 100644
index 00000000..3fd7a06f
--- /dev/null
+++ b/miniprogram/packageAPI/pages/audio/audio.wxml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/miniprogram/packageAPI/pages/audio/audio.wxss b/miniprogram/packageAPI/pages/audio/audio.wxss
new file mode 100644
index 00000000..12696566
--- /dev/null
+++ b/miniprogram/packageAPI/pages/audio/audio.wxss
@@ -0,0 +1 @@
+/* miniprogram/packageAPI/pages/audio/audio.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/background-audio/background-audio.js b/miniprogram/packageAPI/pages/background-audio/background-audio.js
new file mode 100644
index 00000000..2e8c698a
--- /dev/null
+++ b/miniprogram/packageAPI/pages/background-audio/background-audio.js
@@ -0,0 +1,121 @@
+const app = getApp()
+const util = require('../../../util/util.js')
+
+
+const backgroundAudioManager = wx.getBackgroundAudioManager();
+let updateInterval;
+
+Page({
+ onShareAppMessage() {
+ return {
+ title: '背景音乐',
+ path: 'packageAPI/pages/background-audio/background-audio'
+ }
+ },
+ onShow() {
+ if (!backgroundAudioManager.paused && backgroundAudioManager.paused !== undefined) {
+ this._enableInterval()
+ this.setData({
+ playing: true
+ })
+ }
+ },
+ onLoad() {
+ const that = this;
+ // 监听播放事件
+ backgroundAudioManager.onPlay(() => {
+ // 刷新播放时间
+ this._enableInterval()
+ this.setData({
+ pause: false,
+ })
+ })
+
+ // 监听暂停事件
+ backgroundAudioManager.onPause(() => {
+ clearInterval(updateInterval)
+ that.setData({
+ playing: false,
+ pause: true,
+ })
+
+ })
+
+ backgroundAudioManager.onEnded(() => {
+ clearInterval(updateInterval);
+ that.setData({
+ playing: false,
+ playTime: 0,
+ formatedPlayTime: util.formatTime(0)
+ })
+ })
+
+ backgroundAudioManager.onStop(() => {
+ clearInterval(updateInterval);
+ that.setData({
+ playing: false,
+ playTime: 0,
+ formatedPlayTime: util.formatTime(0)
+ })
+ })
+ },
+
+ data: {
+ playing: false, // 播放状态
+ pause: false,
+ playTime: 0, // 播放时长
+ formatedPlayTime: '00:00:00' // 格式化后的播放时长
+ },
+
+ play() {
+ backgroundAudioManager.title = '此时此刻'
+ backgroundAudioManager.epname = '此时此刻'
+ backgroundAudioManager.singer = '许巍'
+ backgroundAudioManager.coverImgUrl = 'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000'
+
+ const that = this
+ if(that.data.pause) {
+ backgroundAudioManager.play();
+ this.setData({
+ playing: true,
+ });
+ } else {
+ that.setData({
+ playing: true,
+ }, () => {
+ // 设置src后会自动播放
+ backgroundAudioManager.src = 'https://dldir1.qq.com/music/release/upload/t_mm_file_publish/2339610.m4a'
+ });
+ }
+ },
+
+ seek(e) {
+ backgroundAudioManager.seek(e.detail.value)
+ },
+
+ pause() {
+ clearInterval(updateInterval)
+ backgroundAudioManager.pause();
+ },
+
+ stop() {
+ clearInterval(updateInterval)
+ backgroundAudioManager.stop();
+ },
+
+ _enableInterval() {
+ const that = this
+ function update() {
+ console.log(backgroundAudioManager.currentTime)
+ that.setData({
+ playTime: backgroundAudioManager.currentTime + 1,
+ formatedPlayTime: util.formatTime(backgroundAudioManager.currentTime + 1)
+ })
+ }
+ updateInterval = setInterval(update, 1000)
+ },
+
+ onUnload() {
+ clearInterval(updateInterval)
+ }
+})
diff --git a/miniprogram/packageAPI/pages/background-audio/background-audio.json b/miniprogram/packageAPI/pages/background-audio/background-audio.json
new file mode 100644
index 00000000..6bb5bd13
--- /dev/null
+++ b/miniprogram/packageAPI/pages/background-audio/background-audio.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "背景音频"
+}
diff --git a/miniprogram/page/API/pages/background-audio/background-audio.wxml b/miniprogram/packageAPI/pages/background-audio/background-audio.wxml
similarity index 100%
rename from miniprogram/page/API/pages/background-audio/background-audio.wxml
rename to miniprogram/packageAPI/pages/background-audio/background-audio.wxml
diff --git a/miniprogram/page/API/pages/background-audio/background-audio.wxss b/miniprogram/packageAPI/pages/background-audio/background-audio.wxss
similarity index 100%
rename from miniprogram/page/API/pages/background-audio/background-audio.wxss
rename to miniprogram/packageAPI/pages/background-audio/background-audio.wxss
diff --git a/miniprogram/page/API/pages/bluetooth/bluetooth.js b/miniprogram/packageAPI/pages/bluetooth/bluetooth.js
similarity index 91%
rename from miniprogram/page/API/pages/bluetooth/bluetooth.js
rename to miniprogram/packageAPI/pages/bluetooth/bluetooth.js
index d3733901..cd4535b4 100644
--- a/miniprogram/page/API/pages/bluetooth/bluetooth.js
+++ b/miniprogram/packageAPI/pages/bluetooth/bluetooth.js
@@ -22,7 +22,7 @@ Page({
onShareAppMessage() {
return {
title: '蓝牙',
- path: 'page/API/pages/bluetooth/bluetooth'
+ path: 'packageAPI/pages/bluetooth/bluetooth'
}
},
@@ -138,6 +138,11 @@ Page({
canWrite: false,
})
},
+ changeMode() {
+ wx.navigateTo({
+ url: './slave/slave',
+ })
+ },
getBLEDeviceServices(deviceId) {
wx.getBLEDeviceServices({
deviceId,
@@ -157,6 +162,7 @@ Page({
serviceId,
success: (res) => {
console.log('getBLEDeviceCharacteristics success', res.characteristics)
+
for (let i = 0; i < res.characteristics.length; i++) {
const item = res.characteristics[i]
if (item.properties.read) {
@@ -173,6 +179,7 @@ Page({
this._deviceId = deviceId
this._serviceId = serviceId
this._characteristicId = item.uuid
+ console.log('write')
this.writeBLECharacteristicValue()
}
if (item.properties.notify || item.properties.indicate) {
@@ -204,6 +211,9 @@ Page({
value: ab2hex(characteristic.value)
}
}
+ wx.showToast({
+ title: '收到从机数据',
+ })
// data[`chs[${this.data.chs.length}]`] = {
// uuid: characteristic.characteristicId,
// value: ab2hex(characteristic.value)
@@ -216,12 +226,22 @@ Page({
const buffer = new ArrayBuffer(1)
const dataView = new DataView(buffer)
// eslint-disable-next-line
- dataView.setUint8(0, Math.random() * 255 | 0)
+ dataView.setUint8(0, Math.random() * 19| 0)
wx.writeBLECharacteristicValue({
deviceId: this._deviceId,
- serviceId: this._deviceId,
+ serviceId: this._serviceId,
characteristicId: this._characteristicId,
value: buffer,
+ success() {
+ console.log('writeBLECharacteristicValue: 成功')
+ },
+ fail() {
+ console.log('writeBLECharacteristicValue: 失败')
+ },
+ complete() {
+ console.log('writeBLECharacteristicValue: 结束')
+
+ }
})
},
closeBluetoothAdapter() {
diff --git a/miniprogram/page/API/pages/bluetooth/bluetooth.json b/miniprogram/packageAPI/pages/bluetooth/bluetooth.json
similarity index 100%
rename from miniprogram/page/API/pages/bluetooth/bluetooth.json
rename to miniprogram/packageAPI/pages/bluetooth/bluetooth.json
diff --git a/miniprogram/page/API/pages/bluetooth/bluetooth.wxml b/miniprogram/packageAPI/pages/bluetooth/bluetooth.wxml
similarity index 90%
rename from miniprogram/page/API/pages/bluetooth/bluetooth.wxml
rename to miniprogram/packageAPI/pages/bluetooth/bluetooth.wxml
index ee1dc6a5..c06c3223 100644
--- a/miniprogram/page/API/pages/bluetooth/bluetooth.wxml
+++ b/miniprogram/packageAPI/pages/bluetooth/bluetooth.wxml
@@ -12,7 +12,6 @@ module.exports.len = function(arr) {
-
@@ -24,7 +23,7 @@ module.exports.len = function(arr) {
bindtap="createBLEConnection"
class="device_item"
hover-class="device_item_hover">
- {{item.name}}
+ {{item.name}}
信号强度: {{item.RSSI}}dBm ({{utils.max(0, item.RSSI + 100)}}%)
UUID: {{item.deviceId}}
Service数量: {{utils.len(item.advertisServiceUUIDs)}}
@@ -36,6 +35,12 @@ module.exports.len = function(arr) {
+
+
+
diff --git a/miniprogram/page/API/pages/bluetooth/bluetooth.wxss b/miniprogram/packageAPI/pages/bluetooth/bluetooth.wxss
similarity index 84%
rename from miniprogram/page/API/pages/bluetooth/bluetooth.wxss
rename to miniprogram/packageAPI/pages/bluetooth/bluetooth.wxss
index a8c4c08f..79298ee2 100644
--- a/miniprogram/page/API/pages/bluetooth/bluetooth.wxss
+++ b/miniprogram/packageAPI/pages/bluetooth/bluetooth.wxss
@@ -1,6 +1,4 @@
-page {
- color: #333;
-}
+
.devices_summary {
padding: 10rpx;
font-size: 30rpx;
@@ -11,9 +9,9 @@ page {
flex: 1;
}
.device_item {
- border-bottom: 1rpx solid #EEE;
+ border-bottom: 1rpx solid var(--weui-FG-3);
padding: 10rpx;
- color: #666;
+ color: var(--weui-FG-HALF);
}
.device_item_hover {
background-color: rgba(0, 0, 0, .1);
@@ -22,7 +20,7 @@ page {
position: fixed;
bottom: 0;
width: 100%;
- background-color: #F0F0F0;
+ background-color: var(--weui-BG-4);
padding: 10rpx;
padding-bottom: 20rpx;
margin-bottom: env(safe-area-inset-bottom);
diff --git a/miniprogram/packageAPI/pages/bluetooth/slave/slave.js b/miniprogram/packageAPI/pages/bluetooth/slave/slave.js
new file mode 100644
index 00000000..6e72d7f1
--- /dev/null
+++ b/miniprogram/packageAPI/pages/bluetooth/slave/slave.js
@@ -0,0 +1,264 @@
+
+const uuid3 = '0C76801A-62EB-45E5-96A8-37C8882ABB2B'
+const serviceId = 'D0611E78-BBB4-4591-A5F8-487910AE4366'
+const characteristicId = '8667556C-9A37-4C91-84ED-54EE27D90049'
+// 上面需要配置主机的 serviceId 和 characteristicId
+
+
+// ArrayBuffer转16进制字符串示例
+function ab2hex(buffer) {
+ let hexArr = Array.prototype.map.call(
+ new Uint8Array(buffer),
+ function (bit) {
+ return ('00' + bit.toString(16)).slice(-2)
+ }
+ )
+ return hexArr.join('');
+}
+
+function inArray(arr, key, val) {
+ for (let i = 0; i < arr.length; i++) {
+ if (arr[i][key] === val) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+// slave/slave.js
+Page({
+ onShareAppMessage() {
+ return {
+ title: '蓝牙',
+ path: 'packageAPI/pages/slave/slave'
+ }
+ },
+ data: {
+ connects: [],
+ servers: []
+ },
+
+ onLoad: function (options) {
+ wx.onBLEPeripheralConnectionStateChanged(res => {
+ console.log('connect')
+ const connects = this.data.connects
+ const idx = inArray(connects, 'deviceId', res.deviceId)
+ if (idx >= 0) {
+ connects[idx] = res
+ } else {
+ connects.push(res)
+ }
+ this.setData({ connects })
+ })
+ },
+
+ openBluetoothAdapter() {
+ // 初始化蓝牙模块
+ wx.openBluetoothAdapter({
+ mode: 'peripheral',
+ success: (res) => {
+ console.log('openBluetoothAdapter success', res)
+ this.createBLEPeripheralServer()
+ },
+ fail: (res) => {
+ console.log(res);
+ wx.showToast({
+ title: `创建失败 错误码: ${res.errCode}`,
+ icon:'none'
+ })
+ if (res.errCode === 10001) {
+ wx.onBluetoothAdapterStateChange(function (res) {
+ console.log('onBluetoothAdapterStateChange', res)
+ if (res.available) {
+ this.createBLEPeripheralServer()
+ }
+ })
+ }
+ }
+ })
+ },
+
+ createBLEPeripheralServer() {
+ //
+ wx.createBLEPeripheralServer().then(res => {
+ console.log('createBLEPeripheralServer', res)
+ this.data.servers.push(res.server)
+ this.server = res.server
+ this.setData({
+ serverId: this.server.serverId
+ })
+ wx.showToast({
+ title: '创建 server ',
+ })
+ this.server.onCharacteristicReadRequest(res => {
+ const { serviceId, characteristicId, callbackId } = res
+ const buffer = new ArrayBuffer(1)
+ const dataView = new DataView(buffer)
+ const newValue = Math.ceil(Math.random() * 10)
+ dataView.setUint8(0, newValue)
+ console.log('onCharacteristicReadRequest', res, newValue)
+ this.server.writeCharacteristicValue({
+ serviceId,
+ characteristicId,
+ value: buffer,
+ needNotify: true,
+ callbackId
+ })
+ })
+ // 监听收到数据
+ this.server.onCharacteristicWriteRequest(res => {
+ console.log('onCharacteristicWriteRequest', res)
+ const { serviceId, characteristicId, value, callbackId } = res
+ wx.showToast({
+ title: '收到主机数据'
+ })
+ this.server.writeCharacteristicValue({
+ serviceId,
+ characteristicId,
+ value,
+ needNotify: true,
+ callbackId
+ })
+ })
+ })
+ },
+ closeServer() {
+ this.server.close()
+ wx.showToast({
+ title: '关闭 server',
+ })
+ },
+ chaneMode() {
+ wx.navigateBack();
+ },
+ onConfirm(e) {
+ console.log('onConfirm')
+ const n = e.detail.value * 1
+ const buffer = new ArrayBuffer(1)
+ const dataView = new DataView(buffer)
+ dataView.setUint8(0, n)
+ this.server.writeCharacteristicValue({
+ serviceId: serviceId,
+ characteristicId: characteristicId,
+ value: buffer,
+ needNotify: true
+ })
+ wx.showModal({
+ title: '写入成功',
+ content: '请在主机查看'
+ })
+ },
+ showInput() {
+ this.setData({
+ input: !this.data.input
+ })
+ },
+ addService() {
+ const buffer = new ArrayBuffer(1)
+ const dataView = new DataView(buffer)
+ dataView.setUint8(0, 2)
+ const descriptorBuffer = new ArrayBuffer(1)
+ const dataView2 = new DataView(descriptorBuffer)
+ dataView2.setInt8(0, 3)
+ const service = {
+ uuid: serviceId,
+ characteristics: [{
+ uuid: characteristicId,
+ properties: {
+ write: true,
+ read: true,
+ notify: true,
+ indicate: true
+ },
+ permission: {
+ readable: true,
+ writeable: true,
+ readEncryptionRequired: true,
+ writeEncryptionRequired: true
+ },
+ value: buffer,
+ descriptors: [{
+ uuid: uuid3,
+ permission: {
+ write: true,
+ read: true
+ },
+ value: descriptorBuffer
+ }]
+ }]
+ }
+
+ this.server.addService({
+ service
+ }).then(res => {
+ console.log('add Service', res)
+ wx.showToast({
+ title: '创建服务',
+ })
+ },(rej) => {
+ console.log(rej);
+ if (rej.errCode === 10001) {
+ wx.showToast({
+ title: '请打开蓝牙',
+ })
+ } else {
+ wx.showModal({
+ title: '创建失败',
+ content: `错误码: ${rej.errCode}`
+ })
+ }
+ })
+ },
+ removeService() {
+ this.server.removeService({
+ serviceId: serviceId
+ }).then(res => {
+ wx.showToast({
+ title: '关闭服务',
+ })
+ console.log('removeService', res)
+ })
+ },
+ startAdvertising() {
+ const buffer = new ArrayBuffer(1)
+ const dataView = new DataView(buffer)
+ dataView.setInt8(0, 4)
+ this.server.startAdvertising({
+ advertiseRequest: {
+ connectable: true,
+ deviceName: 'sanford',
+ serviceUuids: [serviceId],
+ manufacturerData: [{
+ manufacturerId: 'sanfordsun-pc0',
+ manufacturerSpecificData: buffer
+ }]
+ },
+ powerLevel: 'medium'
+ }).then(res => {
+ console.log('startAdvertising', res)
+ wx.showToast({
+ title: '开启广播',
+ })
+ })
+ },
+
+ stopAdvertising() {
+ this.server.stopAdvertising()
+ wx.showToast({
+ title: '关闭广播',
+ })
+ },
+
+ closeBluetoothAdapter() {
+ wx.showToast({
+ title: '结束流程',
+ })
+ wx.closeBluetoothAdapter()
+ },
+
+ onUnload: function () {
+ this.data.servers.forEach(server => {
+ // server.close()
+ })
+ },
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/bluetooth/slave/slave.json b/miniprogram/packageAPI/pages/bluetooth/slave/slave.json
new file mode 100644
index 00000000..8835af06
--- /dev/null
+++ b/miniprogram/packageAPI/pages/bluetooth/slave/slave.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/bluetooth/slave/slave.wxml b/miniprogram/packageAPI/pages/bluetooth/slave/slave.wxml
new file mode 100644
index 00000000..cfe399ef
--- /dev/null
+++ b/miniprogram/packageAPI/pages/bluetooth/slave/slave.wxml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+ 当前 serverId {{serverId}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.deviceId}} : {{item.serverId}}
+ {{item.connected ? "已连接" : "断开"}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/bluetooth/slave/slave.wxss b/miniprogram/packageAPI/pages/bluetooth/slave/slave.wxss
new file mode 100644
index 00000000..5fd03564
--- /dev/null
+++ b/miniprogram/packageAPI/pages/bluetooth/slave/slave.wxss
@@ -0,0 +1,5 @@
+.action-area {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-around;
+}
\ No newline at end of file
diff --git a/miniprogram/page/API/pages/canvas/canvas.js b/miniprogram/packageAPI/pages/canvas/canvas.js
similarity index 94%
rename from miniprogram/page/API/pages/canvas/canvas.js
rename to miniprogram/packageAPI/pages/canvas/canvas.js
index 481f9a07..9e2866e2 100644
--- a/miniprogram/page/API/pages/canvas/canvas.js
+++ b/miniprogram/packageAPI/pages/canvas/canvas.js
@@ -4,7 +4,7 @@ Page({
onShareAppMessage() {
return {
title: '创建画布',
- path: 'page/API/pages/canvas/canvas'
+ path: 'packageAPI/pages/canvas/canvas'
}
},
diff --git a/miniprogram/page/API/pages/canvas/canvas.json b/miniprogram/packageAPI/pages/canvas/canvas.json
similarity index 100%
rename from miniprogram/page/API/pages/canvas/canvas.json
rename to miniprogram/packageAPI/pages/canvas/canvas.json
diff --git a/miniprogram/page/API/pages/canvas/canvas.wxml b/miniprogram/packageAPI/pages/canvas/canvas.wxml
similarity index 100%
rename from miniprogram/page/API/pages/canvas/canvas.wxml
rename to miniprogram/packageAPI/pages/canvas/canvas.wxml
diff --git a/miniprogram/page/API/pages/canvas/canvas.wxss b/miniprogram/packageAPI/pages/canvas/canvas.wxss
similarity index 100%
rename from miniprogram/page/API/pages/canvas/canvas.wxss
rename to miniprogram/packageAPI/pages/canvas/canvas.wxss
diff --git a/miniprogram/page/API/pages/canvas/example.js b/miniprogram/packageAPI/pages/canvas/example.js
similarity index 100%
rename from miniprogram/page/API/pages/canvas/example.js
rename to miniprogram/packageAPI/pages/canvas/example.js
diff --git a/miniprogram/page/API/pages/capture-screen/capture-screen.js b/miniprogram/packageAPI/pages/capture-screen/capture-screen.js
similarity index 79%
rename from miniprogram/page/API/pages/capture-screen/capture-screen.js
rename to miniprogram/packageAPI/pages/capture-screen/capture-screen.js
index 02a67d8b..0581f731 100644
--- a/miniprogram/page/API/pages/capture-screen/capture-screen.js
+++ b/miniprogram/packageAPI/pages/capture-screen/capture-screen.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '用户截屏事件',
- path: 'page/API/pages/capture-screen/capture-screen'
+ path: 'packageAPI/pages/capture-screen/capture-screen'
}
},
diff --git a/miniprogram/page/API/pages/capture-screen/capture-screen.json b/miniprogram/packageAPI/pages/capture-screen/capture-screen.json
similarity index 100%
rename from miniprogram/page/API/pages/capture-screen/capture-screen.json
rename to miniprogram/packageAPI/pages/capture-screen/capture-screen.json
diff --git a/miniprogram/page/API/pages/capture-screen/capture-screen.wxml b/miniprogram/packageAPI/pages/capture-screen/capture-screen.wxml
similarity index 100%
rename from miniprogram/page/API/pages/capture-screen/capture-screen.wxml
rename to miniprogram/packageAPI/pages/capture-screen/capture-screen.wxml
diff --git a/miniprogram/page/API/pages/capture-screen/capture-screen.wxss b/miniprogram/packageAPI/pages/capture-screen/capture-screen.wxss
similarity index 100%
rename from miniprogram/page/API/pages/capture-screen/capture-screen.wxss
rename to miniprogram/packageAPI/pages/capture-screen/capture-screen.wxss
diff --git a/miniprogram/page/API/pages/choose-address/choose-address.js b/miniprogram/packageAPI/pages/choose-address/choose-address.js
similarity index 84%
rename from miniprogram/page/API/pages/choose-address/choose-address.js
rename to miniprogram/packageAPI/pages/choose-address/choose-address.js
index 2e3c2aa7..da9945df 100644
--- a/miniprogram/page/API/pages/choose-address/choose-address.js
+++ b/miniprogram/packageAPI/pages/choose-address/choose-address.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '收货地址',
- path: 'page/API/pages/choose-address/choose-address'
+ path: 'packageAPI/pages/choose-address/choose-address'
}
},
diff --git a/miniprogram/page/API/pages/choose-address/choose-address.json b/miniprogram/packageAPI/pages/choose-address/choose-address.json
similarity index 100%
rename from miniprogram/page/API/pages/choose-address/choose-address.json
rename to miniprogram/packageAPI/pages/choose-address/choose-address.json
diff --git a/miniprogram/page/API/pages/choose-address/choose-address.wxml b/miniprogram/packageAPI/pages/choose-address/choose-address.wxml
similarity index 100%
rename from miniprogram/page/API/pages/choose-address/choose-address.wxml
rename to miniprogram/packageAPI/pages/choose-address/choose-address.wxml
diff --git a/miniprogram/page/API/pages/choose-address/choose-address.wxss b/miniprogram/packageAPI/pages/choose-address/choose-address.wxss
similarity index 100%
rename from miniprogram/page/API/pages/choose-address/choose-address.wxss
rename to miniprogram/packageAPI/pages/choose-address/choose-address.wxss
diff --git a/miniprogram/page/API/pages/choose-invoice-title/choose-invoice-title.js b/miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.js
similarity index 90%
rename from miniprogram/page/API/pages/choose-invoice-title/choose-invoice-title.js
rename to miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.js
index 758eaf27..61482399 100644
--- a/miniprogram/page/API/pages/choose-invoice-title/choose-invoice-title.js
+++ b/miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '获取发票抬头',
- path: 'page/API/pages/choose-invoice-title/choose-invoice-title'
+ path: 'packageAPI/pages/choose-invoice-title/choose-invoice-title'
}
},
diff --git a/miniprogram/page/API/pages/choose-invoice-title/choose-invoice-title.json b/miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.json
similarity index 100%
rename from miniprogram/page/API/pages/choose-invoice-title/choose-invoice-title.json
rename to miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.json
diff --git a/miniprogram/page/API/pages/choose-invoice-title/choose-invoice-title.wxml b/miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.wxml
similarity index 100%
rename from miniprogram/page/API/pages/choose-invoice-title/choose-invoice-title.wxml
rename to miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.wxml
diff --git a/miniprogram/page/API/pages/choose-invoice-title/choose-invoice-title.wxss b/miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.wxss
similarity index 100%
rename from miniprogram/page/API/pages/choose-invoice-title/choose-invoice-title.wxss
rename to miniprogram/packageAPI/pages/choose-invoice-title/choose-invoice-title.wxss
diff --git a/miniprogram/page/API/pages/choose-location/choose-location.js b/miniprogram/packageAPI/pages/choose-location/choose-location.js
similarity index 83%
rename from miniprogram/page/API/pages/choose-location/choose-location.js
rename to miniprogram/packageAPI/pages/choose-location/choose-location.js
index 4480a895..1d4e8a36 100644
--- a/miniprogram/page/API/pages/choose-location/choose-location.js
+++ b/miniprogram/packageAPI/pages/choose-location/choose-location.js
@@ -1,4 +1,4 @@
-const util = require('../../../../util/util.js')
+const util = require('../../../util/util.js')
const formatLocation = util.formatLocation
@@ -6,7 +6,7 @@ Page({
onShareAppMessage() {
return {
title: '使用原生地图选择位置',
- path: 'page/API/pages/choose-location/choose-location'
+ path: 'packageAPI/pages/choose-location/choose-location'
}
},
diff --git a/miniprogram/page/API/pages/choose-location/choose-location.json b/miniprogram/packageAPI/pages/choose-location/choose-location.json
similarity index 100%
rename from miniprogram/page/API/pages/choose-location/choose-location.json
rename to miniprogram/packageAPI/pages/choose-location/choose-location.json
diff --git a/miniprogram/page/API/pages/choose-location/choose-location.wxml b/miniprogram/packageAPI/pages/choose-location/choose-location.wxml
similarity index 100%
rename from miniprogram/page/API/pages/choose-location/choose-location.wxml
rename to miniprogram/packageAPI/pages/choose-location/choose-location.wxml
diff --git a/miniprogram/page/API/pages/choose-location/choose-location.wxss b/miniprogram/packageAPI/pages/choose-location/choose-location.wxss
similarity index 100%
rename from miniprogram/page/API/pages/choose-location/choose-location.wxss
rename to miniprogram/packageAPI/pages/choose-location/choose-location.wxss
diff --git a/miniprogram/page/API/pages/clipboard-data/clipboard-data.js b/miniprogram/packageAPI/pages/clipboard-data/clipboard-data.js
similarity index 92%
rename from miniprogram/page/API/pages/clipboard-data/clipboard-data.js
rename to miniprogram/packageAPI/pages/clipboard-data/clipboard-data.js
index 0d0a1758..5f9f153b 100644
--- a/miniprogram/page/API/pages/clipboard-data/clipboard-data.js
+++ b/miniprogram/packageAPI/pages/clipboard-data/clipboard-data.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '剪切板',
- path: 'page/API/pages/clipboard-data/clipboard-data'
+ path: 'packageAPI/pages/clipboard-data/clipboard-data'
}
},
diff --git a/miniprogram/page/API/pages/clipboard-data/clipboard-data.json b/miniprogram/packageAPI/pages/clipboard-data/clipboard-data.json
similarity index 100%
rename from miniprogram/page/API/pages/clipboard-data/clipboard-data.json
rename to miniprogram/packageAPI/pages/clipboard-data/clipboard-data.json
diff --git a/miniprogram/page/API/pages/clipboard-data/clipboard-data.wxml b/miniprogram/packageAPI/pages/clipboard-data/clipboard-data.wxml
similarity index 100%
rename from miniprogram/page/API/pages/clipboard-data/clipboard-data.wxml
rename to miniprogram/packageAPI/pages/clipboard-data/clipboard-data.wxml
diff --git a/miniprogram/page/API/pages/clipboard-data/clipboard-data.wxss b/miniprogram/packageAPI/pages/clipboard-data/clipboard-data.wxss
similarity index 100%
rename from miniprogram/page/API/pages/clipboard-data/clipboard-data.wxss
rename to miniprogram/packageAPI/pages/clipboard-data/clipboard-data.wxss
diff --git a/miniprogram/page/API/pages/custom-message/custom-message.js b/miniprogram/packageAPI/pages/custom-message/custom-message.js
similarity index 58%
rename from miniprogram/page/API/pages/custom-message/custom-message.js
rename to miniprogram/packageAPI/pages/custom-message/custom-message.js
index f6bb8640..cf0f5003 100644
--- a/miniprogram/page/API/pages/custom-message/custom-message.js
+++ b/miniprogram/packageAPI/pages/custom-message/custom-message.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '客服消息',
- path: 'page/API/pages/custom-message/custom-message'
+ path: 'packageAPI/pages/custom-message/custom-message'
}
},
})
diff --git a/miniprogram/page/API/pages/custom-message/custom-message.json b/miniprogram/packageAPI/pages/custom-message/custom-message.json
similarity index 100%
rename from miniprogram/page/API/pages/custom-message/custom-message.json
rename to miniprogram/packageAPI/pages/custom-message/custom-message.json
diff --git a/miniprogram/page/API/pages/custom-message/custom-message.wxml b/miniprogram/packageAPI/pages/custom-message/custom-message.wxml
similarity index 100%
rename from miniprogram/page/API/pages/custom-message/custom-message.wxml
rename to miniprogram/packageAPI/pages/custom-message/custom-message.wxml
diff --git a/miniprogram/page/API/pages/custom-message/custom-message.wxss b/miniprogram/packageAPI/pages/custom-message/custom-message.wxss
similarity index 100%
rename from miniprogram/page/API/pages/custom-message/custom-message.wxss
rename to miniprogram/packageAPI/pages/custom-message/custom-message.wxss
diff --git a/miniprogram/packageAPI/pages/custom-service/custom-service.js b/miniprogram/packageAPI/pages/custom-service/custom-service.js
new file mode 100644
index 00000000..39d6da7c
--- /dev/null
+++ b/miniprogram/packageAPI/pages/custom-service/custom-service.js
@@ -0,0 +1,8 @@
+Page({
+ onShareAppMessage() {
+ return {
+ title: '联系客服',
+ path: 'packageAPI/pages/custom-service/custom-service'
+ }
+ },
+})
diff --git a/miniprogram/page/API/pages/custom-service/custom-service.json b/miniprogram/packageAPI/pages/custom-service/custom-service.json
similarity index 100%
rename from miniprogram/page/API/pages/custom-service/custom-service.json
rename to miniprogram/packageAPI/pages/custom-service/custom-service.json
diff --git a/miniprogram/page/API/pages/custom-service/custom-service.wxml b/miniprogram/packageAPI/pages/custom-service/custom-service.wxml
similarity index 100%
rename from miniprogram/page/API/pages/custom-service/custom-service.wxml
rename to miniprogram/packageAPI/pages/custom-service/custom-service.wxml
diff --git a/miniprogram/page/API/pages/navigation-bar-loading/navigation-bar-loading.wxss b/miniprogram/packageAPI/pages/custom-service/custom-service.wxss
similarity index 100%
rename from miniprogram/page/API/pages/navigation-bar-loading/navigation-bar-loading.wxss
rename to miniprogram/packageAPI/pages/custom-service/custom-service.wxss
diff --git a/miniprogram/page/API/pages/doc-web-view/doc-web-view.js b/miniprogram/packageAPI/pages/doc-web-view/doc-web-view.js
similarity index 62%
rename from miniprogram/page/API/pages/doc-web-view/doc-web-view.js
rename to miniprogram/packageAPI/pages/doc-web-view/doc-web-view.js
index b31a7ea6..67a2a8ce 100644
--- a/miniprogram/page/API/pages/doc-web-view/doc-web-view.js
+++ b/miniprogram/packageAPI/pages/doc-web-view/doc-web-view.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '小程序接口文档',
- path: 'page/API/pages/doc-web-view/doc-web-view'
+ path: 'packageAPI/pages/doc-web-view/doc-web-view'
}
},
})
diff --git a/miniprogram/page/API/pages/doc-web-view/doc-web-view.json b/miniprogram/packageAPI/pages/doc-web-view/doc-web-view.json
similarity index 100%
rename from miniprogram/page/API/pages/doc-web-view/doc-web-view.json
rename to miniprogram/packageAPI/pages/doc-web-view/doc-web-view.json
diff --git a/miniprogram/page/API/pages/doc-web-view/doc-web-view.wxml b/miniprogram/packageAPI/pages/doc-web-view/doc-web-view.wxml
similarity index 100%
rename from miniprogram/page/API/pages/doc-web-view/doc-web-view.wxml
rename to miniprogram/packageAPI/pages/doc-web-view/doc-web-view.wxml
diff --git a/miniprogram/page/API/pages/doc-web-view/doc-web-view.wxss b/miniprogram/packageAPI/pages/doc-web-view/doc-web-view.wxss
similarity index 100%
rename from miniprogram/page/API/pages/doc-web-view/doc-web-view.wxss
rename to miniprogram/packageAPI/pages/doc-web-view/doc-web-view.wxss
diff --git a/miniprogram/packageAPI/pages/download-file/download-file.js b/miniprogram/packageAPI/pages/download-file/download-file.js
new file mode 100644
index 00000000..af0da04d
--- /dev/null
+++ b/miniprogram/packageAPI/pages/download-file/download-file.js
@@ -0,0 +1,25 @@
+const demoImageFileId = require('../../../config').demoImageFileId
+Page({
+ onShareAppMessage() {
+ return {
+ title: '下载文件',
+ path: 'packageAPI/pages/download-file/download-file'
+ }
+ },
+
+ downloadImage() {
+ const self = this
+
+ wx.cloud.downloadFile({
+ fileID: demoImageFileId, // 文件 ID
+ success: res => {
+ console.log('downloadFile success, res is', res)
+
+ self.setData({
+ imageSrc: res.tempFilePath
+ })
+ },
+ fail: console.error
+ })
+ }
+})
diff --git a/miniprogram/page/API/pages/download-file/download-file.json b/miniprogram/packageAPI/pages/download-file/download-file.json
similarity index 100%
rename from miniprogram/page/API/pages/download-file/download-file.json
rename to miniprogram/packageAPI/pages/download-file/download-file.json
diff --git a/miniprogram/page/API/pages/download-file/download-file.wxml b/miniprogram/packageAPI/pages/download-file/download-file.wxml
similarity index 100%
rename from miniprogram/page/API/pages/download-file/download-file.wxml
rename to miniprogram/packageAPI/pages/download-file/download-file.wxml
diff --git a/miniprogram/page/API/pages/download-file/download-file.wxss b/miniprogram/packageAPI/pages/download-file/download-file.wxss
similarity index 100%
rename from miniprogram/page/API/pages/download-file/download-file.wxss
rename to miniprogram/packageAPI/pages/download-file/download-file.wxss
diff --git a/miniprogram/page/API/pages/file/file.js b/miniprogram/packageAPI/pages/file/file.js
similarity index 97%
rename from miniprogram/page/API/pages/file/file.js
rename to miniprogram/packageAPI/pages/file/file.js
index d9f379ac..5fdfdec2 100644
--- a/miniprogram/page/API/pages/file/file.js
+++ b/miniprogram/packageAPI/pages/file/file.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '文件',
- path: 'page/API/pages/file/file'
+ path: 'packageAPI/pages/file/file'
}
},
diff --git a/miniprogram/page/API/pages/file/file.json b/miniprogram/packageAPI/pages/file/file.json
similarity index 100%
rename from miniprogram/page/API/pages/file/file.json
rename to miniprogram/packageAPI/pages/file/file.json
diff --git a/miniprogram/page/API/pages/file/file.wxml b/miniprogram/packageAPI/pages/file/file.wxml
similarity index 100%
rename from miniprogram/page/API/pages/file/file.wxml
rename to miniprogram/packageAPI/pages/file/file.wxml
diff --git a/miniprogram/page/API/pages/file/file.wxss b/miniprogram/packageAPI/pages/file/file.wxss
similarity index 68%
rename from miniprogram/page/API/pages/file/file.wxss
rename to miniprogram/packageAPI/pages/file/file.wxss
index 8a06a195..4bc85e0e 100644
--- a/miniprogram/page/API/pages/file/file.wxss
+++ b/miniprogram/packageAPI/pages/file/file.wxss
@@ -7,8 +7,8 @@
box-sizing: border-box;
padding: 30rpx;
height: 420rpx;
- border-top: 1rpx solid #D9D9D9;
- border-bottom: 1rpx solid #D9D9D9;
+ border-top: 1rpx solid var(--weui-FG-3);
+ border-bottom: 1rpx solid var(--weui-FG-3);
align-items: center;
justify-content: center;
}
diff --git a/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.js b/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.js
new file mode 100644
index 00000000..7c009e1b
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.js
@@ -0,0 +1,55 @@
+// 使用周期性数据的时候,需要先调用setBackgroundFetchToken, 可在 app.js 中查看具体例子
+Page({
+ onShareAppMessage() {
+ return {
+ title: '周期性缓存',
+ path: 'packageAPI/pages/get-background-fetch-data/get-background-fetch-data'
+ }
+ },
+ onShow() {
+ // 获取缓存的周期性更新数据
+ this.getBackgroundFetchData();
+ },
+ data: {
+ openid: '',
+ appid: '',
+ canIUse: true,
+ },
+ getBackgroundFetchData() {
+ console.log('读取周期性更新数据')
+ const that = this;
+ if (wx.getBackgroundFetchData) {
+ wx.getBackgroundFetchData({
+ // 当type = 'periodic' 微信客户端会每隔 12 小时向服务器请求一次数据。
+ fetchType: 'periodic',
+ success(res) {
+ console.log(res)
+ const { fetchedData } = res;
+ const result = JSON.parse(fetchedData)
+ that.setData({
+ appid: result.appid,
+ openid: result.openid,
+ })
+ console.log('读取周期性更新数据成功')
+ },
+ fail() {
+ console.log('读取周期性更新数据失败')
+ wx.showToast({
+ title: '无缓存数据',
+ icon: 'none'
+ })
+ },
+ complete() {
+ console.log('结束读取')
+ }
+ })
+ } else {
+ this.setData({
+ canIUse: false
+ })
+ wx.showModal({
+ title: '微信版本过低,暂不支持本功能',
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.json b/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.json
new file mode 100644
index 00000000..3e7f248c
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "周期性更新数据"
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.wxml b/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.wxml
new file mode 100644
index 00000000..c1a2fe36
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.wxml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+ 周期性缓存数据
+
+
+ OpenID
+ {{openid}}
+
+
+ AppID
+ {{appid}}
+
+
+
+ 微信客户端每隔 12 个小时才会发起一次请求
+ 为了方便调试周期性数据,可以在 工具 -> 拉取周期性缓存数据 开启
+
+
+
+
+
+
+
diff --git a/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.wxss b/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.wxss
new file mode 100644
index 00000000..94a40f33
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-background-fetch-data/get-background-fetch-data.wxss
@@ -0,0 +1,14 @@
+.page-body-info {
+ padding-bottom: 0;
+ height: 300px;
+}
+.page-body-text {
+ padding: 0 30rpx;
+ text-align: center;
+}
+.page-body-title {
+ margin-bottom: 40rpx;
+}
+.context-value {
+ font-size: 38rpx;
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.js b/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.js
new file mode 100644
index 00000000..63191538
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.js
@@ -0,0 +1,67 @@
+const app = getApp();
+// 使用预缓存数据的时候,需要先调用setBackgroundFetchToken, 可在 app.js 中查看具体例子
+
+Date.prototype.Format = function (fmt) {
+ var o = {
+ "M+": this.getMonth() + 1, //月份
+ "d+": this.getDate(), //日
+ "h+": this.getHours(), //小时
+ "m+": this.getMinutes(), //分
+ "s+": this.getSeconds(), //秒
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+ "S": this.getMilliseconds() //毫秒
+ };
+
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+ for (var k in o){
+ if (new RegExp("(" + k + ")").test(fmt)) {
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+ }
+ }
+
+ return fmt;
+}
+
+Page({
+ onShow() {
+ // 获取缓存的预拉取数据
+ this.getBackgroundFetchData();
+ },
+ onShareAppMessage() {
+ return {
+ title: '预拉取',
+ path: 'packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data'
+ }
+ },
+ data: {
+ openid: '',
+ appid: '',
+ getDataTime: '',
+ canIUse: true,
+ },
+ getBackgroundFetchData() {
+ if (wx.getBackgroundFetchData) {
+ console.log('读取预拉取数据')
+ const res = app.globalData.backgroundFetchData;
+ const { fetchedData } = res;
+ const result = JSON.parse(fetchedData)
+ const systemInfo = wx.getSystemInfoSync();
+ const timeStamp = systemInfo.brand === 'iPhone' ? res.timeStamp * 1000 : res.timeStamp
+ const time = new Date(timeStamp).Format("yyyy-MM-dd hh:mm:ss");
+ this.setData({
+ appid: result.appid,
+ openid: result.openid,
+ getDataTime: time,
+
+ })
+ } else {
+ this.setData({
+ canIUse: false,
+ })
+ wx.showModal({
+ title: '微信版本过低,暂不支持本功能',
+ })
+ }
+
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.json b/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.json
new file mode 100644
index 00000000..dac50b39
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "数据预拉取"
+
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.wxml b/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.wxml
new file mode 100644
index 00000000..c4b34165
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.wxml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+ 数据预拉取
+
+
+ OpenID
+ {{openid}}
+
+
+ AppID
+ {{appid}}
+
+
+ 数据缓存的时间
+ {{getDataTime}}
+
+
+
+ 用户启动小程序时,调用 wx.getBackgroundFetchData() 获取已缓存到本地的数据。
+
+
+
+
+
+
+
+
diff --git a/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.wxss b/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.wxss
new file mode 100644
index 00000000..7f789aad
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-background-prefetch-data/get-background-prefetch-data.wxss
@@ -0,0 +1,14 @@
+.page-body-info {
+ padding-bottom: 0;
+ height: 340px;
+}
+.page-body-title {
+ margin-bottom: 40rpx;
+}
+.page-body-text {
+ padding: 0 30rpx;
+ text-align: center;
+}
+.context-value {
+ font-size: 38rpx;
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.js b/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.js
new file mode 100644
index 00000000..cfd2fe7d
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.js
@@ -0,0 +1,24 @@
+// miniprogram/page/API/pages/get-battery-info/get-battery-info.js
+Page({
+ onShareAppMessage() {
+ return {
+ title: '获取电池信息',
+ path: 'packageAPI/pages/get-battery-info/get-battery-info'
+ }
+ },
+ data: {
+
+ },
+
+ getBatteryInfo() {
+ wx.getBatteryInfo({
+ complete: (res) => {
+ const msg = res.isCharging ? '充电中' : '使用电池中';
+ this.setData({
+ level: res.level,
+ isCharging: msg,
+ })
+ },
+ })
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.json b/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.json
new file mode 100644
index 00000000..4f2df612
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "获取手机设备电量"
+
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.wxml b/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.wxml
new file mode 100644
index 00000000..2000d113
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.wxml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+ 当前电量
+
+
+
+
+
+
+
+ 电池模式
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.wxss b/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.wxss
new file mode 100644
index 00000000..07fec9df
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-battery-info/get-battery-info.wxss
@@ -0,0 +1,2 @@
+@import "../../../common/lib/weui.wxss";
+
diff --git a/miniprogram/page/API/pages/get-location/get-location.js b/miniprogram/packageAPI/pages/get-location/get-location.js
similarity index 82%
rename from miniprogram/page/API/pages/get-location/get-location.js
rename to miniprogram/packageAPI/pages/get-location/get-location.js
index 7ccdb077..f305dbde 100644
--- a/miniprogram/page/API/pages/get-location/get-location.js
+++ b/miniprogram/packageAPI/pages/get-location/get-location.js
@@ -1,4 +1,4 @@
-const util = require('../../../../util/util.js')
+const util = require('../../../util/util.js')
const formatLocation = util.formatLocation
@@ -6,7 +6,7 @@ Page({
onShareAppMessage() {
return {
title: '获取位置',
- path: 'page/API/pages/get-location/get-location'
+ path: 'packageAPI/pages/get-location/get-location'
}
},
diff --git a/miniprogram/page/API/pages/get-location/get-location.json b/miniprogram/packageAPI/pages/get-location/get-location.json
similarity index 100%
rename from miniprogram/page/API/pages/get-location/get-location.json
rename to miniprogram/packageAPI/pages/get-location/get-location.json
diff --git a/miniprogram/page/API/pages/get-location/get-location.wxml b/miniprogram/packageAPI/pages/get-location/get-location.wxml
similarity index 100%
rename from miniprogram/page/API/pages/get-location/get-location.wxml
rename to miniprogram/packageAPI/pages/get-location/get-location.wxml
diff --git a/miniprogram/page/API/pages/get-location/get-location.wxss b/miniprogram/packageAPI/pages/get-location/get-location.wxss
similarity index 89%
rename from miniprogram/page/API/pages/get-location/get-location.wxss
rename to miniprogram/packageAPI/pages/get-location/get-location.wxss
index bcefb379..1a86a2e4 100644
--- a/miniprogram/page/API/pages/get-location/get-location.wxss
+++ b/miniprogram/packageAPI/pages/get-location/get-location.wxss
@@ -3,7 +3,7 @@
}
.page-body-text-small {
font-size: 24rpx;
- color: #000;
+ color: var(--weui-FG-0);
margin-bottom: 100rpx;
}
.page-body-text-location {
diff --git a/miniprogram/page/API/pages/get-network-type/get-network-type.js b/miniprogram/packageAPI/pages/get-network-type/get-network-type.js
similarity index 88%
rename from miniprogram/page/API/pages/get-network-type/get-network-type.js
rename to miniprogram/packageAPI/pages/get-network-type/get-network-type.js
index a5a0019b..811ae7b0 100644
--- a/miniprogram/page/API/pages/get-network-type/get-network-type.js
+++ b/miniprogram/packageAPI/pages/get-network-type/get-network-type.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '获取手机网络状态',
- path: 'page/API/pages/get-network-type/get-network-type'
+ path: 'packageAPI/pages/get-network-type/get-network-type'
}
},
diff --git a/miniprogram/page/API/pages/get-network-type/get-network-type.json b/miniprogram/packageAPI/pages/get-network-type/get-network-type.json
similarity index 100%
rename from miniprogram/page/API/pages/get-network-type/get-network-type.json
rename to miniprogram/packageAPI/pages/get-network-type/get-network-type.json
diff --git a/miniprogram/page/API/pages/get-network-type/get-network-type.wxml b/miniprogram/packageAPI/pages/get-network-type/get-network-type.wxml
similarity index 100%
rename from miniprogram/page/API/pages/get-network-type/get-network-type.wxml
rename to miniprogram/packageAPI/pages/get-network-type/get-network-type.wxml
diff --git a/miniprogram/page/API/pages/get-network-type/get-network-type.wxss b/miniprogram/packageAPI/pages/get-network-type/get-network-type.wxss
similarity index 100%
rename from miniprogram/page/API/pages/get-network-type/get-network-type.wxss
rename to miniprogram/packageAPI/pages/get-network-type/get-network-type.wxss
diff --git a/miniprogram/packageAPI/pages/get-performance/get-performance.js b/miniprogram/packageAPI/pages/get-performance/get-performance.js
new file mode 100644
index 00000000..17ba9328
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-performance/get-performance.js
@@ -0,0 +1,55 @@
+// miniprogram/page/API/pages/get-performance/get-performance.js
+
+const util = require('./util')
+const performance = wx.getPerformance ? wx.getPerformance() : {};
+const performanceObserver = performance.createObserver ? performance.createObserver() : null;
+
+
+Page({
+ onShareAppMessage() {
+ return {
+ title: '周期性缓存',
+ path: 'packageAPI/pages/get-performance/get-performance'
+ }
+ },
+ data: {
+ array: [],
+ support: false,
+ },
+ onLoad() {
+ console.log('canIUse:getPerformance:', wx.canIUse('getPerformance'));
+ let canIUse = false;
+ if(wx.getPerformance) {
+ canIUse = true;
+ }
+ this.setData({
+ support: canIUse,
+ })
+ },
+ getPerformanceInfo() {
+ const EntryList = performance.getEntries();
+ const array = [];
+ EntryList.forEach((item) => {
+ array.push({
+ entryType: util.renderEntryType(item.entryType),
+ name: util.renderName(item.name),
+ duration: util.renderDuration(item.duration),
+ startTime: util.renderStartTime(item.startTime),
+ })
+ })
+ this.setData({
+ array: array,
+ })
+ },
+
+ startObserver() {
+ // 监听需要的性能指标
+ performanceObserver.observe({ entryTypes: ['render', 'script', 'navigation'] });
+
+ },
+
+ stopObserver() {
+ // 结束监听
+ performanceObserver.disconnect();
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-performance/get-performance.json b/miniprogram/packageAPI/pages/get-performance/get-performance.json
new file mode 100644
index 00000000..2ef772ee
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-performance/get-performance.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "性能数据"
+
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-performance/get-performance.wxml b/miniprogram/packageAPI/pages/get-performance/get-performance.wxml
new file mode 100644
index 00000000..d2658421
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-performance/get-performance.wxml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{item.entryType}}:{{item.name}}
+ 耗时:{{item.duration}}
+ 时间:{{item.startTime}}
+
+
+
+
+
+ 微信版本过低,暂不支持本功能
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/get-performance/get-performance.wxss b/miniprogram/packageAPI/pages/get-performance/get-performance.wxss
new file mode 100644
index 00000000..b202eacd
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-performance/get-performance.wxss
@@ -0,0 +1,10 @@
+.performance-list {
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ align-items: center;
+}
+.performance-item {
+ margin: 30rpx 0;
+ width: 80%;
+}
diff --git a/miniprogram/packageAPI/pages/get-performance/util.js b/miniprogram/packageAPI/pages/get-performance/util.js
new file mode 100644
index 00000000..69c8d6cc
--- /dev/null
+++ b/miniprogram/packageAPI/pages/get-performance/util.js
@@ -0,0 +1,67 @@
+const util = {};
+
+// const { formatDateTime } = require('../../../../util/util')
+Date.prototype.Format = function (fmt) {
+ var o = {
+ "M+": this.getMonth() + 1, //月份
+ "d+": this.getDate(), //日
+ "h+": this.getHours(), //小时
+ "m+": this.getMinutes(), //分
+ "s+": this.getSeconds(), //秒
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+ "S": this.getMilliseconds() //毫秒
+ };
+
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+ for (var k in o){
+ if (new RegExp("(" + k + ")").test(fmt)) {
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+ }
+ }
+
+ return fmt;
+}
+
+util.renderName = (name) => {
+ switch (name) {
+ case 'appLaunch':
+ return '小程序启动'
+ break;
+ case 'firstRender':
+ return '页面首次渲染'
+ break;
+ case 'route':
+ return '路由性能'
+ break;
+ case 'evaluateScript':
+ return '注入脚本';
+ break;
+ }
+}
+
+util.renderEntryType = (entryType) => {
+ switch (entryType) {
+ case 'navigation':
+ return '路由'
+ break;
+ case 'render':
+ return '渲染'
+ break;
+ case 'script':
+ return '脚本'
+ break;
+ }
+}
+
+util.renderDuration = (duration) => {
+ return duration ? duration + 'ms' : '';
+}
+
+util.renderStartTime = (startTime) => {
+ if (!startTime) return '';
+
+ const date = new Date(startTime);
+ return date.Format("yyyy-MM-dd hh:mm:ss");
+}
+
+module.exports = util;
\ No newline at end of file
diff --git a/miniprogram/page/API/pages/get-system-info/get-system-info.js b/miniprogram/packageAPI/pages/get-system-info/get-system-info.js
similarity index 82%
rename from miniprogram/page/API/pages/get-system-info/get-system-info.js
rename to miniprogram/packageAPI/pages/get-system-info/get-system-info.js
index 95ff1021..aa63226e 100644
--- a/miniprogram/page/API/pages/get-system-info/get-system-info.js
+++ b/miniprogram/packageAPI/pages/get-system-info/get-system-info.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '获取手机系统信息',
- path: 'page/API/pages/get-system-info/get-system-info'
+ path: 'packageAPI/pages/get-system-info/get-system-info'
}
},
diff --git a/miniprogram/page/API/pages/get-system-info/get-system-info.json b/miniprogram/packageAPI/pages/get-system-info/get-system-info.json
similarity index 100%
rename from miniprogram/page/API/pages/get-system-info/get-system-info.json
rename to miniprogram/packageAPI/pages/get-system-info/get-system-info.json
diff --git a/miniprogram/page/API/pages/get-system-info/get-system-info.wxml b/miniprogram/packageAPI/pages/get-system-info/get-system-info.wxml
similarity index 100%
rename from miniprogram/page/API/pages/get-system-info/get-system-info.wxml
rename to miniprogram/packageAPI/pages/get-system-info/get-system-info.wxml
diff --git a/miniprogram/page/API/pages/get-system-info/get-system-info.wxss b/miniprogram/packageAPI/pages/get-system-info/get-system-info.wxss
similarity index 100%
rename from miniprogram/page/API/pages/get-system-info/get-system-info.wxss
rename to miniprogram/packageAPI/pages/get-system-info/get-system-info.wxss
diff --git a/miniprogram/page/API/pages/get-user-info/get-user-info.js b/miniprogram/packageAPI/pages/get-user-info/get-user-info.js
similarity index 85%
rename from miniprogram/page/API/pages/get-user-info/get-user-info.js
rename to miniprogram/packageAPI/pages/get-user-info/get-user-info.js
index 1176449d..1573c53a 100644
--- a/miniprogram/page/API/pages/get-user-info/get-user-info.js
+++ b/miniprogram/packageAPI/pages/get-user-info/get-user-info.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '获取用户信息',
- path: 'page/API/pages/get-user-info/get-user-info'
+ path: 'packageAPI/pages/get-user-info/get-user-info'
}
},
diff --git a/miniprogram/page/API/pages/get-user-info/get-user-info.json b/miniprogram/packageAPI/pages/get-user-info/get-user-info.json
similarity index 100%
rename from miniprogram/page/API/pages/get-user-info/get-user-info.json
rename to miniprogram/packageAPI/pages/get-user-info/get-user-info.json
diff --git a/miniprogram/page/API/pages/get-user-info/get-user-info.wxml b/miniprogram/packageAPI/pages/get-user-info/get-user-info.wxml
similarity index 100%
rename from miniprogram/page/API/pages/get-user-info/get-user-info.wxml
rename to miniprogram/packageAPI/pages/get-user-info/get-user-info.wxml
diff --git a/miniprogram/page/API/pages/get-user-info/get-user-info.wxss b/miniprogram/packageAPI/pages/get-user-info/get-user-info.wxss
similarity index 100%
rename from miniprogram/page/API/pages/get-user-info/get-user-info.wxss
rename to miniprogram/packageAPI/pages/get-user-info/get-user-info.wxss
diff --git a/miniprogram/page/API/pages/get-wxml-node-info/get-wxml-node-info.js b/miniprogram/packageAPI/pages/get-wxml-node-info/get-wxml-node-info.js
similarity index 90%
rename from miniprogram/page/API/pages/get-wxml-node-info/get-wxml-node-info.js
rename to miniprogram/packageAPI/pages/get-wxml-node-info/get-wxml-node-info.js
index 898e7663..bcf62655 100644
--- a/miniprogram/page/API/pages/get-wxml-node-info/get-wxml-node-info.js
+++ b/miniprogram/packageAPI/pages/get-wxml-node-info/get-wxml-node-info.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '获取WXML节点信息',
- path: 'page/API/pages/get-wxml-node-info/get-wxml-node-info'
+ path: 'packageAPI/pages/get-wxml-node-info/get-wxml-node-info'
}
},
diff --git a/miniprogram/page/API/pages/get-wxml-node-info/get-wxml-node-info.json b/miniprogram/packageAPI/pages/get-wxml-node-info/get-wxml-node-info.json
similarity index 100%
rename from miniprogram/page/API/pages/get-wxml-node-info/get-wxml-node-info.json
rename to miniprogram/packageAPI/pages/get-wxml-node-info/get-wxml-node-info.json
diff --git a/miniprogram/page/API/pages/get-wxml-node-info/get-wxml-node-info.wxml b/miniprogram/packageAPI/pages/get-wxml-node-info/get-wxml-node-info.wxml
similarity index 100%
rename from miniprogram/page/API/pages/get-wxml-node-info/get-wxml-node-info.wxml
rename to miniprogram/packageAPI/pages/get-wxml-node-info/get-wxml-node-info.wxml
diff --git a/miniprogram/page/API/pages/get-wxml-node-info/get-wxml-node-info.wxss b/miniprogram/packageAPI/pages/get-wxml-node-info/get-wxml-node-info.wxss
similarity index 100%
rename from miniprogram/page/API/pages/get-wxml-node-info/get-wxml-node-info.wxss
rename to miniprogram/packageAPI/pages/get-wxml-node-info/get-wxml-node-info.wxss
diff --git a/miniprogram/page/API/pages/ibeacon/ibeacon.js b/miniprogram/packageAPI/pages/ibeacon/ibeacon.js
similarity index 93%
rename from miniprogram/page/API/pages/ibeacon/ibeacon.js
rename to miniprogram/packageAPI/pages/ibeacon/ibeacon.js
index 25b8588a..4ef278e6 100644
--- a/miniprogram/page/API/pages/ibeacon/ibeacon.js
+++ b/miniprogram/packageAPI/pages/ibeacon/ibeacon.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: 'iBeacon',
- path: 'page/API/pages/ibeacon/ibeacon'
+ path: 'packageAPI/pages/ibeacon/ibeacon'
}
},
diff --git a/miniprogram/page/API/pages/ibeacon/ibeacon.json b/miniprogram/packageAPI/pages/ibeacon/ibeacon.json
similarity index 100%
rename from miniprogram/page/API/pages/ibeacon/ibeacon.json
rename to miniprogram/packageAPI/pages/ibeacon/ibeacon.json
diff --git a/miniprogram/page/API/pages/ibeacon/ibeacon.wxml b/miniprogram/packageAPI/pages/ibeacon/ibeacon.wxml
similarity index 100%
rename from miniprogram/page/API/pages/ibeacon/ibeacon.wxml
rename to miniprogram/packageAPI/pages/ibeacon/ibeacon.wxml
diff --git a/miniprogram/page/API/pages/ibeacon/ibeacon.wxss b/miniprogram/packageAPI/pages/ibeacon/ibeacon.wxss
similarity index 82%
rename from miniprogram/page/API/pages/ibeacon/ibeacon.wxss
rename to miniprogram/packageAPI/pages/ibeacon/ibeacon.wxss
index f713711e..380e19b5 100644
--- a/miniprogram/page/API/pages/ibeacon/ibeacon.wxss
+++ b/miniprogram/packageAPI/pages/ibeacon/ibeacon.wxss
@@ -16,9 +16,9 @@
flex: 1;
}
.device_item {
- border-bottom: 1rpx solid #EEE;
+ border-bottom: 1rpx solid var(--weui-FG-3);
padding: 10rpx;
- color: #666;
+ color: var(--weui-FG-HALF);
}
.device_item_hover {
background-color: rgba(0, 0, 0, .1);
diff --git a/miniprogram/page/API/pages/image/image.js b/miniprogram/packageAPI/pages/image/image.js
similarity index 96%
rename from miniprogram/page/API/pages/image/image.js
rename to miniprogram/packageAPI/pages/image/image.js
index c2d3a7c4..93b0527b 100644
--- a/miniprogram/page/API/pages/image/image.js
+++ b/miniprogram/packageAPI/pages/image/image.js
@@ -5,7 +5,7 @@ Page({
onShareAppMessage() {
return {
title: '图片',
- path: 'page/API/pages/image/image'
+ path: 'packageAPI/pages/image/image'
}
},
diff --git a/miniprogram/page/API/pages/image/image.json b/miniprogram/packageAPI/pages/image/image.json
similarity index 100%
rename from miniprogram/page/API/pages/image/image.json
rename to miniprogram/packageAPI/pages/image/image.json
diff --git a/miniprogram/page/API/pages/image/image.wxml b/miniprogram/packageAPI/pages/image/image.wxml
similarity index 100%
rename from miniprogram/page/API/pages/image/image.wxml
rename to miniprogram/packageAPI/pages/image/image.wxml
diff --git a/miniprogram/page/API/pages/image/image.wxss b/miniprogram/packageAPI/pages/image/image.wxss
similarity index 100%
rename from miniprogram/page/API/pages/image/image.wxss
rename to miniprogram/packageAPI/pages/image/image.wxss
diff --git a/miniprogram/page/API/pages/intersection-observer/intersection-observer.js b/miniprogram/packageAPI/pages/intersection-observer/intersection-observer.js
similarity index 86%
rename from miniprogram/page/API/pages/intersection-observer/intersection-observer.js
rename to miniprogram/packageAPI/pages/intersection-observer/intersection-observer.js
index 32be6ac1..7e81325b 100644
--- a/miniprogram/page/API/pages/intersection-observer/intersection-observer.js
+++ b/miniprogram/packageAPI/pages/intersection-observer/intersection-observer.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: 'WXML节点布局相交状态',
- path: 'page/API/pages/intersection-observer/intersection-observer'
+ path: 'packageAPI/pages/intersection-observer/intersection-observer'
}
},
diff --git a/miniprogram/page/API/pages/intersection-observer/intersection-observer.json b/miniprogram/packageAPI/pages/intersection-observer/intersection-observer.json
similarity index 100%
rename from miniprogram/page/API/pages/intersection-observer/intersection-observer.json
rename to miniprogram/packageAPI/pages/intersection-observer/intersection-observer.json
diff --git a/miniprogram/page/API/pages/intersection-observer/intersection-observer.wxml b/miniprogram/packageAPI/pages/intersection-observer/intersection-observer.wxml
similarity index 100%
rename from miniprogram/page/API/pages/intersection-observer/intersection-observer.wxml
rename to miniprogram/packageAPI/pages/intersection-observer/intersection-observer.wxml
diff --git a/miniprogram/page/API/pages/intersection-observer/intersection-observer.wxss b/miniprogram/packageAPI/pages/intersection-observer/intersection-observer.wxss
similarity index 93%
rename from miniprogram/page/API/pages/intersection-observer/intersection-observer.wxss
rename to miniprogram/packageAPI/pages/intersection-observer/intersection-observer.wxss
index 6260bfb2..9ead930e 100644
--- a/miniprogram/page/API/pages/intersection-observer/intersection-observer.wxss
+++ b/miniprogram/packageAPI/pages/intersection-observer/intersection-observer.wxss
@@ -1,6 +1,6 @@
.scroll-view {
height: 400rpx;
- background: #fff;
+ background: var(--weui-BG-2);
}
.scroll-area {
diff --git a/miniprogram/page/API/pages/load-font-face/load-font-face.js b/miniprogram/packageAPI/pages/load-font-face/load-font-face.js
similarity index 91%
rename from miniprogram/page/API/pages/load-font-face/load-font-face.js
rename to miniprogram/packageAPI/pages/load-font-face/load-font-face.js
index dae0d1a5..066ebf45 100644
--- a/miniprogram/page/API/pages/load-font-face/load-font-face.js
+++ b/miniprogram/packageAPI/pages/load-font-face/load-font-face.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '动态加载字体',
- path: 'page/API/pages/load-font-face/load-font-face'
+ path: 'packageAPI/pages/load-font-face/load-font-face'
}
},
diff --git a/miniprogram/page/API/pages/load-font-face/load-font-face.json b/miniprogram/packageAPI/pages/load-font-face/load-font-face.json
similarity index 100%
rename from miniprogram/page/API/pages/load-font-face/load-font-face.json
rename to miniprogram/packageAPI/pages/load-font-face/load-font-face.json
diff --git a/miniprogram/page/API/pages/load-font-face/load-font-face.wxml b/miniprogram/packageAPI/pages/load-font-face/load-font-face.wxml
similarity index 100%
rename from miniprogram/page/API/pages/load-font-face/load-font-face.wxml
rename to miniprogram/packageAPI/pages/load-font-face/load-font-face.wxml
diff --git a/miniprogram/page/API/pages/load-font-face/load-font-face.wxss b/miniprogram/packageAPI/pages/load-font-face/load-font-face.wxss
similarity index 100%
rename from miniprogram/page/API/pages/load-font-face/load-font-face.wxss
rename to miniprogram/packageAPI/pages/load-font-face/load-font-face.wxss
diff --git a/miniprogram/page/API/pages/login/login.js b/miniprogram/packageAPI/pages/login/login.js
similarity index 89%
rename from miniprogram/page/API/pages/login/login.js
rename to miniprogram/packageAPI/pages/login/login.js
index 56b05f54..50233008 100644
--- a/miniprogram/page/API/pages/login/login.js
+++ b/miniprogram/packageAPI/pages/login/login.js
@@ -3,7 +3,7 @@ Page({
onShareAppMessage() {
return {
title: '微信登录',
- path: 'page/API/pages/login/login'
+ path: 'package/API/pages/login/login'
}
},
diff --git a/miniprogram/page/API/pages/login/login.json b/miniprogram/packageAPI/pages/login/login.json
similarity index 100%
rename from miniprogram/page/API/pages/login/login.json
rename to miniprogram/packageAPI/pages/login/login.json
diff --git a/miniprogram/page/API/pages/login/login.wxml b/miniprogram/packageAPI/pages/login/login.wxml
similarity index 100%
rename from miniprogram/page/API/pages/login/login.wxml
rename to miniprogram/packageAPI/pages/login/login.wxml
diff --git a/miniprogram/page/API/pages/login/login.wxss b/miniprogram/packageAPI/pages/login/login.wxss
similarity index 100%
rename from miniprogram/page/API/pages/login/login.wxss
rename to miniprogram/packageAPI/pages/login/login.wxss
diff --git a/miniprogram/page/API/pages/make-phone-call/make-phone-call.js b/miniprogram/packageAPI/pages/make-phone-call/make-phone-call.js
similarity index 88%
rename from miniprogram/page/API/pages/make-phone-call/make-phone-call.js
rename to miniprogram/packageAPI/pages/make-phone-call/make-phone-call.js
index 5d7f2449..8609962e 100644
--- a/miniprogram/page/API/pages/make-phone-call/make-phone-call.js
+++ b/miniprogram/packageAPI/pages/make-phone-call/make-phone-call.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '打电话',
- path: 'page/API/pages/make-phone-call/make-phone-call'
+ path: 'packageAPI/pages/make-phone-call/make-phone-call'
}
},
diff --git a/miniprogram/page/API/pages/make-phone-call/make-phone-call.json b/miniprogram/packageAPI/pages/make-phone-call/make-phone-call.json
similarity index 100%
rename from miniprogram/page/API/pages/make-phone-call/make-phone-call.json
rename to miniprogram/packageAPI/pages/make-phone-call/make-phone-call.json
diff --git a/miniprogram/page/API/pages/make-phone-call/make-phone-call.wxml b/miniprogram/packageAPI/pages/make-phone-call/make-phone-call.wxml
similarity index 100%
rename from miniprogram/page/API/pages/make-phone-call/make-phone-call.wxml
rename to miniprogram/packageAPI/pages/make-phone-call/make-phone-call.wxml
diff --git a/miniprogram/page/API/pages/make-phone-call/make-phone-call.wxss b/miniprogram/packageAPI/pages/make-phone-call/make-phone-call.wxss
similarity index 73%
rename from miniprogram/page/API/pages/make-phone-call/make-phone-call.wxss
rename to miniprogram/packageAPI/pages/make-phone-call/make-phone-call.wxss
index 81b05596..44bc08cf 100644
--- a/miniprogram/page/API/pages/make-phone-call/make-phone-call.wxss
+++ b/miniprogram/packageAPI/pages/make-phone-call/make-phone-call.wxss
@@ -2,7 +2,7 @@
width: auto;
margin: 30rpx;
padding: 44rpx 60rpx 60rpx;
- background-color: #fff;
+ background-color: var(--weui-BG-2);
font-size: 28rpx;
}
.desc{
@@ -12,7 +12,7 @@
height: 119rpx;
line-height: 119rpx;
font-size: 78rpx;
- border-bottom: 1rpx solid #E2E2E2;
+ border-bottom: 1rpx solid var(--weui-FG-3);
}
.btn-area{
padding: 0;
diff --git a/miniprogram/packageAPI/pages/mdns/mdns.js b/miniprogram/packageAPI/pages/mdns/mdns.js
new file mode 100644
index 00000000..3b5fb227
--- /dev/null
+++ b/miniprogram/packageAPI/pages/mdns/mdns.js
@@ -0,0 +1,132 @@
+// miniprogram/page/API/pages/mdns/mdns.js
+let serviceList = [];
+let resolveFailList = [];
+Page({
+ onShareAppMessage() {
+ return {
+ title: 'mdns',
+ path: 'packageAPI/pages/mdns/mdns'
+ }
+ },
+ daga: {
+ serviceList: [],
+ resolveFailList: [],
+ },
+ onShow() {
+ this.onLocalService();
+ },
+
+ startDiscovery() {
+ wx.startLocalServiceDiscovery({
+ serviceType: '_http._tcp.',
+ success: function(res) {
+ console.log(res);
+ wx.showToast({
+ title: '开启成功',
+ icon: 'none',
+ duration: 2000
+ })
+ },
+ fail: (err) => {
+ wx.showToast({
+ title: '开启失败',
+ icon: 'none',
+ duration: 2000
+ })
+ console.log(err)
+ },
+ complete: () => {
+ console.log('startDiscovery: complete')
+ }
+ })
+ },
+
+ stopDiscovery() {
+ const that = this;
+ wx.stopLocalServiceDiscovery({
+ success: (res) => {
+ wx.showToast({
+ title: '关闭成功',
+ icon: 'none',
+ duration: 2000
+ })
+ serviceList = [];
+ resolveFailList = [];
+ that.setData({
+ serviceList: [],
+ resolveFailList: []
+ })
+ },
+ fail: () => {
+ console.log('stopDiscovery: fail')
+ wx.showToast({
+ title: '关闭失败',
+ icon: 'none',
+ duration: 2000
+ })
+ },
+ complete: () => {
+ console.log('stopDIscovery: complete')
+ }
+ })
+ },
+
+
+ // 监听列表
+ onLocalService() {
+ let that = this
+
+ // 监听服务发现事件
+ wx.onLocalServiceFound(function(obj) {
+ console.log(obj)
+ serviceList.push(obj);
+
+ that.setData({
+ serviceList: serviceList,
+ })
+ })
+
+ // 监听服务解析失败事件
+ wx.onLocalServiceResolveFail(function(obj) {
+ console.log(obj)
+ resolveFailList.push(obj)
+ that.setData({
+ resolveFailList: resolveFailList
+ })
+ })
+
+ // 监听服务离开
+ wx.onLocalServiceLost(function(obj) {
+ console.log(obj)
+ })
+
+ // 监听搜索停止
+ wx.onLocalServiceDiscoveryStop(function(obj) {
+ console.log('监听到搜索停止事件')
+ })
+ },
+ // 取消监听
+ offLocalService() {
+
+ console.log('是否执行此部分数据')
+ // 取消监听服务发现事件
+ wx.offLocalServiceFound(function () {
+ console.log('取消监听服务发现事件 成功')
+ })
+
+ // 取消监听服务解析失败事件
+ wx.offLocalServiceResolveFail(function () {
+ console.log('取消监听 mDNS 服务解析失败的事件 成功')
+ })
+
+ // 取消监听服务离开
+ wx.offLocalServiceLost(function () {
+ console.log('取消监听服务离开事件 成功')
+ })
+
+ // 取消监听搜索停止
+ wx.offLocalServiceDiscoveryStop(function () {
+ console.log('取消监听 mDNS 服务停止搜索的事件 成功')
+ })
+ },
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/mdns/mdns.json b/miniprogram/packageAPI/pages/mdns/mdns.json
new file mode 100644
index 00000000..539e3544
--- /dev/null
+++ b/miniprogram/packageAPI/pages/mdns/mdns.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "mDNS"
+
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/mdns/mdns.wxml b/miniprogram/packageAPI/pages/mdns/mdns.wxml
new file mode 100644
index 00000000..b3fc03cf
--- /dev/null
+++ b/miniprogram/packageAPI/pages/mdns/mdns.wxml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+ 设备服务名:{{item.serviceName}}
+ ip地址:{{item.ip}}:{{item.port}}
+ 当前服务类型:{{item.serviceType}}
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/mdns/mdns.wxss b/miniprogram/packageAPI/pages/mdns/mdns.wxss
new file mode 100644
index 00000000..46004371
--- /dev/null
+++ b/miniprogram/packageAPI/pages/mdns/mdns.wxss
@@ -0,0 +1 @@
+/* miniprogram/page/API/pages/mdns/mdns.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/media-container/media-container.js b/miniprogram/packageAPI/pages/media-container/media-container.js
new file mode 100644
index 00000000..c1a477dc
--- /dev/null
+++ b/miniprogram/packageAPI/pages/media-container/media-container.js
@@ -0,0 +1,86 @@
+
+Page({
+ onShareAppMessage() {
+ return {
+ title: '音视频合成',
+ path: 'packageAPI/pages/media-container/media-container'
+ }
+ },
+ onLoad() {
+ const canIUse = wx.canIUse('wx.createMediaContainer()')
+ if(canIUse) {
+ this.mediaContainer = wx.createMediaContainer()
+ } else {
+ this.setData({
+ canIUse: false,
+ })
+ wx.showModal({
+ title: '微信版本过低,暂不支持本功能',
+ })
+ }
+ },
+ data: {
+ targetSrc: '',
+ one: '',
+ two: '',
+ canIUse: true,
+ },
+ handleChooseVideo(e) {
+ const that = this;
+ wx.chooseVideo({
+ sourceType: ['album', 'camera'],
+ success(res) {
+ console.log(res.tempFilePath)
+ that.setData({
+ [e.currentTarget.dataset.video]: res.tempFilePath
+ })
+ if (e.currentTarget.dataset.video === 'one') {
+ that.mediaContainer.extractDataSource({
+ source: that.data.one,
+ success(mt) {
+ that.mediaTrackOne = mt;
+ }
+ })
+ } else {
+ that.mediaContainer.extractDataSource({
+ source: that.data.two,
+ success(mt) {
+ that.mediaTrackTwo = mt;
+ }
+ })
+ }
+ }
+ })
+ },
+ handleExport() {
+ if (this.data.one === '' || this.data.two === '') {
+ wx.showToast({
+ title: '请先选择源视频',
+ icon: "none"
+ })
+ } else {
+ console.log(this.mediaTrackOne, this.mediaTrackTwo)
+ // 获取源视频 1 的视频轨道
+ const [ trackMedia ] = this.mediaTrackOne.tracks.filter(item => item.kind === 'video');
+ // 获取源视频 2 的音频轨道
+ const [ trackAudio ] = this.mediaTrackTwo.tracks.filter(item => item.kind === 'audio');
+ console.log(trackMedia, trackAudio)
+ // 添加轨道到目标容器
+ this.mediaContainer.addTrack(
+ trackMedia
+ );
+ this.mediaContainer.addTrack(
+ trackAudio
+ );
+ const that = this;
+ // 合成目标视频
+ this.mediaContainer.export({
+ success: (res) => {
+ that.setData({
+ targetSrc: res.tempFilePath
+ })
+ }
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/media-container/media-container.json b/miniprogram/packageAPI/pages/media-container/media-container.json
new file mode 100644
index 00000000..9d280788
--- /dev/null
+++ b/miniprogram/packageAPI/pages/media-container/media-container.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "音视频合成"
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/media-container/media-container.wxml b/miniprogram/packageAPI/pages/media-container/media-container.wxml
new file mode 100644
index 00000000..a0b65b3a
--- /dev/null
+++ b/miniprogram/packageAPI/pages/media-container/media-container.wxml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+ 源视频
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 合成视频
+
+
+ 合成视频轨道为:源视频1视频轨道 + 源视频2音频轨道
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram/packageAPI/pages/media-container/media-container.wxss b/miniprogram/packageAPI/pages/media-container/media-container.wxss
new file mode 100644
index 00000000..94f2ddba
--- /dev/null
+++ b/miniprogram/packageAPI/pages/media-container/media-container.wxss
@@ -0,0 +1,5 @@
+.page-section {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
\ No newline at end of file
diff --git a/miniprogram/page/API/pages/modal/modal.js b/miniprogram/packageAPI/pages/modal/modal.js
similarity index 93%
rename from miniprogram/page/API/pages/modal/modal.js
rename to miniprogram/packageAPI/pages/modal/modal.js
index 0a2ff36c..d37f76cd 100644
--- a/miniprogram/page/API/pages/modal/modal.js
+++ b/miniprogram/packageAPI/pages/modal/modal.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '模态弹窗',
- path: 'page/API/pages/modal/modal'
+ path: 'packageAPI/pages/modal/modal'
}
},
diff --git a/miniprogram/page/API/pages/modal/modal.json b/miniprogram/packageAPI/pages/modal/modal.json
similarity index 100%
rename from miniprogram/page/API/pages/modal/modal.json
rename to miniprogram/packageAPI/pages/modal/modal.json
diff --git a/miniprogram/page/API/pages/modal/modal.wxml b/miniprogram/packageAPI/pages/modal/modal.wxml
similarity index 100%
rename from miniprogram/page/API/pages/modal/modal.wxml
rename to miniprogram/packageAPI/pages/modal/modal.wxml
diff --git a/miniprogram/page/API/pages/modal/modal.wxss b/miniprogram/packageAPI/pages/modal/modal.wxss
similarity index 100%
rename from miniprogram/page/API/pages/modal/modal.wxss
rename to miniprogram/packageAPI/pages/modal/modal.wxss
diff --git a/miniprogram/page/API/pages/navigation-bar-loading/navigation-bar-loading.js b/miniprogram/packageAPI/pages/navigation-bar-loading/navigation-bar-loading.js
similarity index 75%
rename from miniprogram/page/API/pages/navigation-bar-loading/navigation-bar-loading.js
rename to miniprogram/packageAPI/pages/navigation-bar-loading/navigation-bar-loading.js
index b5f2f6ef..2aac0700 100644
--- a/miniprogram/page/API/pages/navigation-bar-loading/navigation-bar-loading.js
+++ b/miniprogram/packageAPI/pages/navigation-bar-loading/navigation-bar-loading.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '标题栏加载动画',
- path: 'page/API/pages/navigation-bar-loading/navigation-bar-loading'
+ path: 'packageAPI/pages/navigation-bar-loading/navigation-bar-loading'
}
},
diff --git a/miniprogram/page/API/pages/navigation-bar-loading/navigation-bar-loading.json b/miniprogram/packageAPI/pages/navigation-bar-loading/navigation-bar-loading.json
similarity index 100%
rename from miniprogram/page/API/pages/navigation-bar-loading/navigation-bar-loading.json
rename to miniprogram/packageAPI/pages/navigation-bar-loading/navigation-bar-loading.json
diff --git a/miniprogram/page/API/pages/navigation-bar-loading/navigation-bar-loading.wxml b/miniprogram/packageAPI/pages/navigation-bar-loading/navigation-bar-loading.wxml
similarity index 100%
rename from miniprogram/page/API/pages/navigation-bar-loading/navigation-bar-loading.wxml
rename to miniprogram/packageAPI/pages/navigation-bar-loading/navigation-bar-loading.wxml
diff --git a/miniprogram/page/API/pages/navigator/navigator.wxss b/miniprogram/packageAPI/pages/navigation-bar-loading/navigation-bar-loading.wxss
similarity index 100%
rename from miniprogram/page/API/pages/navigator/navigator.wxss
rename to miniprogram/packageAPI/pages/navigation-bar-loading/navigation-bar-loading.wxss
diff --git a/miniprogram/page/API/pages/navigator/navigator.js b/miniprogram/packageAPI/pages/navigator/navigator.js
similarity index 88%
rename from miniprogram/page/API/pages/navigator/navigator.js
rename to miniprogram/packageAPI/pages/navigator/navigator.js
index 4b6a4b99..fbbd32c6 100644
--- a/miniprogram/page/API/pages/navigator/navigator.js
+++ b/miniprogram/packageAPI/pages/navigator/navigator.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '页面跳转',
- path: 'page/API/pages/navigator/navigator'
+ path: 'packageAPI/pages/navigator/navigator'
}
},
diff --git a/miniprogram/page/API/pages/navigator/navigator.json b/miniprogram/packageAPI/pages/navigator/navigator.json
similarity index 100%
rename from miniprogram/page/API/pages/navigator/navigator.json
rename to miniprogram/packageAPI/pages/navigator/navigator.json
diff --git a/miniprogram/page/API/pages/navigator/navigator.wxml b/miniprogram/packageAPI/pages/navigator/navigator.wxml
similarity index 100%
rename from miniprogram/page/API/pages/navigator/navigator.wxml
rename to miniprogram/packageAPI/pages/navigator/navigator.wxml
diff --git a/miniprogram/page/API/pages/request/request.wxss b/miniprogram/packageAPI/pages/navigator/navigator.wxss
similarity index 100%
rename from miniprogram/page/API/pages/request/request.wxss
rename to miniprogram/packageAPI/pages/navigator/navigator.wxss
diff --git a/miniprogram/page/API/pages/on-accelerometer-change/on-accelerometer-change.js b/miniprogram/packageAPI/pages/on-accelerometer-change/on-accelerometer-change.js
similarity index 96%
rename from miniprogram/page/API/pages/on-accelerometer-change/on-accelerometer-change.js
rename to miniprogram/packageAPI/pages/on-accelerometer-change/on-accelerometer-change.js
index 58c8bb45..53b283a0 100644
--- a/miniprogram/page/API/pages/on-accelerometer-change/on-accelerometer-change.js
+++ b/miniprogram/packageAPI/pages/on-accelerometer-change/on-accelerometer-change.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '监听重力感应数据',
- path: 'page/API/pages/on-accelerometer-change/on-accelerometer-change'
+ path: 'packageAPI/pages/on-accelerometer-change/on-accelerometer-change'
}
},
diff --git a/miniprogram/page/API/pages/on-accelerometer-change/on-accelerometer-change.json b/miniprogram/packageAPI/pages/on-accelerometer-change/on-accelerometer-change.json
similarity index 100%
rename from miniprogram/page/API/pages/on-accelerometer-change/on-accelerometer-change.json
rename to miniprogram/packageAPI/pages/on-accelerometer-change/on-accelerometer-change.json
diff --git a/miniprogram/page/API/pages/on-accelerometer-change/on-accelerometer-change.wxml b/miniprogram/packageAPI/pages/on-accelerometer-change/on-accelerometer-change.wxml
similarity index 100%
rename from miniprogram/page/API/pages/on-accelerometer-change/on-accelerometer-change.wxml
rename to miniprogram/packageAPI/pages/on-accelerometer-change/on-accelerometer-change.wxml
diff --git a/miniprogram/page/API/pages/on-accelerometer-change/on-accelerometer-change.wxss b/miniprogram/packageAPI/pages/on-accelerometer-change/on-accelerometer-change.wxss
similarity index 100%
rename from miniprogram/page/API/pages/on-accelerometer-change/on-accelerometer-change.wxss
rename to miniprogram/packageAPI/pages/on-accelerometer-change/on-accelerometer-change.wxss
diff --git a/miniprogram/page/API/pages/on-compass-change/compass.png b/miniprogram/packageAPI/pages/on-compass-change/compass.png
similarity index 100%
rename from miniprogram/page/API/pages/on-compass-change/compass.png
rename to miniprogram/packageAPI/pages/on-compass-change/compass.png
diff --git a/miniprogram/page/API/pages/on-compass-change/on-compass-change.js b/miniprogram/packageAPI/pages/on-compass-change/on-compass-change.js
similarity index 91%
rename from miniprogram/page/API/pages/on-compass-change/on-compass-change.js
rename to miniprogram/packageAPI/pages/on-compass-change/on-compass-change.js
index cb9a6f35..4546bf54 100644
--- a/miniprogram/page/API/pages/on-compass-change/on-compass-change.js
+++ b/miniprogram/packageAPI/pages/on-compass-change/on-compass-change.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '监听罗盘数据',
- path: 'page/API/pages/on-compass-change/on-compass-change'
+ path: 'packageAPI/pages/on-compass-change/on-compass-change'
}
},
diff --git a/miniprogram/page/API/pages/on-compass-change/on-compass-change.json b/miniprogram/packageAPI/pages/on-compass-change/on-compass-change.json
similarity index 100%
rename from miniprogram/page/API/pages/on-compass-change/on-compass-change.json
rename to miniprogram/packageAPI/pages/on-compass-change/on-compass-change.json
diff --git a/miniprogram/page/API/pages/on-compass-change/on-compass-change.wxml b/miniprogram/packageAPI/pages/on-compass-change/on-compass-change.wxml
similarity index 100%
rename from miniprogram/page/API/pages/on-compass-change/on-compass-change.wxml
rename to miniprogram/packageAPI/pages/on-compass-change/on-compass-change.wxml
diff --git a/miniprogram/page/API/pages/on-compass-change/on-compass-change.wxss b/miniprogram/packageAPI/pages/on-compass-change/on-compass-change.wxss
similarity index 100%
rename from miniprogram/page/API/pages/on-compass-change/on-compass-change.wxss
rename to miniprogram/packageAPI/pages/on-compass-change/on-compass-change.wxss
diff --git a/miniprogram/page/API/pages/on-network-status-change/on-network-status-change.js b/miniprogram/packageAPI/pages/on-network-status-change/on-network-status-change.js
similarity index 87%
rename from miniprogram/page/API/pages/on-network-status-change/on-network-status-change.js
rename to miniprogram/packageAPI/pages/on-network-status-change/on-network-status-change.js
index f22e42bc..78b010a1 100644
--- a/miniprogram/page/API/pages/on-network-status-change/on-network-status-change.js
+++ b/miniprogram/packageAPI/pages/on-network-status-change/on-network-status-change.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '监听手机网络变化',
- path: 'page/API/pages/on-network-status-change/on-network-status-change'
+ path: 'packageAPI/pages/on-network-status-change/on-network-status-change'
}
},
diff --git a/miniprogram/page/API/pages/on-network-status-change/on-network-status-change.json b/miniprogram/packageAPI/pages/on-network-status-change/on-network-status-change.json
similarity index 100%
rename from miniprogram/page/API/pages/on-network-status-change/on-network-status-change.json
rename to miniprogram/packageAPI/pages/on-network-status-change/on-network-status-change.json
diff --git a/miniprogram/page/API/pages/on-network-status-change/on-network-status-change.wxml b/miniprogram/packageAPI/pages/on-network-status-change/on-network-status-change.wxml
similarity index 100%
rename from miniprogram/page/API/pages/on-network-status-change/on-network-status-change.wxml
rename to miniprogram/packageAPI/pages/on-network-status-change/on-network-status-change.wxml
diff --git a/miniprogram/page/API/pages/on-network-status-change/on-network-status-change.wxss b/miniprogram/packageAPI/pages/on-network-status-change/on-network-status-change.wxss
similarity index 100%
rename from miniprogram/page/API/pages/on-network-status-change/on-network-status-change.wxss
rename to miniprogram/packageAPI/pages/on-network-status-change/on-network-status-change.wxss
diff --git a/miniprogram/page/API/pages/open-location/open-location.js b/miniprogram/packageAPI/pages/open-location/open-location.js
similarity index 85%
rename from miniprogram/page/API/pages/open-location/open-location.js
rename to miniprogram/packageAPI/pages/open-location/open-location.js
index 31a03737..9e45e2cc 100644
--- a/miniprogram/page/API/pages/open-location/open-location.js
+++ b/miniprogram/packageAPI/pages/open-location/open-location.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '查看位置',
- path: 'page/API/pages/open-location/open-location'
+ path: 'packageAPI/pages/open-location/open-location'
}
},
diff --git a/miniprogram/page/API/pages/open-location/open-location.json b/miniprogram/packageAPI/pages/open-location/open-location.json
similarity index 100%
rename from miniprogram/page/API/pages/open-location/open-location.json
rename to miniprogram/packageAPI/pages/open-location/open-location.json
diff --git a/miniprogram/page/API/pages/open-location/open-location.wxml b/miniprogram/packageAPI/pages/open-location/open-location.wxml
similarity index 100%
rename from miniprogram/page/API/pages/open-location/open-location.wxml
rename to miniprogram/packageAPI/pages/open-location/open-location.wxml
diff --git a/miniprogram/page/API/pages/open-location/open-location.wxss b/miniprogram/packageAPI/pages/open-location/open-location.wxss
similarity index 100%
rename from miniprogram/page/API/pages/open-location/open-location.wxss
rename to miniprogram/packageAPI/pages/open-location/open-location.wxss
diff --git a/miniprogram/page/API/pages/page-scroll/page-scroll.js b/miniprogram/packageAPI/pages/page-scroll/page-scroll.js
similarity index 83%
rename from miniprogram/page/API/pages/page-scroll/page-scroll.js
rename to miniprogram/packageAPI/pages/page-scroll/page-scroll.js
index 66a1e891..6ad645a3 100644
--- a/miniprogram/page/API/pages/page-scroll/page-scroll.js
+++ b/miniprogram/packageAPI/pages/page-scroll/page-scroll.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '页面滚动',
- path: 'page/API/pages/page-scroll/page-scroll'
+ path: 'packageAPI/pages/page-scroll/page-scroll'
}
},
diff --git a/miniprogram/page/API/pages/page-scroll/page-scroll.json b/miniprogram/packageAPI/pages/page-scroll/page-scroll.json
similarity index 100%
rename from miniprogram/page/API/pages/page-scroll/page-scroll.json
rename to miniprogram/packageAPI/pages/page-scroll/page-scroll.json
diff --git a/miniprogram/page/API/pages/page-scroll/page-scroll.wxml b/miniprogram/packageAPI/pages/page-scroll/page-scroll.wxml
similarity index 100%
rename from miniprogram/page/API/pages/page-scroll/page-scroll.wxml
rename to miniprogram/packageAPI/pages/page-scroll/page-scroll.wxml
diff --git a/miniprogram/page/API/pages/page-scroll/page-scroll.wxss b/miniprogram/packageAPI/pages/page-scroll/page-scroll.wxss
similarity index 100%
rename from miniprogram/page/API/pages/page-scroll/page-scroll.wxss
rename to miniprogram/packageAPI/pages/page-scroll/page-scroll.wxss
diff --git a/miniprogram/page/API/pages/pull-down-refresh/pull-down-refresh.js b/miniprogram/packageAPI/pages/pull-down-refresh/pull-down-refresh.js
similarity index 85%
rename from miniprogram/page/API/pages/pull-down-refresh/pull-down-refresh.js
rename to miniprogram/packageAPI/pages/pull-down-refresh/pull-down-refresh.js
index c1b04679..9d1c8ba9 100644
--- a/miniprogram/page/API/pages/pull-down-refresh/pull-down-refresh.js
+++ b/miniprogram/packageAPI/pages/pull-down-refresh/pull-down-refresh.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '下拉刷新',
- path: 'page/API/pages/pull-down-refresh/pull-down-refresh'
+ path: 'packageAPI/pages/pull-down-refresh/pull-down-refresh'
}
},
diff --git a/miniprogram/packageAPI/pages/pull-down-refresh/pull-down-refresh.json b/miniprogram/packageAPI/pages/pull-down-refresh/pull-down-refresh.json
new file mode 100644
index 00000000..335945c0
--- /dev/null
+++ b/miniprogram/packageAPI/pages/pull-down-refresh/pull-down-refresh.json
@@ -0,0 +1,5 @@
+{
+ "navigationBarTitleText": "下拉刷新",
+ "enablePullDownRefresh": true,
+ "backgroundTextStyle": "@backgroundTextStyle"
+}
diff --git a/miniprogram/page/API/pages/pull-down-refresh/pull-down-refresh.wxml b/miniprogram/packageAPI/pages/pull-down-refresh/pull-down-refresh.wxml
similarity index 100%
rename from miniprogram/page/API/pages/pull-down-refresh/pull-down-refresh.wxml
rename to miniprogram/packageAPI/pages/pull-down-refresh/pull-down-refresh.wxml
diff --git a/miniprogram/page/API/pages/pull-down-refresh/pull-down-refresh.wxss b/miniprogram/packageAPI/pages/pull-down-refresh/pull-down-refresh.wxss
similarity index 100%
rename from miniprogram/page/API/pages/pull-down-refresh/pull-down-refresh.wxss
rename to miniprogram/packageAPI/pages/pull-down-refresh/pull-down-refresh.wxss
diff --git a/miniprogram/packageAPI/pages/request-payment/request-payment.js b/miniprogram/packageAPI/pages/request-payment/request-payment.js
new file mode 100644
index 00000000..b2836ee3
--- /dev/null
+++ b/miniprogram/packageAPI/pages/request-payment/request-payment.js
@@ -0,0 +1,64 @@
+
+const app = getApp()
+
+Page({
+ onShareAppMessage() {
+ return {
+ title: '发起支付',
+ path: 'packageAPI/pages/request-payment/request-payment'
+ }
+ },
+
+ onLoad() {},
+
+ requestPayment() {
+ const self = this
+
+ self.setData({
+ loading: true
+ })
+
+ // 此处需要先调用wx.login方法获取code,然后在服务端调用微信接口使用code换取下单用户的openId
+ // 具体文档参考https://mp.weixin.qq.com/debug/wxadoc/dev/api/api-login.html?t=20161230#wxloginobject
+ app.getUserOpenId(function (err, openid) {
+ if (!err) {
+ wx.cloud.callFunction({
+ name: 'pay',
+ data: {
+ action: 'unifiedorder',
+ userInfo: {
+ openId: openid
+ },
+ price: 0.01
+ },
+ success: res => {
+ console.warn('[云函数] [openapi] templateMessage.send 调用成功:', res)
+ const data = res.result.data
+ wx.requestPayment({
+ timeStamp: data.time_stamp,
+ nonceStr: data.nonce_str,
+ package: `prepay_id=${data.prepay_id}`,
+ signType: 'MD5',
+ paySign: data.sign,
+ success: () => {
+ wx.showToast({ title: '支付成功' });
+ }
+ });
+ },
+ fail: err => {
+ wx.showToast({
+ icon: 'none',
+ title: '支付失败',
+ })
+ console.error('[云函数] [openapi] templateMessage.send 调用失败:', err)
+ }
+ })
+ } else {
+ console.log('err:', err)
+ self.setData({
+ loading: false
+ })
+ }
+ })
+ }
+})
diff --git a/miniprogram/page/API/pages/request-payment/request-payment.json b/miniprogram/packageAPI/pages/request-payment/request-payment.json
similarity index 100%
rename from miniprogram/page/API/pages/request-payment/request-payment.json
rename to miniprogram/packageAPI/pages/request-payment/request-payment.json
diff --git a/miniprogram/page/API/pages/request-payment/request-payment.wxml b/miniprogram/packageAPI/pages/request-payment/request-payment.wxml
similarity index 100%
rename from miniprogram/page/API/pages/request-payment/request-payment.wxml
rename to miniprogram/packageAPI/pages/request-payment/request-payment.wxml
diff --git a/miniprogram/page/API/pages/request-payment/request-payment.wxss b/miniprogram/packageAPI/pages/request-payment/request-payment.wxss
similarity index 85%
rename from miniprogram/page/API/pages/request-payment/request-payment.wxss
rename to miniprogram/packageAPI/pages/request-payment/request-payment.wxss
index 1c38e84f..d8ab406a 100644
--- a/miniprogram/page/API/pages/request-payment/request-payment.wxss
+++ b/miniprogram/packageAPI/pages/request-payment/request-payment.wxss
@@ -2,12 +2,12 @@
width: auto;
margin: 30rpx;
padding: 64rpx 30rpx;
- background-color: #fff;
+ background-color: var(--weui-BG-2);
text-align: center;
font-size: 28rpx;
}
.desc{
- color: #B2B2B2;
+ color: var(--weui-FG-1);
}
.price{
margin-top: 30rpx;
diff --git a/miniprogram/page/API/pages/request/request.js b/miniprogram/packageAPI/pages/request/request.js
similarity index 87%
rename from miniprogram/page/API/pages/request/request.js
rename to miniprogram/packageAPI/pages/request/request.js
index 360301e1..ec4c677c 100644
--- a/miniprogram/page/API/pages/request/request.js
+++ b/miniprogram/packageAPI/pages/request/request.js
@@ -1,4 +1,4 @@
-const requestUrl = require('../../../../config').requestUrl
+const requestUrl = require('../../../config').requestUrl
const duration = 2000
@@ -6,7 +6,7 @@ Page({
onShareAppMessage() {
return {
title: '网络请求',
- path: 'page/API/pages/request/request'
+ path: 'packageAPI/pages/request/request'
}
},
diff --git a/miniprogram/page/API/pages/request/request.json b/miniprogram/packageAPI/pages/request/request.json
similarity index 100%
rename from miniprogram/page/API/pages/request/request.json
rename to miniprogram/packageAPI/pages/request/request.json
diff --git a/miniprogram/page/API/pages/request/request.wxml b/miniprogram/packageAPI/pages/request/request.wxml
similarity index 100%
rename from miniprogram/page/API/pages/request/request.wxml
rename to miniprogram/packageAPI/pages/request/request.wxml
diff --git a/miniprogram/page/API/pages/soter-authentication/soter-authentication.wxss b/miniprogram/packageAPI/pages/request/request.wxss
similarity index 100%
rename from miniprogram/page/API/pages/soter-authentication/soter-authentication.wxss
rename to miniprogram/packageAPI/pages/request/request.wxss
diff --git a/miniprogram/packageAPI/pages/resizable/resizable.js b/miniprogram/packageAPI/pages/resizable/resizable.js
new file mode 100644
index 00000000..d9ba7cad
--- /dev/null
+++ b/miniprogram/packageAPI/pages/resizable/resizable.js
@@ -0,0 +1,17 @@
+// miniprogram/packageAPI/pages/resizable/resizable.js
+Page({
+ onShareAppMessage() {
+ return {
+ title: '屏幕旋转',
+ path: 'package/API/pages/resizable/resizable'
+ }
+ },
+ data: {
+ status: 'lock',
+ },
+ handleStatusChange: function(e) {
+ this.setData({
+ status: e.currentTarget.dataset.status,
+ })
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/resizable/resizable.json b/miniprogram/packageAPI/pages/resizable/resizable.json
new file mode 100644
index 00000000..83016ef9
--- /dev/null
+++ b/miniprogram/packageAPI/pages/resizable/resizable.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "屏幕旋转",
+ "pageOrientation": "auto"
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/resizable/resizable.wxml b/miniprogram/packageAPI/pages/resizable/resizable.wxml
new file mode 100644
index 00000000..f52f5de7
--- /dev/null
+++ b/miniprogram/packageAPI/pages/resizable/resizable.wxml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+ 旋转屏幕
+
+
+
+
+
+
+
+
diff --git a/miniprogram/packageAPI/pages/resizable/resizable.wxs b/miniprogram/packageAPI/pages/resizable/resizable.wxs
new file mode 100644
index 00000000..bead2ff8
--- /dev/null
+++ b/miniprogram/packageAPI/pages/resizable/resizable.wxs
@@ -0,0 +1,13 @@
+function renderResizable(status) {
+ console.log(status)
+ switch(status) {
+ case "lock":
+ return '锁定屏幕中';
+ case "unlock":
+ return "可旋转屏幕";
+ }
+}
+
+module.exports = {
+ renderResizable: renderResizable
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/resizable/resizable.wxss b/miniprogram/packageAPI/pages/resizable/resizable.wxss
new file mode 100644
index 00000000..c9792719
--- /dev/null
+++ b/miniprogram/packageAPI/pages/resizable/resizable.wxss
@@ -0,0 +1 @@
+/* miniprogram/packageAPI/pages/resizable/resizable.wxss */
\ No newline at end of file
diff --git a/miniprogram/page/API/pages/scan-code/scan-code.js b/miniprogram/packageAPI/pages/scan-code/scan-code.js
similarity index 84%
rename from miniprogram/page/API/pages/scan-code/scan-code.js
rename to miniprogram/packageAPI/pages/scan-code/scan-code.js
index 0ab0f9ce..d0ae9488 100644
--- a/miniprogram/page/API/pages/scan-code/scan-code.js
+++ b/miniprogram/packageAPI/pages/scan-code/scan-code.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '扫码',
- path: 'page/API/pages/scan-code/scan-code'
+ path: 'packageAPI/pages/scan-code/scan-code'
}
},
diff --git a/miniprogram/page/API/pages/scan-code/scan-code.json b/miniprogram/packageAPI/pages/scan-code/scan-code.json
similarity index 100%
rename from miniprogram/page/API/pages/scan-code/scan-code.json
rename to miniprogram/packageAPI/pages/scan-code/scan-code.json
diff --git a/miniprogram/page/API/pages/scan-code/scan-code.wxml b/miniprogram/packageAPI/pages/scan-code/scan-code.wxml
similarity index 100%
rename from miniprogram/page/API/pages/scan-code/scan-code.wxml
rename to miniprogram/packageAPI/pages/scan-code/scan-code.wxml
diff --git a/miniprogram/page/API/pages/scan-code/scan-code.wxss b/miniprogram/packageAPI/pages/scan-code/scan-code.wxss
similarity index 100%
rename from miniprogram/page/API/pages/scan-code/scan-code.wxss
rename to miniprogram/packageAPI/pages/scan-code/scan-code.wxss
diff --git a/miniprogram/page/API/pages/screen-brightness/screen-brightness.js b/miniprogram/packageAPI/pages/screen-brightness/screen-brightness.js
similarity index 74%
rename from miniprogram/page/API/pages/screen-brightness/screen-brightness.js
rename to miniprogram/packageAPI/pages/screen-brightness/screen-brightness.js
index 64fca971..a7fb9d0e 100644
--- a/miniprogram/page/API/pages/screen-brightness/screen-brightness.js
+++ b/miniprogram/packageAPI/pages/screen-brightness/screen-brightness.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '屏幕亮度',
- path: 'page/API/pages/screen-brightness/screen-brightness'
+ path: 'packageAPI/pages/screen-brightness/screen-brightness'
}
},
@@ -18,17 +18,21 @@ Page({
const value = Number.parseFloat(
(e.detail.value).toFixed(1)
)
+ this.setData({
+ screenBrightness: Number.parseFloat(
+ e.detail.value.toFixed(1)
+ )
+ })
wx.setScreenBrightness({
value,
- success: () => {
- this._updateScreenBrightness()
- }
+
})
},
_updateScreenBrightness() {
wx.getScreenBrightness({
success: (res) => {
+ console.log(res);
this.setData({
screenBrightness: Number.parseFloat(
res.value.toFixed(1)
diff --git a/miniprogram/page/API/pages/screen-brightness/screen-brightness.json b/miniprogram/packageAPI/pages/screen-brightness/screen-brightness.json
similarity index 100%
rename from miniprogram/page/API/pages/screen-brightness/screen-brightness.json
rename to miniprogram/packageAPI/pages/screen-brightness/screen-brightness.json
diff --git a/miniprogram/page/API/pages/screen-brightness/screen-brightness.wxml b/miniprogram/packageAPI/pages/screen-brightness/screen-brightness.wxml
similarity index 100%
rename from miniprogram/page/API/pages/screen-brightness/screen-brightness.wxml
rename to miniprogram/packageAPI/pages/screen-brightness/screen-brightness.wxml
diff --git a/miniprogram/page/API/pages/screen-brightness/screen-brightness.wxss b/miniprogram/packageAPI/pages/screen-brightness/screen-brightness.wxss
similarity index 100%
rename from miniprogram/page/API/pages/screen-brightness/screen-brightness.wxss
rename to miniprogram/packageAPI/pages/screen-brightness/screen-brightness.wxss
diff --git a/miniprogram/packageAPI/pages/sendMessage/sendMessage.js b/miniprogram/packageAPI/pages/sendMessage/sendMessage.js
new file mode 100644
index 00000000..1d492d07
--- /dev/null
+++ b/miniprogram/packageAPI/pages/sendMessage/sendMessage.js
@@ -0,0 +1,8 @@
+Page({
+ onShareAppMessage() {
+ return {
+ title: 'sendMessage',
+ path: 'packageAPI/pages/sendMessage/sendMessage'
+ }
+ },
+})
diff --git a/miniprogram/page/API/pages/sendMessage/sendMessage.json b/miniprogram/packageAPI/pages/sendMessage/sendMessage.json
similarity index 100%
rename from miniprogram/page/API/pages/sendMessage/sendMessage.json
rename to miniprogram/packageAPI/pages/sendMessage/sendMessage.json
diff --git a/miniprogram/page/API/pages/sendMessage/sendMessage.wxml b/miniprogram/packageAPI/pages/sendMessage/sendMessage.wxml
similarity index 100%
rename from miniprogram/page/API/pages/sendMessage/sendMessage.wxml
rename to miniprogram/packageAPI/pages/sendMessage/sendMessage.wxml
diff --git a/miniprogram/page/API/pages/sendMessage/sendMessage.wxss b/miniprogram/packageAPI/pages/sendMessage/sendMessage.wxss
similarity index 100%
rename from miniprogram/page/API/pages/sendMessage/sendMessage.wxss
rename to miniprogram/packageAPI/pages/sendMessage/sendMessage.wxss
diff --git a/miniprogram/page/API/pages/set-navigation-bar-title/set-navigation-bar-title.js b/miniprogram/packageAPI/pages/set-navigation-bar-title/set-navigation-bar-title.js
similarity index 84%
rename from miniprogram/page/API/pages/set-navigation-bar-title/set-navigation-bar-title.js
rename to miniprogram/packageAPI/pages/set-navigation-bar-title/set-navigation-bar-title.js
index a08f70df..d41c4e3e 100644
--- a/miniprogram/page/API/pages/set-navigation-bar-title/set-navigation-bar-title.js
+++ b/miniprogram/packageAPI/pages/set-navigation-bar-title/set-navigation-bar-title.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '设置页面标题',
- path: 'page/API/pages/set-navigation-bar-title/set-navigation-bar-title'
+ path: 'packageAPI/pages/set-navigation-bar-title/set-navigation-bar-title'
}
},
diff --git a/miniprogram/page/API/pages/set-navigation-bar-title/set-navigation-bar-title.json b/miniprogram/packageAPI/pages/set-navigation-bar-title/set-navigation-bar-title.json
similarity index 100%
rename from miniprogram/page/API/pages/set-navigation-bar-title/set-navigation-bar-title.json
rename to miniprogram/packageAPI/pages/set-navigation-bar-title/set-navigation-bar-title.json
diff --git a/miniprogram/page/API/pages/set-navigation-bar-title/set-navigation-bar-title.wxml b/miniprogram/packageAPI/pages/set-navigation-bar-title/set-navigation-bar-title.wxml
similarity index 100%
rename from miniprogram/page/API/pages/set-navigation-bar-title/set-navigation-bar-title.wxml
rename to miniprogram/packageAPI/pages/set-navigation-bar-title/set-navigation-bar-title.wxml
diff --git a/miniprogram/page/API/pages/set-navigation-bar-title/set-navigation-bar-title.wxss b/miniprogram/packageAPI/pages/set-navigation-bar-title/set-navigation-bar-title.wxss
similarity index 100%
rename from miniprogram/page/API/pages/set-navigation-bar-title/set-navigation-bar-title.wxss
rename to miniprogram/packageAPI/pages/set-navigation-bar-title/set-navigation-bar-title.wxss
diff --git a/miniprogram/page/API/pages/setting/setting.js b/miniprogram/packageAPI/pages/setting/setting.js
similarity index 85%
rename from miniprogram/page/API/pages/setting/setting.js
rename to miniprogram/packageAPI/pages/setting/setting.js
index e2e6b170..4530d16a 100644
--- a/miniprogram/page/API/pages/setting/setting.js
+++ b/miniprogram/packageAPI/pages/setting/setting.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '设置',
- path: 'page/API/pages/setting/setting'
+ path: 'packageAPI/pages/setting/setting'
}
},
diff --git a/miniprogram/page/API/pages/setting/setting.json b/miniprogram/packageAPI/pages/setting/setting.json
similarity index 100%
rename from miniprogram/page/API/pages/setting/setting.json
rename to miniprogram/packageAPI/pages/setting/setting.json
diff --git a/miniprogram/page/API/pages/setting/setting.wxml b/miniprogram/packageAPI/pages/setting/setting.wxml
similarity index 100%
rename from miniprogram/page/API/pages/setting/setting.wxml
rename to miniprogram/packageAPI/pages/setting/setting.wxml
diff --git a/miniprogram/page/API/pages/setting/setting.wxss b/miniprogram/packageAPI/pages/setting/setting.wxss
similarity index 100%
rename from miniprogram/page/API/pages/setting/setting.wxss
rename to miniprogram/packageAPI/pages/setting/setting.wxss
diff --git a/miniprogram/page/API/pages/share-button/share-button.js b/miniprogram/packageAPI/pages/share-button/share-button.js
similarity index 86%
rename from miniprogram/page/API/pages/share-button/share-button.js
rename to miniprogram/packageAPI/pages/share-button/share-button.js
index 16343100..99750fd0 100644
--- a/miniprogram/page/API/pages/share-button/share-button.js
+++ b/miniprogram/packageAPI/pages/share-button/share-button.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '转发按钮',
- path: 'page/API/pages/share-button/share-button'
+ path: 'packageAPI/pages/share-button/share-button'
}
},
handleTapShareButton() {
diff --git a/miniprogram/page/API/pages/share-button/share-button.json b/miniprogram/packageAPI/pages/share-button/share-button.json
similarity index 100%
rename from miniprogram/page/API/pages/share-button/share-button.json
rename to miniprogram/packageAPI/pages/share-button/share-button.json
diff --git a/miniprogram/page/API/pages/share-button/share-button.wxml b/miniprogram/packageAPI/pages/share-button/share-button.wxml
similarity index 100%
rename from miniprogram/page/API/pages/share-button/share-button.wxml
rename to miniprogram/packageAPI/pages/share-button/share-button.wxml
diff --git a/miniprogram/page/API/pages/share-button/share-button.wxss b/miniprogram/packageAPI/pages/share-button/share-button.wxss
similarity index 100%
rename from miniprogram/page/API/pages/share-button/share-button.wxss
rename to miniprogram/packageAPI/pages/share-button/share-button.wxss
diff --git a/miniprogram/page/API/pages/share/share.js b/miniprogram/packageAPI/pages/share/share.js
similarity index 80%
rename from miniprogram/page/API/pages/share/share.js
rename to miniprogram/packageAPI/pages/share/share.js
index b2c3ec23..10b8704d 100644
--- a/miniprogram/page/API/pages/share/share.js
+++ b/miniprogram/packageAPI/pages/share/share.js
@@ -3,7 +3,7 @@ Page({
shareData: {
title: '自定义转发标题',
desc: '自定义转发描述',
- path: '/page/API/pages/share/share'
+ path: 'packageAPI/pages/share/share'
}
},
diff --git a/miniprogram/page/API/pages/share/share.json b/miniprogram/packageAPI/pages/share/share.json
similarity index 100%
rename from miniprogram/page/API/pages/share/share.json
rename to miniprogram/packageAPI/pages/share/share.json
diff --git a/miniprogram/page/API/pages/share/share.wxml b/miniprogram/packageAPI/pages/share/share.wxml
similarity index 100%
rename from miniprogram/page/API/pages/share/share.wxml
rename to miniprogram/packageAPI/pages/share/share.wxml
diff --git a/miniprogram/page/API/pages/share/share.wxss b/miniprogram/packageAPI/pages/share/share.wxss
similarity index 100%
rename from miniprogram/page/API/pages/share/share.wxss
rename to miniprogram/packageAPI/pages/share/share.wxss
diff --git a/miniprogram/page/API/pages/soter-authentication/soter-authentication.js b/miniprogram/packageAPI/pages/soter-authentication/soter-authentication.js
similarity index 77%
rename from miniprogram/page/API/pages/soter-authentication/soter-authentication.js
rename to miniprogram/packageAPI/pages/soter-authentication/soter-authentication.js
index c7d29208..4ed77dea 100644
--- a/miniprogram/page/API/pages/soter-authentication/soter-authentication.js
+++ b/miniprogram/packageAPI/pages/soter-authentication/soter-authentication.js
@@ -1,14 +1,16 @@
-const AUTH_MODE = 'fingerPrint'
Page({
onShareAppMessage() {
return {
title: '生物认证',
- path: 'page/API/pages/soter-authentication/soter-authentication'
+ path: 'packageAPI/pages/soter-authentication/soter-authentication'
}
},
- startAuth() {
+ startAuth(e) {
+ console.log(e)
+ const AUTH_MODE = e.currentTarget.dataset.mode;
+ console.log(AUTH_MODE)
const startSoterAuthentication = () => {
wx.startSoterAuthentication({
requestAuthModes: [AUTH_MODE],
@@ -38,7 +40,7 @@ Page({
if (parseInt(res.isEnrolled, 10) <= 0) {
wx.showModal({
title: '错误',
- content: '您暂未录入指纹信息,请录入后重试',
+ content: `您暂未录入${AUTH_MODE === 'facial' ? '人脸' : '指纹'}信息,请录入后重试`,
showCancel: false
})
return
@@ -54,7 +56,7 @@ Page({
const notSupported = () => {
wx.showModal({
title: '错误',
- content: '您的设备不支持指纹识别',
+ content: `您的设备不支持${AUTH_MODE === 'facial' ? '人脸' : '指纹'}识别`,
showCancel: false
})
}
@@ -65,7 +67,7 @@ Page({
if (
!res ||
res.supportMode.length === 0 ||
- res.supportMode.indexOf('fingerPrint') < 0
+ res.supportMode.indexOf(AUTH_MODE) < 0
) {
notSupported()
return
@@ -77,5 +79,6 @@ Page({
notSupported()
}
})
- }
+ },
+
})
diff --git a/miniprogram/page/API/pages/soter-authentication/soter-authentication.json b/miniprogram/packageAPI/pages/soter-authentication/soter-authentication.json
similarity index 100%
rename from miniprogram/page/API/pages/soter-authentication/soter-authentication.json
rename to miniprogram/packageAPI/pages/soter-authentication/soter-authentication.json
diff --git a/miniprogram/page/API/pages/soter-authentication/soter-authentication.wxml b/miniprogram/packageAPI/pages/soter-authentication/soter-authentication.wxml
similarity index 56%
rename from miniprogram/page/API/pages/soter-authentication/soter-authentication.wxml
rename to miniprogram/packageAPI/pages/soter-authentication/soter-authentication.wxml
index 4d5fbf1e..2f24637d 100644
--- a/miniprogram/page/API/pages/soter-authentication/soter-authentication.wxml
+++ b/miniprogram/packageAPI/pages/soter-authentication/soter-authentication.wxml
@@ -6,7 +6,10 @@
-
+
+
+
+
diff --git a/miniprogram/page/API/pages/vibrate/vibrate.wxss b/miniprogram/packageAPI/pages/soter-authentication/soter-authentication.wxss
similarity index 100%
rename from miniprogram/page/API/pages/vibrate/vibrate.wxss
rename to miniprogram/packageAPI/pages/soter-authentication/soter-authentication.wxss
diff --git a/miniprogram/page/API/pages/storage/storage.js b/miniprogram/packageAPI/pages/storage/storage.js
similarity index 53%
rename from miniprogram/page/API/pages/storage/storage.js
rename to miniprogram/packageAPI/pages/storage/storage.js
index 23dc04bf..f22e8622 100644
--- a/miniprogram/page/API/pages/storage/storage.js
+++ b/miniprogram/packageAPI/pages/storage/storage.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '数据存储',
- path: 'page/API/pages/storage/storage'
+ path: 'packageAPI/pages/storage/storage'
}
},
@@ -32,28 +32,31 @@ Page({
this.setData({
key,
data,
- 'dialog.hidden': false,
- 'dialog.title': '读取数据失败',
- 'dialog.content': 'key 不能为空'
+ })
+ wx.showModal({
+ title: '读取数据失败',
+ content: 'key 不能为空'
})
} else {
storageData = wx.getStorageSync(key)
+ console.log(storageData)
if (storageData === '') {
this.setData({
key,
- data,
- 'dialog.hidden': false,
- 'dialog.title': '读取数据失败',
- 'dialog.content': '找不到 key 对应的数据'
+ data: storageData
+ })
+ wx.showModal({
+ title: '读取数据失败',
+ content: '找不到 key 对应的数据'
})
} else {
this.setData({
key,
- data,
- 'dialog.hidden': false,
- 'dialog.title': '读取数据成功',
- // eslint-disable-next-line
- 'dialog.content': "data: '"+ storageData + "'"
+ data:storageData
+ })
+ wx.showModal({
+ title: '读取数据成功',
+ content: storageData,
})
}
}
@@ -65,17 +68,20 @@ Page({
this.setData({
key,
data,
- 'dialog.hidden': false,
- 'dialog.title': '保存数据失败',
- 'dialog.content': 'key 不能为空'
+ })
+ wx.showModal({
+ title: '保存数据失败',
+ content: 'key 不能为空'
})
} else {
wx.setStorageSync(key, data)
this.setData({
key,
data,
- 'dialog.hidden': false,
- 'dialog.title': '存储数据成功'
+
+ })
+ wx.showModal({
+ title: '存储数据成功'
})
}
},
@@ -85,17 +91,9 @@ Page({
this.setData({
key: '',
data: '',
- 'dialog.hidden': false,
- 'dialog.title': '清除数据成功',
- 'dialog.content': ''
})
- },
-
- confirm() {
- this.setData({
- 'dialog.hidden': true,
- 'dialog.title': '',
- 'dialog.content': ''
+ wx.showModal({
+ title: '清除数据成功'
})
- }
+ },
})
diff --git a/miniprogram/page/API/pages/storage/storage.json b/miniprogram/packageAPI/pages/storage/storage.json
similarity index 100%
rename from miniprogram/page/API/pages/storage/storage.json
rename to miniprogram/packageAPI/pages/storage/storage.json
diff --git a/miniprogram/page/API/pages/storage/storage.wxml b/miniprogram/packageAPI/pages/storage/storage.wxml
similarity index 91%
rename from miniprogram/page/API/pages/storage/storage.wxml
rename to miniprogram/packageAPI/pages/storage/storage.wxml
index 53aafbab..59ee7f76 100644
--- a/miniprogram/page/API/pages/storage/storage.wxml
+++ b/miniprogram/packageAPI/pages/storage/storage.wxml
@@ -31,8 +31,5 @@
-
- {{dialog.content}}
-
diff --git a/miniprogram/page/API/pages/storage/storage.wxss b/miniprogram/packageAPI/pages/storage/storage.wxss
similarity index 100%
rename from miniprogram/page/API/pages/storage/storage.wxss
rename to miniprogram/packageAPI/pages/storage/storage.wxss
diff --git a/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.js b/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.js
new file mode 100644
index 00000000..c77604c0
--- /dev/null
+++ b/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.js
@@ -0,0 +1,110 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ // 请求订阅
+ requestSubscribeMessage() {
+ const self = this
+ wx.requestSubscribeMessage({
+ tmplIds: ['y1bXHAg_oDuvrQ3pHgcODcMPl-2hZHenWugsqdB2CXY'],
+ success(res) {
+ console.log(res)
+ if (res.errMsg === 'requestSubscribeMessage:ok') {
+ self.subscribeMessageSend()
+ }
+ },
+ complete(res) {
+ console.log(res)
+ }
+ })
+ },
+
+ // 下发订阅消息
+ subscribeMessageSend() {
+ wx.cloud.callFunction({
+ name: 'openapi',
+ data: {
+ action: 'sendSubscribeMessage'
+ },
+ success: res => {
+ console.warn('[云函数] [openapi] templateMessage.send 调用成功:', res)
+ wx.showModal({
+ title: '订阅成功',
+ content: '请返回微信主界面查看',
+ showCancel: false,
+ })
+ },
+ fail: err => {
+ wx.showToast({
+ icon: 'none',
+ title: '调用失败',
+ })
+ console.error('[云函数] [openapi] templateMessage.send 调用失败:', err)
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+ return {
+ title: '订阅消息',
+ path: 'packageAPI/pages/subscribe-message/subscribe-message'
+ }
+ },
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.json b/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.json
new file mode 100644
index 00000000..8835af06
--- /dev/null
+++ b/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.wxml b/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.wxml
new file mode 100644
index 00000000..4281a092
--- /dev/null
+++ b/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.wxml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+ 点击提交,调用示例订阅消息
+
+
+
+
+
+
+
diff --git a/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.wxss b/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.wxss
new file mode 100644
index 00000000..9673f8ba
--- /dev/null
+++ b/miniprogram/packageAPI/pages/subscribe-message/subscribe-message.wxss
@@ -0,0 +1,24 @@
+.page-section {
+ margin-top: 200rpx;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+ padding: 0 50rpx;
+ box-sizing: border-box;
+}
+.page-body-title {
+ font-size: 60rpx;
+ line-height: 200rpx;
+}
+.page-body-text {
+ color: var(--weui-FG-1);
+ font-size: 28rpx;
+ line-height: 40rpx;
+ margin: 0 0 100rpx 0;
+ text-align: center;
+}
+.page-body-button {
+ width: 100%;
+}
diff --git a/miniprogram/page/API/pages/template-message/template-message.js b/miniprogram/packageAPI/pages/template-message/template-message.js
similarity index 89%
rename from miniprogram/page/API/pages/template-message/template-message.js
rename to miniprogram/packageAPI/pages/template-message/template-message.js
index 8378fe73..9db7d668 100644
--- a/miniprogram/page/API/pages/template-message/template-message.js
+++ b/miniprogram/packageAPI/pages/template-message/template-message.js
@@ -1,4 +1,4 @@
-const templateMessageUrl = require('../../../../config').templateMessageUrl
+const templateMessageUrl = require('../../../config').templateMessageUrl
const app = getApp()
@@ -13,7 +13,7 @@ Page({
onShareAppMessage() {
return {
title: '模板消息',
- path: 'page/API/pages/template-message/template-message'
+ path: 'packageAPI/pages/template-message/template-message'
}
},
diff --git a/miniprogram/page/API/pages/template-message/template-message.json b/miniprogram/packageAPI/pages/template-message/template-message.json
similarity index 100%
rename from miniprogram/page/API/pages/template-message/template-message.json
rename to miniprogram/packageAPI/pages/template-message/template-message.json
diff --git a/miniprogram/page/API/pages/template-message/template-message.wxml b/miniprogram/packageAPI/pages/template-message/template-message.wxml
similarity index 100%
rename from miniprogram/page/API/pages/template-message/template-message.wxml
rename to miniprogram/packageAPI/pages/template-message/template-message.wxml
diff --git a/miniprogram/page/API/pages/template-message/template-message.wxss b/miniprogram/packageAPI/pages/template-message/template-message.wxss
similarity index 100%
rename from miniprogram/page/API/pages/template-message/template-message.wxss
rename to miniprogram/packageAPI/pages/template-message/template-message.wxss
diff --git a/miniprogram/page/API/pages/toast/toast.js b/miniprogram/packageAPI/pages/toast/toast.js
similarity index 90%
rename from miniprogram/page/API/pages/toast/toast.js
rename to miniprogram/packageAPI/pages/toast/toast.js
index 84525cef..4d34cb5b 100644
--- a/miniprogram/page/API/pages/toast/toast.js
+++ b/miniprogram/packageAPI/pages/toast/toast.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '消息提示框',
- path: 'page/API/pages/toast/toast'
+ path: 'packageAPI/pages/toast/toast'
}
},
diff --git a/miniprogram/page/API/pages/toast/toast.json b/miniprogram/packageAPI/pages/toast/toast.json
similarity index 100%
rename from miniprogram/page/API/pages/toast/toast.json
rename to miniprogram/packageAPI/pages/toast/toast.json
diff --git a/miniprogram/page/API/pages/toast/toast.wxml b/miniprogram/packageAPI/pages/toast/toast.wxml
similarity index 100%
rename from miniprogram/page/API/pages/toast/toast.wxml
rename to miniprogram/packageAPI/pages/toast/toast.wxml
diff --git a/miniprogram/page/API/pages/toast/toast.wxss b/miniprogram/packageAPI/pages/toast/toast.wxss
similarity index 100%
rename from miniprogram/page/API/pages/toast/toast.wxss
rename to miniprogram/packageAPI/pages/toast/toast.wxss
diff --git a/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.js b/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.js
new file mode 100644
index 00000000..a21a04f4
--- /dev/null
+++ b/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.js
@@ -0,0 +1,69 @@
+// miniprogram/page/API/pages/two-way-bindings/two-way-bindings.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ value: '',
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+ return {
+ title: '双向绑定',
+ path: 'packageAPI/pages/make-phone-call/make-phone-call'
+ }
+ },
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.json b/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.json
new file mode 100644
index 00000000..730af47f
--- /dev/null
+++ b/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "two-way-bindings"
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.wxml b/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.wxml
new file mode 100644
index 00000000..30e1e783
--- /dev/null
+++ b/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.wxml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+ 这是你输入的数据:{{value}}
+
+
+
+
+
+
diff --git a/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.wxss b/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.wxss
new file mode 100644
index 00000000..dfa50e70
--- /dev/null
+++ b/miniprogram/packageAPI/pages/two-way-bindings/two-way-bindings.wxss
@@ -0,0 +1,9 @@
+.input {
+ margin: 30rpx auto;
+ width: 80%;
+ /* border-bottom: 1px solid black; */
+}
+.text {
+ margin: 30rpx auto;
+ width: 80%;
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/udp-socket/udp-socket.js b/miniprogram/packageAPI/pages/udp-socket/udp-socket.js
new file mode 100644
index 00000000..913b2640
--- /dev/null
+++ b/miniprogram/packageAPI/pages/udp-socket/udp-socket.js
@@ -0,0 +1,90 @@
+
+const AB2String = (arrayBuffer) => {
+ let unit8Arr = new Uint8Array(arrayBuffer) ;
+ let encodedString = String.fromCharCode.apply(null, unit8Arr),
+ decodedString = decodeURIComponent(escape((encodedString)));//没有这一步中文会乱码
+ return decodedString;
+}
+
+Page({
+ onShareAppMessage() {
+ return {
+ title: 'UDPSocket',
+ path: 'packageAPI/pages/udp-socket/udp-socket'
+ }
+ },
+ data: {
+ port: undefined,
+ remote_port: undefined,
+ startUDP: false,
+ mode: 'local',
+ address: 'localhost',
+ canIUse: true,
+ },
+ onLoad(){
+ const canIUse = wx.canIUse('createUDPSocket');
+ if(!canIUse) {
+ wx.showModal({
+ title: '微信版本过低,暂不支持本功能'
+ })
+ this.setData({
+ canIUse,
+ })
+ }
+ },
+ handleCreateUDPTap() {
+ this.UDPSocket = wx.createUDPSocket();
+ this.remoteUDPSocket = wx.createUDPSocket();
+ this.port = this.UDPSocket.bind();
+ this.remote_port = this.remoteUDPSocket.bind();
+ this.setData({
+ port: this.port,
+ remote_port: this.remote_port,
+ startUDP: true,
+ })
+ this.remoteUDPSocket.onMessage((res) => {
+ const { remoteInfo } = res;
+ console.log(res);
+ wx.showModal({
+ title: `IP:${remoteInfo.address}发来的信息`,
+ content: AB2String(res.message),
+ })
+ })
+ },
+
+ handleCloseUDPTap () {
+ this.setData({
+ startUDP: false,
+ mode: 'local',
+ })
+ console.log(this.data);
+ this.UDPSocket.close();
+ this.remoteUDPSocket.close();
+ },
+ handleSendRemoteMessage() {
+ this.UDPSocket.send({
+ address: this.data.address || 'localhost', // 可以是任意 ip 和域名
+ port: this.remote_port,
+ message: `port[${this.port}] 向 remote-port[${this.remote_port}] 发送信息: Hello Wechat!`,
+ })
+ },
+ changeMode() {
+ this.setData({
+ mode: 'remote',
+ })
+ },
+ handleInputChange(e) {
+ this.setData({
+ address: e.detail.value,
+ })
+ },
+ handleSendMessage() {
+ this.UDPSocket.send({
+ address: 'localhost', // 可以是任意 ip 和域名
+ port: this.remote_port,
+ message: `port[${this.port}] 向 remote-port[${this.remote_port}] 发送信息: Hello Wechat!`,
+ })
+ },
+
+
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/udp-socket/udp-socket.json b/miniprogram/packageAPI/pages/udp-socket/udp-socket.json
new file mode 100644
index 00000000..84cb8919
--- /dev/null
+++ b/miniprogram/packageAPI/pages/udp-socket/udp-socket.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "UDPSocket"
+
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/udp-socket/udp-socket.wxml b/miniprogram/packageAPI/pages/udp-socket/udp-socket.wxml
new file mode 100644
index 00000000..9806a88a
--- /dev/null
+++ b/miniprogram/packageAPI/pages/udp-socket/udp-socket.wxml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+ 本机port: {{port}} 模拟远程port: {{remote_port}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram/packageAPI/pages/udp-socket/udp-socket.wxss b/miniprogram/packageAPI/pages/udp-socket/udp-socket.wxss
new file mode 100644
index 00000000..e69de29b
diff --git a/miniprogram/page/API/pages/upload-file/upload-file.js b/miniprogram/packageAPI/pages/upload-file/upload-file.js
similarity index 51%
rename from miniprogram/page/API/pages/upload-file/upload-file.js
rename to miniprogram/packageAPI/pages/upload-file/upload-file.js
index 79867f05..fd821d96 100644
--- a/miniprogram/page/API/pages/upload-file/upload-file.js
+++ b/miniprogram/packageAPI/pages/upload-file/upload-file.js
@@ -1,10 +1,9 @@
-const uploadFileUrl = require('../../../../config').uploadFileUrl
Page({
onShareAppMessage() {
return {
title: '上传文件',
- path: 'page/API/pages/upload-file/upload-file'
+ path: 'packageAPI/pages/upload-file/upload-file'
}
},
@@ -20,11 +19,15 @@ Page({
const imageSrc = res.tempFilePaths[0]
- wx.uploadFile({
- url: uploadFileUrl,
- filePath: imageSrc,
- name: 'data',
- success(res) {
+ wx.cloud.uploadFile({
+ cloudPath: 'example.png', // 上传至云端的路径
+ filePath: imageSrc, // 小程序临时文件路径
+ config: {
+ env: 'release-b86096'
+ },
+ success: res => {
+ // 返回文件 ID
+ console.log(res.fileID)
console.log('uploadImage success, res is:', res)
wx.showToast({
@@ -34,7 +37,8 @@ Page({
})
self.setData({
- imageSrc
+ imageSrc,
+ fileID: res.fileID,
})
},
fail({errMsg}) {
@@ -43,9 +47,20 @@ Page({
})
},
- fail({errMsg}) {
- console.log('chooseImage fail, err is', errMsg)
+ fail: res => {
+ wx.showToast({
+ icon: 'none',
+ title: '上传失败',
+ })
+ console.log('uploadImage fail, errMsg is', res.errMsg)
}
})
+ },
+ onUnload() {
+ if(this.data.fileID) {
+ wx.cloud.deleteFile({
+ fileList: [this.data.fileID]
+ })
+ }
}
})
diff --git a/miniprogram/page/API/pages/upload-file/upload-file.json b/miniprogram/packageAPI/pages/upload-file/upload-file.json
similarity index 100%
rename from miniprogram/page/API/pages/upload-file/upload-file.json
rename to miniprogram/packageAPI/pages/upload-file/upload-file.json
diff --git a/miniprogram/page/API/pages/upload-file/upload-file.wxml b/miniprogram/packageAPI/pages/upload-file/upload-file.wxml
similarity index 100%
rename from miniprogram/page/API/pages/upload-file/upload-file.wxml
rename to miniprogram/packageAPI/pages/upload-file/upload-file.wxml
diff --git a/miniprogram/page/API/pages/upload-file/upload-file.wxss b/miniprogram/packageAPI/pages/upload-file/upload-file.wxss
similarity index 68%
rename from miniprogram/page/API/pages/upload-file/upload-file.wxss
rename to miniprogram/packageAPI/pages/upload-file/upload-file.wxss
index 8a06a195..4bc85e0e 100644
--- a/miniprogram/page/API/pages/upload-file/upload-file.wxss
+++ b/miniprogram/packageAPI/pages/upload-file/upload-file.wxss
@@ -7,8 +7,8 @@
box-sizing: border-box;
padding: 30rpx;
height: 420rpx;
- border-top: 1rpx solid #D9D9D9;
- border-bottom: 1rpx solid #D9D9D9;
+ border-top: 1rpx solid var(--weui-FG-3);
+ border-bottom: 1rpx solid var(--weui-FG-3);
align-items: center;
justify-content: center;
}
diff --git a/miniprogram/page/API/pages/vibrate/vibrate.js b/miniprogram/packageAPI/pages/vibrate/vibrate.js
similarity index 91%
rename from miniprogram/page/API/pages/vibrate/vibrate.js
rename to miniprogram/packageAPI/pages/vibrate/vibrate.js
index ab5ef393..c53f675c 100644
--- a/miniprogram/page/API/pages/vibrate/vibrate.js
+++ b/miniprogram/packageAPI/pages/vibrate/vibrate.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: '振动',
- path: 'page/API/pages/vibrate/vibrate'
+ path: 'packageAPI/pages/vibrate/vibrate'
}
},
diff --git a/miniprogram/page/API/pages/vibrate/vibrate.json b/miniprogram/packageAPI/pages/vibrate/vibrate.json
similarity index 100%
rename from miniprogram/page/API/pages/vibrate/vibrate.json
rename to miniprogram/packageAPI/pages/vibrate/vibrate.json
diff --git a/miniprogram/page/API/pages/vibrate/vibrate.wxml b/miniprogram/packageAPI/pages/vibrate/vibrate.wxml
similarity index 100%
rename from miniprogram/page/API/pages/vibrate/vibrate.wxml
rename to miniprogram/packageAPI/pages/vibrate/vibrate.wxml
diff --git a/miniprogram/packageAPI/pages/vibrate/vibrate.wxss b/miniprogram/packageAPI/pages/vibrate/vibrate.wxss
new file mode 100644
index 00000000..e69de29b
diff --git a/miniprogram/page/API/pages/video/video.js b/miniprogram/packageAPI/pages/video/video.js
similarity index 96%
rename from miniprogram/page/API/pages/video/video.js
rename to miniprogram/packageAPI/pages/video/video.js
index 11c7b59a..273dcd7f 100644
--- a/miniprogram/page/API/pages/video/video.js
+++ b/miniprogram/packageAPI/pages/video/video.js
@@ -10,7 +10,7 @@ Page({
onShareAppMessage() {
return {
title: '拍摄/选择视频',
- path: 'page/API/pages/video/video'
+ path: 'packageAPI/pages/video/video'
}
},
diff --git a/miniprogram/page/API/pages/video/video.json b/miniprogram/packageAPI/pages/video/video.json
similarity index 100%
rename from miniprogram/page/API/pages/video/video.json
rename to miniprogram/packageAPI/pages/video/video.json
diff --git a/miniprogram/page/API/pages/video/video.wxml b/miniprogram/packageAPI/pages/video/video.wxml
similarity index 100%
rename from miniprogram/page/API/pages/video/video.wxml
rename to miniprogram/packageAPI/pages/video/video.wxml
diff --git a/miniprogram/page/API/pages/video/video.wxss b/miniprogram/packageAPI/pages/video/video.wxss
similarity index 67%
rename from miniprogram/page/API/pages/video/video.wxss
rename to miniprogram/packageAPI/pages/video/video.wxss
index a16e5d8f..c50ff815 100644
--- a/miniprogram/page/API/pages/video/video.wxss
+++ b/miniprogram/packageAPI/pages/video/video.wxss
@@ -5,8 +5,8 @@
margin-top: 40rpx;
padding: 0;
height: 360rpx;
- border-top: 1rpx solid #D9D9D9;
- border-bottom: 1rpx solid #D9D9D9;
+ border-top: 1rpx solid var(--weui-FG-3);
+ border-bottom: 1rpx solid var(--weui-FG-3);
align-items: center;
justify-content: center;
}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/voice/voice.js b/miniprogram/packageAPI/pages/voice/voice.js
new file mode 100644
index 00000000..0f121045
--- /dev/null
+++ b/miniprogram/packageAPI/pages/voice/voice.js
@@ -0,0 +1,160 @@
+const util = require('../../../util/util.js')
+
+let playTimeInterval
+let recordTimeInterval
+const recorderManager = wx.getRecorderManager()
+const innerAudioContext = wx.createInnerAudioContext();
+Page({
+ onShareAppMessage() {
+ return {
+ title: '录音',
+ path: 'packageAPI/pages/voice/voice'
+ }
+ },
+ data: {
+ recording: false, // 录音中
+ playing: false, // 播放中
+ hasRecord: false, // 已经录音
+ recordTime: 0, // 录音时长
+ playTime: 0, // 播放时长
+ formatedRecordTime: '00:00:00', // 录音时间
+ formatedPlayTime: '00:00:00' // 播放时间
+ },
+
+ onHide() {
+ if (this.data.playing) {
+ this.stopVoice()
+ } else if (this.data.recording) {
+ this.stopRecordUnexpectedly()
+ }
+ },
+
+ onLoad() {
+ const that = this;
+ // 监听录音开始事件
+ recorderManager.onStart(() => {
+ console.log('recorderManage: onStart')
+ // 录音时长记录 每秒刷新
+ recordTimeInterval = setInterval(() => {
+ const recordTime = that.data.recordTime += 1
+ that.setData({
+ formatedRecordTime: util.formatTime(that.data.recordTime),
+ recordTime
+ })
+ }, 1000)
+ });
+
+ // 监听录音停止事件
+ recorderManager.onStop((res) => {
+ console.log('recorderManage: onStop')
+ that.setData({
+ hasRecord: true, // 录音完毕
+ recording: false,
+ tempFilePath: res.tempFilePath,
+ formatedPlayTime: util.formatTime(that.data.playTime),
+ })
+ // 清除录音计时器
+ clearInterval(recordTimeInterval)
+ });
+
+ // 监听播放开始事件
+ innerAudioContext.onPlay(() => {
+ console.log('innerAudioContext: onPlay')
+ playTimeInterval = setInterval(() => {
+ const playTime = that.data.playTime + 1
+ if(that.data.playTime === that.data.recordTime) {
+ that.stopVoice();
+ } else {
+ console.log('update playTime', playTime)
+ that.setData({
+ formatedPlayTime: util.formatTime(playTime),
+ playTime
+ })
+ }
+ }, 1000);
+ });
+
+ innerAudioContext.onStop(() => {
+
+ })
+ },
+
+ startRecord() {
+ this.setData({
+ recording: true // 录音开始
+ })
+ // 设置 Recorder 参数
+ const options = {
+ duration: 10000, // 持续时长
+ sampleRate: 44100,
+ numberOfChannels: 1,
+ encodeBitRate: 192000,
+ format: 'aac',
+ frameSize: 50
+ }
+ recorderManager.start(options) // 开始录音
+ },
+
+ stopRecord() {
+ recorderManager.stop(); // 停止录音
+ },
+
+ stopRecordUnexpectedly() {
+ const that = this
+ wx.stopRecord({
+ success() {
+ console.log('stop record success')
+ clearInterval(recordTimeInterval)
+ that.setData({
+ recording: false,
+ hasRecord: false,
+ recordTime: 0,
+ formatedRecordTime: util.formatTime(0)
+ })
+ }
+ })
+ },
+
+ playVoice() {
+ innerAudioContext.src = this.data.tempFilePath;
+ this.setData({
+ playing: true,
+
+ }, () => {
+ innerAudioContext.play();
+
+ })
+
+ },
+
+ pauseVoice() {
+ clearInterval(playTimeInterval)
+ innerAudioContext.pause();
+ this.setData({
+ playing: false
+ })
+ },
+
+ stopVoice() {
+ clearInterval(playTimeInterval)
+ innerAudioContext.stop();
+ this.setData({
+ playing: false,
+ formatedPlayTime: util.formatTime(0),
+ playTime: 0
+ })
+ },
+
+ clear() {
+ clearInterval(playTimeInterval)
+ innerAudioContext.stop();
+ this.setData({
+ playing: false,
+ hasRecord: false,
+ tempFilePath: '',
+ formatedRecordTime: util.formatTime(0),
+ recordTime: 0,
+ playTime: 0
+ })
+ }
+})
diff --git a/miniprogram/page/API/pages/voice/voice.json b/miniprogram/packageAPI/pages/voice/voice.json
similarity index 100%
rename from miniprogram/page/API/pages/voice/voice.json
rename to miniprogram/packageAPI/pages/voice/voice.json
diff --git a/miniprogram/page/API/pages/voice/voice.wxml b/miniprogram/packageAPI/pages/voice/voice.wxml
similarity index 93%
rename from miniprogram/page/API/pages/voice/voice.wxml
rename to miniprogram/packageAPI/pages/voice/voice.wxml
index 97d77c7e..61764991 100644
--- a/miniprogram/page/API/pages/voice/voice.wxml
+++ b/miniprogram/packageAPI/pages/voice/voice.wxml
@@ -2,7 +2,7 @@
-
+
@@ -57,9 +57,9 @@
-
+
diff --git a/miniprogram/page/API/pages/voice/voice.wxss b/miniprogram/packageAPI/pages/voice/voice.wxss
similarity index 100%
rename from miniprogram/page/API/pages/voice/voice.wxss
rename to miniprogram/packageAPI/pages/voice/voice.wxss
diff --git a/miniprogram/page/API/pages/web-socket/web-socket.js b/miniprogram/packageAPI/pages/web-socket/web-socket.js
similarity index 97%
rename from miniprogram/page/API/pages/web-socket/web-socket.js
rename to miniprogram/packageAPI/pages/web-socket/web-socket.js
index 6f4cf49f..3baa5e6c 100644
--- a/miniprogram/page/API/pages/web-socket/web-socket.js
+++ b/miniprogram/packageAPI/pages/web-socket/web-socket.js
@@ -19,7 +19,7 @@ Page({
onShareAppMessage() {
return {
title: 'Web Socket',
- path: 'page/API/pages/web-socket/web-socket'
+ path: 'packageAPI/pages/web-socket/web-socket'
}
},
diff --git a/miniprogram/page/API/pages/web-socket/web-socket.json b/miniprogram/packageAPI/pages/web-socket/web-socket.json
similarity index 100%
rename from miniprogram/page/API/pages/web-socket/web-socket.json
rename to miniprogram/packageAPI/pages/web-socket/web-socket.json
diff --git a/miniprogram/page/API/pages/web-socket/web-socket.wxml b/miniprogram/packageAPI/pages/web-socket/web-socket.wxml
similarity index 100%
rename from miniprogram/page/API/pages/web-socket/web-socket.wxml
rename to miniprogram/packageAPI/pages/web-socket/web-socket.wxml
diff --git a/miniprogram/page/API/pages/web-socket/web-socket.wxss b/miniprogram/packageAPI/pages/web-socket/web-socket.wxss
similarity index 100%
rename from miniprogram/page/API/pages/web-socket/web-socket.wxss
rename to miniprogram/packageAPI/pages/web-socket/web-socket.wxss
diff --git a/miniprogram/page/API/pages/wifi/wifi.js b/miniprogram/packageAPI/pages/wifi/wifi.js
similarity index 97%
rename from miniprogram/page/API/pages/wifi/wifi.js
rename to miniprogram/packageAPI/pages/wifi/wifi.js
index c11a0de1..2414598d 100644
--- a/miniprogram/page/API/pages/wifi/wifi.js
+++ b/miniprogram/packageAPI/pages/wifi/wifi.js
@@ -2,7 +2,7 @@ Page({
onShareAppMessage() {
return {
title: 'Wi-Fi',
- path: 'page/API/pages/wifi/wifi'
+ path: 'packageAPI/pages/wifi/wifi'
}
},
diff --git a/miniprogram/page/API/pages/wifi/wifi.json b/miniprogram/packageAPI/pages/wifi/wifi.json
similarity index 100%
rename from miniprogram/page/API/pages/wifi/wifi.json
rename to miniprogram/packageAPI/pages/wifi/wifi.json
diff --git a/miniprogram/page/API/pages/wifi/wifi.wxml b/miniprogram/packageAPI/pages/wifi/wifi.wxml
similarity index 100%
rename from miniprogram/page/API/pages/wifi/wifi.wxml
rename to miniprogram/packageAPI/pages/wifi/wifi.wxml
diff --git a/miniprogram/page/API/pages/wifi/wifi.wxss b/miniprogram/packageAPI/pages/wifi/wifi.wxss
similarity index 100%
rename from miniprogram/page/API/pages/wifi/wifi.wxss
rename to miniprogram/packageAPI/pages/wifi/wifi.wxss
diff --git a/miniprogram/page/API/pages/worker/worker.js b/miniprogram/packageAPI/pages/worker/worker.js
similarity index 96%
rename from miniprogram/page/API/pages/worker/worker.js
rename to miniprogram/packageAPI/pages/worker/worker.js
index abbd75dc..0c6b846d 100644
--- a/miniprogram/page/API/pages/worker/worker.js
+++ b/miniprogram/packageAPI/pages/worker/worker.js
@@ -1,10 +1,10 @@
-const {fib} = require('../../../../util/util.js')
+const {fib} = require('../../../util/util.js')
Page({
onShareAppMessage() {
return {
title: '多线程Worker',
- path: 'page/API/pages/worker/worker'
+ path: 'packageAPI/pages/worker/worker'
}
},
diff --git a/miniprogram/page/API/pages/worker/worker.json b/miniprogram/packageAPI/pages/worker/worker.json
similarity index 100%
rename from miniprogram/page/API/pages/worker/worker.json
rename to miniprogram/packageAPI/pages/worker/worker.json
diff --git a/miniprogram/page/API/pages/worker/worker.wxml b/miniprogram/packageAPI/pages/worker/worker.wxml
similarity index 100%
rename from miniprogram/page/API/pages/worker/worker.wxml
rename to miniprogram/packageAPI/pages/worker/worker.wxml
diff --git a/miniprogram/page/API/pages/worker/worker.wxss b/miniprogram/packageAPI/pages/worker/worker.wxss
similarity index 100%
rename from miniprogram/page/API/pages/worker/worker.wxss
rename to miniprogram/packageAPI/pages/worker/worker.wxss
diff --git a/miniprogram/packageAPI/pages/wxs/image/1.jpeg b/miniprogram/packageAPI/pages/wxs/image/1.jpeg
new file mode 100644
index 00000000..80c325d2
Binary files /dev/null and b/miniprogram/packageAPI/pages/wxs/image/1.jpeg differ
diff --git a/miniprogram/packageAPI/pages/wxs/image/2.jpg b/miniprogram/packageAPI/pages/wxs/image/2.jpg
new file mode 100644
index 00000000..8c7e0d1a
Binary files /dev/null and b/miniprogram/packageAPI/pages/wxs/image/2.jpg differ
diff --git a/miniprogram/packageAPI/pages/wxs/image/3.jpg b/miniprogram/packageAPI/pages/wxs/image/3.jpg
new file mode 100644
index 00000000..ed4074c6
Binary files /dev/null and b/miniprogram/packageAPI/pages/wxs/image/3.jpg differ
diff --git a/miniprogram/packageAPI/pages/wxs/image/4.jpg b/miniprogram/packageAPI/pages/wxs/image/4.jpg
new file mode 100644
index 00000000..27cb15b2
Binary files /dev/null and b/miniprogram/packageAPI/pages/wxs/image/4.jpg differ
diff --git a/miniprogram/packageAPI/pages/wxs/image/btn.png b/miniprogram/packageAPI/pages/wxs/image/btn.png
new file mode 100644
index 00000000..c6536be6
Binary files /dev/null and b/miniprogram/packageAPI/pages/wxs/image/btn.png differ
diff --git a/miniprogram/packageAPI/pages/wxs/movable.js b/miniprogram/packageAPI/pages/wxs/movable.js
new file mode 100644
index 00000000..976a5ab8
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/movable.js
@@ -0,0 +1,44 @@
+// pages/movable/movable.js
+Page({
+ onShareAppMessage() {
+ return {
+ title: 'movable',
+ path: 'packageAPI/pages/wxs/movable'
+ }
+ },
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ left: 50,
+ top: 50,
+ taptest: 'taptest',
+ show: true,
+ dataObj: {
+ obj: 1
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+ setTimeout(() => {
+ this.setData({
+ // show: false,
+ })
+ }, 3000)
+ },
+ taptest() {
+ this.setData({
+ show: false,
+ })
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/movable.json b/miniprogram/packageAPI/pages/wxs/movable.json
new file mode 100644
index 00000000..4a86ec76
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/movable.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "movable"
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/movable.wxml b/miniprogram/packageAPI/pages/wxs/movable.wxml
new file mode 100644
index 00000000..6bcbb8b8
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/movable.wxml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/movable.wxs b/miniprogram/packageAPI/pages/wxs/movable.wxs
new file mode 100644
index 00000000..b1622fa0
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/movable.wxs
@@ -0,0 +1,36 @@
+var startX = 0
+var startY = 0
+var lastLeft = lastTop = 50
+function touchstart(event, ins) {
+ var touch = event.touches[0] || event.changedTouches[0]
+ startX = touch.pageX
+ startY = touch.pageY
+ ins.callMethod('testCallmethod', {
+ complete: function(res) {
+ console.log('args', res)
+ }
+ })
+}
+function touchmove(event, ins) {
+ var touch = event.touches[0] || event.changedTouches[0]
+ var pageX = touch.pageX
+ var pageY = touch.pageY
+ var left = pageX - startX + lastLeft
+ var top = pageY - startY + lastTop
+ startX = pageX
+ startY = pageY
+ lastLeft = left
+ lastTop = top
+ // console.log('idff', pageX - context.startX, left, top)
+ ins.selectComponent('.movable').setStyle({
+ left: left + 'px',
+ top: top + 'px'
+ })
+ // console.log('get data', JSON.stringify(ins.selectComponent('.movable')[0].getData()))
+ // console.log('get data set', JSON.stringify(ins.selectComponent('.movable')[0].getDataset()))
+ // console.log('test select', ins.selectComponent('.movable')[0].selectComponent('.dd'))
+}
+module.exports = {
+ touchstart: touchstart,
+ touchmove: touchmove,
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/movable.wxss b/miniprogram/packageAPI/pages/wxs/movable.wxss
new file mode 100644
index 00000000..c9f71e10
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/movable.wxss
@@ -0,0 +1 @@
+/* miniprogram/page/API/pages/wxs/movable.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/nearby.js b/miniprogram/packageAPI/pages/wxs/nearby.js
new file mode 100644
index 00000000..886aca96
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/nearby.js
@@ -0,0 +1,60 @@
+const windowWidth = wx.getSystemInfoSync().windowWidth
+Page({
+ onShareAppMessage() {
+ return {
+ title: 'nearby',
+ path: 'packageAPI/pages/wxs/nearby'
+ }
+ },
+ data: {
+ imgUrls: [
+ 'http://mmbiz.qpic.cn/sz_mmbiz_jpg/GEWVeJPFkSEV5QjxLDJaL6ibHLSZ02TIcve0ocPXrdTVqGGbqAmh5Mw9V7504dlEiatSvnyibibHCrVQO2GEYsJicPA/0?wx_fmt=jpeg',
+ 'http://mmbiz.qpic.cn/sz_mmbiz_png/GEWVeJPFkSHALb0g5rCc4Jf5IqDfdwhWJ43I1IvriaV5uFr9fLAuv3uxHR7DQstbIxhNXFoQEcxGzWwzQUDBd6Q/0?wx_fmt=png',
+ 'http://mmbiz.qpic.cn/sz_mmbiz_jpg/GEWVeJPFkSGqys4ibO2a8L9nnIgH0ibjNXfbicNbZQQYfxxUpmicQglAEYQ2btVXjOhY9gRtSTCxKvAlKFek7sRUFA/0?wx_fmt=jpeg',
+ 'http://mmbiz.qpic.cn/sz_mmbiz_jpg/GEWVeJPFkSH2Eic4Lt0HkZeEN08pWXTticVRgyNGgBVHMJwMtRhmB0hE4m4alSuwsBk3uBBOhdCr91bZlSFbYhFg/0?wx_fmt=jpeg'
+ ],
+ imgSize: [{
+ height: 150
+ }, {
+ height: 200
+ }, {
+ height: 150
+ }, {
+ height: 150
+ }],
+ indicatorDots: true,
+ autoplay: false,
+ interval: 3000,
+ duration: 500,
+ left: 0,
+ windowWidth: windowWidth
+ },
+ changeIndicatorDots: function (e) {
+ this.setData({
+ indicatorDots: !this.data.indicatorDots
+ })
+ },
+ swiperTransition1(e) {
+ console.log('e.transition', e)
+ this.setData({
+ left: (e.detail.x) / 4
+ })
+ },
+ onReady() {
+ },
+ changeAutoplay: function (e) {
+ this.setData({
+ autoplay: !this.data.autoplay
+ })
+ },
+ intervalChange: function (e) {
+ this.setData({
+ interval: e.detail.value
+ })
+ },
+ durationChange: function (e) {
+ this.setData({
+ duration: e.detail.value
+ })
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/nearby.json b/miniprogram/packageAPI/pages/wxs/nearby.json
new file mode 100644
index 00000000..4f9a2ee1
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/nearby.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "nearby"
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/nearby.wxml b/miniprogram/packageAPI/pages/wxs/nearby.wxml
new file mode 100644
index 00000000..8f1074ff
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/nearby.wxml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/nearby.wxs b/miniprogram/packageAPI/pages/wxs/nearby.wxs
new file mode 100644
index 00000000..03390278
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/nearby.wxs
@@ -0,0 +1,61 @@
+var func = function (e, instance) {
+ var dataset = e.instance.getDataset()
+ var st = e.instance.getState()
+ var current = st.current || 0
+ var imgsize = dataset.imgsize
+ var width = dataset.width
+ var detail = e.detail
+ var dx = e.detail.dx
+ // 相比上次没有任何改变, 直接返回
+ var diff = typeof st.lastx !== 'undefined' ? (dx - st.lastx) : (dx - 0)
+ if (diff === 0) return
+ st.continueCount = st.continueCount || 1
+ // 连续滑动过程中, 且到达下一个swiper-item的transition开始了, 修正一下current值
+ if (Math.abs(dx) > width * st.continueCount && st.tmpcurrent != -1) {
+ console.log('mod is 0 some info', st.tmpcurrent, current)
+ current = st.tmpcurrent
+ st.current = st.tmpcurrent
+ st.tmpcurrent = -1
+ st.continueCount++
+ }
+ // 连续滑动dx的值会比width大,这时候要减去多余的width值
+ var setToWidth = false
+ var dir = dx > 0
+ if (dx !== 0 && Math.abs(dx) >= width) {
+ setToWidth = true
+ }
+ dx = dx - width * parseInt(dx / width)
+ if (dx === 0 && setToWidth) {
+ dx = dir ? width : -width
+ }
+ // 先判断下方向对不对
+ if (current >= imgsize.length - 1 && dx > 0) return
+ if (current <= 0 && dx < 0) return
+ var currentSize = imgsize[current]
+ var nextSize = dx > 0 ? imgsize[current + 1] : imgsize[current - 1]
+ var currentHeight = st.currentHeight || currentSize.height
+ var diffHeight = Math.abs((nextSize.height - currentSize.height) * (dx / width))
+ var realheight = currentSize.height + (nextSize.height - currentSize.height > 0 ? diffHeight : -diffHeight)
+ st.currentHeight = realheight
+ e.instance.setStyle({
+ height: realheight + 'px'
+ })
+ st.lastdir = dx > 0
+ console.log('111', realheight, dx, current, nextSize.height, currentSize.height)
+}
+module.exports = {
+ func: func,
+ change: function(e, instance) {
+ var st = e.instance.getState()
+ console.log('=====change detail is', e.detail.current)
+ st.tmpcurrent = e.detail.current
+ },
+ animationFinish: function(e) {
+ var st = e.instance.getState()
+ if (typeof st.tmpcurrent === 'undefined' || st.tmpcurrent === -1) return
+ console.log('====animation finish is', st.tmpcurrent)
+ st.current = st.tmpcurrent
+ st.tmpcurrent = -1
+ st.continueCount = 1
+ }
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/nearby.wxss b/miniprogram/packageAPI/pages/wxs/nearby.wxss
new file mode 100644
index 00000000..01c38e04
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/nearby.wxss
@@ -0,0 +1,4 @@
+/* pages/nearby/nearby.wxss */
+.swiper {
+ width: 100%
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/sidebar.js b/miniprogram/packageAPI/pages/wxs/sidebar.js
new file mode 100644
index 00000000..5b03ee5c
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/sidebar.js
@@ -0,0 +1,28 @@
+// page/one/index.js
+Page({
+ data: {
+ tabs: [],
+ open: false,
+ mark: 0,
+ newmark: 0,
+ startmark: 0,
+ endmark: 0,
+ windowWidth: wx.getSystemInfoSync().windowWidth,
+ staus: 1,
+ translate: ''
+ },
+ onLoad() {
+ const tabs = [
+ {
+ title: '技术开发',
+ title2: '小程序开发进阶',
+ img: 'http://mmbiz.qpic.cn/sz_mmbiz_jpg/GEWVeJPFkSEV5QjxLDJaL6ibHLSZ02TIcve0ocPXrdTVqGGbqAmh5Mw9V7504dlEiatSvnyibibHCrVQO2GEYsJicPA/0?wx_fmt=jpeg',
+ desc: '本视频系列课程,由腾讯课堂NEXT学院与微信团队联合出品,通过实战案例,深入浅出地进行讲解。',
+ },
+ ]
+ this.setData({ tabs })
+ // setTimeout(() => {
+ // this.initInteraction()
+ // }, 5000)
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/sidebar.json b/miniprogram/packageAPI/pages/wxs/sidebar.json
new file mode 100644
index 00000000..80fae7ac
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/sidebar.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "sidebar"
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/sidebar.wxml b/miniprogram/packageAPI/pages/wxs/sidebar.wxml
new file mode 100644
index 00000000..08a1ef3d
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/sidebar.wxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+ 技术开发
+
+
+ 产品解析
+
+
+ 运营规范
+
+
+ 高校大赛
+
+
+
+
+ >>> 右滑出现侧边菜单
+
+
+
+
+
+
+
+
diff --git a/miniprogram/packageAPI/pages/wxs/sidebar.wxs b/miniprogram/packageAPI/pages/wxs/sidebar.wxs
new file mode 100644
index 00000000..af3f6065
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/sidebar.wxs
@@ -0,0 +1,61 @@
+var newmark = startmark = 0
+var status = 0
+function touchstart(e, ins) {
+ var pageX = (e.touches[0] || e.changedTouches[0]).pageX
+ startmark = newmark = pageX
+}
+
+function touchmove(e, ins) {
+ var pageX = (e.touches[0] || e.changedTouches[0]).pageX
+ console.log('pageX', pageX);
+ newmark = pageX
+ // var data = ins.getData()
+ var data = {
+ windowWidth: e.target.dataset.width
+ }
+ if (startmark < pageX) {
+ if (data.windowWidth * 0.4 > Math.abs(newmark - startmark)) {
+ console.log('newmark - startmark',newmark - startmark)
+ ins.selectComponent('.page-top').setStyle({
+ transform: 'translateX(' + Math.min(data.windowWidth * 0.4, ((status == 1 ? data.windowWidth * 0.4 : 0) + newmark - startmark)) + 'px)'
+ })
+ }
+ }
+ if (startmark > pageX) {
+ ins.selectComponent('.page-top').setStyle({
+ transform: 'translateX(' + Math.max(0, ((status == 1 ? data.windowWidth * 0.4 : 0) + newmark - startmark)) + 'px)'
+ })
+ }
+}
+function touchend(e, ins) {
+ var pageX = (e.touches[0] || e.changedTouches[0]).pageX
+ newmark = pageX
+ // var data = ins.getData()
+ var data = {
+ windowWidth: e.target.dataset.width
+ }
+ if (startmark < pageX) {
+ if (data.windowWidth * 0.2 < Math.abs(newmark - startmark)) {
+ ins.selectComponent('.page-top').setStyle({
+ transform: 'translateX(' + (data.windowWidth * 0.4) + 'px)'
+ })
+ status = 1 // 展开状态
+ } else {
+ ins.selectComponent('.page-top').setStyle({
+ transform: 'translateX(0px)'
+ })
+ status = 0 // 收起状态
+ }
+ }
+ if (startmark > newmark) {
+ ins.selectComponent('.page-top').setStyle({
+ transform: 'translateX(0px)'
+ })
+ status = 0 // 收起状态
+ }
+}
+module.exports = {
+ touchstart: touchstart,
+ touchmove: touchmove,
+ touchend: touchend
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/sidebar.wxss b/miniprogram/packageAPI/pages/wxs/sidebar.wxss
new file mode 100644
index 00000000..a52fba6b
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/sidebar.wxss
@@ -0,0 +1,56 @@
+.container {
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: space-between;
+ padding: 200rpx 0;
+ box-sizing: border-box;
+}
+page,.page {
+ height: 100%;
+ font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'Droid Sans Fallback', 'Microsoft Yahei', sans-serif;
+}
+.page-bottom{
+ height: 100%;
+ width: 750rpx;
+ position: fixed;
+ background-color: #07c160;
+ z-index: 0;
+}
+.wc{
+ color: white;
+ padding: 30rpx 0 30rpx 40rpx;
+}
+.page-content{
+ padding-top: 300rpx;
+}
+.page-top{
+ height: 100%;
+ position: fixed;
+ width: 750rpx;
+ background-color: var(--weui-BG-1);
+ z-index: 0;
+ transition: All 0.4s ease;
+ -webkit-transition: All 0.4s ease;
+}
+
+.c-state1{
+ transform: rotate(0deg) scale(1) translate(40%,0%);
+ -webkit-transform: rotate(0deg) scale(1) translate(40%,0%);
+}
+.c-state2{
+ transform: rotate(0deg) scale(.8) translate(40%,0%);
+ -webkit-transform: rotate(0deg) scale(.8) translate(40%,0%);
+}
+
+.item-title {
+ margin: 20rpx 20rpx 10rpx;
+ font-size: 18px;
+ width: 100%;
+}
+.item-desc {
+ margin: 10rpx 20rpx 0;
+ width: 100%;
+ color: #00000080
+}
diff --git a/miniprogram/packageAPI/pages/wxs/stick-top.js b/miniprogram/packageAPI/pages/wxs/stick-top.js
new file mode 100644
index 00000000..9d6bbf48
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/stick-top.js
@@ -0,0 +1,55 @@
+const height = wx.getSystemInfoSync().windowHeight;
+const app = getApp();
+Page({
+ data: {
+ sticky: false,
+ opacity: 0,
+ height: height,
+ tabs: [],
+ theme: app.globalData.theme,
+ },
+ //滚动条监听
+ onPageScroll: function (e) {
+ // console.log('page scroll')
+ },
+ onShow() {
+
+ },
+ onReady() {
+ },
+ onLoad() {
+ const tabs = [
+ {
+ title: '技术开发',
+ title2: '小程序开发进阶',
+ img: 'http://mmbiz.qpic.cn/sz_mmbiz_jpg/GEWVeJPFkSEV5QjxLDJaL6ibHLSZ02TIcve0ocPXrdTVqGGbqAmh5Mw9V7504dlEiatSvnyibibHCrVQO2GEYsJicPA/0?wx_fmt=jpeg',
+ desc: '本视频系列课程,由腾讯课堂NEXT学院与微信团队联合出品,通过实战案例,深入浅出地进行讲解。',
+ },
+ {
+ title: '产品解析',
+ title2: '微信小程序直播',
+ img: 'http://mmbiz.qpic.cn/sz_mmbiz_png/GEWVeJPFkSHALb0g5rCc4Jf5IqDfdwhWJ43I1IvriaV5uFr9fLAuv3uxHR7DQstbIxhNXFoQEcxGzWwzQUDBd6Q/0?wx_fmt=png',
+ desc: '微信小程序直播系列课程持续更新中,帮助大家更好地理解、应用微信小程序直播功能。',
+ },
+ {
+ title: '运营规范',
+ title2: '常见问题和解决方案',
+ img: 'http://mmbiz.qpic.cn/sz_mmbiz_jpg/GEWVeJPFkSGqys4ibO2a8L9nnIgH0ibjNXfbicNbZQQYfxxUpmicQglAEYQ2btVXjOhY9gRtSTCxKvAlKFek7sRUFA/0?wx_fmt=jpeg',
+ desc: '提高审核质量',
+ },
+ {
+ title: '营销经验',
+ title2: '流量主小程序',
+ img: 'http://mmbiz.qpic.cn/sz_mmbiz_jpg/GEWVeJPFkSH2Eic4Lt0HkZeEN08pWXTticVRgyNGgBVHMJwMtRhmB0hE4m4alSuwsBk3uBBOhdCr91bZlSFbYhFg/0?wx_fmt=jpeg',
+ desc: '本课程共四节,将分阶段为开发者展示如何开通流量主功能、如何接入广告组件、不同类型小程序接入的建议,以及如何通过工具调优小程序变现效率。',
+ },
+ {
+ title: '高校大赛',
+ title2:'2020中国高校计算机大赛',
+ img: 'http://mmbiz.qpic.cn/mmbiz_jpg/TcDuyasB5T3Eg34AYwjMw7xbEK2n01ekiaicPiaMInEMTkOQtuv1yke5KziaYF4MLia4IAbxlm0m5NxkibicFg4IZ92EA/0?wx_fmt=jpeg',
+ desc: '微信小程序应用开发赛',
+ },
+ ]
+ this.setData({ tabs })
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/stick-top.json b/miniprogram/packageAPI/pages/wxs/stick-top.json
new file mode 100644
index 00000000..a65b21d8
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/stick-top.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "stick-top"
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/stick-top.wxml b/miniprogram/packageAPI/pages/wxs/stick-top.wxml
new file mode 100644
index 00000000..4942f8ce
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/stick-top.wxml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ 抗疫专区
+ 技术开发
+ 运营专区
+ 我的
+
+
+
+
+
+ {{item.title2}}
+
+
+ {{item.desc}}
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/stick-top.wxs b/miniprogram/packageAPI/pages/wxs/stick-top.wxs
new file mode 100644
index 00000000..f069376a
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/stick-top.wxs
@@ -0,0 +1,57 @@
+var funcA = function(e, ins) {
+ var scrollTop = e.detail.scrollTop
+ if (scrollTop > 200) {
+ ins.selectComponent('.page-group').setStyle({
+ "background-color": 'rgba(235, 235, 235, 1)',
+ 'z-index': '999',
+ }).addClass('page-group-position')
+ ins.selectComponent('.page-banner .image').setStyle({
+ opacity: 1 - Math.max(0, (scrollTop) / 200)
+ })
+ ins.selectComponent('.goods-list').setStyle({
+ "margin-top": '59px'
+ })
+ } else {
+ ins.selectComponent('.goods-list').setStyle({
+ "margin-top": '0'
+ })
+ ins.selectComponent('.page-group').setStyle({
+ "background-color": 'rgba(235, 235, 235, ' + Math.max(0, (scrollTop) / 200) + ')',
+ }).removeClass('page-group-position')
+ ins.selectComponent('.page-banner .image').setStyle({
+ opacity: 1 - Math.max(0, (scrollTop) / 200)
+ })
+ console.log(ins)
+
+ }
+}
+
+var funcD = function(e, ins) {
+ var scrollTop = e.detail.scrollTop
+ if (scrollTop > 200) {
+ ins.selectComponent('.page-group').setStyle({
+ "background-color": 'rgba(95, 95, 95, 1)',
+ 'z-index': '999',
+ }).addClass('page-group-position')
+ ins.selectComponent('.page-banner .image').setStyle({
+ opacity: 1 - Math.max(0, (scrollTop) / 200)
+ })
+ ins.selectComponent('.goods-list').setStyle({
+ "margin-top": '59px'
+ })
+ } else {
+ ins.selectComponent('.goods-list').setStyle({
+ "margin-top": '0'
+ })
+ ins.selectComponent('.page-group').setStyle({
+ "background-color": 'rgba(95, 95, 95, ' + Math.max(0, (scrollTop) / 200) + ')',
+ }).removeClass('page-group-position')
+ ins.selectComponent('.page-banner .image').setStyle({
+ opacity: 1 - Math.max(0, (scrollTop) / 200)
+ })
+ }
+}
+module.exports = {
+ funcA: funcA,
+ funcD: funcD
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/stick-top.wxss b/miniprogram/packageAPI/pages/wxs/stick-top.wxss
new file mode 100644
index 00000000..bf8eca92
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/stick-top.wxss
@@ -0,0 +1,41 @@
+.page-banner{
+ height:200px;
+ background-color: #fff;
+ color:#fff;
+}
+.page-group{
+ display: table;
+ /* background-color: rgba(00, 00, 00, 1); */
+ width: 100%;
+ table-layout: fixed;
+ position: relative;
+ top: 0;
+ left: 0;
+}
+.page-group-position{
+ position: fixed;
+}
+.page-nav-list{
+ padding:30rpx 0 ;
+ display: table-cell;
+ text-align: center;
+ color: #07c160;
+}
+.goods-list{
+ height: 300px;
+ background-color: var(--weui-BG-2);
+ padding: 20rpx;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+.item-title {
+ margin: 20rpx 20rpx 10rpx;
+ font-size: 18px;
+ width: 100%;
+}
+.item-desc {
+ margin: 10rpx 20rpx 0;
+ width: 100%;
+ color: var(--weui-FG-2)
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/wxs.js b/miniprogram/packageAPI/pages/wxs/wxs.js
new file mode 100644
index 00000000..0181b891
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/wxs.js
@@ -0,0 +1,15 @@
+// miniprogram/page/API/pages/wxs/wxs.js
+Page({
+ onShareAppMessage() {
+ return {
+ title: 'wxs',
+ path: 'packageAPI/pages/wxs/wxs'
+ }
+ },
+ handleNavChange(e) {
+ console.log(e);
+ wx.navigateTo({
+ url: `/packageAPI/pages/wxs/${e.currentTarget.dataset.nav}`,
+ })
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/wxs.json b/miniprogram/packageAPI/pages/wxs/wxs.json
new file mode 100644
index 00000000..ea6df226
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/wxs.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "WXS"
+}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/wxs/wxs.wxml b/miniprogram/packageAPI/pages/wxs/wxs.wxml
new file mode 100644
index 00000000..909135b4
--- /dev/null
+++ b/miniprogram/packageAPI/pages/wxs/wxs.wxml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram/packageAPI/pages/wxs/wxs.wxss b/miniprogram/packageAPI/pages/wxs/wxs.wxss
new file mode 100644
index 00000000..e69de29b
diff --git a/miniprogram/page/cloud/pages/cloud-file-component/cloud-file-component.js b/miniprogram/packageCloud/pages/cloud-file-component/cloud-file-component.js
similarity index 76%
rename from miniprogram/page/cloud/pages/cloud-file-component/cloud-file-component.js
rename to miniprogram/packageCloud/pages/cloud-file-component/cloud-file-component.js
index e8b27527..6931c6ba 100644
--- a/miniprogram/page/cloud/pages/cloud-file-component/cloud-file-component.js
+++ b/miniprogram/packageCloud/pages/cloud-file-component/cloud-file-component.js
@@ -1,4 +1,4 @@
-const {demoImageFileId, demoVideoFileId} = require('../../../../config')
+const {demoImageFileId, demoVideoFileId} = require('../../../config')
Page({
onShareAppMessage() {
diff --git a/miniprogram/page/cloud/pages/cloud-file-component/cloud-file-component.json b/miniprogram/packageCloud/pages/cloud-file-component/cloud-file-component.json
similarity index 100%
rename from miniprogram/page/cloud/pages/cloud-file-component/cloud-file-component.json
rename to miniprogram/packageCloud/pages/cloud-file-component/cloud-file-component.json
diff --git a/miniprogram/page/cloud/pages/cloud-file-component/cloud-file-component.wxml b/miniprogram/packageCloud/pages/cloud-file-component/cloud-file-component.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/cloud-file-component/cloud-file-component.wxml
rename to miniprogram/packageCloud/pages/cloud-file-component/cloud-file-component.wxml
diff --git a/miniprogram/page/cloud/pages/cloud-file-component/cloud-file-component.wxss b/miniprogram/packageCloud/pages/cloud-file-component/cloud-file-component.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/cloud-file-component/cloud-file-component.wxss
rename to miniprogram/packageCloud/pages/cloud-file-component/cloud-file-component.wxss
diff --git a/miniprogram/page/cloud/pages/crud-detail/crud-detail.js b/miniprogram/packageCloud/pages/crud-detail/crud-detail.js
similarity index 100%
rename from miniprogram/page/cloud/pages/crud-detail/crud-detail.js
rename to miniprogram/packageCloud/pages/crud-detail/crud-detail.js
diff --git a/miniprogram/page/cloud/pages/crud-detail/crud-detail.json b/miniprogram/packageCloud/pages/crud-detail/crud-detail.json
similarity index 100%
rename from miniprogram/page/cloud/pages/crud-detail/crud-detail.json
rename to miniprogram/packageCloud/pages/crud-detail/crud-detail.json
diff --git a/miniprogram/page/cloud/pages/crud-detail/crud-detail.wxml b/miniprogram/packageCloud/pages/crud-detail/crud-detail.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/crud-detail/crud-detail.wxml
rename to miniprogram/packageCloud/pages/crud-detail/crud-detail.wxml
diff --git a/miniprogram/page/cloud/pages/crud-detail/crud-detail.wxss b/miniprogram/packageCloud/pages/crud-detail/crud-detail.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/crud-detail/crud-detail.wxss
rename to miniprogram/packageCloud/pages/crud-detail/crud-detail.wxss
diff --git a/miniprogram/page/cloud/pages/crud/crud.js b/miniprogram/packageCloud/pages/crud/crud.js
similarity index 100%
rename from miniprogram/page/cloud/pages/crud/crud.js
rename to miniprogram/packageCloud/pages/crud/crud.js
diff --git a/miniprogram/page/cloud/pages/crud/crud.json b/miniprogram/packageCloud/pages/crud/crud.json
similarity index 100%
rename from miniprogram/page/cloud/pages/crud/crud.json
rename to miniprogram/packageCloud/pages/crud/crud.json
diff --git a/miniprogram/page/cloud/pages/crud/crud.wxml b/miniprogram/packageCloud/pages/crud/crud.wxml
similarity index 87%
rename from miniprogram/page/cloud/pages/crud/crud.wxml
rename to miniprogram/packageCloud/pages/crud/crud.wxml
index c13027fb..d0b3e586 100644
--- a/miniprogram/page/cloud/pages/crud/crud.wxml
+++ b/miniprogram/packageCloud/pages/crud/crud.wxml
@@ -9,7 +9,7 @@
-
+
@@ -21,8 +21,8 @@
-
-
+
+
{{item.description}}
diff --git a/miniprogram/page/cloud/pages/crud/crud.wxss b/miniprogram/packageCloud/pages/crud/crud.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/crud/crud.wxss
rename to miniprogram/packageCloud/pages/crud/crud.wxss
diff --git a/miniprogram/page/cloud/pages/db-permission/db-permission.js b/miniprogram/packageCloud/pages/db-permission/db-permission.js
similarity index 100%
rename from miniprogram/page/cloud/pages/db-permission/db-permission.js
rename to miniprogram/packageCloud/pages/db-permission/db-permission.js
diff --git a/miniprogram/page/cloud/pages/db-permission/db-permission.json b/miniprogram/packageCloud/pages/db-permission/db-permission.json
similarity index 100%
rename from miniprogram/page/cloud/pages/db-permission/db-permission.json
rename to miniprogram/packageCloud/pages/db-permission/db-permission.json
diff --git a/miniprogram/page/cloud/pages/db-permission/db-permission.wxml b/miniprogram/packageCloud/pages/db-permission/db-permission.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/db-permission/db-permission.wxml
rename to miniprogram/packageCloud/pages/db-permission/db-permission.wxml
diff --git a/miniprogram/page/cloud/pages/db-permission/db-permission.wxss b/miniprogram/packageCloud/pages/db-permission/db-permission.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/db-permission/db-permission.wxss
rename to miniprogram/packageCloud/pages/db-permission/db-permission.wxss
diff --git a/miniprogram/page/cloud/pages/delete-file/delete-file.js b/miniprogram/packageCloud/pages/delete-file/delete-file.js
similarity index 100%
rename from miniprogram/page/cloud/pages/delete-file/delete-file.js
rename to miniprogram/packageCloud/pages/delete-file/delete-file.js
diff --git a/miniprogram/page/cloud/pages/delete-file/delete-file.json b/miniprogram/packageCloud/pages/delete-file/delete-file.json
similarity index 100%
rename from miniprogram/page/cloud/pages/delete-file/delete-file.json
rename to miniprogram/packageCloud/pages/delete-file/delete-file.json
diff --git a/miniprogram/page/cloud/pages/delete-file/delete-file.wxml b/miniprogram/packageCloud/pages/delete-file/delete-file.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/delete-file/delete-file.wxml
rename to miniprogram/packageCloud/pages/delete-file/delete-file.wxml
diff --git a/miniprogram/page/cloud/pages/delete-file/delete-file.wxss b/miniprogram/packageCloud/pages/delete-file/delete-file.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/delete-file/delete-file.wxss
rename to miniprogram/packageCloud/pages/delete-file/delete-file.wxss
diff --git a/miniprogram/page/cloud/pages/doc-web-view/doc-web-view.js b/miniprogram/packageCloud/pages/doc-web-view/doc-web-view.js
similarity index 100%
rename from miniprogram/page/cloud/pages/doc-web-view/doc-web-view.js
rename to miniprogram/packageCloud/pages/doc-web-view/doc-web-view.js
diff --git a/miniprogram/page/cloud/pages/doc-web-view/doc-web-view.json b/miniprogram/packageCloud/pages/doc-web-view/doc-web-view.json
similarity index 100%
rename from miniprogram/page/cloud/pages/doc-web-view/doc-web-view.json
rename to miniprogram/packageCloud/pages/doc-web-view/doc-web-view.json
diff --git a/miniprogram/page/cloud/pages/doc-web-view/doc-web-view.wxml b/miniprogram/packageCloud/pages/doc-web-view/doc-web-view.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/doc-web-view/doc-web-view.wxml
rename to miniprogram/packageCloud/pages/doc-web-view/doc-web-view.wxml
diff --git a/miniprogram/page/cloud/pages/doc-web-view/doc-web-view.wxss b/miniprogram/packageCloud/pages/doc-web-view/doc-web-view.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/doc-web-view/doc-web-view.wxss
rename to miniprogram/packageCloud/pages/doc-web-view/doc-web-view.wxss
diff --git a/miniprogram/page/cloud/pages/download-file/download-file.js b/miniprogram/packageCloud/pages/download-file/download-file.js
similarity index 93%
rename from miniprogram/page/cloud/pages/download-file/download-file.js
rename to miniprogram/packageCloud/pages/download-file/download-file.js
index 3ba95aa8..6ccaad90 100644
--- a/miniprogram/page/cloud/pages/download-file/download-file.js
+++ b/miniprogram/packageCloud/pages/download-file/download-file.js
@@ -1,4 +1,4 @@
-const demoImageFileId = require('../../../../config').demoImageFileId
+const demoImageFileId = require('../../../config').demoImageFileId
// 参考文档:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-client-api/storage/downloadFile.html
diff --git a/miniprogram/page/cloud/pages/download-file/download-file.json b/miniprogram/packageCloud/pages/download-file/download-file.json
similarity index 100%
rename from miniprogram/page/cloud/pages/download-file/download-file.json
rename to miniprogram/packageCloud/pages/download-file/download-file.json
diff --git a/miniprogram/page/cloud/pages/download-file/download-file.wxml b/miniprogram/packageCloud/pages/download-file/download-file.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/download-file/download-file.wxml
rename to miniprogram/packageCloud/pages/download-file/download-file.wxml
diff --git a/miniprogram/page/cloud/pages/download-file/download-file.wxss b/miniprogram/packageCloud/pages/download-file/download-file.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/download-file/download-file.wxss
rename to miniprogram/packageCloud/pages/download-file/download-file.wxss
diff --git a/miniprogram/page/cloud/pages/get-temp-file-url/get-temp-file-url.js b/miniprogram/packageCloud/pages/get-temp-file-url/get-temp-file-url.js
similarity index 94%
rename from miniprogram/page/cloud/pages/get-temp-file-url/get-temp-file-url.js
rename to miniprogram/packageCloud/pages/get-temp-file-url/get-temp-file-url.js
index 8b1152e9..4b875a5b 100644
--- a/miniprogram/page/cloud/pages/get-temp-file-url/get-temp-file-url.js
+++ b/miniprogram/packageCloud/pages/get-temp-file-url/get-temp-file-url.js
@@ -1,4 +1,4 @@
-const demoImageFileId = require('../../../../config').demoImageFileId
+const demoImageFileId = require('../../../config').demoImageFileId
// 参考文档:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-client-api/storage/getTempFileURL.html
diff --git a/miniprogram/page/cloud/pages/get-temp-file-url/get-temp-file-url.json b/miniprogram/packageCloud/pages/get-temp-file-url/get-temp-file-url.json
similarity index 100%
rename from miniprogram/page/cloud/pages/get-temp-file-url/get-temp-file-url.json
rename to miniprogram/packageCloud/pages/get-temp-file-url/get-temp-file-url.json
diff --git a/miniprogram/page/cloud/pages/get-temp-file-url/get-temp-file-url.wxml b/miniprogram/packageCloud/pages/get-temp-file-url/get-temp-file-url.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/get-temp-file-url/get-temp-file-url.wxml
rename to miniprogram/packageCloud/pages/get-temp-file-url/get-temp-file-url.wxml
diff --git a/miniprogram/page/cloud/pages/get-temp-file-url/get-temp-file-url.wxss b/miniprogram/packageCloud/pages/get-temp-file-url/get-temp-file-url.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/get-temp-file-url/get-temp-file-url.wxss
rename to miniprogram/packageCloud/pages/get-temp-file-url/get-temp-file-url.wxss
diff --git a/miniprogram/page/cloud/pages/get-wx-context/get-wx-context.js b/miniprogram/packageCloud/pages/get-wx-context/get-wx-context.js
similarity index 100%
rename from miniprogram/page/cloud/pages/get-wx-context/get-wx-context.js
rename to miniprogram/packageCloud/pages/get-wx-context/get-wx-context.js
diff --git a/miniprogram/page/cloud/pages/get-wx-context/get-wx-context.json b/miniprogram/packageCloud/pages/get-wx-context/get-wx-context.json
similarity index 100%
rename from miniprogram/page/cloud/pages/get-wx-context/get-wx-context.json
rename to miniprogram/packageCloud/pages/get-wx-context/get-wx-context.json
diff --git a/miniprogram/page/cloud/pages/get-wx-context/get-wx-context.wxml b/miniprogram/packageCloud/pages/get-wx-context/get-wx-context.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/get-wx-context/get-wx-context.wxml
rename to miniprogram/packageCloud/pages/get-wx-context/get-wx-context.wxml
diff --git a/miniprogram/page/cloud/pages/get-wx-context/get-wx-context.wxss b/miniprogram/packageCloud/pages/get-wx-context/get-wx-context.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/get-wx-context/get-wx-context.wxss
rename to miniprogram/packageCloud/pages/get-wx-context/get-wx-context.wxss
diff --git a/miniprogram/page/cloud/pages/scf-database/scf-database.js b/miniprogram/packageCloud/pages/scf-database/scf-database.js
similarity index 88%
rename from miniprogram/page/cloud/pages/scf-database/scf-database.js
rename to miniprogram/packageCloud/pages/scf-database/scf-database.js
index 2c9fe2de..fd8412b6 100644
--- a/miniprogram/page/cloud/pages/scf-database/scf-database.js
+++ b/miniprogram/packageCloud/pages/scf-database/scf-database.js
@@ -14,7 +14,20 @@ Page({
serverDataCloud: '',
serverDataCloudError: false,
clientLoading: false,
- cloudLoading: false
+ cloudLoading: false,
+ theme: 'light'
+ },
+
+ onLoad() {
+ this.setData({
+ theme: wx.getSystemInfoSync().theme || 'light'
+ })
+
+ if (wx.onThemeChange) {
+ wx.onThemeChange(({ theme }) => {
+ this.setData({ theme })
+ })
+ }
},
queryServerDataViaClient() {
diff --git a/miniprogram/page/cloud/pages/scf-database/scf-database.json b/miniprogram/packageCloud/pages/scf-database/scf-database.json
similarity index 100%
rename from miniprogram/page/cloud/pages/scf-database/scf-database.json
rename to miniprogram/packageCloud/pages/scf-database/scf-database.json
diff --git a/miniprogram/page/cloud/pages/scf-database/scf-database.wxml b/miniprogram/packageCloud/pages/scf-database/scf-database.wxml
similarity index 69%
rename from miniprogram/page/cloud/pages/scf-database/scf-database.wxml
rename to miniprogram/packageCloud/pages/scf-database/scf-database.wxml
index 06e1b6bc..346f2d8e 100644
--- a/miniprogram/page/cloud/pages/scf-database/scf-database.wxml
+++ b/miniprogram/packageCloud/pages/scf-database/scf-database.wxml
@@ -13,9 +13,11 @@
-
+
+
-
+
+
@@ -39,11 +41,14 @@
-
+
+
-
+
+
-
+
+
diff --git a/miniprogram/page/cloud/pages/scf-database/scf-database.wxss b/miniprogram/packageCloud/pages/scf-database/scf-database.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/scf-database/scf-database.wxss
rename to miniprogram/packageCloud/pages/scf-database/scf-database.wxss
diff --git a/miniprogram/page/cloud/pages/scf-openapi/scf-openapi.js b/miniprogram/packageCloud/pages/scf-openapi/scf-openapi.js
similarity index 93%
rename from miniprogram/page/cloud/pages/scf-openapi/scf-openapi.js
rename to miniprogram/packageCloud/pages/scf-openapi/scf-openapi.js
index 50788a65..3152dd1e 100644
--- a/miniprogram/page/cloud/pages/scf-openapi/scf-openapi.js
+++ b/miniprogram/packageCloud/pages/scf-openapi/scf-openapi.js
@@ -15,6 +15,19 @@ Page({
getWXACodeError: false,
sendTemplateMessageLoading: false,
getWXACodeLoading: false,
+ theme: 'light'
+ },
+
+ onLoad() {
+ this.setData({
+ theme: wx.getSystemInfoSync().theme || 'light'
+ })
+
+ if (wx.onThemeChange) {
+ wx.onThemeChange(({ theme }) => {
+ this.setData({ theme })
+ })
+ }
},
sendTemplateMessageViaCloudFunction(e) {
diff --git a/miniprogram/page/cloud/pages/scf-openapi/scf-openapi.json b/miniprogram/packageCloud/pages/scf-openapi/scf-openapi.json
similarity index 100%
rename from miniprogram/page/cloud/pages/scf-openapi/scf-openapi.json
rename to miniprogram/packageCloud/pages/scf-openapi/scf-openapi.json
diff --git a/miniprogram/page/cloud/pages/scf-openapi/scf-openapi.wxml b/miniprogram/packageCloud/pages/scf-openapi/scf-openapi.wxml
similarity index 72%
rename from miniprogram/page/cloud/pages/scf-openapi/scf-openapi.wxml
rename to miniprogram/packageCloud/pages/scf-openapi/scf-openapi.wxml
index ccade0ad..1a5c8315 100644
--- a/miniprogram/page/cloud/pages/scf-openapi/scf-openapi.wxml
+++ b/miniprogram/packageCloud/pages/scf-openapi/scf-openapi.wxml
@@ -16,11 +16,14 @@
-
+
+
-
+
+
-
+
+
@@ -46,9 +49,11 @@
-
+
+
-
+
+
diff --git a/miniprogram/page/cloud/pages/scf-openapi/scf-openapi.wxss b/miniprogram/packageCloud/pages/scf-openapi/scf-openapi.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/scf-openapi/scf-openapi.wxss
rename to miniprogram/packageCloud/pages/scf-openapi/scf-openapi.wxss
diff --git a/miniprogram/page/cloud/pages/scf-storage/scf-storage.js b/miniprogram/packageCloud/pages/scf-storage/scf-storage.js
similarity index 94%
rename from miniprogram/page/cloud/pages/scf-storage/scf-storage.js
rename to miniprogram/packageCloud/pages/scf-storage/scf-storage.js
index a72fdedb..3cf89772 100644
--- a/miniprogram/page/cloud/pages/scf-storage/scf-storage.js
+++ b/miniprogram/packageCloud/pages/scf-storage/scf-storage.js
@@ -1,4 +1,4 @@
-const demoImageFileId = require('../../../../config').demoImageFileId
+const demoImageFileId = require('../../../config').demoImageFileId
// 参考文档:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-server-api/storage/
diff --git a/miniprogram/page/cloud/pages/scf-storage/scf-storage.json b/miniprogram/packageCloud/pages/scf-storage/scf-storage.json
similarity index 100%
rename from miniprogram/page/cloud/pages/scf-storage/scf-storage.json
rename to miniprogram/packageCloud/pages/scf-storage/scf-storage.json
diff --git a/miniprogram/page/cloud/pages/scf-storage/scf-storage.wxml b/miniprogram/packageCloud/pages/scf-storage/scf-storage.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/scf-storage/scf-storage.wxml
rename to miniprogram/packageCloud/pages/scf-storage/scf-storage.wxml
diff --git a/miniprogram/page/cloud/pages/scf-storage/scf-storage.wxss b/miniprogram/packageCloud/pages/scf-storage/scf-storage.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/scf-storage/scf-storage.wxss
rename to miniprogram/packageCloud/pages/scf-storage/scf-storage.wxss
diff --git a/miniprogram/page/cloud/pages/server-date/server-date.js b/miniprogram/packageCloud/pages/server-date/server-date.js
similarity index 98%
rename from miniprogram/page/cloud/pages/server-date/server-date.js
rename to miniprogram/packageCloud/pages/server-date/server-date.js
index 1b2b4016..e8ca2b19 100644
--- a/miniprogram/page/cloud/pages/server-date/server-date.js
+++ b/miniprogram/packageCloud/pages/server-date/server-date.js
@@ -1,4 +1,4 @@
-const util = require('../../../../util/util.js')
+const util = require('../../../util/util.js')
// 参考文档:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-client-api/database/db.serverDate.html
diff --git a/miniprogram/page/cloud/pages/server-date/server-date.json b/miniprogram/packageCloud/pages/server-date/server-date.json
similarity index 100%
rename from miniprogram/page/cloud/pages/server-date/server-date.json
rename to miniprogram/packageCloud/pages/server-date/server-date.json
diff --git a/miniprogram/page/cloud/pages/server-date/server-date.wxml b/miniprogram/packageCloud/pages/server-date/server-date.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/server-date/server-date.wxml
rename to miniprogram/packageCloud/pages/server-date/server-date.wxml
diff --git a/miniprogram/page/cloud/pages/server-date/server-date.wxss b/miniprogram/packageCloud/pages/server-date/server-date.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/server-date/server-date.wxss
rename to miniprogram/packageCloud/pages/server-date/server-date.wxss
diff --git a/miniprogram/page/cloud/pages/upload-file/upload-file.js b/miniprogram/packageCloud/pages/upload-file/upload-file.js
similarity index 100%
rename from miniprogram/page/cloud/pages/upload-file/upload-file.js
rename to miniprogram/packageCloud/pages/upload-file/upload-file.js
diff --git a/miniprogram/page/cloud/pages/upload-file/upload-file.json b/miniprogram/packageCloud/pages/upload-file/upload-file.json
similarity index 100%
rename from miniprogram/page/cloud/pages/upload-file/upload-file.json
rename to miniprogram/packageCloud/pages/upload-file/upload-file.json
diff --git a/miniprogram/page/cloud/pages/upload-file/upload-file.wxml b/miniprogram/packageCloud/pages/upload-file/upload-file.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/upload-file/upload-file.wxml
rename to miniprogram/packageCloud/pages/upload-file/upload-file.wxml
diff --git a/miniprogram/page/cloud/pages/upload-file/upload-file.wxss b/miniprogram/packageCloud/pages/upload-file/upload-file.wxss
similarity index 79%
rename from miniprogram/page/cloud/pages/upload-file/upload-file.wxss
rename to miniprogram/packageCloud/pages/upload-file/upload-file.wxss
index d438159b..796be7c4 100644
--- a/miniprogram/page/cloud/pages/upload-file/upload-file.wxss
+++ b/miniprogram/packageCloud/pages/upload-file/upload-file.wxss
@@ -10,8 +10,8 @@
box-sizing: border-box;
padding: 30rpx;
height: 420rpx;
- border-top: 1rpx solid #D9D9D9;
- border-bottom: 1rpx solid #D9D9D9;
+ border-top: 1rpx solid var(--weui-FG-3);
+ border-bottom: 1rpx solid var(--weui-FG-3);
align-items: center;
justify-content: center;
}
diff --git a/miniprogram/page/cloud/pages/user-authentication/user-authentication.js b/miniprogram/packageCloud/pages/user-authentication/user-authentication.js
similarity index 100%
rename from miniprogram/page/cloud/pages/user-authentication/user-authentication.js
rename to miniprogram/packageCloud/pages/user-authentication/user-authentication.js
diff --git a/miniprogram/page/cloud/pages/user-authentication/user-authentication.json b/miniprogram/packageCloud/pages/user-authentication/user-authentication.json
similarity index 100%
rename from miniprogram/page/cloud/pages/user-authentication/user-authentication.json
rename to miniprogram/packageCloud/pages/user-authentication/user-authentication.json
diff --git a/miniprogram/page/cloud/pages/user-authentication/user-authentication.wxml b/miniprogram/packageCloud/pages/user-authentication/user-authentication.wxml
similarity index 100%
rename from miniprogram/page/cloud/pages/user-authentication/user-authentication.wxml
rename to miniprogram/packageCloud/pages/user-authentication/user-authentication.wxml
diff --git a/miniprogram/page/cloud/pages/user-authentication/user-authentication.wxss b/miniprogram/packageCloud/pages/user-authentication/user-authentication.wxss
similarity index 100%
rename from miniprogram/page/cloud/pages/user-authentication/user-authentication.wxss
rename to miniprogram/packageCloud/pages/user-authentication/user-authentication.wxss
diff --git a/miniprogram/packageCloud/resources/db_dump/perm1.json b/miniprogram/packageCloud/resources/db_dump/perm1.json
new file mode 100644
index 00000000..434a3d5e
--- /dev/null
+++ b/miniprogram/packageCloud/resources/db_dump/perm1.json
@@ -0,0 +1 @@
+{"_openid":"kiki","whatsUp":"心情美美哒"}
diff --git a/miniprogram/packageCloud/resources/db_dump/perm2.json b/miniprogram/packageCloud/resources/db_dump/perm2.json
new file mode 100644
index 00000000..bd209f23
--- /dev/null
+++ b/miniprogram/packageCloud/resources/db_dump/perm2.json
@@ -0,0 +1 @@
+{"_openid":"popo","email":"popo@weixin.qq.com"}
diff --git a/miniprogram/packageCloud/resources/db_dump/perm3.json b/miniprogram/packageCloud/resources/db_dump/perm3.json
new file mode 100644
index 00000000..19095d12
--- /dev/null
+++ b/miniprogram/packageCloud/resources/db_dump/perm3.json
@@ -0,0 +1 @@
+{"_openid":"admin","price":"58","name":"微信气泡狗抱枕"}
diff --git a/miniprogram/packageCloud/resources/db_dump/perm4.json b/miniprogram/packageCloud/resources/db_dump/perm4.json
new file mode 100644
index 00000000..7ce078d9
--- /dev/null
+++ b/miniprogram/packageCloud/resources/db_dump/perm4.json
@@ -0,0 +1 @@
+{"_openid":"server","data":"DEMO_SERVER_DATA"}
diff --git a/miniprogram/packageCloud/resources/kind/database.png b/miniprogram/packageCloud/resources/kind/database.png
new file mode 100644
index 00000000..c0d3cbcd
Binary files /dev/null and b/miniprogram/packageCloud/resources/kind/database.png differ
diff --git a/miniprogram/packageCloud/resources/kind/database_dark.png b/miniprogram/packageCloud/resources/kind/database_dark.png
new file mode 100644
index 00000000..93913e53
Binary files /dev/null and b/miniprogram/packageCloud/resources/kind/database_dark.png differ
diff --git a/miniprogram/packageCloud/resources/kind/logo.png b/miniprogram/packageCloud/resources/kind/logo.png
new file mode 100644
index 00000000..e5345b2e
Binary files /dev/null and b/miniprogram/packageCloud/resources/kind/logo.png differ
diff --git a/miniprogram/packageCloud/resources/kind/scf.png b/miniprogram/packageCloud/resources/kind/scf.png
new file mode 100644
index 00000000..41fd7193
Binary files /dev/null and b/miniprogram/packageCloud/resources/kind/scf.png differ
diff --git a/miniprogram/packageCloud/resources/kind/scf_dark.png b/miniprogram/packageCloud/resources/kind/scf_dark.png
new file mode 100644
index 00000000..5bca30a5
Binary files /dev/null and b/miniprogram/packageCloud/resources/kind/scf_dark.png differ
diff --git a/miniprogram/packageCloud/resources/kind/storage.png b/miniprogram/packageCloud/resources/kind/storage.png
new file mode 100644
index 00000000..03e528b6
Binary files /dev/null and b/miniprogram/packageCloud/resources/kind/storage.png differ
diff --git a/miniprogram/packageCloud/resources/kind/storage_dark.png b/miniprogram/packageCloud/resources/kind/storage_dark.png
new file mode 100644
index 00000000..c9ccfc8c
Binary files /dev/null and b/miniprogram/packageCloud/resources/kind/storage_dark.png differ
diff --git a/miniprogram/packageCloud/resources/kind/user.png b/miniprogram/packageCloud/resources/kind/user.png
new file mode 100644
index 00000000..ea286431
Binary files /dev/null and b/miniprogram/packageCloud/resources/kind/user.png differ
diff --git a/miniprogram/packageCloud/resources/kind/user_dark.png b/miniprogram/packageCloud/resources/kind/user_dark.png
new file mode 100644
index 00000000..0af62e2f
Binary files /dev/null and b/miniprogram/packageCloud/resources/kind/user_dark.png differ
diff --git a/miniprogram/page/API/index.js b/miniprogram/page/API/index.js
index be3d23e2..daab6e92 100644
--- a/miniprogram/page/API/index.js
+++ b/miniprogram/page/API/index.js
@@ -32,8 +32,8 @@ Page({
zh: '客服消息',
url: 'custom-message/custom-message'
}, {
- zh: '模板消息',
- url: 'template-message/template-message'
+ zh: '订阅消息',
+ url: 'subscribe-message/subscribe-message'
}, {
zh: '收货地址',
url: 'choose-address/choose-address'
@@ -108,6 +108,9 @@ Page({
}, {
zh: '获取手机系统信息',
url: 'get-system-info/get-system-info'
+ }, {
+ zh: '获取手机设备电量',
+ url: 'get-battery-info/get-battery-info'
}, {
zh: '监听重力感应数据',
url: 'on-accelerometer-change/on-accelerometer-change'
@@ -146,6 +149,16 @@ Page({
url: 'wifi/wifi'
}
]
+ }, {
+ id: 'performance',
+ name: '性能',
+ open: false,
+ pages: [
+ {
+ zh: '获取性能数据',
+ url: 'get-performance/get-performance'
+ }
+ ]
}, {
id: 'network',
name: '网络',
@@ -163,6 +176,12 @@ Page({
}, {
zh: '下载文件',
url: 'download-file/download-file'
+ }, {
+ zh: 'UDPSocket',
+ url: 'udp-socket/udp-socket'
+ },{
+ zh: 'mDNS',
+ url: 'mdns/mdns'
}
]
}, {
@@ -173,6 +192,9 @@ Page({
{
zh: '图片',
url: 'image/image'
+ }, {
+ zh: '音频',
+ url: 'audio/audio'
}, {
zh: '录音',
url: 'voice/voice'
@@ -185,7 +207,10 @@ Page({
}, {
zh: '视频',
url: 'video/video'
- }, {
+ },{
+ zh: '音视频合成',
+ url: 'media-container/media-container'
+ },{
zh: '动态加载字体',
url: 'load-font-face/load-font-face'
}
@@ -209,14 +234,49 @@ Page({
}, {
id: 'storage',
name: '数据',
- url: 'storage/storage'
+ pages: [{
+ zh: '本地存储',
+ url: 'storage/storage'
+ }, {
+ zh: '周期性更新',
+ url: 'get-background-fetch-data/get-background-fetch-data'
+
+ }, {
+ zh: '数据预拉取',
+ url: 'get-background-prefetch-data/get-background-prefetch-data'
+ }],
}, {
id: 'worker',
name: '多线程',
url: 'worker/worker'
+ }, {
+ id: 'framework',
+ name: '框架',
+ pages: [{
+ zh: '双向绑定',
+ url: 'two-way-bindings/two-way-bindings',
+ }, {
+ zh: 'WXS',
+ url: 'wxs/wxs'
+ }, {
+ zh: '屏幕旋转',
+ url: 'resizable/resizable'
+ }]
}
],
isSetTabBarPage: false,
+ theme: 'light'
+ },
+ onLoad() {
+ this.setData({
+ theme: wx.getSystemInfoSync().theme || 'light'
+ })
+
+ if (wx.onThemeChange) {
+ wx.onThemeChange(({ theme }) => {
+ this.setData({ theme })
+ })
+ }
},
onShow() {
this.leaveSetTabBarPage()
@@ -231,7 +291,7 @@ Page({
if (list[i].id === id) {
if (list[i].url) {
wx.navigateTo({
- url: 'pages/' + list[i].url
+ url: '../../packageAPI/pages/' + list[i].url
})
return
}
diff --git a/miniprogram/page/API/index.wxml b/miniprogram/page/API/index.wxml
index 28aabbdc..a3118c7a 100644
--- a/miniprogram/page/API/index.wxml
+++ b/miniprogram/page/API/index.wxml
@@ -10,12 +10,13 @@
{{item.name}}
-
+
+
-
+
{{page.zh}}
diff --git a/miniprogram/page/API/index.wxss b/miniprogram/page/API/index.wxss
index 1557ca95..1db1d39b 100644
--- a/miniprogram/page/API/index.wxss
+++ b/miniprogram/page/API/index.wxss
@@ -2,5 +2,5 @@
.weui-agree__link {
display: inline;
- color: #586c94;
+ color: var(--weui-LINK);
}
diff --git a/miniprogram/page/API/pages/animation/animation.js b/miniprogram/page/API/pages/animation/animation.js
deleted file mode 100644
index e0cceda3..00000000
--- a/miniprogram/page/API/pages/animation/animation.js
+++ /dev/null
@@ -1,64 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '动画',
- path: 'page/API/pages/animation/animation'
- }
- },
-
- onReady() {
- this.animation = wx.createAnimation()
- },
- rotate() {
- this.animation.rotate(Math.random() * 720 - 360).step()
- this.setData({animation: this.animation.export()})
- },
- scale() {
- this.animation.scale(Math.random() * 2).step()
- this.setData({animation: this.animation.export()})
- },
- translate() {
- this.animation.translate(Math.random() * 100 - 50, Math.random() * 100 - 50).step()
- this.setData({animation: this.animation.export()})
- },
- skew() {
- this.animation.skew(Math.random() * 90, Math.random() * 90).step()
- this.setData({animation: this.animation.export()})
- },
- rotateAndScale() {
- this.animation.rotate(Math.random() * 720 - 360)
- .scale(Math.random() * 2)
- .step()
- this.setData({animation: this.animation.export()})
- },
- rotateThenScale() {
- this.animation.rotate(Math.random() * 720 - 360).step()
- .scale(Math.random() * 2).step()
- this.setData({animation: this.animation.export()})
- },
- all() {
- this.animation.rotate(Math.random() * 720 - 360)
- .scale(Math.random() * 2)
- .translate(Math.random() * 100 - 50, Math.random() * 100 - 50)
- .skew(Math.random() * 90, Math.random() * 90)
- .step()
- this.setData({animation: this.animation.export()})
- },
- allInQueue() {
- this.animation.rotate(Math.random() * 720 - 360).step()
- .scale(Math.random() * 2).step()
- .translate(Math.random() * 100 - 50, Math.random() * 100 - 50)
- .step()
- .skew(Math.random() * 90, Math.random() * 90)
- .step()
- this.setData({animation: this.animation.export()})
- },
- reset() {
- this.animation.rotate(0, 0)
- .scale(1)
- .translate(0, 0)
- .skew(0, 0)
- .step({duration: 0})
- this.setData({animation: this.animation.export()})
- }
-})
diff --git a/miniprogram/page/API/pages/animation/animation.wxml b/miniprogram/page/API/pages/animation/animation.wxml
deleted file mode 100644
index fc8bae1a..00000000
--- a/miniprogram/page/API/pages/animation/animation.wxml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/page/API/pages/background-audio/background-audio.js b/miniprogram/page/API/pages/background-audio/background-audio.js
deleted file mode 100644
index 4cfb0c3a..00000000
--- a/miniprogram/page/API/pages/background-audio/background-audio.js
+++ /dev/null
@@ -1,100 +0,0 @@
-const app = getApp()
-const util = require('../../../../util/util.js')
-
-const dataUrl = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E061FF02C31F716658E5C81F5594D561F2E88B854E81CAAB7806D5E4F103E55D33C16F3FAC506D1AB172DE8600B37E43FAD&fromtag=46'
-Page({
- onShareAppMessage() {
- return {
- title: '背景音乐',
- path: 'page/API/pages/background-audio/background-audio'
- }
- },
-
- onLoad() {
- this._enableInterval()
-
- if (app.globalData.backgroundAudioPlaying) {
- this.setData({
- playing: true
- })
- }
- },
- data: {
- playing: false,
- playTime: 0,
- formatedPlayTime: '00:00:00'
- },
- play() {
- const that = this
- wx.playBackgroundAudio({
- dataUrl,
- title: '此时此刻',
- coverImgUrl: 'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000',
- complete() {
- that.setData({
- playing: true
- })
- }
- })
- this._enableInterval()
- app.globalData.backgroundAudioPlaying = true
- },
- seek(e) {
- clearInterval(this.updateInterval)
- const that = this
- wx.seekBackgroundAudio({
- position: e.detail.value,
- complete() {
- // 实际会延迟两秒左右才跳过去
- setTimeout(function () {
- that._enableInterval()
- }, 2000)
- }
- })
- },
- pause() {
- const that = this
- wx.pauseBackgroundAudio({
- dataUrl,
- success() {
- that.setData({
- playing: false
- })
- }
- })
- app.globalData.backgroundAudioPlaying = false
- },
- stop() {
- const that = this
- wx.stopBackgroundAudio({
- dataUrl,
- success() {
- that.setData({
- playing: false,
- playTime: 0,
- formatedPlayTime: util.formatTime(0)
- })
- }
- })
- app.globalData.backgroundAudioPlaying = false
- },
- _enableInterval() {
- const that = this
- function update() {
- wx.getBackgroundAudioPlayerState({
- success(res) {
- that.setData({
- playTime: res.currentPosition,
- formatedPlayTime: util.formatTime(res.currentPosition + 1)
- })
- }
- })
- }
-
- update()
- this.updateInterval = setInterval(update, 500)
- },
- onUnload() {
- clearInterval(this.updateInterval)
- }
-})
diff --git a/miniprogram/page/API/pages/background-audio/background-audio.json b/miniprogram/page/API/pages/background-audio/background-audio.json
deleted file mode 100644
index a4aa711e..00000000
--- a/miniprogram/page/API/pages/background-audio/background-audio.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "navigationBarTitleText": "背景音乐"
-}
diff --git a/miniprogram/page/API/pages/custom-service/custom-service.js b/miniprogram/page/API/pages/custom-service/custom-service.js
deleted file mode 100644
index ba768046..00000000
--- a/miniprogram/page/API/pages/custom-service/custom-service.js
+++ /dev/null
@@ -1 +0,0 @@
-Page({})
diff --git a/miniprogram/page/API/pages/download-file/download-file.js b/miniprogram/page/API/pages/download-file/download-file.js
deleted file mode 100644
index aeeb248d..00000000
--- a/miniprogram/page/API/pages/download-file/download-file.js
+++ /dev/null
@@ -1,28 +0,0 @@
-const downloadExampleUrl = require('../../../../config').downloadExampleUrl
-
-Page({
- onShareAppMessage() {
- return {
- title: '下载文件',
- path: 'page/API/pages/download-file/download-file'
- }
- },
-
- downloadImage() {
- const self = this
-
- wx.downloadFile({
- url: downloadExampleUrl,
- success(res) {
- console.log('downloadFile success, res is', res)
-
- self.setData({
- imageSrc: res.tempFilePath
- })
- },
- fail({errMsg}) {
- console.log('downloadFile fail, err is:', errMsg)
- }
- })
- }
-})
diff --git a/miniprogram/page/API/pages/pull-down-refresh/pull-down-refresh.json b/miniprogram/page/API/pages/pull-down-refresh/pull-down-refresh.json
deleted file mode 100644
index 3e593091..00000000
--- a/miniprogram/page/API/pages/pull-down-refresh/pull-down-refresh.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "下拉刷新",
- "enablePullDownRefresh": true
-}
diff --git a/miniprogram/page/API/pages/request-payment/request-payment.js b/miniprogram/page/API/pages/request-payment/request-payment.js
deleted file mode 100644
index 11853d51..00000000
--- a/miniprogram/page/API/pages/request-payment/request-payment.js
+++ /dev/null
@@ -1,56 +0,0 @@
-const paymentUrl = require('../../../../config').paymentUrl
-
-const app = getApp()
-
-Page({
- onShareAppMessage() {
- return {
- title: '发起支付',
- path: 'page/API/pages/request-payment/request-payment'
- }
- },
-
- onLoad() {},
-
- requestPayment() {
- const self = this
-
- self.setData({
- loading: true
- })
-
- // 此处需要先调用wx.login方法获取code,然后在服务端调用微信接口使用code换取下单用户的openId
- // 具体文档参考https://mp.weixin.qq.com/debug/wxadoc/dev/api/api-login.html?t=20161230#wxloginobject
- app.getUserOpenId(function (err, openid) {
- if (!err) {
- wx.request({
- url: paymentUrl,
- data: {
- openid
- },
- method: 'POST',
- success(res) {
- console.log('unified order success, response is:', res)
- const payargs = res.data.payargs
- wx.requestPayment({
- timeStamp: payargs.timeStamp,
- nonceStr: payargs.nonceStr,
- package: payargs.package,
- signType: payargs.signType,
- paySign: payargs.paySign
- })
-
- self.setData({
- loading: false
- })
- }
- })
- } else {
- console.log('err:', err)
- self.setData({
- loading: false
- })
- }
- })
- }
-})
diff --git a/miniprogram/page/API/pages/sendMessage/sendMessage.js b/miniprogram/page/API/pages/sendMessage/sendMessage.js
deleted file mode 100644
index ba768046..00000000
--- a/miniprogram/page/API/pages/sendMessage/sendMessage.js
+++ /dev/null
@@ -1 +0,0 @@
-Page({})
diff --git a/miniprogram/page/API/pages/voice/voice.js b/miniprogram/page/API/pages/voice/voice.js
deleted file mode 100644
index 17042b3a..00000000
--- a/miniprogram/page/API/pages/voice/voice.js
+++ /dev/null
@@ -1,135 +0,0 @@
-const util = require('../../../../util/util.js')
-
-let playTimeInterval
-let recordTimeInterval
-
-Page({
- onShareAppMessage() {
- return {
- title: '录音',
- path: 'page/API/pages/voice/voice'
- }
- },
-
- data: {
- recording: false,
- playing: false,
- hasRecord: false,
- recordTime: 0,
- playTime: 0,
- formatedRecordTime: '00:00:00',
- formatedPlayTime: '00:00:00'
- },
-
- onHide() {
- if (this.data.playing) {
- this.stopVoice()
- } else if (this.data.recording) {
- this.stopRecordUnexpectedly()
- }
- },
-
- startRecord() {
- this.setData({recording: true})
-
- const that = this
- recordTimeInterval = setInterval(function () {
- const recordTime = that.data.recordTime += 1
- that.setData({
- formatedRecordTime: util.formatTime(that.data.recordTime),
- recordTime
- })
- }, 1000)
-
- wx.startRecord({
- success(res) {
- that.setData({
- hasRecord: true,
- tempFilePath: res.tempFilePath,
- formatedPlayTime: util.formatTime(that.data.playTime)
- })
- },
- complete() {
- that.setData({recording: false})
- clearInterval(recordTimeInterval)
- }
- })
- },
-
- stopRecord() {
- wx.stopRecord()
- },
-
- stopRecordUnexpectedly() {
- const that = this
- wx.stopRecord({
- success() {
- console.log('stop record success')
- clearInterval(recordTimeInterval)
- that.setData({
- recording: false,
- hasRecord: false,
- recordTime: 0,
- formatedRecordTime: util.formatTime(0)
- })
- }
- })
- },
-
- playVoice() {
- const that = this
- playTimeInterval = setInterval(function () {
- const playTime = that.data.playTime + 1
- console.log('update playTime', playTime)
- that.setData({
- playing: true,
- formatedPlayTime: util.formatTime(playTime),
- playTime
- })
- }, 1000)
- wx.playVoice({
- filePath: this.data.tempFilePath,
- success() {
- clearInterval(playTimeInterval)
- const playTime = 0
- console.log('play voice finished')
- that.setData({
- playing: false,
- formatedPlayTime: util.formatTime(playTime),
- playTime
- })
- }
- })
- },
-
- pauseVoice() {
- clearInterval(playTimeInterval)
- wx.pauseVoice()
- this.setData({
- playing: false
- })
- },
-
- stopVoice() {
- clearInterval(playTimeInterval)
- this.setData({
- playing: false,
- formatedPlayTime: util.formatTime(0),
- playTime: 0
- })
- wx.stopVoice()
- },
-
- clear() {
- clearInterval(playTimeInterval)
- wx.stopVoice()
- this.setData({
- playing: false,
- hasRecord: false,
- tempFilePath: '',
- formatedRecordTime: util.formatTime(0),
- recordTime: 0,
- playTime: 0
- })
- }
-})
diff --git a/miniprogram/page/API/resources/kind/api_dark.png b/miniprogram/page/API/resources/kind/api_dark.png
new file mode 100644
index 00000000..a01b62ee
Binary files /dev/null and b/miniprogram/page/API/resources/kind/api_dark.png differ
diff --git a/miniprogram/page/API/resources/kind/device_dark.png b/miniprogram/page/API/resources/kind/device_dark.png
new file mode 100644
index 00000000..c30fc531
Binary files /dev/null and b/miniprogram/page/API/resources/kind/device_dark.png differ
diff --git a/miniprogram/page/API/resources/kind/feedback_dark.png b/miniprogram/page/API/resources/kind/feedback_dark.png
new file mode 100644
index 00000000..e5134fa6
Binary files /dev/null and b/miniprogram/page/API/resources/kind/feedback_dark.png differ
diff --git a/miniprogram/page/API/resources/kind/framework.png b/miniprogram/page/API/resources/kind/framework.png
new file mode 100644
index 00000000..1ff282c4
Binary files /dev/null and b/miniprogram/page/API/resources/kind/framework.png differ
diff --git a/miniprogram/page/API/resources/kind/framework_dark.png b/miniprogram/page/API/resources/kind/framework_dark.png
new file mode 100644
index 00000000..c30fc531
Binary files /dev/null and b/miniprogram/page/API/resources/kind/framework_dark.png differ
diff --git a/miniprogram/page/API/resources/kind/location_dark.png b/miniprogram/page/API/resources/kind/location_dark.png
new file mode 100644
index 00000000..12febb65
Binary files /dev/null and b/miniprogram/page/API/resources/kind/location_dark.png differ
diff --git a/miniprogram/page/API/resources/kind/logo.png b/miniprogram/page/API/resources/kind/logo.png
index 863f5358..9cfa655e 100644
Binary files a/miniprogram/page/API/resources/kind/logo.png and b/miniprogram/page/API/resources/kind/logo.png differ
diff --git a/miniprogram/page/API/resources/kind/media_dark.png b/miniprogram/page/API/resources/kind/media_dark.png
new file mode 100644
index 00000000..49abc9c2
Binary files /dev/null and b/miniprogram/page/API/resources/kind/media_dark.png differ
diff --git a/miniprogram/page/API/resources/kind/network_dark.png b/miniprogram/page/API/resources/kind/network_dark.png
new file mode 100644
index 00000000..51699e9b
Binary files /dev/null and b/miniprogram/page/API/resources/kind/network_dark.png differ
diff --git a/miniprogram/page/API/resources/kind/page_dark.png b/miniprogram/page/API/resources/kind/page_dark.png
new file mode 100644
index 00000000..f81d3d0c
Binary files /dev/null and b/miniprogram/page/API/resources/kind/page_dark.png differ
diff --git a/miniprogram/page/API/resources/kind/performance.png b/miniprogram/page/API/resources/kind/performance.png
new file mode 100644
index 00000000..8f08fc28
Binary files /dev/null and b/miniprogram/page/API/resources/kind/performance.png differ
diff --git a/miniprogram/page/API/resources/kind/performance_dark.png b/miniprogram/page/API/resources/kind/performance_dark.png
new file mode 100644
index 00000000..99edb26a
Binary files /dev/null and b/miniprogram/page/API/resources/kind/performance_dark.png differ
diff --git a/miniprogram/page/API/resources/kind/storage_dark.png b/miniprogram/page/API/resources/kind/storage_dark.png
new file mode 100644
index 00000000..99edb26a
Binary files /dev/null and b/miniprogram/page/API/resources/kind/storage_dark.png differ
diff --git a/miniprogram/page/API/resources/kind/worker_dark.png b/miniprogram/page/API/resources/kind/worker_dark.png
new file mode 100644
index 00000000..2aadd797
Binary files /dev/null and b/miniprogram/page/API/resources/kind/worker_dark.png differ
diff --git a/miniprogram/page/cloud/index.js b/miniprogram/page/cloud/index.js
index 93967123..642aa229 100644
--- a/miniprogram/page/cloud/index.js
+++ b/miniprogram/page/cloud/index.js
@@ -77,15 +77,29 @@ Page({
]
}
],
+ theme: 'light'
+ },
+ onLoad() {
+ this.setData({
+ theme: wx.getSystemInfoSync().theme || 'light'
+ })
+
+ if (wx.onThemeChange) {
+ wx.onThemeChange(({ theme }) => {
+ this.setData({ theme })
+ })
+ }
},
kindToggle(e) {
- const id = e.currentTarget.id; const
- list = this.data.list
+ const id = e.currentTarget.id;
+ const list = this.data.list
+ console.log(id, list)
for (let i = 0, len = list.length; i < len; ++i) {
if (list[i].id === id) {
if (list[i].url) {
+ console.log(list[i].url)
wx.navigateTo({
- url: 'pages/' + list[i].url
+ url: '../../packageCloud/pages/' + list[i].url
})
return
}
diff --git a/miniprogram/page/cloud/index.wxml b/miniprogram/page/cloud/index.wxml
index 89e47324..0a1d114a 100644
--- a/miniprogram/page/cloud/index.wxml
+++ b/miniprogram/page/cloud/index.wxml
@@ -1,7 +1,7 @@
- 以下将演示小程序云开发能力,具体属性参数详见 小程序开发文档。
+ 以下将演示小程序云开发能力,具体属性参数详见 小程序开发文档。
@@ -9,12 +9,13 @@
{{item.name}}
-
+
+
-
+
{{page.zh}}
diff --git a/miniprogram/page/cloud/index.wxss b/miniprogram/page/cloud/index.wxss
index 1557ca95..1db1d39b 100644
--- a/miniprogram/page/cloud/index.wxss
+++ b/miniprogram/page/cloud/index.wxss
@@ -2,5 +2,5 @@
.weui-agree__link {
display: inline;
- color: #586c94;
+ color: var(--weui-LINK);
}
diff --git a/miniprogram/page/cloud/resources/kind/database_dark.png b/miniprogram/page/cloud/resources/kind/database_dark.png
new file mode 100644
index 00000000..93913e53
Binary files /dev/null and b/miniprogram/page/cloud/resources/kind/database_dark.png differ
diff --git a/miniprogram/page/cloud/resources/kind/scf_dark.png b/miniprogram/page/cloud/resources/kind/scf_dark.png
new file mode 100644
index 00000000..5bca30a5
Binary files /dev/null and b/miniprogram/page/cloud/resources/kind/scf_dark.png differ
diff --git a/miniprogram/page/cloud/resources/kind/storage_dark.png b/miniprogram/page/cloud/resources/kind/storage_dark.png
new file mode 100644
index 00000000..c9ccfc8c
Binary files /dev/null and b/miniprogram/page/cloud/resources/kind/storage_dark.png differ
diff --git a/miniprogram/page/cloud/resources/kind/user_dark.png b/miniprogram/page/cloud/resources/kind/user_dark.png
new file mode 100644
index 00000000..0af62e2f
Binary files /dev/null and b/miniprogram/page/cloud/resources/kind/user_dark.png differ
diff --git a/miniprogram/page/common/index.wxss b/miniprogram/page/common/index.wxss
index 6f840547..b9d1c5f2 100644
--- a/miniprogram/page/common/index.wxss
+++ b/miniprogram/page/common/index.wxss
@@ -15,7 +15,7 @@
}
.index-desc {
margin-top: 20rpx;
- color: #888888;
+ color: var(--weui-FG-1);
font-size: 28rpx;
}
@@ -23,7 +23,7 @@
.navigator-box {
opacity: 0;
position: relative;
- background-color: #FFFFFF;
+ background-color: var(--weui-BG-2);
line-height: 1.41176471;
font-size: 34rpx;
@@ -47,8 +47,8 @@
top: 0;
right: 30rpx;
height: 1px;
- border-top: 1rpx solid #D8D8D8;
- color: #D8D8D8;
+ border-top: 1rpx solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
}
.navigator:first-child:before {
display: none;
@@ -66,7 +66,7 @@
height: 18rpx;
width: 18rpx;
border-width: 2rpx 2rpx 0 0;
- border-color: #888888;
+ border-color: var(--weui-FG-2);
border-style: solid;
transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
position: absolute;
@@ -78,7 +78,7 @@
.kind-list-item {
margin: 20rpx 0;
- background-color: #FFFFFF;
+ background-color: var(--weui-BG-2);
border-radius: 4rpx;
overflow: hidden;
}
diff --git a/miniprogram/page/common/lib/weui.wxss b/miniprogram/page/common/lib/weui.wxss
index 4cb7da85..e732bb4a 100644
--- a/miniprogram/page/common/lib/weui.wxss
+++ b/miniprogram/page/common/lib/weui.wxss
@@ -1,70 +1,694 @@
/*!
- * weui.js v1.1.0 (https://github.com/weui/weui-wxss)
- * Copyright 2016, wechat ui team
- * MIT license
+ * WeUI v2.3.0 (https://github.com/weui/weui-wxss)
+ * Copyright 2020 Tencent, Inc.
+ * Licensed under the MIT license
*/
+[data-weui-theme=light],
+page {
+ --weui-BTN-DISABLED-FONT-COLOR: rgba(0, 0, 0, .2)
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BTN-DISABLED-FONT-COLOR: hsla(0, 0%, 100%, .2)
+ }
+}
+
+[data-weui-theme=light],
+page {
+ --weui-BTN-DEFAULT-BG: #f2f2f2
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BTN-DEFAULT-BG: hsla(0, 0%, 100%, .08)
+ }
+}
+
+[data-weui-theme=light],
+page {
+ --weui-BTN-DEFAULT-COLOR: #06ae56
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BTN-DEFAULT-COLOR: hsla(0, 0%, 100%, .8)
+ }
+}
+
+[data-weui-theme=light],
+page {
+ --weui-BTN-DEFAULT-ACTIVE-BG: #e6e6e6
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BTN-DEFAULT-ACTIVE-BG: hsla(0, 0%, 100%, .126)
+ }
+}
+
+[data-weui-theme=light],
+page {
+ --weui-DIALOG-LINE-COLOR: rgba(0, 0, 0, .1)
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-DIALOG-LINE-COLOR: hsla(0, 0%, 100%, .1)
+ }
+}
+
page {
line-height: 1.6;
- font-family: -apple-system-font, "Helvetica Neue", sans-serif;
+ font-family: -apple-system-font, Helvetica Neue, sans-serif
}
+
icon {
+ vertical-align: middle
+}
+
+[data-weui-theme=light],
+page {
+ --weui-BG-0: #ededed;
+ --weui-BG-1: #f7f7f7;
+ --weui-BG-2: #fff;
+ --weui-BG-3: #f7f7f7;
+ --weui-BG-4: #4c4c4c;
+ --weui-BG-5: #fff;
+ --weui-FG-0: rgba(0, 0, 0, .9);
+ --weui-FG-HALF: rgba(0, 0, 0, .9);
+ --weui-FG-1: rgba(0, 0, 0, .5);
+ --weui-FG-2: rgba(0, 0, 0, .3);
+ --weui-FG-3: rgba(0, 0, 0, .1);
+ --weui-RED: #fa5151;
+ --weui-ORANGE: #fa9d3b;
+ --weui-YELLOW: #ffc300;
+ --weui-GREEN: #91d300;
+ --weui-LIGHTGREEN: #95ec69;
+ --weui-BRAND: #07c160;
+ --weui-BLUE: #10aeff;
+ --weui-INDIGO: #1485ee;
+ --weui-PURPLE: #6467f0;
+ --weui-WHITE: #fff;
+ --weui-LINK: #576b95;
+ --weui-TEXTGREEN: #06ae56;
+ --weui-FG: #000;
+ --weui-BG: #fff;
+ --weui-TAG-TEXT-ORANGE: #fa9d3b;
+ --weui-TAG-BACKGROUND-ORANGE: rgba(250, 157, 59, .1);
+ --weui-TAG-TEXT-GREEN: #06ae56;
+ --weui-TAG-BACKGROUND-GREEN: rgba(6, 174, 86, .1);
+ --weui-TAG-TEXT-BLUE: #10aeff;
+ --weui-TAG-BACKGROUND-BLUE: rgba(16, 174, 255, .1);
+ --weui-TAG-TEXT-BLACK: rgba(0, 0, 0, .5);
+ --weui-TAG-BACKGROUND-BLACK: rgba(0, 0, 0, .05)
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BG-0: #191919;
+ --weui-BG-1: #1f1f1f;
+ --weui-BG-2: #232323;
+ --weui-BG-3: #2f2f2f;
+ --weui-BG-4: #606060;
+ --weui-BG-5: #2c2c2c;
+ --weui-FG-0: hsla(0, 0%, 100%, .8);
+ --weui-FG-HALF: hsla(0, 0%, 100%, .6);
+ --weui-FG-1: hsla(0, 0%, 100%, .5);
+ --weui-FG-2: hsla(0, 0%, 100%, .3);
+ --weui-FG-3: hsla(0, 0%, 100%, .05);
+ --weui-RED: #fa5151;
+ --weui-ORANGE: #c87d2f;
+ --weui-YELLOW: #cc9c00;
+ --weui-GREEN: #74a800;
+ --weui-LIGHTGREEN: #28b561;
+ --weui-BRAND: #07c160;
+ --weui-BLUE: #10aeff;
+ --weui-INDIGO: #1196ff;
+ --weui-PURPLE: #8183ff;
+ --weui-WHITE: hsla(0, 0%, 100%, .8);
+ --weui-LINK: #7d90a9;
+ --weui-TEXTGREEN: #259c5c;
+ --weui-FG: #fff;
+ --weui-BG: #000;
+ --weui-TAG-TEXT-ORANGE: rgba(250, 157, 59, .6);
+ --weui-TAG-BACKGROUND-ORANGE: rgba(250, 157, 59, .1);
+ --weui-TAG-TEXT-GREEN: rgba(6, 174, 86, .6);
+ --weui-TAG-BACKGROUND-GREEN: rgba(6, 174, 86, .1);
+ --weui-TAG-TEXT-BLUE: rgba(16, 174, 255, .6);
+ --weui-TAG-BACKGROUND-BLUE: rgba(16, 174, 255, .1);
+ --weui-TAG-TEXT-BLACK: hsla(0, 0%, 100%, .5);
+ --weui-TAG-BACKGROUND-BLACK: hsla(0, 0%, 100%, .05)
+ }
+}
+
+[data-weui-theme=light],
+page {
+ --weui-BG-COLOR-ACTIVE: #ececec
+}
+
+@media(prefers-color-scheme: dark) {
+ page{
+ --weui-BG-COLOR-ACTIVE: #373737
+ }
+}
+
+[class*=" weui-icon-"],
+[class^=weui-icon-] {
+ display: inline-block;
vertical-align: middle;
+ width: 24px;
+ height: 24px;
+ -webkit-mask-position: 50% 50%;
+ mask-position: 50% 50%;
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-size: 100%;
+ mask-size: 100%;
+ background-color: currentColor
+}
+
+.weui-icon-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-download {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.25%2012.04l-1.72-1.72-1.06%201.06%202.828%202.83a1%201%200%20001.414-.001l2.828-2.828-1.06-1.061-1.73%201.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55%200%20.999.446.999.996v13.008a.998.998%200%2001-.996.996H4.996A.998.998%200%20014%2021.004V7.996A1%201%200%20014.999%207h6.251z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.25%2012.04l-1.72-1.72-1.06%201.06%202.828%202.83a1%201%200%20001.414-.001l2.828-2.828-1.06-1.061-1.73%201.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55%200%20.999.446.999.996v13.008a.998.998%200%2001-.996.996H4.996A.998.998%200%20014%2021.004V7.996A1%201%200%20014.999%207h6.251z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-info {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.75-12v7h1.5v-7h-1.5zM12%209a1%201%200%20100-2%201%201%200%20000%202z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.75-12v7h1.5v-7h-1.5zM12%209a1%201%200%20100-2%201%201%200%20000%202z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-safe-success {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.6C315.5%2046.7%20180.4%2093.1%2057.6%20132c0%20129.3.2%20231.7.2%20339.7%200%20304.2%20248.3%20471.6%20443.1%20523.7C695.7%20943.3%20944%20775.9%20944%20471.7c0-108%20.2-210.4.2-339.7C821.4%2093.1%20686.3%2046.7%20500.9%204.6zm248.3%20349.1l-299.7%20295c-2.1%202-5.3%202-7.4-.1L304.4%20506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3%205-2.8%207.2-1l112.2%2086c2.3%201.8%206%201.7%208.1-.1l274.7-228.9c2.2-1.8%205.7-1.7%207.7.3l17%2016.8c2.2%202.1%202.2%205.3.2%207.4z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23070202%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.6C315.5%2046.7%20180.4%2093.1%2057.6%20132c0%20129.3.2%20231.7.2%20339.7%200%20304.2%20248.3%20471.6%20443.1%20523.7C695.7%20943.3%20944%20775.9%20944%20471.7c0-108%20.2-210.4.2-339.7C821.4%2093.1%20686.3%2046.7%20500.9%204.6zm248.3%20349.1l-299.7%20295c-2.1%202-5.3%202-7.4-.1L304.4%20506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3%205-2.8%207.2-1l112.2%2086c2.3%201.8%206%201.7%208.1-.1l274.7-228.9c2.2-1.8%205.7-1.7%207.7.3l17%2016.8c2.2%202.1%202.2%205.3.2%207.4z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23070202%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-safe-warn {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.5c-185.4%2042-320.4%2088.4-443.2%20127.3%200%20129.3.2%20231.7.2%20339.6%200%20304.1%20248.2%20471.4%20443%20523.6%20194.7-52.2%20443-219.5%20443-523.6%200-107.9.2-210.3.2-339.6C821.3%2092.9%20686.2%2046.5%20500.9%204.5zm-26.1%20271.1h52.1c5.8%200%2010.3%204.7%2010.1%2010.4l-11.6%20313.8c-.1%202.8-2.5%205.2-5.4%205.2h-38.2c-2.9%200-5.3-2.3-5.4-5.2L464.8%20286c-.2-5.8%204.3-10.4%2010-10.4zm26.1%20448.3c-20.2%200-36.5-16.3-36.5-36.5s16.3-36.5%2036.5-36.5%2036.5%2016.3%2036.5%2036.5-16.4%2036.5-36.5%2036.5z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23020202%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.5c-185.4%2042-320.4%2088.4-443.2%20127.3%200%20129.3.2%20231.7.2%20339.6%200%20304.1%20248.2%20471.4%20443%20523.6%20194.7-52.2%20443-219.5%20443-523.6%200-107.9.2-210.3.2-339.6C821.3%2092.9%20686.2%2046.5%20500.9%204.5zm-26.1%20271.1h52.1c5.8%200%2010.3%204.7%2010.1%2010.4l-11.6%20313.8c-.1%202.8-2.5%205.2-5.4%205.2h-38.2c-2.9%200-5.3-2.3-5.4-5.2L464.8%20286c-.2-5.8%204.3-10.4%2010-10.4zm26.1%20448.3c-20.2%200-36.5-16.3-36.5-36.5s16.3-36.5%2036.5-36.5%2036.5%2016.3%2036.5%2036.5-16.4%2036.5-36.5%2036.5z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23020202%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-success {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-success-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm-1.172-6.242l5.809-5.808.848.849-5.95%205.95a1%201%200%2001-1.414%200L7%2012.426l.849-.849%202.98%202.98z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm-1.172-6.242l5.809-5.808.848.849-5.95%205.95a1%201%200%2001-1.414%200L7%2012.426l.849-.849%202.98%202.98z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-success-no-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-waiting {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.75%2011.38V6h-1.5v6l4.243%204.243%201.06-1.06-3.803-3.804zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.75%2011.38V6h-1.5v6l4.243%204.243%201.06-1.06-3.803-3.804zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-waiting-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.6%2011.503l3.891%203.891-.848.849L11.4%2012V6h1.2v5.503zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.6%2011.503l3.891%203.891-.848.849L11.4%2012V6h1.2v5.503zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-warn {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-info-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zM11.4%2010h1.2v7h-1.2v-7zm.6-1a1%201%200%20110-2%201%201%200%20010%202z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zM11.4%2010h1.2v7h-1.2v-7zm.6-1a1%201%200%20110-2%201%201%200%20010%202z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-cancel {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%20fill-rule%3D%22nonzero%22%2F%3E%3Cpath%20d%3D%22M12.849%2012l3.11%203.111-.848.849L12%2012.849l-3.111%203.11-.849-.848L11.151%2012l-3.11-3.111.848-.849L12%2011.151l3.111-3.11.849.848L12.849%2012z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%20fill-rule%3D%22nonzero%22%2F%3E%3Cpath%20d%3D%22M12.849%2012l3.11%203.111-.848.849L12%2012.849l-3.111%203.11-.849-.848L11.151%2012l-3.11-3.111.848-.849L12%2011.151l3.111-3.11.849.848L12.849%2012z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-search {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
}
-.weui-cells {
+
+.weui-icon-clear {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.06%2012l3.006-3.005-1.06-1.06L12%2010.938%208.995%207.934l-1.06%201.06L10.938%2012l-3.005%203.005%201.06%201.06L12%2013.062l3.005%203.005%201.06-1.06L13.062%2012zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.06%2012l3.006-3.005-1.06-1.06L12%2010.938%208.995%207.934l-1.06%201.06L10.938%2012l-3.005%203.005%201.06%201.06L12%2013.062l3.005%203.005%201.06-1.06L13.062%2012zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-back {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm1.999-6.563L10.68%2012%2014%208.562%2012.953%207.5%209.29%2011.277a1.045%201.045%200%20000%201.446l3.663%203.777L14%2015.437z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm1.999-6.563L10.68%2012%2014%208.562%2012.953%207.5%209.29%2011.277a1.045%201.045%200%20000%201.446l3.663%203.777L14%2015.437z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-delete {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.774%206.4l.812%2013.648a.8.8%200%2000.798.752h7.232a.8.8%200%2000.798-.752L17.226%206.4H6.774zm11.655%200l-.817%2013.719A2%202%200%200115.616%2022H8.384a2%202%200%2001-1.996-1.881L5.571%206.4H3.5v-.7a.5.5%200%2001.5-.5h16a.5.5%200%2001.5.5v.7h-2.071zM14%203a.5.5%200%2001.5.5v.7h-5v-.7A.5.5%200%200110%203h4zM9.5%209h1.2l.5%209H10l-.5-9zm3.8%200h1.2l-.5%209h-1.2l.5-9z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.774%206.4l.812%2013.648a.8.8%200%2000.798.752h7.232a.8.8%200%2000.798-.752L17.226%206.4H6.774zm11.655%200l-.817%2013.719A2%202%200%200115.616%2022H8.384a2%202%200%2001-1.996-1.881L5.571%206.4H3.5v-.7a.5.5%200%2001.5-.5h16a.5.5%200%2001.5.5v.7h-2.071zM14%203a.5.5%200%2001.5.5v.7h-5v-.7A.5.5%200%200110%203h4zM9.5%209h1.2l.5%209H10l-.5-9zm3.8%200h1.2l-.5%209h-1.2l.5-9z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-success-no-circle-thin {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.864%2016.617l-5.303-5.303-1.061%201.06%205.657%205.657a1%201%200%20001.414%200L21.238%206.364l-1.06-1.06L8.864%2016.616z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.864%2016.617l-5.303-5.303-1.061%201.06%205.657%205.657a1%201%200%20001.414%200L21.238%206.364l-1.06-1.06L8.864%2016.616z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-arrow {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-arrow-bold {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2212%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.157%2012.711L4.5%2018.368l-1.414-1.414%204.95-4.95-4.95-4.95L4.5%205.64l5.657%205.657a1%201%200%20010%201.414z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2212%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.157%2012.711L4.5%2018.368l-1.414-1.414%204.95-4.95-4.95-4.95L4.5%205.64l5.657%205.657a1%201%200%20010%201.414z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-back-arrow {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.343%2012l7.071%207.071L9%2020.485l-7.778-7.778a1%201%200%20010-1.414L9%203.515l1.414%201.414L3.344%2012z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.343%2012l7.071%207.071L9%2020.485l-7.778-7.778a1%201%200%20010-1.414L9%203.515l1.414%201.414L3.344%2012z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-back-arrow-thin {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-close {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2010.586l5.657-5.657%201.414%201.414L13.414%2012l5.657%205.657-1.414%201.414L12%2013.414l-5.657%205.657-1.414-1.414L10.586%2012%204.929%206.343%206.343%204.93%2012%2010.586z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2010.586l5.657-5.657%201.414%201.414L13.414%2012l5.657%205.657-1.414%201.414L12%2013.414l-5.657%205.657-1.414-1.414L10.586%2012%204.929%206.343%206.343%204.93%2012%2010.586z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-close-thin {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-back-circle {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm1.999-5.363L12.953%2016.5%209.29%2012.723a1.045%201.045%200%20010-1.446L12.953%207.5%2014%208.563%2010.68%2012%2014%2015.438z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm1.999-5.363L12.953%2016.5%209.29%2012.723a1.045%201.045%200%20010-1.446L12.953%207.5%2014%208.563%2010.68%2012%2014%2015.438z%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-icon-success {
+ color: var(--weui-BRAND)
+}
+
+.weui-icon-waiting {
+ color: var(--weui-BLUE)
+}
+
+.weui-icon-warn {
+ color: var(--weui-RED)
+}
+
+.weui-icon-info {
+ color: var(--weui-BLUE)
+}
+
+.weui-icon-success-circle,
+.weui-icon-success-no-circle,
+.weui-icon-success-no-circle-thin {
+ color: var(--weui-BRAND)
+}
+
+.weui-icon-waiting-circle {
+ color: var(--weui-BLUE)
+}
+
+.weui-icon-circle {
+ color: var(--weui-FG-2)
+}
+
+.weui-icon-download {
+ color: var(--weui-BRAND)
+}
+
+.weui-icon-info-circle {
+ color: var(--weui-FG-2)
+}
+
+.weui-icon-safe-success {
+ color: var(--weui-BRAND)
+}
+
+.weui-icon-safe-warn {
+ color: var(--weui-YELLOW)
+}
+
+.weui-icon-cancel {
+ color: var(--weui-RED)
+}
+
+.weui-icon-search {
+ color: var(--weui-FG-1)
+}
+
+.weui-icon-clear {
+ color: var(--weui-FG-2)
+}
+
+.weui-icon-clear:active {
+ color: var(--weui-FG-1)
+}
+
+.weui-icon-delete.weui-icon_gallery-delete {
+ color: var(--weui-WHITE)
+}
+
+.weui-icon-arrow,
+.weui-icon-arrow-bold,
+.weui-icon-back-arrow,
+.weui-icon-back-arrow-thin {
+ width: 12px
+}
+
+.weui-icon-arrow,
+.weui-icon-arrow-bold {
+ color: var(--weui-FG-2)
+}
+
+.weui-icon-back,
+.weui-icon-back-arrow,
+.weui-icon-back-arrow-thin,
+.weui-icon-back-circle {
+ color: var(--weui-FG-0)
+}
+
+.weui-icon_msg {
+ width: 64px;
+ height: 64px
+}
+
+.weui-icon_msg.weui-icon-warn {
+ color: var(--weui-RED)
+}
+
+.weui-icon_msg-primary {
+ width: 64px;
+ height: 64px
+}
+
+.weui-icon_msg-primary.weui-icon-warn {
+ color: var(--weui-YELLOW)
+}
+
+.weui-link {
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-link,
+.weui-link:visited {
+ color: var(--weui-LINK)
+}
+
+.weui-btn {
+ position: relative;
+ display: block;
+ width: 184px;
+ margin-left: auto;
+ margin-right: auto;
+ padding: 8px 24px;
+ box-sizing: border-box;
+ font-weight: 700;
+ font-size: 17px;
+ text-align: center;
+ text-decoration: none;
+ color: #fff;
+ line-height: 1.41176471;
+ border-radius: 4px;
+ overflow: hidden;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-btn_block {
+ width: auto
+}
+
+.weui-btn_inline {
+ display: inline-block
+}
+
+.weui-btn_default {
+ background-color: var(--weui-BTN-DEFAULT-BG)
+}
+
+.weui-btn_default,
+.weui-btn_default:not(.weui-btn_disabled):visited {
+ color: var(--weui-BTN-DEFAULT-COLOR)
+}
+
+.weui-btn_default:not(.weui-btn_disabled):active {
+ background-color: var(--weui-BTN-DEFAULT-ACTIVE-BG)
+}
+
+.weui-btn_primary {
+ background-color: var(--weui-BRAND)
+}
+
+.weui-btn_primary:not(.weui-btn_disabled):visited {
+ color: #fff
+}
+
+.weui-btn_primary:not(.weui-btn_disabled):active {
+ background-color: var(--weui-TAG-TEXT-GREEN)
+}
+
+.weui-btn_warn {
+ background-color: var(--weui-BTN-DEFAULT-BG)
+}
+
+.weui-btn_warn,
+.weui-btn_warn:not(.weui-btn_disabled):visited {
+ color: var(--weui-RED)
+}
+
+.weui-btn_warn:not(.weui-btn_disabled):active {
+ background-color: var(--weui-BTN-DEFAULT-ACTIVE-BG)
+}
+
+.weui-btn_disabled {
+ color: var(--weui-BTN-DISABLED-FONT-COLOR);
+ background-color: var(--weui-BTN-DEFAULT-BG)
+}
+
+.weui-btn_loading .weui-loading {
+ margin: -.2em .34em 0 0
+}
+
+.weui-btn_loading.weui-btn_primary {
+ background-color: var(--weui-TAG-TEXT-GREEN);
+ color: var(--weui-WHITE)
+}
+
+.weui-btn_loading.weui-btn_default,
+.weui-btn_loading.weui-btn_warn {
+ background-color: var(--weui-BTN-DEFAULT-ACTIVE-BG)
+}
+
+.weui-btn_cell {
position: relative;
- margin-top: 1.17647059em;
- background-color: #FFFFFF;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ box-sizing: border-box;
+ font-size: 17px;
+ text-align: center;
+ text-decoration: none;
+ color: #fff;
+ line-height: 1.41176471;
+ padding: 16px;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ overflow: hidden;
+ background-color: var(--weui-BG-5)
+}
+
+.weui-btn_cell+.weui-btn_cell {
+ margin-top: 16px
+}
+
+.weui-btn_cell:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-btn_cell__icon {
+ display: inline-block;
+ vertical-align: middle;
+ width: 24px;
+ height: 24px;
+ margin: -.2em .34em 0 0
+}
+
+.weui-btn_cell-default {
+ color: var(--weui-FG-0)
+}
+
+.weui-btn_cell-primary {
+ color: var(--weui-LINK)
+}
+
+.weui-btn_cell-warn {
+ color: var(--weui-RED)
+}
+
+button.weui-btn,
+input.weui-btn {
+ border-width: 0;
+ outline: 0;
+ -webkit-appearance: none
+}
+
+button.weui-btn:focus,
+input.weui-btn:focus {
+ outline: 0
+}
+
+button.weui-btn_inline,
+button.weui-btn_mini,
+input.weui-btn_inline,
+input.weui-btn_mini {
+ width: auto
+}
+
+.weui-btn_mini {
+ display: inline-block;
+ width: auto;
+ padding: 0 .75em;
+ line-height: 2;
+ font-size: 16px
+}
+
+.weui-btn:not(.weui-btn_mini)+.weui-btn:not(.weui-btn_mini) {
+ margin-top: 16px
+}
+
+.weui-btn.weui-btn_inline+.weui-btn.weui-btn_inline {
+ margin-top: auto;
+ margin-left: 16px
+}
+
+.weui-btn-area {
+ margin: 48px 16px 8px
+}
+
+.weui-btn-area_inline {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex
+}
+
+.weui-btn-area_inline .weui-btn {
+ margin-top: auto;
+ margin-right: 16px;
+ width: 100%;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
+}
+
+.weui-btn-area_inline .weui-btn:last-child {
+ margin-right: 0
+}
+
+.weui-btn_reset {
+ background: transparent;
+ border: 0;
+ padding: 0;
+ outline: 0
+}
+
+.weui-btn_icon {
+ font-size: 0
+}
+
+.weui-btn_icon:active [class*=weui-icon-] {
+ color: var(--weui-FG-1)
+}
+
+.weui-cells {
+ margin-top: 8px;
+ background-color: var(--weui-BG-2);
line-height: 1.41176471;
font-size: 17px;
+ overflow: hidden;
+ position: relative
}
+
+.weui-cells:before {
+ top: 0;
+ border-top: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-cells:after,
.weui-cells:before {
content: " ";
position: absolute;
left: 0;
- top: 0;
right: 0;
height: 1px;
- border-top: 1rpx solid #D9D9D9;
- color: #D9D9D9;
+ color: var(--weui-FG-3);
+ z-index: 2
}
+
.weui-cells:after {
- content: " ";
- position: absolute;
- left: 0;
bottom: 0;
- right: 0;
- height: 1px;
- border-bottom: 1rpx solid #D9D9D9;
- color: #D9D9D9;
+ border-bottom: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
}
+
.weui-cells__title {
- margin-top: .77em;
- margin-bottom: .3em;
- padding-left: 15px;
- padding-right: 15px;
- color: #999999;
+ margin-top: 16px;
+ margin-bottom: 3px;
+ padding-left: 16px;
+ padding-right: 16px;
+ color: var(--weui-FG-1);
font-size: 14px;
+ line-height: 1.4
}
-.weui-cells_after-title {
- margin-top: 0;
+
+.weui-cells__title+.weui-cells {
+ margin-top: 0
}
+
.weui-cells__tips {
- margin-top: .3em;
- color: #999999;
- padding-left: 15px;
- padding-right: 15px;
+ margin-top: 8px;
+ color: var(--weui-FG-1);
+ padding-left: 16px;
+ padding-right: 16px;
font-size: 14px;
+ line-height: 1.4
}
+
+.weui-cells__tips a,
+.weui-cells__tips navigator {
+ color: var(--weui-LINK)
+}
+
+.weui-cells__tips navigator {
+ display: inline
+}
+
.weui-cell {
- padding: 10px 15px;
+ padding: 16px;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
- align-items: center;
+ align-items: center
}
+
.weui-cell:before {
content: " ";
position: absolute;
@@ -72,168 +696,331 @@ icon {
top: 0;
right: 0;
height: 1px;
- border-top: 1rpx solid #D9D9D9;
- color: #D9D9D9;
- left: 15px;
-}
+ border-top: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5);
+ left: 16px;
+ z-index: 2
+}
+
.weui-cell:first-child:before {
- display: none;
+ display: none
}
-.weui-cell_active {
- background-color: #ECECEC;
+
+.weui-cell_active:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
}
+
.weui-cell_primary {
-webkit-box-align: start;
-webkit-align-items: flex-start;
- align-items: flex-start;
+ align-items: flex-start
}
+
.weui-cell__bd {
-webkit-box-flex: 1;
-webkit-flex: 1;
- flex: 1;
+ flex: 1
}
+
.weui-cell__ft {
text-align: right;
- color: #999999;
+ color: var(--weui-FG-1)
}
-.weui-cell_access {
- color: inherit;
+
+.weui-cell_swiped {
+ display: block;
+ padding: 0
}
-.weui-cell__ft_in-access {
- padding-right: 13px;
+
+.weui-cell_swiped>.weui-cell__bd {
position: relative;
+ z-index: 1;
+ background-color: var(--weui-BG-2)
}
-.weui-cell__ft_in-access:after {
- content: " ";
- display: inline-block;
- height: 6px;
- width: 6px;
- border-width: 2px 2px 0 0;
- border-color: #C8C8CD;
- border-style: solid;
- -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
- transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
- position: relative;
- top: -2px;
+
+.weui-cell_swiped>.weui-cell__ft {
position: absolute;
- top: 50%;
- margin-top: -4px;
- right: 2px;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ color: #fff
}
-.weui-cell_link {
- color: #586C94;
- font-size: 14px;
+
+.weui-swiped-btn {
+ display: block;
+ padding: 16px 1em;
+ line-height: 1.41176471;
+ color: inherit
}
-.weui-cell_link:active {
- background-color: #ECECEC;
+
+.weui-swiped-btn_default {
+ background-color: var(--weui-BG-0)
}
-.weui-cell_link:first-child:before {
- display: block;
+
+.weui-swiped-btn_warn {
+ background-color: var(--weui-RED)
}
-.weui-icon-radio {
- margin-left: 3.2px;
- margin-right: 3.2px;
+
+.weui-cell_access {
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ color: inherit
}
-.weui-icon-checkbox_circle,
-.weui-icon-checkbox_success {
- margin-left: 4.6px;
- margin-right: 4.6px;
+
+.weui-cell_access:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
}
-.weui-check__label:active {
- background-color: #ECECEC;
+
+.weui-cell_access .weui-cell__ft {
+ padding-right: 22px;
+ position: relative
}
-.weui-check {
+
+.weui-cell_access .weui-cell__ft:after {
+ content: " ";
+ width: 12px;
+ height: 24px;
+ -webkit-mask-position: 0 0;
+ mask-position: 0 0;
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-size: 100%;
+ mask-size: 100%;
+ background-color: currentColor;
+ color: var(--weui-FG-2);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
position: absolute;
- left: -9999px;
+ top: 50%;
+ right: 0;
+ margin-top: -12px
}
-.weui-check__hd_in-checkbox {
- padding-right: 0.35em;
+
+.weui-cell_link {
+ color: var(--weui-LINK);
+ font-size: 17px
}
-.weui-cell__ft_in-radio {
- padding-left: 0.35em;
+
+.weui-cell_link:first-child:before {
+ display: block
}
-.weui-cell_input {
- padding-top: 0;
- padding-bottom: 0;
+
+.weui-check__label {
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
}
+
+.weui-check__label:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-check {
+ position: absolute;
+ left: -9999px
+}
+
+.weui-cells_radio .weui-cell__ft {
+ padding-left: 16px;
+ font-size: 0
+}
+
+.weui-cells_radio .weui-check+.weui-icon-checked {
+ min-width: 16px;
+ color: transparent
+}
+
+.weui-cells_radio .weui-check:checked+.weui-icon-checked,
+.weui-cells_radio .weui-check[aria-checked=true]+.weui-icon-checked {
+ color: var(--weui-BRAND);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-cells_checkbox .weui-check__label:before {
+ left: 55px
+}
+
+.weui-cells_checkbox .weui-cell__hd {
+ padding-right: 16px;
+ font-size: 0
+}
+
+.weui-cells_checkbox .weui-icon-checked {
+ color: var(--weui-FG-2);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E)
+}
+
+.weui-cells_checkbox .weui-check:checked+.weui-icon-checked,
+.weui-cells_checkbox .weui-check[aria-checked=true]+.weui-icon-checked {
+ color: var(--weui-BRAND);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E)
+}
+
.weui-label {
+ display: block;
width: 105px;
word-wrap: break-word;
- word-break: break-all;
+ word-break: break-all
}
+
.weui-input {
- height: 2.58823529em;
- min-height: 2.58823529em;
- line-height: 2.58823529em;
-}
-.weui-toptips {
- position: fixed;
- -webkit-transform: translateZ(0);
- transform: translateZ(0);
- top: 0;
- left: 0;
- right: 0;
- padding: 5px;
- font-size: 14px;
- text-align: center;
- color: #FFFFFF;
- z-index: 5000;
- word-wrap: break-word;
- word-break: break-all;
-}
-.weui-toptips_warn {
- background-color: #E64340;
-}
+ width: 100%;
+ border: 0;
+ outline: 0;
+ -webkit-appearance: none;
+ background-color: transparent;
+ font-size: inherit;
+ color: inherit;
+ height: 1.41176471em;
+ line-height: 1.41176471
+}
+
+.weui-input::-webkit-inner-spin-button,
+.weui-input::-webkit-outer-spin-button {
+ -webkit-appearance: none;
+ margin: 0
+}
+
+.weui-input:focus:not(:placeholder-shown)+.weui-btn_input-clear {
+ display: inline
+}
+
+.weui-input::-webkit-input-placeholder,
+.weui-input__placeholder {
+ color: var(--weui-FG-2)
+}
+
+.weui-input::placeholder,
+.weui-input__placeholder {
+ color: var(--weui-FG-2)
+}
+
.weui-textarea {
display: block;
+ border: 0;
+ resize: none;
+ background: transparent;
width: 100%;
+ color: inherit;
+ font-size: 1em;
+ line-height: inherit;
+ outline: 0
}
+
.weui-textarea-counter {
- color: #B2B2B2;
+ color: var(--weui-FG-2);
text-align: right;
-}
-.weui-textarea-counter_warn {
- color: #E64340;
-}
+ font-size: 14px
+}
+
+.weui-cell_warn .weui-textarea-counter {
+ color: var(--weui-RED)
+}
+
+.weui-cells_form .weui-cell_disabled:active,
+.weui-cells_form .weui-cell_readonly:active,
+.weui-cells_form .weui-cell_switch:active,
+.weui-cells_form .weui-cell_vcode:active {
+ background-color: transparent
+}
+
+.weui-cells_form .weui-cell__ft {
+ font-size: 0
+}
+
+.weui-cells_form .weui-icon-warn {
+ display: none
+}
+
+.weui-cells_form input,
+.weui-cells_form label[for],
+.weui-cells_form textarea {
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
.weui-cell_warn {
- color: #E64340;
+ color: var(--weui-RED)
+}
+
+.weui-cell_warn .weui-icon-warn {
+ display: inline-block
+}
+
+.weui-cell_disabled .weui-input:disabled,
+.weui-cell_disabled .weui-textarea:disabled,
+.weui-cell_readonly .weui-input:disabled,
+.weui-cell_readonly .weui-textarea:disabled {
+ opacity: 1;
+ -webkit-text-fill-color: var(--weui-FG-1)
+}
+
+.weui-cell_disabled .weui-input[disabled],
+.weui-cell_disabled .weui-input[readonly],
+.weui-cell_disabled .weui-textarea[disabled],
+.weui-cell_disabled .weui-textarea[readonly],
+.weui-cell_readonly .weui-input[disabled],
+.weui-cell_readonly .weui-input[readonly],
+.weui-cell_readonly .weui-textarea[disabled],
+.weui-cell_readonly .weui-textarea[readonly] {
+ color: var(--weui-FG-1)
+}
+
+.weui-btn_input-clear {
+ display: none;
+ padding-left: 8px
}
+
+.weui-btn_input-clear [class*=weui-icon-] {
+ width: 18px
+}
+
.weui-form-preview {
position: relative;
- background-color: #FFFFFF;
+ background-color: var(--weui-BG-2)
}
+
+.weui-form-preview:before {
+ top: 0;
+ border-top: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-form-preview:after,
.weui-form-preview:before {
content: " ";
position: absolute;
left: 0;
- top: 0;
right: 0;
height: 1px;
- border-top: 1rpx solid #D9D9D9;
- color: #D9D9D9;
+ color: var(--weui-FG-3)
}
+
.weui-form-preview:after {
- content: " ";
- position: absolute;
- left: 0;
bottom: 0;
- right: 0;
- height: 1px;
- border-bottom: 1rpx solid #D9D9D9;
- color: #D9D9D9;
-}
-.weui-form-preview__value {
- font-size: 14px;
-}
-.weui-form-preview__value_in-hd {
- font-size: 26px;
+ border-bottom: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
}
+
.weui-form-preview__hd {
position: relative;
- padding: 10px 15px;
+ padding: 16px;
text-align: right;
- line-height: 2.5em;
+ line-height: 2.5em
}
+
.weui-form-preview__hd:after {
content: " ";
position: absolute;
@@ -241,60 +1028,95 @@ icon {
bottom: 0;
right: 0;
height: 1px;
- border-bottom: 1rpx solid #D9D9D9;
- color: #D9D9D9;
- left: 15px;
-}
+ border-bottom: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5);
+ left: 16px
+}
+
+.weui-form-preview__hd .weui-form-preview__value {
+ font-style: normal;
+ font-size: 1.6em
+}
+
.weui-form-preview__bd {
- padding: 10px 15px;
+ padding: 16px;
font-size: .9em;
text-align: right;
- color: #999999;
- line-height: 2;
+ color: var(--weui-FG-1);
+ line-height: 2
}
+
.weui-form-preview__ft {
position: relative;
line-height: 50px;
display: -webkit-box;
display: -webkit-flex;
- display: flex;
+ display: flex
}
-.weui-form-preview__ft:after {
+
+.weui-form-preview__ft:before {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
- border-top: 1rpx solid #D5D5D6;
- color: #D5D5D6;
-}
+ border-top: 1px solid var(--weui-DIALOG-LINE-COLOR);
+ color: var(--weui-DIALOG-LINE-COLOR);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
.weui-form-preview__item {
- overflow: hidden;
+ overflow: hidden
}
+
.weui-form-preview__label {
float: left;
margin-right: 1em;
min-width: 4em;
- color: #999999;
+ color: var(--weui-FG-1);
text-align: justify;
- text-align-last: justify;
+ text-align-last: justify
}
+
.weui-form-preview__value {
display: block;
overflow: hidden;
word-break: normal;
word-wrap: break-word;
+ color: var(--weui-FG-0)
}
+
.weui-form-preview__btn {
position: relative;
display: block;
-webkit-box-flex: 1;
-webkit-flex: 1;
- flex: 1;
- color: #3CC51F;
+ flex: 1;
+ color: var(--weui-LINK);
text-align: center;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+button.weui-form-preview__btn {
+ background-color: transparent;
+ border: 0;
+ outline: 0;
+ line-height: inherit;
+ font-size: inherit
+}
+
+.weui-form-preview__btn:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
}
+
.weui-form-preview__btn:after {
content: " ";
position: absolute;
@@ -302,119 +1124,374 @@ icon {
top: 0;
width: 1px;
bottom: 0;
- border-left: 1rpx solid #D5D5D6;
- color: #D5D5D6;
-}
+ border-left: 1px solid var(--weui-DIALOG-LINE-COLOR);
+ color: var(--weui-DIALOG-LINE-COLOR);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
.weui-form-preview__btn:first-child:after {
- display: none;
-}
-.weui-form-preview__btn_active {
- background-color: #EEEEEE;
+ display: none
}
+
.weui-form-preview__btn_default {
- color: #999999;
+ color: var(--weui-FG-HALF)
}
+
.weui-form-preview__btn_primary {
- color: #0BB20C;
+ color: var(--weui-LINK)
}
+
.weui-cell_select {
- padding: 0;
+ padding: 0
+}
+
+.weui-cell_select .weui-select {
+ padding-right: 30px
+}
+
+.weui-cell_select .weui-cell__bd:after {
+ content: " ";
+ width: 12px;
+ height: 24px;
+ -webkit-mask-position: 0 0;
+ mask-position: 0 0;
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-size: 100%;
+ mask-size: 100%;
+ background-color: currentColor;
+ color: var(--weui-FG-2);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ position: absolute;
+ top: 50%;
+ right: 16px;
+ margin-top: -12px
}
+
.weui-select {
+ -webkit-appearance: none;
+ border: 0;
+ outline: 0;
+ background-color: transparent;
+ width: 100%;
+ font-size: inherit;
+ height: 56px;
+ line-height: 56px;
position: relative;
- padding-left: 15px;
- padding-right: 30px;
- height: 2.58823529em;
- min-height: 2.58823529em;
- line-height: 2.58823529em;
- border-right: 1rpx solid #D9D9D9;
-}
-.weui-select:before {
+ z-index: 1;
+ padding-left: 16px;
+ color: var(--weui-FG-0)
+}
+
+.weui-cell_select-before {
+ padding-right: 16px
+}
+
+.weui-cell_select-before .weui-select {
+ width: 105px;
+ box-sizing: border-box
+}
+
+.weui-cell_select-before .weui-cell__hd {
+ position: relative
+}
+
+.weui-cell_select-before .weui-cell__hd:after {
content: " ";
- display: inline-block;
- height: 6px;
- width: 6px;
- border-width: 2px 2px 0 0;
- border-color: #C8C8CD;
- border-style: solid;
- -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
- transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
- position: relative;
- top: -2px;
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-right: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 100% 0;
+ transform-origin: 100% 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-cell_select-before .weui-cell__hd:before {
+ content: " ";
+ width: 12px;
+ height: 24px;
+ -webkit-mask-position: 0 0;
+ mask-position: 0 0;
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-size: 100%;
+ mask-size: 100%;
+ background-color: currentColor;
+ color: var(--weui-FG-2);
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
position: absolute;
top: 50%;
- right: 15px;
- margin-top: -4px;
+ right: 16px;
+ margin-top: -12px
+}
+
+.weui-cell_select-before .weui-cell__bd {
+ padding-left: 16px
}
-.weui-select_in-select-after {
- padding-left: 0;
+
+.weui-cell_select-before .weui-cell__bd:after {
+ display: none
}
-.weui-cell__hd_in-select-after,
-.weui-cell__bd_in-select-before {
- padding-left: 15px;
+
+.weui-cell_select-before.weui-cell_access .weui-cell__hd {
+ line-height: 56px;
+ padding-left: 32px
}
+
+.weui-cell_select-after {
+ padding-left: 16px
+}
+
+.weui-cell_select-after .weui-select {
+ padding-left: 0
+}
+
+.weui-cell_select-after.weui-cell_access .weui-cell__bd {
+ line-height: 56px
+}
+
.weui-cell_vcode {
+ padding-top: 0;
padding-right: 0;
+ padding-bottom: 0
}
+
+.weui-vcode-btn,
.weui-vcode-img {
margin-left: 5px;
- height: 2.58823529em;
- vertical-align: middle;
+ height: 56px;
+ vertical-align: middle
}
+
.weui-vcode-btn {
display: inline-block;
- height: 2.58823529em;
- margin-left: 5px;
- padding: 0 0.6em 0 0.7em;
- border-left: 1px solid #E5E5E5;
- line-height: 2.58823529em;
- vertical-align: middle;
+ padding: 0 .6em 0 .7em;
+ line-height: 56px;
font-size: 17px;
- color: #3CC51F;
- white-space: nowrap;
+ color: var(--weui-LINK);
+ position: relative
}
+
+.weui-vcode-btn:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+button.weui-vcode-btn {
+ background-color: transparent;
+ border: 0;
+ outline: 0
+}
+
.weui-vcode-btn:active {
- color: #52a341;
+ color: #767676
+}
+
+.weui-gallery {
+ display: none;
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ background-color: #000;
+ z-index: 1000
+}
+
+.weui-gallery__img,
+.weui-gallery__opr {
+ position: absolute;
+ left: 0;
+ left: constant(safe-area-inset-left);
+ left: env(safe-area-inset-left);
+ right: 0;
+ right: constant(safe-area-inset-right);
+ right: env(safe-area-inset-right)
+}
+
+.weui-gallery__img {
+ top: 0;
+ top: constant(safe-area-inset-top);
+ top: env(safe-area-inset-top);
+ bottom: 60px;
+ bottom: calc(60px + constant(safe-area-inset-bottom));
+ bottom: calc(60px + env(safe-area-inset-bottom));
+ background: 50% no-repeat;
+ background-size: contain
+}
+
+.weui-gallery__opr {
+ position: absolute;
+ bottom: 0;
+ padding-bottom: 0;
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
+ background-color: #0d0d0d;
+ color: var(--weui-WHITE);
+ line-height: 60px;
+ text-align: center
+}
+
+.weui-gallery__del {
+ display: block
}
+
.weui-cell_switch {
- padding-top: 6px;
- padding-bottom: 6px;
+ padding-top: 12px;
+ padding-bottom: 12px
+}
+
+.weui-switch {
+ -webkit-appearance: none;
+ appearance: none
+}
+
+.weui-switch,
+.weui-switch-cp__box {
+ position: relative;
+ width: 52px;
+ height: 32px;
+ border: 2px solid var(--weui-FG-3);
+ outline: 0;
+ border-radius: 16px;
+ box-sizing: border-box;
+ -webkit-transition: background-color .1s, border .1s;
+ transition: background-color .1s, border .1s
+}
+
+.weui-switch-cp__box:before,
+.weui-switch:before {
+ content: " ";
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ border-radius: 15px;
+ background-color: var(--weui-BG-3);
+ -webkit-transition: -webkit-transform .35s cubic-bezier(.45, 1, .4, 1);
+ transition: -webkit-transform .35s cubic-bezier(.45, 1, .4, 1);
+ transition: transform .35s cubic-bezier(.45, 1, .4, 1);
+ transition: transform .35s cubic-bezier(.45, 1, .4, 1), -webkit-transform .35s cubic-bezier(.45, 1, .4, 1)
+}
+
+.weui-switch-cp__box:after,
+.weui-switch:after {
+ content: " ";
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 28px;
+ height: 28px;
+ border-radius: 15px;
+ background-color: #fff;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
+ -webkit-transition: -webkit-transform .35s cubic-bezier(.4, .4, .25, 1.35);
+ transition: -webkit-transform .35s cubic-bezier(.4, .4, .25, 1.35);
+ transition: transform .35s cubic-bezier(.4, .4, .25, 1.35);
+ transition: transform .35s cubic-bezier(.4, .4, .25, 1.35), -webkit-transform .35s cubic-bezier(.4, .4, .25, 1.35)
+}
+
+.weui-switch-cp__input:checked+.weui-switch-cp__box,
+.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box,
+.weui-switch:checked {
+ border-color: var(--weui-BRAND);
+ background-color: var(--weui-BRAND)
+}
+
+.weui-switch-cp__input:checked+.weui-switch-cp__box:before,
+.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box:before,
+.weui-switch:checked:before {
+ -webkit-transform: scale(0);
+ transform: scale(0)
+}
+
+.weui-switch-cp__input:checked+.weui-switch-cp__box:after,
+.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box:after,
+.weui-switch:checked:after {
+ -webkit-transform: translateX(20px);
+ transform: translateX(20px)
+}
+
+.weui-switch-cp__input {
+ position: absolute;
+ left: -9999px
+}
+
+.weui-switch-cp__box {
+ display: block
+}
+
+.weui-uploader {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
}
+
.weui-uploader__hd {
display: -webkit-box;
display: -webkit-flex;
display: flex;
- padding-bottom: 10px;
+ padding-bottom: 16px;
-webkit-box-align: center;
-webkit-align-items: center;
- align-items: center;
+ align-items: center
}
+
.weui-uploader__title {
-webkit-box-flex: 1;
-webkit-flex: 1;
- flex: 1;
+ flex: 1
}
+
.weui-uploader__info {
- color: #B2B2B2;
+ color: var(--weui-FG-2)
}
+
.weui-uploader__bd {
- margin-bottom: -4px;
- margin-right: -9px;
- overflow: hidden;
+ margin-bottom: -8px;
+ margin-right: -8px;
+ overflow: hidden
+}
+
+.weui-uploader__files {
+ list-style: none
}
+
.weui-uploader__file {
float: left;
- margin-right: 9px;
- margin-bottom: 9px;
-}
-.weui-uploader__img {
- display: block;
- width: 79px;
- height: 79px;
+ margin-right: 8px;
+ margin-bottom: 8px;
+ width: 96px;
+ height: 96px;
+ background: no-repeat 50%;
+ background-size: cover
}
+
.weui-uploader__file_status {
- position: relative;
+ position: relative
}
+
.weui-uploader__file_status:before {
content: " ";
position: absolute;
@@ -422,50 +1499,77 @@ icon {
right: 0;
bottom: 0;
left: 0;
- background-color: rgba(0, 0, 0, 0.5);
+ background-color: rgba(0, 0, 0, .5)
}
+
+.weui-uploader__file_status .weui-uploader__file-content {
+ display: block
+}
+
.weui-uploader__file-content {
+ display: none;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
- transform: translate(-50%, -50%);
- color: #FFFFFF;
+ transform: translate(-50%, -50%);
+ color: var(--weui-WHITE)
}
+
+.weui-uploader__file-content .weui-icon-warn {
+ display: inline-block
+}
+
.weui-uploader__input-box {
float: left;
position: relative;
- margin-right: 9px;
- margin-bottom: 9px;
- width: 77px;
- height: 77px;
- border: 1px solid #D9D9D9;
+ margin-right: 8px;
+ margin-bottom: 8px;
+ width: 96px;
+ height: 96px;
+ box-sizing: border-box;
+ background-color: #ededed
}
-.weui-uploader__input-box:before,
-.weui-uploader__input-box:after {
+
+@media(prefers-color-scheme: dark) {
+ .weui-uploader__input-box {
+ background-color: #2e2e2e
+ }
+}
+
+.weui-uploader__input-box:after,
+.weui-uploader__input-box:before {
content: " ";
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
- transform: translate(-50%, -50%);
- background-color: #D9D9D9;
+ transform: translate(-50%, -50%);
+ background-color: #a3a3a3
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-uploader__input-box:after,
+ .weui-uploader__input-box:before {
+ background-color: #6d6d6d
+ }
}
+
.weui-uploader__input-box:before {
width: 2px;
- height: 39.5px;
+ height: 32px
}
+
.weui-uploader__input-box:after {
- width: 39.5px;
- height: 2px;
+ width: 32px;
+ height: 2px
}
-.weui-uploader__input-box:active {
- border-color: #999999;
-}
-.weui-uploader__input-box:active:before,
-.weui-uploader__input-box:active:after {
- background-color: #999999;
+
+.weui-uploader__input-box:active:after,
+.weui-uploader__input-box:active:before {
+ opacity: .7
}
+
.weui-uploader__input {
position: absolute;
z-index: 1;
@@ -474,320 +1578,618 @@ icon {
width: 100%;
height: 100%;
opacity: 0;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
}
-.weui-article {
- padding: 20px 15px;
- font-size: 15px;
-}
-.weui-article__section {
- margin-bottom: 1.5em;
-}
-.weui-article__h1 {
- font-size: 18px;
- font-weight: 400;
- margin-bottom: .9em;
-}
-.weui-article__h2 {
- font-size: 16px;
- font-weight: 400;
- margin-bottom: .34em;
-}
-.weui-article__h3 {
- font-weight: 400;
- font-size: 15px;
- margin-bottom: .34em;
-}
-.weui-article__p {
- margin: 0 0 .8em;
-}
+
.weui-msg {
- padding-top: 36px;
+ padding-top: 48px;
+ padding: calc(48px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);
+ padding: calc(48px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
text-align: center;
+ line-height: 1.4;
+ min-height: 100%;
+ box-sizing: border-box;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ background-color: var(--weui-BG-2)
+}
+
+.weui-msg a:not(.weui-btn) {
+ color: var(--weui-LINK);
+ display: inline-block;
+ vertical-align: baseline
}
-.weui-msg__link {
- display: inline;
- color: #586C94;
-}
+
.weui-msg__icon-area {
- margin-bottom: 30px;
+ margin-bottom: 32px
}
+
.weui-msg__text-area {
- margin-bottom: 25px;
- padding: 0 20px;
+ margin-bottom: 32px;
+ padding: 0 32px;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ line-height: 1.6
+}
+
+.weui-msg__text-area:first-child {
+ padding-top: 96px
}
+
.weui-msg__title {
- margin-bottom: 5px;
- font-weight: 400;
- font-size: 20px;
+ font-weight: 700;
+ font-size: 22px
+}
+
+.weui-msg__desc,
+.weui-msg__title {
+ margin-bottom: 16px;
+ color: var(--weui-FG-0);
+ word-wrap: break-word;
+ word-break: break-all
}
+
.weui-msg__desc {
+ font-size: 17px
+}
+
+.weui-msg__desc-primary {
font-size: 14px;
- color: #999999;
+ color: var(--weui-FG-1);
+ word-wrap: break-word;
+ word-break: break-all;
+ margin-bottom: 16px
}
+
.weui-msg__opr-area {
- margin-bottom: 25px;
+ margin-bottom: 16px
+}
+
+.weui-msg__opr-area .weui-btn-area {
+ margin: 0
+}
+
+.weui-msg__opr-area .weui-btn+.weui-btn {
+ margin-bottom: 16px
+}
+
+.weui-msg__opr-area:last-child {
+ margin-bottom: 96px
}
+
+.weui-msg__opr-area+.weui-msg__extra-area {
+ margin-top: 48px
+}
+
+.weui-msg__tips-area {
+ margin-bottom: 16px;
+ padding: 0 40px
+}
+
+.weui-msg__opr-area+.weui-msg__tips-area {
+ margin-bottom: 48px
+}
+
+.weui-msg__tips-area:last-child {
+ margin-bottom: 64px
+}
+
+.weui-msg__extra-area,
+.weui-msg__tips {
+ font-size: 12px;
+ color: var(--weui-FG-1)
+}
+
.weui-msg__extra-area {
- margin-bottom: 15px;
- font-size: 14px;
- color: #999999;
+ margin-bottom: 24px
}
-@media screen and (min-height: 438px) {
- .weui-msg__extra-area {
- position: fixed;
- left: 0;
- bottom: 0;
- width: 100%;
- text-align: center;
- }
+
+.weui-msg__extra-area a,
+.weui-msg__extra-area navigator {
+ color: var(--weui-LINK)
}
-.weui-flex {
+
+.weui-msg__extra-area navigator {
+ display: inline
+}
+
+.weui-cells__group_form:first-child .weui-cells__title {
+ margin-top: 0
+}
+
+.weui-cells__group_form .weui-cells__title {
+ margin-top: 24px;
+ margin-bottom: 8px;
+ padding: 0 32px
+}
+
+.weui-cells__group_form .weui-cell:before,
+.weui-cells__group_form .weui-cells:before {
+ left: 32px;
+ right: 32px
+}
+
+.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before {
+ left: 72px
+}
+
+.weui-cells__group_form .weui-cells:after {
+ left: 32px;
+ right: 32px
+}
+
+.weui-cells__group_form .weui-cell {
+ padding: 16px 32px
+}
+
+.weui-cells__group_form .weui-cell:not(.weui-cell_link) {
+ color: var(--weui-FG-0)
+}
+
+.weui-cells__group_form .weui-cell__hd {
+ padding-right: 16px
+}
+
+.weui-cells__group_form .weui-cell__ft {
+ padding-left: 16px
+}
+
+.weui-cells__group_form .weui-cell_warn input {
+ color: var(--weui-RED)
+}
+
+.weui-cells__group_form .weui-label {
+ max-width: 5em;
+ margin-right: 8px
+}
+
+.weui-cells__group_form .weui-cells__tips {
+ margin-top: 8px;
+ padding: 0 32px;
+ color: rgba(0, 0, 0, .3)
+}
+
+.weui-cells__group_form .weui-cells__tips a {
+ font-weight: 700
+}
+
+.weui-cells__group_form .weui-cell_vcode {
+ padding: 12px 32px
+}
+
+.weui-cells__group_form .weui-vcode-btn {
+ font-size: 16px;
+ padding: 0 12px;
+ margin-left: 0;
+ height: auto;
+ width: auto;
+ line-height: 2em;
+ color: var(--weui-BTN-DEFAULT-COLOR);
+ background-color: var(--weui-BTN-DEFAULT-BG)
+}
+
+.weui-cells__group_form .weui-vcode-btn:before {
+ display: none
+}
+
+.weui-cells__group_form .weui-cell_select {
+ padding: 0
+}
+
+.weui-cells__group_form .weui-cell_select .weui-select {
+ padding: 0 32px
+}
+
+.weui-cells__group_form .weui-cell_select .weui-cell__bd:after {
+ right: 32px
+}
+
+.weui-cells__group_form .weui-cell_select-before .weui-label {
+ margin-right: 24px
+}
+
+.weui-cells__group_form .weui-cell_select-before .weui-select {
+ padding-right: 24px;
+ box-sizing: initial
+}
+
+.weui-cells__group_form .weui-cell_select-after {
+ padding-left: 32px
+}
+
+.weui-cells__group_form .weui-cell_select-after .weui-select {
+ padding-left: 0
+}
+
+.weui-cells__group_form .weui-cell_switch {
+ padding: 12px 32px
+}
+
+.weui-form {
+ padding: 56px 0 0;
+ padding: calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);
+ padding: calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
display: -webkit-box;
display: -webkit-flex;
display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ line-height: 1.4;
+ min-height: 100%;
+ box-sizing: border-box;
+ background-color: var(--weui-BG-2)
}
-.weui-flex__item {
- -webkit-box-flex: 1;
- -webkit-flex: 1;
- flex: 1;
+
+.weui-form .weui-footer,
+.weui-form .weui-footer__link {
+ font-size: 14px
}
-.weui-btn {
- margin-top: 15px;
+
+.weui-form .weui-agree {
+ padding: 0
}
-.weui-btn:first-child {
- margin-top: 0;
+
+.weui-form__text-area {
+ padding: 0 32px;
+ color: var(--weui-FG-0);
+ text-align: center
}
-.weui-btn-area {
- margin: 1.17647059em 15px 0.3em;
+
+.weui-form__control-area {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ margin: 48px 0
+}
+
+.weui-form__tips-area {
+ overflow: hidden
+}
+
+.weui-form__extra-area,
+.weui-form__tips-area {
+ margin-bottom: 24px;
+ text-align: center
+}
+
+.weui-form__opr-area {
+ margin-bottom: 64px
+}
+
+.weui-form__opr-area:last-child {
+ margin-bottom: 96px
+}
+
+.weui-form__title {
+ font-size: 22px;
+ font-weight: 700;
+ line-height: 1.36
+}
+
+.weui-form__desc {
+ font-size: 17px;
+ margin-top: 16px
}
-.weui-agree {
- display: block;
- padding: .5em 15px;
- font-size: 13px;
+
+.weui-form__tips {
+ color: var(--weui-FG-1);
+ font-size: 14px
}
-.weui-agree__text {
- color: #999999;
+
+.weui-form__tips a,
+.weui-form__tips navigator {
+ color: var(--weui-LINK)
}
-.weui-agree__link {
- display: inline;
- color: #586C94;
+
+.weui-form__tips navigator {
+ display: inline
}
-.weui-agree__checkbox {
- position: absolute;
- left: -9999px;
+
+.weui-article {
+ padding: 24px 16px;
+ padding: 24px calc(16px + constant(safe-area-inset-right)) calc(24px + constant(safe-area-inset-bottom)) calc(16px + constant(safe-area-inset-left));
+ padding: 24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
+ font-size: 17px;
+ color: var(--weui-FG-0)
}
-.weui-agree__checkbox-icon {
- position: relative;
- top: 2px;
- display: inline-block;
- border: 1px solid #D1D1D1;
- background-color: #FFFFFF;
- border-radius: 3px;
- width: 11px;
- height: 11px;
+
+.weui-article__section {
+ margin-bottom: 1.5em
}
-.weui-agree__checkbox-icon-check {
- position: absolute;
- top: 1px;
- left: 1px;
+
+.weui-article__h1 {
+ font-size: 22px;
+ font-weight: 700;
+ margin-bottom: .9em;
+ line-height: 1.4
}
-.weui-footer {
- color: #999999;
- font-size: 14px;
- text-align: center;
+
+.weui-article__h2 {
+ font-size: 17px
}
-.weui-footer_fixed-bottom {
- position: fixed;
- bottom: .52em;
- left: 0;
- right: 0;
+
+.weui-article__h2,
+.weui-article__h3 {
+ font-weight: 700;
+ margin-bottom: .34em;
+ line-height: 1.4
}
-.weui-footer__links {
- font-size: 0;
+
+.weui-article__h3 {
+ font-size: 15px
}
-.weui-footer__link {
- display: inline-block;
- vertical-align: top;
- margin: 0 .62em;
+
+.weui-article__p {
+ margin: 0 0 .8em
+}
+
+.weui-tabbar {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
position: relative;
- font-size: 14px;
- color: #586C94;
+ z-index: 500;
+ background-color: var(--weui-BG-1)
}
-.weui-footer__link:before {
+
+.weui-tabbar:before {
content: " ";
position: absolute;
left: 0;
top: 0;
- width: 1px;
- bottom: 0;
- border-left: 1rpx solid #C7C7C7;
- color: #C7C7C7;
- left: -0.65em;
- top: .36em;
- bottom: .36em;
-}
-.weui-footer__link:first-child:before {
- display: none;
-}
-.weui-footer__text {
- padding: 0 .34em;
- font-size: 12px;
-}
-.weui-grids {
- border-top: 1rpx solid #D9D9D9;
- border-left: 1rpx solid #D9D9D9;
- overflow: hidden;
-}
-.weui-grid {
- position: relative;
- float: left;
- padding: 20px 10px;
- width: 33.33333333%;
- box-sizing: border-box;
- border-right: 1rpx solid #D9D9D9;
- border-bottom: 1rpx solid #D9D9D9;
-}
-.weui-grid_active {
- background-color: #ECECEC;
-}
-.weui-grid__icon {
+ right: 0;
+ height: 1px;
+ border-top: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-tabbar__item {
display: block;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ padding: 8px 0;
+ padding-bottom: calc(8px + constant(safe-area-inset-bottom));
+ padding-bottom: calc(8px + env(safe-area-inset-bottom));
+ font-size: 0;
+ color: var(--weui-FG-1);
+ text-align: center;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-tabbar__item:first-child {
+ padding-left: constant(safe-area-inset-left);
+ padding-left: env(safe-area-inset-left)
+}
+
+.weui-tabbar__item:last-child {
+ padding-right: constant(safe-area-inset-right);
+ padding-right: env(safe-area-inset-right)
+}
+
+.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,
+.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,
+.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label {
+ color: var(--weui-BRAND)
+}
+
+.weui-tabbar__icon {
+ display: inline-block;
width: 28px;
height: 28px;
- margin: 0 auto;
+ margin-bottom: 2px
}
-.weui-grid__label {
- margin-top: 5px;
- display: block;
- text-align: center;
- color: #000000;
- font-size: 14px;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
+
+.weui-tabbar__icon>i,
+i.weui-tabbar__icon {
+ font-size: 24px;
+ color: var(--weui-FG-1)
}
-.weui-loading {
- margin: 0 5px;
- width: 20px;
- height: 20px;
- display: inline-block;
- vertical-align: middle;
- -webkit-animation: weuiLoading 1s steps(12, end) infinite;
- animation: weuiLoading 1s steps(12, end) infinite;
- background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
- background-size: 100%;
+
+.weui-tabbar__icon img {
+ width: 100%;
+ height: 100%
}
-@-webkit-keyframes weuiLoading {
- 0% {
- -webkit-transform: rotate3d(0, 0, 1, 0deg);
- transform: rotate3d(0, 0, 1, 0deg);
- }
- 100% {
- -webkit-transform: rotate3d(0, 0, 1, 360deg);
- transform: rotate3d(0, 0, 1, 360deg);
- }
+
+.weui-tabbar__label {
+ color: var(--weui-FG-0);
+ font-size: 10px;
+ line-height: 1.4
}
-@keyframes weuiLoading {
- 0% {
- -webkit-transform: rotate3d(0, 0, 1, 0deg);
- transform: rotate3d(0, 0, 1, 0deg);
- }
- 100% {
- -webkit-transform: rotate3d(0, 0, 1, 360deg);
- transform: rotate3d(0, 0, 1, 360deg);
- }
+
+.weui-navbar {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ position: relative;
+ z-index: 500;
+ background-color: var(--weui-BG-2);
+ padding-top: constant(safe-area-inset-top);
+ padding-top: env(safe-area-inset-top)
}
-.weui-badge {
- display: inline-block;
- padding: .15em .4em;
- min-width: 8px;
- border-radius: 18px;
- background-color: #F43530;
- color: #FFFFFF;
- line-height: 1.2;
+
+.weui-navbar:after {
+ content: " ";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ border-bottom: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-navbar+.weui-tab__panel {
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom)
+}
+
+.weui-navbar__item {
+ position: relative;
+ display: block;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ padding: 16px 0;
+ padding-top: calc(16px + constant(safe-area-inset-top));
+ padding-top: calc(16px + env(safe-area-inset-top));
text-align: center;
- font-size: 12px;
- vertical-align: middle;
+ font-size: 17px;
+ line-height: 1.41176471;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
}
-.weui-badge_dot {
- padding: .4em;
- min-width: 0;
+
+.weui-navbar__item.weui-bar__item_on,
+.weui-navbar__item:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
}
-.weui-loadmore {
- width: 65%;
- margin: 1.5em auto;
- line-height: 1.6em;
- font-size: 14px;
- text-align: center;
+
+.weui-navbar__item:after {
+ content: " ";
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-right: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 100% 0;
+ transform-origin: 100% 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-navbar__item:first-child {
+ padding-left: constant(safe-area-inset-left);
+ padding-left: env(safe-area-inset-left)
+}
+
+.weui-navbar__item:last-child {
+ padding-right: constant(safe-area-inset-right);
+ padding-right: env(safe-area-inset-right)
+}
+
+.weui-navbar__item:last-child:after {
+ display: none
+}
+
+.weui-tab {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ height: 100%;
+ box-sizing: border-box;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column
}
-.weui-loadmore__tips {
- display: inline-block;
- vertical-align: middle;
+
+.weui-tab__panel {
+ box-sizing: border-box;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ overflow: auto;
+ -webkit-overflow-scrolling: touch
}
-.weui-loadmore_line {
- border-top: 1px solid #E5E5E5;
- margin-top: 2.4em;
+
+.weui-tab__content {
+ display: none
}
-.weui-loadmore__tips_in-line {
- position: relative;
- top: -0.9em;
- padding: 0 .55em;
- background-color: #FFFFFF;
- color: #999999;
+
+.weui-progress {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
}
-.weui-loadmore__tips_in-dot {
- position: relative;
- padding: 0 .16em;
- width: 4px;
- height: 1.6em;
+
+.weui-progress__bar {
+ background-color: var(--weui-BG-0);
+ height: 3px;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
}
-.weui-loadmore__tips_in-dot:before {
- content: " ";
- position: absolute;
- top: 50%;
- left: 50%;
- margin-top: -1px;
- margin-left: -2px;
- width: 4px;
- height: 4px;
- border-radius: 50%;
- background-color: #E5E5E5;
+
+.weui-progress__inner-bar {
+ width: 0;
+ height: 100%;
+ background-color: var(--weui-BRAND)
+}
+
+.weui-progress__opr {
+ display: block;
+ margin-left: 15px;
+ font-size: 0
}
+
.weui-panel {
- background-color: #FFFFFF;
+ background-color: var(--weui-BG-2);
margin-top: 10px;
position: relative;
- overflow: hidden;
+ overflow: hidden
}
+
.weui-panel:first-child {
- margin-top: 0;
+ margin-top: 0
}
+
+.weui-panel:before {
+ top: 0;
+ border-top: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-panel:after,
.weui-panel:before {
content: " ";
position: absolute;
left: 0;
- top: 0;
right: 0;
height: 1px;
- border-top: 1rpx solid #E5E5E5;
- color: #E5E5E5;
+ color: var(--weui-FG-3)
}
+
.weui-panel:after {
- content: " ";
- position: absolute;
- left: 0;
bottom: 0;
- right: 0;
- height: 1px;
- border-bottom: 1rpx solid #E5E5E5;
- color: #E5E5E5;
+ border-bottom: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
}
+
.weui-panel__hd {
- padding: 14px 15px 10px;
- color: #999999;
- font-size: 13px;
- position: relative;
+ padding: 16px 16px 13px;
+ color: var(--weui-FG-0);
+ font-size: 15px;
+ font-weight: 700;
+ position: relative
}
+
.weui-panel__hd:after {
content: " ";
position: absolute;
@@ -795,14 +2197,20 @@ icon {
bottom: 0;
right: 0;
height: 1px;
- border-bottom: 1rpx solid #E5E5E5;
- color: #E5E5E5;
- left: 15px;
-}
+ border-bottom: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5);
+ left: 15px
+}
+
.weui-media-box {
- padding: 15px;
- position: relative;
+ padding: 16px;
+ position: relative
}
+
.weui-media-box:before {
content: " ";
position: absolute;
@@ -810,233 +2218,2176 @@ icon {
top: 0;
right: 0;
height: 1px;
- border-top: 1rpx solid #E5E5E5;
- color: #E5E5E5;
- left: 15px;
-}
+ border-top: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5);
+ left: 16px
+}
+
.weui-media-box:first-child:before {
- display: none;
+ display: none
+}
+
+a.weui-media-box {
+ color: #000;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+a.weui-media-box:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
}
+
.weui-media-box__title {
font-weight: 400;
font-size: 17px;
+ color: var(--weui-FG-0);
width: auto;
- overflow: hidden;
- text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
word-wrap: break-word;
- word-break: break-all;
+ word-break: break-all
}
-.weui-media-box__desc {
- color: #999999;
- font-size: 13px;
- line-height: 1.2;
+
+.weui-media-box__desc,
+.weui-media-box__title {
+ line-height: 1.4;
overflow: hidden;
- text-overflow: ellipsis;
+ text-overflow: ellipsis
+}
+
+.weui-media-box__desc {
+ color: var(--weui-FG-2);
+ font-size: 14px;
+ padding-top: 4px;
display: -webkit-box;
-webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
+ -webkit-line-clamp: 2
}
+
.weui-media-box__info {
- margin-top: 15px;
- padding-bottom: 5px;
+ margin-top: 16px;
+ padding-bottom: 4px;
font-size: 13px;
- color: #CECECE;
+ color: var(--weui-FG-2);
line-height: 1em;
list-style: none;
- overflow: hidden;
+ overflow: hidden
}
+
.weui-media-box__info__meta {
float: left;
- padding-right: 1em;
+ padding-right: 1em
}
+
.weui-media-box__info__meta_extra {
padding-left: 1em;
- border-left: 1px solid #CECECE;
-}
-.weui-media-box__title_in-text {
- margin-bottom: 8px;
+ border-left: 1px solid var(--weui-FG-2)
}
+
.weui-media-box_appmsg {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
- align-items: center;
-}
-.weui-media-box__thumb {
- width: 100%;
- height: 100%;
- vertical-align: top;
+ align-items: center
}
-.weui-media-box__hd_in-appmsg {
- margin-right: .8em;
+
+.weui-media-box_appmsg .weui-media-box__hd {
+ margin-right: 16px;
width: 60px;
height: 60px;
line-height: 60px;
- text-align: center;
+ text-align: center
+}
+
+.weui-media-box_appmsg .weui-media-box__thumb {
+ width: 100%;
+ max-height: 100%;
+ vertical-align: top
}
-.weui-media-box__bd_in-appmsg {
+
+.weui-media-box_appmsg .weui-media-box__bd {
-webkit-box-flex: 1;
-webkit-flex: 1;
- flex: 1;
- min-width: 0;
+ flex: 1;
+ min-width: 0
}
+
.weui-media-box_small-appmsg {
- padding: 0;
+ padding: 0
}
-.weui-cells_in-small-appmsg {
- margin-top: 0;
+
+.weui-media-box_small-appmsg .weui-cells {
+ margin-top: 0
}
-.weui-cells_in-small-appmsg:before {
- display: none;
+
+.weui-media-box_small-appmsg .weui-cells:before {
+ display: none
}
-.weui-progress {
+
+.weui-grids {
+ position: relative;
+ overflow: hidden
+}
+
+.weui-grids:before {
+ right: 0;
+ height: 1px;
+ border-top: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-grids:after,
+.weui-grids:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ color: var(--weui-FG-3)
+}
+
+.weui-grids:after {
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-grid {
+ position: relative;
+ float: left;
+ padding: 20px 10px;
+ width: 33.33333333%;
+ box-sizing: border-box
+}
+
+.weui-grid:before {
+ top: 0;
+ width: 1px;
+ border-right: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 100% 0;
+ transform-origin: 100% 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-grid:after,
+.weui-grid:before {
+ content: " ";
+ position: absolute;
+ right: 0;
+ bottom: 0;
+ color: var(--weui-FG-3)
+}
+
+.weui-grid:after {
+ left: 0;
+ height: 1px;
+ border-bottom: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-grid:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-grid__icon {
+ width: 28px;
+ height: 28px;
+ margin: 0 auto
+}
+
+.weui-grid__icon img {
+ display: block;
+ width: 100%;
+ height: 100%
+}
+
+.weui-grid__icon+.weui-grid__label {
+ margin-top: 4px
+}
+
+.weui-grid__label {
+ display: block;
+ color: var(--weui-FG-0);
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden
+}
+
+.weui-footer,
+.weui-grid__label {
+ text-align: center;
+ font-size: 14px
+}
+
+.weui-footer {
+ color: var(--weui-FG-2);
+ line-height: 1.4
+}
+
+.weui-footer a,
+.weui-footer navigator {
+ color: var(--weui-LINK)
+}
+
+.weui-footer navigator {
+ display: inline
+}
+
+.weui-footer_fixed-bottom {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ padding-top: 16px;
+ padding-bottom: 16px;
+ padding-bottom: calc(16px + constant(safe-area-inset-bottom));
+ padding-bottom: calc(16px + env(safe-area-inset-bottom));
+ left: constant(safe-area-inset-left);
+ left: env(safe-area-inset-left);
+ right: constant(safe-area-inset-right);
+ right: env(safe-area-inset-right)
+}
+
+.weui-footer__links {
+ font-size: 0
+}
+
+.weui-footer__link {
+ display: inline-block;
+ vertical-align: top;
+ margin: 0 8px;
+ position: relative;
+ font-size: 14px
+}
+
+.weui-footer__link:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5);
+ left: -8px;
+ top: .36em;
+ bottom: .36em
+}
+
+.weui-footer__link:first-child:before {
+ display: none
+}
+
+.weui-footer__text {
+ padding: 0 16px;
+ font-size: 12px
+}
+
+.weui-flex {
display: -webkit-box;
display: -webkit-flex;
- display: flex;
- -webkit-box-align: center;
- -webkit-align-items: center;
- align-items: center;
+ display: flex
}
-.weui-progress__bar {
+
+.weui-flex__item {
-webkit-box-flex: 1;
-webkit-flex: 1;
- flex: 1;
-}
-.weui-progress__opr {
- margin-left: 15px;
- font-size: 0;
+ flex: 1
}
-.weui-navbar {
+
+.weui-dialog {
+ position: fixed;
+ z-index: 5000;
+ top: 50%;
+ left: 16px;
+ right: 16px;
+ -webkit-transform: translateY(-50%);
+ transform: translateY(-50%);
+ background-color: var(--weui-BG-2);
+ text-align: center;
+ border-radius: 12px;
+ overflow: hidden;
display: -webkit-box;
display: -webkit-flex;
display: flex;
- position: absolute;
- z-index: 500;
- top: 0;
- width: 100%;
- border-bottom: 1rpx solid #CCCCCC;
+ -webkit-flex-direction: column;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ flex-direction: column;
+ max-height: 90%
}
-.weui-navbar__item {
+
+.weui-dialog__hd {
+ padding: 32px 24px 16px
+}
+
+.weui-dialog__title {
+ font-weight: 700;
+ font-size: 17px;
+ line-height: 1.4
+}
+
+.weui-dialog__bd {
+ overflow-y: auto;
+ -webkit-overflow-scrolling: touch;
+ padding: 0 24px;
+ margin-bottom: 32px;
+ font-size: 17px;
+ line-height: 1.4;
+ word-wrap: break-word;
+ -webkit-hyphens: auto;
+ hyphens: auto;
+ color: var(--weui-FG-1)
+}
+
+.weui-dialog__bd:first-child {
+ min-height: 40px;
+ padding: 32px 24px 0;
+ font-weight: 700;
+ color: var(--weui-FG-0);
+ -webkit-flex-direction: column;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ flex-direction: column;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center
+}
+
+.weui-dialog__bd:first-child,
+.weui-dialog__ft {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex
+}
+
+.weui-dialog__ft {
position: relative;
+ line-height: 56px;
+ min-height: 56px;
+ font-size: 17px
+}
+
+.weui-dialog__ft:after {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ height: 1px;
+ border-top: 1px solid var(--weui-DIALOG-LINE-COLOR);
+ color: var(--weui-DIALOG-LINE-COLOR);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-dialog__btn {
display: block;
-webkit-box-flex: 1;
-webkit-flex: 1;
- flex: 1;
- padding: 13px 0;
- text-align: center;
- font-size: 0;
-}
-.weui-navbar__item.weui-bar__item_on {
- color: #1AAD19;
-}
-.weui-navbar__slider {
- position: absolute;
+ flex: 1;
+ color: var(--weui-LINK);
+ font-weight: 700;
+ text-decoration: none;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ position: relative
+}
+
+.weui-dialog__btn:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-dialog__btn:after {
content: " ";
+ position: absolute;
left: 0;
+ top: 0;
+ width: 1px;
bottom: 0;
- width: 6em;
- height: 3px;
- background-color: #1AAD19;
- -webkit-transition: -webkit-transform .3s;
- transition: -webkit-transform .3s;
- transition: transform .3s;
- transition: transform .3s, -webkit-transform .3s;
+ border-left: 1px solid var(--weui-DIALOG-LINE-COLOR);
+ color: var(--weui-DIALOG-LINE-COLOR);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-dialog__btn:first-child:after {
+ display: none
+}
+
+.weui-dialog__btn_default {
+ color: var(--weui-FG-HALF)
+}
+
+.weui-skin_android .weui-dialog {
+ text-align: left;
+ box-shadow: 0 6px 30px 0 rgba(0, 0, 0, .1)
+}
+
+.weui-skin_android .weui-dialog__title {
+ font-size: 22px;
+ line-height: 1.4
+}
+
+.weui-skin_android .weui-dialog__hd {
+ text-align: left
+}
+
+.weui-skin_android .weui-dialog__bd {
+ color: var(--weui-FG-1);
+ text-align: left
+}
+
+.weui-skin_android .weui-dialog__bd:first-child {
+ color: var(--weui-FG-0)
+}
+
+.weui-skin_android .weui-dialog__ft {
+ display: block;
+ text-align: right;
+ line-height: 40px;
+ min-height: 40px;
+ padding: 0 24px 16px
+}
+
+.weui-skin_android .weui-dialog__ft:after {
+ display: none
}
-.weui-navbar__title {
+
+.weui-skin_android .weui-dialog__btn {
display: inline-block;
- font-size: 15px;
- max-width: 8em;
- width: auto;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- word-wrap: normal;
+ vertical-align: top;
+ padding: 0 .8em
}
-.weui-tab {
- position: relative;
- height: 100%;
+
+.weui-skin_android .weui-dialog__btn:after {
+ display: none
}
-.weui-tab__panel {
- box-sizing: border-box;
- height: 100%;
- padding-top: 50px;
- overflow: auto;
- -webkit-overflow-scrolling: touch;
+
+.weui-skin_android .weui-dialog__btn:last-child {
+ margin-right: -.8em
}
-.weui-search-bar {
- position: relative;
- padding: 8px 10px;
+
+.weui-skin_android .weui-dialog__btn_default {
+ color: var(--weui-FG-HALF)
+}
+
+@media screen and (min-width:352px) {
+ .weui-dialog {
+ width: 320px;
+ margin: 0 auto
+ }
+}
+
+.weui-half-screen-dialog {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ max-height: 75%;
+ z-index: 5000;
+ line-height: 1.4;
+ background-color: var(--weui-BG-2);
+ border-top-left-radius: 12px;
+ border-top-right-radius: 12px;
+ overflow: hidden;
+ padding: 0 24px;
+ padding: 0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));
+ padding: 0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))
+}
+
+@media only screen and (max-height:558px) {
+ .weui-half-screen-dialog {
+ max-height: none
+ }
+}
+
+.weui-half-screen-dialog__hd {
+ font-size: 8px;
+ height: 8em;
display: -webkit-box;
display: -webkit-flex;
display: flex;
- box-sizing: border-box;
- background-color: #EFEFF4;
- border-top: 1rpx solid #D7D6DC;
- border-bottom: 1rpx solid #D7D6DC;
-}
-.weui-icon-search {
- margin-right: 8px;
- font-size: inherit;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
}
-.weui-icon-search_in-box {
+
+.weui-half-screen-dialog__hd .weui-icon-btn {
position: absolute;
- left: 10px;
- top: 7px;
+ top: 50%;
+ -webkit-transform: translateY(-50%);
+ transform: translateY(-50%)
}
-.weui-search-bar__text {
- display: inline-block;
- font-size: 14px;
- vertical-align: middle;
+
+.weui-half-screen-dialog__hd .weui-icon-btn:active {
+ opacity: .5
}
-.weui-search-bar__form {
+
+.weui-half-screen-dialog__hd__side {
position: relative;
+ left: -8px
+}
+
+.weui-half-screen-dialog__hd__main {
-webkit-box-flex: 1;
- -webkit-flex: auto;
- flex: auto;
- border-radius: 5px;
- background: #FFFFFF;
- border: 1rpx solid #E6E6EA;
+ -webkit-flex: 1;
+ flex: 1
}
-.weui-search-bar__box {
- position: relative;
- padding-left: 30px;
- padding-right: 30px;
- width: 100%;
- box-sizing: border-box;
- z-index: 1;
+
+.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main {
+ text-align: center;
+ padding: 0 40px
}
-.weui-search-bar__input {
- height: 28px;
- line-height: 28px;
+
+.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side {
+ right: -8px;
+ left: auto
+}
+
+.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn {
+ right: 0
+}
+
+.weui-half-screen-dialog__title {
+ display: block;
+ color: var(--weui-FG-0);
+ font-weight: 700;
+ font-size: 15px
+}
+
+.weui-half-screen-dialog__subtitle {
+ display: block;
+ color: var(--weui-FG-1);
+ font-size: 10px
+}
+
+.weui-half-screen-dialog__bd {
+ word-wrap: break-word;
+ -webkit-hyphens: auto;
+ hyphens: auto;
+ overflow-y: auto;
+ padding-top: 4px;
+ padding-bottom: 40px;
font-size: 14px;
+ color: var(--weui-FG-0)
}
-.weui-icon-clear {
- position: absolute;
+
+.weui-half-screen-dialog__desc {
+ font-size: 17px;
+ font-weight: 700;
+ color: var(--weui-FG-0);
+ line-height: 1.4
+}
+
+.weui-half-screen-dialog__tips {
+ padding-top: 16px;
+ font-size: 14px;
+ color: var(--weui-FG-2);
+ line-height: 1.4
+}
+
+.weui-half-screen-dialog__ft {
+ padding: 0 24px 32px;
+ text-align: center
+}
+
+.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),
+.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn {
+ display: inline-block;
+ vertical-align: top;
+ margin: 0 8px;
+ width: 120px
+}
+
+.weui-icon-btn {
+ outline: 0;
+ -webkit-appearance: none;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ border-width: 0;
+ background-color: transparent;
+ color: var(--weui-FG-0);
+ font-size: 0
+}
+
+.weui-icon-more {
+ width: 24px;
+ -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M5 10.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E%3C/svg%3E") no-repeat 50% 50%;
+ mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M5 10.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E%3C/svg%3E") no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover
+}
+
+.weui-icon-btn_goback,
+.weui-icon-more {
+ display: inline-block;
+ vertical-align: middle;
+ height: 24px;
+ background-color: currentColor;
+ color: var(--weui-FG-0)
+}
+
+.weui-icon-btn_goback {
+ width: 12px;
+ -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;
+ mask: url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover
+}
+
+.weui-icon-btn_close {
+ color: var(--weui-FG-0);
+ display: inline-block;
+ vertical-align: middle;
+ width: 14px;
+ height: 24px;
+ -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;
+ mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover;
+ background-color: currentColor
+}
+
+.weui-toast {
+ position: fixed;
+ z-index: 5000;
+ width: 120px;
+ height: 120px;
+ top: 40%;
+ left: 50%;
+ -webkit-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+ text-align: center;
+ border-radius: 5px;
+ color: hsla(0, 0%, 100%, .9);
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ background-color: #4c4c4c
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-toast {
+ background-color: #606060
+ }
+}
+
+.weui-icon_toast {
+ display: block
+}
+
+.weui-icon_toast.weui-icon-success-no-circle {
+ color: hsla(0, 0%, 100%, .9);
+ width: 55px;
+ height: 55px
+}
+
+.weui-icon_toast.weui-loading {
+ margin: 8px 0;
+ width: 38px;
+ height: 38px;
+ vertical-align: baseline
+}
+
+.weui-toast__content {
+ font-size: 14px
+}
+
+.weui-mask {
+ background: rgba(0, 0, 0, .6)
+}
+
+.weui-mask,
+.weui-mask_transparent {
+ position: fixed;
+ z-index: 1000;
top: 0;
right: 0;
- padding: 7px 8px;
- font-size: 0;
+ left: 0;
+ bottom: 0
}
-.weui-search-bar__label {
+
+.weui-actionsheet {
+ position: fixed;
+ left: 0;
+ bottom: 0;
+ -webkit-transform: translateY(100%);
+ transform: translateY(100%);
+ -webkit-backface-visibility: hidden;
+ backface-visibility: hidden;
+ z-index: 5000;
+ width: 100%;
+ background-color: var(--weui-BG-1);
+ -webkit-transition: -webkit-transform .3s;
+ transition: -webkit-transform .3s;
+ transition: transform .3s;
+ transition: transform .3s, -webkit-transform .3s;
+ border-top-left-radius: 12px;
+ border-top-right-radius: 12px;
+ overflow: hidden
+}
+
+.weui-actionsheet__title {
+ position: relative;
+ height: 56px;
+ padding: 0 24px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ text-align: center;
+ font-size: 12px;
+ color: var(--weui-FG-1);
+ line-height: 1.4;
+ background: var(--weui-BG-2)
+}
+
+.weui-actionsheet__title:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ border-bottom: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-actionsheet__title .weui-actionsheet__title-text {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2
+}
+
+.weui-actionsheet__menu {
+ color: var(--weui-FG-0);
+ background-color: var(--weui-BG-2)
+}
+
+.weui-actionsheet__action {
+ margin-top: 8px;
+ background-color: var(--weui-BG-2);
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom)
+}
+
+.weui-actionsheet__cell {
+ position: relative;
+ padding: 16px;
+ text-align: center;
+ font-size: 17px;
+ line-height: 1.41176471
+}
+
+.weui-actionsheet__cell:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ height: 1px;
+ border-top: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-actionsheet__cell:active {
+ background-color: var(--weui-BG-COLOR-ACTIVE)
+}
+
+.weui-actionsheet__cell:first-child:before {
+ display: none
+}
+
+.weui-actionsheet__cell_warn {
+ color: var(--weui-RED)
+}
+
+.weui-skin_android .weui-actionsheet {
+ position: fixed;
+ left: 50%;
+ top: 50%;
+ bottom: auto;
+ -webkit-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+ width: 274px;
+ box-sizing: border-box;
+ -webkit-backface-visibility: hidden;
+ backface-visibility: hidden;
+ background: transparent;
+ -webkit-transition: -webkit-transform .3s;
+ transition: -webkit-transform .3s;
+ transition: transform .3s;
+ transition: transform .3s, -webkit-transform .3s;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0
+}
+
+.weui-skin_android .weui-actionsheet__action {
+ display: none
+}
+
+.weui-skin_android .weui-actionsheet__menu {
+ border-radius: 2px;
+ box-shadow: 0 6px 30px 0 rgba(0, 0, 0, .1)
+}
+
+.weui-skin_android .weui-actionsheet__cell {
+ padding: 16px;
+ font-size: 17px;
+ line-height: 1.41176471;
+ color: var(--weui-FG-0);
+ text-align: left
+}
+
+.weui-skin_android .weui-actionsheet__cell:first-child {
+ border-top-left-radius: 2px;
+ border-top-right-radius: 2px
+}
+
+.weui-skin_android .weui-actionsheet__cell:last-child {
+ border-bottom-left-radius: 2px;
+ border-bottom-right-radius: 2px
+}
+
+.weui-actionsheet_toggle {
+ -webkit-transform: translate(0);
+ transform: translate(0)
+}
+
+.weui-loadmore {
+ width: 65%;
+ margin: 1.5em auto;
+ line-height: 1.6em;
+ font-size: 14px;
+ text-align: center
+}
+
+.weui-loadmore__tips {
+ display: inline-block;
+ vertical-align: middle;
+ color: var(--weui-FG-0)
+}
+
+.weui-loadmore_line {
+ border-top: 1px solid var(--weui-FG-3);
+ margin-top: 2.4em
+}
+
+.weui-loadmore_line .weui-loadmore__tips {
+ position: relative;
+ top: -.9em;
+ padding: 0 .55em;
+ background-color: var(--weui-BG-2);
+ color: var(--weui-FG-1)
+}
+
+.weui-loadmore_dot .weui-loadmore__tips {
+ padding: 0 .16em
+}
+
+.weui-loadmore_dot .weui-loadmore__tips:before {
+ content: " ";
+ width: 4px;
+ height: 4px;
+ border-radius: 50%;
+ background-color: var(--weui-FG-3);
+ display: inline-block;
+ position: relative;
+ vertical-align: 0;
+ top: -.16em
+}
+
+.weui-badge {
+ display: inline-block;
+ padding: .15em .4em;
+ min-width: 8px;
+ border-radius: 18px;
+ background-color: var(--weui-RED);
+ color: #fff;
+ line-height: 1.2;
+ text-align: center;
+ font-size: 12px;
+ vertical-align: middle
+}
+
+.weui-badge_dot {
+ padding: .4em;
+ min-width: 0
+}
+
+.weui-toptips {
+ display: none;
+ position: fixed;
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0);
+ top: 8px;
+ left: 8px;
+ right: 8px;
+ padding: 10px;
+ border-radius: 8px;
+ font-size: 14px;
+ text-align: center;
+ color: #fff;
+ z-index: 5000;
+ word-wrap: break-word;
+ word-break: break-all
+}
+
+.weui-toptips_warn {
+ background-color: var(--weui-RED)
+}
+
+.weui-search-bar {
+ position: relative;
+ padding: 8px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ box-sizing: border-box;
+ background-color: var(--weui-BG-0);
+ -webkit-text-size-adjust: 100%;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-search-bar.weui-search-bar_focusing .weui-search-bar__cancel-btn {
+ display: block
+}
+
+.weui-search-bar.weui-search-bar_focusing .weui-search-bar__label {
+ display: none
+}
+
+.weui-search-bar .weui-icon-search {
+ width: 16px;
+ height: 16px
+}
+
+.weui-search-bar__form {
+ position: relative;
+ -webkit-box-flex: 1;
+ -webkit-flex: auto;
+ flex: auto;
+ background-color: var(--weui-BG-2);
+ border-radius: 4px
+}
+
+.weui-search-bar__box {
+ position: relative;
+ padding-left: 28px;
+ padding-right: 32px;
+ height: 100%;
+ width: 100%;
+ box-sizing: border-box;
+ z-index: 1
+}
+
+.weui-search-bar__box .weui-search-bar__input {
+ padding: 8px 0;
+ width: 100%;
+ height: 1.14285714em;
+ border: 0;
+ font-size: 14px;
+ line-height: 1.14285714em;
+ box-sizing: content-box;
+ background: transparent;
+ caret-color: var(--weui-BRAND);
+ color: var(--weui-FG-0)
+}
+
+.weui-search-bar__box .weui-search-bar__input:focus {
+ outline: none
+}
+
+.weui-search-bar__box .weui-icon-search {
+ position: absolute;
+ top: 50%;
+ left: 8px;
+ margin-top: -8px
+}
+
+.weui-search-bar__box .weui-icon-clear {
+ position: absolute;
+ top: 50%;
+ right: 0;
+ margin-top: -16px;
+ padding: 8px;
+ width: 16px;
+ height: 16px;
+ -webkit-mask-size: 16px;
+ mask-size: 16px
+}
+
+.weui-search-bar__label {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
- border-radius: 3px;
- text-align: center;
- color: #9B9B9B;
- background: #FFFFFF;
- line-height: 28px;
+ font-size: 0;
+ border-radius: 4px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ color: var(--weui-FG-1);
+ background: var(--weui-BG-2)
+}
+
+.weui-search-bar__label span {
+ display: inline-block;
+ font-size: 14px;
+ vertical-align: middle
}
+
+.weui-search-bar__label .weui-icon-search {
+ margin-right: 4px
+}
+
.weui-search-bar__cancel-btn {
- margin-left: 10px;
+ display: none;
+ margin-left: 8px;
line-height: 28px;
- color: #09BB07;
+ color: var(--weui-LINK);
+ white-space: nowrap
+}
+
+.weui-search-bar__input:not(:valid)+.weui-icon-clear {
+ display: none
+}
+
+input[type=search]::-webkit-search-cancel-button,
+input[type=search]::-webkit-search-decoration,
+input[type=search]::-webkit-search-results-button,
+input[type=search]::-webkit-search-results-decoration {
+ display: none
+}
+
+.weui-picker {
+ position: fixed;
+ width: 100%;
+ box-sizing: border-box;
+ left: 0;
+ bottom: 0;
+ z-index: 5000;
+ background-color: var(--weui-BG-2);
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
+ -webkit-backface-visibility: hidden;
+ backface-visibility: hidden;
+ -webkit-transform: translateY(100%);
+ transform: translateY(100%);
+ -webkit-transition: -webkit-transform .3s;
+ transition: -webkit-transform .3s;
+ transition: transform .3s;
+ transition: transform .3s, -webkit-transform .3s
+}
+
+.weui-picker__hd {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ padding: 16px;
+ padding: 16px calc(16px + constant(safe-area-inset-right)) 16px calc(16px + constant(safe-area-inset-left));
+ padding: 16px calc(16px + env(safe-area-inset-right)) 16px calc(16px + env(safe-area-inset-left));
+ position: relative;
+ text-align: center;
+ font-size: 17px;
+ line-height: 1.4
+}
+
+.weui-picker__hd:after {
+ content: " ";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ border-bottom: 1px solid var(--weui-FG-3);
+ color: var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-picker__bd {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ position: relative;
+ background-color: var(--weui-BG-2);
+ height: 240px;
+ overflow: hidden
+}
+
+.weui-picker__group {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ position: relative;
+ height: 100%
+}
+
+.weui-picker__group:first-child .weui-picker__item {
+ padding-left: constant(safe-area-inset-left);
+ padding-left: env(safe-area-inset-left)
+}
+
+.weui-picker__group:last-child .weui-picker__item {
+ padding-right: constant(safe-area-inset-right);
+ padding-right: env(safe-area-inset-right)
+}
+
+.weui-picker__mask {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ margin: 0 auto;
+ z-index: 3;
+ background-image: -webkit-linear-gradient(top, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6)), -webkit-linear-gradient(bottom, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6));
+ background-image: linear-gradient(180deg, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6)), linear-gradient(0deg, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6));
+ background-position: top, bottom;
+ background-size: 100% 92px;
+ background-repeat: no-repeat;
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0)
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-picker__mask {
+ background-image: -webkit-linear-gradient(top, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6)), -webkit-linear-gradient(bottom, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6));
+ background-image: linear-gradient(180deg, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6)), linear-gradient(0deg, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6))
+ }
+}
+
+.weui-picker__indicator {
+ width: 100%;
+ height: 56px;
+ position: absolute;
+ left: 0;
+ top: 92px;
+ z-index: 3
+}
+
+.weui-picker__indicator:before {
+ top: 0;
+ border-top: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-picker__indicator:after,
+.weui-picker__indicator:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ right: 0;
+ height: 1px;
+ color: var(--weui-FG-3)
+}
+
+.weui-picker__indicator:after {
+ bottom: 0;
+ border-bottom: 1px solid var(--weui-FG-3);
+ -webkit-transform-origin: 0 100%;
+ transform-origin: 0 100%;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5)
+}
+
+.weui-picker__content {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%
+}
+
+.weui-picker__item {
+ height: 48px;
+ line-height: 48px;
+ text-align: center;
+ color: var(--weui-FG-0);
+ text-overflow: ellipsis;
white-space: nowrap;
+ overflow: hidden
+}
+
+.weui-picker__item_disabled {
+ color: var(--weui-FG-1)
+}
+
+@-webkit-keyframes a {
+ 0% {
+ -webkit-transform: translate3d(0, 100%, 0);
+ transform: translate3d(0, 100%, 0)
+ }
+
+ to {
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0)
+ }
+}
+
+@keyframes a {
+ 0% {
+ -webkit-transform: translate3d(0, 100%, 0);
+ transform: translate3d(0, 100%, 0)
+ }
+
+ to {
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0)
+ }
+}
+
+.weui-animate-slide-up {
+ -webkit-animation: a ease .3s forwards;
+ animation: a ease .3s forwards
+}
+
+@-webkit-keyframes b {
+ 0% {
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0)
+ }
+
+ to {
+ -webkit-transform: translate3d(0, 100%, 0);
+ transform: translate3d(0, 100%, 0)
+ }
+}
+
+@keyframes b {
+ 0% {
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0)
+ }
+
+ to {
+ -webkit-transform: translate3d(0, 100%, 0);
+ transform: translate3d(0, 100%, 0)
+ }
+}
+
+.weui-animate-slide-down {
+ -webkit-animation: b ease .3s forwards;
+ animation: b ease .3s forwards
+}
+
+@-webkit-keyframes c {
+ 0% {
+ opacity: 0
+ }
+
+ to {
+ opacity: 1
+ }
+}
+
+@keyframes c {
+ 0% {
+ opacity: 0
+ }
+
+ to {
+ opacity: 1
+ }
+}
+
+.weui-animate-fade-in {
+ -webkit-animation: c ease .3s forwards;
+ animation: c ease .3s forwards
+}
+
+@-webkit-keyframes d {
+ 0% {
+ opacity: 1
+ }
+
+ to {
+ opacity: 0
+ }
+}
+
+@keyframes d {
+ 0% {
+ opacity: 1
+ }
+
+ to {
+ opacity: 0
+ }
+}
+
+.weui-animate-fade-out {
+ -webkit-animation: d ease .3s forwards;
+ animation: d ease .3s forwards
+}
+
+.weui-agree {
+ display: block;
+ padding: 8px 15px 0;
+ font-size: 14px;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
+}
+
+.weui-agree a,
+.weui-agree navigator {
+ color: var(--weui-LINK)
+}
+
+.weui-agree navigator {
+ display: inline
+}
+
+.weui-agree__text {
+ color: var(--weui-FG-1);
+ margin-left: 2px
+}
+
+.weui-agree__checkbox {
+ -webkit-appearance: none;
+ appearance: none;
+ display: inline-block;
+ border: 0;
+ outline: 0;
+ vertical-align: middle;
+ background-color: currentColor;
+ -webkit-mask-position: 0 0;
+ mask-position: 0 0;
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-size: 100%;
+ mask-size: 100%;
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E);
+ color: var(--weui-FG-2);
+ width: 1em;
+ height: 1em;
+ font-size: 17px;
+ margin-top: -.2em
+}
+
+.weui-agree__checkbox-check {
+ position: absolute;
+ left: -9999px
+}
+
+.weui-agree__checkbox-check[aria-checked=true]+.weui-agree__checkbox,
+.weui-agree__checkbox:checked {
+ -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);
+ mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);
+ color: var(--weui-BRAND)
+}
+
+.weui-agree_animate {
+ -webkit-animation: e .3s 1;
+ animation: e .3s 1
+}
+
+@-webkit-keyframes e {
+ 0% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 16% {
+ -webkit-transform: translateX(-8px);
+ transform: translateX(-8px)
+ }
+
+ 28% {
+ -webkit-transform: translateX(-16px);
+ transform: translateX(-16px)
+ }
+
+ 44% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 59% {
+ -webkit-transform: translateX(-16px);
+ transform: translateX(-16px)
+ }
+
+ 73% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 82% {
+ -webkit-transform: translateX(16px);
+ transform: translateX(16px)
+ }
+
+ 94% {
+ -webkit-transform: translateX(8px);
+ transform: translateX(8px)
+ }
+
+ to {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+}
+
+@keyframes e {
+ 0% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 16% {
+ -webkit-transform: translateX(-8px);
+ transform: translateX(-8px)
+ }
+
+ 28% {
+ -webkit-transform: translateX(-16px);
+ transform: translateX(-16px)
+ }
+
+ 44% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 59% {
+ -webkit-transform: translateX(-16px);
+ transform: translateX(-16px)
+ }
+
+ 73% {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+
+ 82% {
+ -webkit-transform: translateX(16px);
+ transform: translateX(16px)
+ }
+
+ 94% {
+ -webkit-transform: translateX(8px);
+ transform: translateX(8px)
+ }
+
+ to {
+ -webkit-transform: translateX(0);
+ transform: translateX(0)
+ }
+}
+
+.weui-loading {
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+ vertical-align: middle;
+ -webkit-animation: f 1s steps(12) infinite;
+ animation: f 1s steps(12) infinite;
+ background: transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;
+ background-size: 100%
+}
+
+.weui-btn_loading.weui-btn_primary .weui-loading,
+.weui-loading.weui-loading_transparent {
+ background-image: url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")
+}
+
+@-webkit-keyframes f {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg)
+ }
+
+ to {
+ -webkit-transform: rotate(1turn);
+ transform: rotate(1turn)
+ }
+}
+
+@keyframes f {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg)
+ }
+
+ to {
+ -webkit-transform: rotate(1turn);
+ transform: rotate(1turn)
+ }
+}
+
+.weui-slider {
+ padding: 15px 18px;
+ -webkit-user-select: none;
+ user-select: none
+}
+
+.weui-slider__inner {
+ position: relative;
+ height: 2px;
+ background-color: var(--weui-FG-3)
+}
+
+.weui-slider__track {
+ height: 2px;
+ background-color: var(--weui-BRAND);
+ width: 0
+}
+
+.weui-slider__handler {
+ position: absolute;
+ left: 0;
+ top: 50%;
+ width: 28px;
+ height: 28px;
+ margin-left: -14px;
+ margin-top: -14px;
+ border-radius: 50%;
+ background-color: #fff;
+ box-shadow: 0 0 4px var(--weui-FG-3)
+}
+
+.weui-slider-box {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-slider-box .weui-slider {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1
+}
+
+.weui-slider-box__value {
+ margin-left: .5em;
+ min-width: 24px;
+ color: var(--weui-FG-1);
+ text-align: center;
+ font-size: 14px
+}
+
+.wx_dot_loading,
+.wx_dot_loading:after,
+.wx_dot_loading:before {
+ display: inline-block;
+ vertical-align: middle;
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background-color: rgba(0, 0, 0, .3);
+ font-size: 0;
+ -webkit-animation: h 1.6s step-start infinite;
+ animation: h 1.6s step-start infinite
+}
+
+.wx_dot_loading {
+ position: relative
+}
+
+.wx_dot_loading:before {
+ content: "";
+ position: absolute;
+ left: -12px;
+ background-color: rgba(0, 0, 0, .1);
+ -webkit-animation: g 1.6s step-start infinite;
+ animation: g 1.6s step-start infinite
+}
+
+.wx_dot_loading:after {
+ content: "";
+ position: absolute;
+ right: -12px;
+ background-color: rgba(0, 0, 0, .5);
+ -webkit-animation: i 1.6s step-start infinite;
+ animation: i 1.6s step-start infinite
+}
+
+@-webkit-keyframes g {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .1)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .5)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .3)
+ }
+}
+
+@keyframes g {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .1)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .5)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .3)
+ }
+}
+
+@-webkit-keyframes h {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .3)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .1)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .5)
+ }
+}
+
+@keyframes h {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .3)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .1)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .5)
+ }
+}
+
+@-webkit-keyframes i {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .5)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .3)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .1)
+ }
+}
+
+@keyframes i {
+
+ 0%,
+ to {
+ background-color: rgba(0, 0, 0, .5)
+ }
+
+ 30% {
+ background-color: rgba(0, 0, 0, .3)
+ }
+
+ 60% {
+ background-color: rgba(0, 0, 0, .1)
+ }
+}
+
+.wx_dot_loading_white {
+ background-color: hsla(0, 0%, 100%, .3);
+ -webkit-animation: k 1.6s step-start infinite;
+ animation: k 1.6s step-start infinite
+}
+
+.wx_dot_loading_white:before {
+ background-color: hsla(0, 0%, 100%, .5);
+ -webkit-animation: j 1.6s step-start infinite;
+ animation: j 1.6s step-start infinite
+}
+
+.wx_dot_loading_white:after {
+ background-color: hsla(0, 0%, 100%, .1);
+ -webkit-animation: l 1.6s step-start infinite;
+ animation: l 1.6s step-start infinite
+}
+
+@-webkit-keyframes j {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+}
+
+@keyframes j {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+}
+
+@-webkit-keyframes k {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+}
+
+@keyframes k {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+}
+
+@-webkit-keyframes l {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+}
+
+@keyframes l {
+
+ 0%,
+ to {
+ background-color: hsla(0, 0%, 100%, .1)
+ }
+
+ 30% {
+ background-color: hsla(0, 0%, 100%, .3)
+ }
+
+ 60% {
+ background-color: hsla(0, 0%, 100%, .5)
+ }
+}
+
+:host {
+ width: 100%
+}
+
+.weui-slideview {
+ position: relative;
+ overflow: hidden
+}
+
+.weui-slideview__left {
+ position: relative;
+ z-index: 10
+}
+
+.weui-slideview__right {
+ position: absolute;
+ z-index: 1;
+ left: 100%;
+ top: 0;
+ height: 100%
+}
+
+.weui-slideview__btn__wrp {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ text-align: center;
+ min-width: 69px;
+ height: 100%;
+ white-space: nowrap
+}
+
+.weui-slideview__btn {
+ color: #fff;
+ padding: 0 17px
+}
+
+.weui-slideview__btn-group_default .weui-slideview__btn {
+ background: #c7c7cc
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-slideview__btn-group_default .weui-slideview__btn {
+ background: var(--weui-BG-4)
+ }
+}
+
+.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid #fff;
+ color: #fff;
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before {
+ border-left-color: var(--weui-FG-3)
+ }
+}
+
+.weui-slideview__btn-group_default:first-child:before {
+ display: none
+}
+
+.weui-slideview__btn-group_warn .weui-slideview__btn {
+ background: #fe3b30
+}
+
+.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before {
+ content: " ";
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 1px;
+ bottom: 0;
+ border-left: 1px solid #fff;
+ color: #fff;
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleX(.5);
+ transform: scaleX(.5)
+}
+
+.weui-slideview__btn-group_warn:first-child:before {
+ display: none
+}
+
+.weui-slideview_icon .weui-slideview__btn__wrp {
+ background: transparent;
+ font-size: 0
+}
+
+.weui-slideview_icon .weui-slideview__btn__wrp:first-child {
+ padding-left: 16px
+}
+
+.weui-slideview_icon .weui-slideview__btn__wrp:last-child {
+ padding-right: 8px
+}
+
+.weui-slideview_icon .weui-slideview__btn {
+ width: 48px;
+ height: 48px;
+ line-height: 48px;
+ padding: 0;
+ display: inline-block;
+ vertical-align: middle;
+ border-radius: 50%;
+ background-color: #fff
+}
+
+@media(prefers-color-scheme: dark) {
+ .weui-slideview_icon .weui-slideview__btn {
+ background-color: var(--weui-BG-4)
+ }
+}
+
+.weui-slideview_icon .weui-slideview__btn__icon {
+ display: inline-block;
+ vertical-align: middle;
+ width: 22px;
+ height: 22px
+}
+
+page {
+ --height: 44px;
+ --right: 190rpx
+}
+
+.weui-navigation-bar {
+ overflow: hidden;
+ color: var(--weui-FG-0)
+}
+
+.weui-navigation-bar .android {
+ --height: 48px;
+ --right: 222rpx
+}
+
+.weui-navigation-bar__inner {
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 5001;
+ height: var(--height);
+ padding-right: var(--right);
+ width: calc(100% - var(--right))
+}
+
+.weui-navigation-bar__inner,
+.weui-navigation-bar__inner .weui-navigation-bar__left {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__left {
+ position: relative;
+ width: var(--right);
+ padding-left: 16px
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn {
+ display: inline-block;
+ vertical-align: middle;
+ background-repeat: no-repeat
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback {
+ font-size: 12px;
+ width: 1em;
+ height: 2em;
+ -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%;
+ mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover;
+ background-color: currentColor
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active {
+ opacity: .5
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__center {
+ font-size: 17px;
+ text-align: center;
+ position: relative;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__loading {
+ margin-right: 4px;
+ font-size: 0
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading {
+ margin-left: 0
+}
+
+.weui-navigation-bar__inner .weui-navigation-bar__right {
+ margin-right: 16px
+}
+
+.weui-navigation-bar__placeholder {
+ height: var(--height);
+ background: var(--weui-BG-1);
+ position: relative;
+ z-index: 50
+}
+
+.weui-uploader__hd {
+ display: block
+}
+
+.weui-uploader__overview {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center
+}
+
+.weui-uploader__tips {
+ color: var(--weui-FG-2);
+ font-size: 14px;
+ line-height: 1.4;
+ padding-top: 4px
+}
+
+.weui-uploader__img {
+ display: block;
+ width: 100%;
+ height: 100%
+}
+
+.weui-gallery {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ -webkit-flex-wrap: nowrap;
+ flex-wrap: nowrap
+}
+
+.weui-gallery__info {
+ color: #fff;
+ font-size: 17px;
+ line-height: 60px;
+ min-height: 60px;
+ text-align: center
+}
+
+.weui-gallery__img__wrp {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
+ flex: 1;
+ position: relative;
+ font-size: 0
+}
+
+.weui-gallery__img {
+ position: absolute;
+ width: 100%;
+ height: 100%
+}
+
+.weui-gallery__opr {
+ position: static
+}
+
+.weui-search-bar .weui-search-bar__box .weui-search-bar__input {
+ height: inherit;
+ line-height: inherit
+}
+
+.weui-search-bar .weui-search-bar__box .weui-icon-clear {
+ display: block
+}
+
+.weui-loadmore .weui-loading {
+ margin-right: .3em
}
+
+.weui-btn_input-clear {
+ display: block
+}
\ No newline at end of file
diff --git a/miniprogram/page/component/index.js b/miniprogram/page/component/index.js
index 1ed67f14..5e400251 100644
--- a/miniprogram/page/component/index.js
+++ b/miniprogram/page/component/index.js
@@ -35,7 +35,7 @@ Page({
id: 'media',
name: '媒体组件',
open: false,
- pages: ['image', 'audio', 'video', 'camera']
+ pages: ['image', 'video', 'camera', 'live-pusher', 'live-player']
}, {
id: 'map',
name: '地图',
@@ -51,8 +51,26 @@ Page({
name: '开放能力',
open: false,
pages: ['ad', 'open-data', 'web-view']
+ }, {
+ id: 'obstacle-free',
+ name: '无障碍访问',
+ open: false,
+ pages: ['aria-component']
}
- ]
+ ],
+ theme: 'light'
+ },
+
+ onLoad() {
+ this.setData({
+ theme: wx.getSystemInfoSync().theme || 'light'
+ })
+
+ if (wx.onThemeChange) {
+ wx.onThemeChange(({ theme }) => {
+ this.setData({ theme })
+ })
+ }
},
kindToggle(e) {
diff --git a/miniprogram/page/component/index.wxml b/miniprogram/page/component/index.wxml
index 0c984999..b92d5426 100644
--- a/miniprogram/page/component/index.wxml
+++ b/miniprogram/page/component/index.wxml
@@ -9,7 +9,8 @@
{{item.name}}
-
+
+
diff --git a/miniprogram/page/component/index.wxss b/miniprogram/page/component/index.wxss
index 1557ca95..1db1d39b 100644
--- a/miniprogram/page/component/index.wxss
+++ b/miniprogram/page/component/index.wxss
@@ -2,5 +2,5 @@
.weui-agree__link {
display: inline;
- color: #586c94;
+ color: var(--weui-LINK);
}
diff --git a/miniprogram/page/component/pages/aria-component/aria-component.js b/miniprogram/page/component/pages/aria-component/aria-component.js
new file mode 100644
index 00000000..b34109a4
--- /dev/null
+++ b/miniprogram/page/component/pages/aria-component/aria-component.js
@@ -0,0 +1,10 @@
+// miniprogram/page/component/pages/aria-component/aria-component.js
+Page({
+ onShareAppMessage() {
+ return {
+ title: '无障碍访问',
+ path: 'page/component/pages/aria-component/aria-component'
+ }
+ },
+
+})
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/aria-component/aria-component.json b/miniprogram/page/component/pages/aria-component/aria-component.json
new file mode 100644
index 00000000..d122be39
--- /dev/null
+++ b/miniprogram/page/component/pages/aria-component/aria-component.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "aria-component"
+}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/aria-component/aria-component.wxml b/miniprogram/page/component/pages/aria-component/aria-component.wxml
new file mode 100644
index 00000000..01d61a87
--- /dev/null
+++ b/miniprogram/page/component/pages/aria-component/aria-component.wxml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+ 无障碍访问说明
+
+
+
+ 为了更好地满足视障人士\n对于小程序的访问需求\n基础库自2.7.1起,支持部分ARIA标签\n无障碍特性在读屏模式下可以访问
+
+
+
+
+
+ 例子
+
+
+ 提交
+
+
+
+
+
diff --git a/miniprogram/page/component/pages/aria-component/aria-component.wxss b/miniprogram/page/component/pages/aria-component/aria-component.wxss
new file mode 100644
index 00000000..88e7251a
--- /dev/null
+++ b/miniprogram/page/component/pages/aria-component/aria-component.wxss
@@ -0,0 +1,12 @@
+.text-box{
+ margin-bottom: 70rpx;
+ padding: 40rpx 0;
+ display: flex;
+ min-height: 300rpx;
+ justify-content: center;
+ align-items: center;
+ text-align: center;
+ font-size: 30rpx;
+ color: #353535;
+ line-height: 2em;
+}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/audio/audio.js b/miniprogram/page/component/pages/audio/audio.js
deleted file mode 100644
index fdce7a54..00000000
--- a/miniprogram/page/component/pages/audio/audio.js
+++ /dev/null
@@ -1,20 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'audio',
- path: 'page/component/pages/audio/audio'
- }
- },
-
- data: {
- current: {
- poster: 'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000',
- name: '此时此刻',
- author: '许巍',
- src: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46',
- },
- audioAction: {
- method: 'pause'
- }
- }
-})
diff --git a/miniprogram/page/component/pages/audio/audio.json b/miniprogram/page/component/pages/audio/audio.json
deleted file mode 100644
index a751b260..00000000
--- a/miniprogram/page/component/pages/audio/audio.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "navigationBarTitleText": "audio"
-}
diff --git a/miniprogram/page/component/pages/audio/audio.wxml b/miniprogram/page/component/pages/audio/audio.wxml
deleted file mode 100644
index 393086cb..00000000
--- a/miniprogram/page/component/pages/audio/audio.wxml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/audio/audio.wxss b/miniprogram/page/component/pages/audio/audio.wxss
deleted file mode 100644
index 3329b02f..00000000
--- a/miniprogram/page/component/pages/audio/audio.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* page/component/pages/audio/audio.wxss */
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/button/button.js b/miniprogram/page/component/pages/button/button.js
index 5919317d..33f25195 100644
--- a/miniprogram/page/component/pages/button/button.js
+++ b/miniprogram/page/component/pages/button/button.js
@@ -32,6 +32,26 @@ const pageObject = {
this.setData({
loading: !this.data.loading
})
+ },
+
+ handleContact(e) {
+ console.log(e.detail)
+ },
+
+ handleGetPhoneNumber(e) {
+ console.log(e.detail)
+ },
+
+ handleGetUserInfo(e) {
+ console.log(e.detail)
+ },
+
+ handleOpenSetting(e) {
+ console.log(e.detail.authSetting)
+ },
+
+ handleGetUserInfo(e) {
+ console.log(e.detail.userInfo)
}
}
diff --git a/miniprogram/page/component/pages/button/button.wxml b/miniprogram/page/component/pages/button/button.wxml
index 958660a8..dbba38aa 100644
--- a/miniprogram/page/component/pages/button/button.wxml
+++ b/miniprogram/page/component/pages/button/button.wxml
@@ -27,6 +27,12 @@
+
+
+
+
+
+
diff --git a/miniprogram/page/component/pages/camera/camera.js b/miniprogram/page/component/pages/camera/camera.js
index c0bb2ac4..52580565 100644
--- a/miniprogram/page/component/pages/camera/camera.js
+++ b/miniprogram/page/component/pages/camera/camera.js
@@ -1,3 +1,122 @@
+const vs = `
+ attribute vec3 aPos;
+ attribute vec2 aVertexTextureCoord;
+ varying highp vec2 vTextureCoord;
+
+ void main(void){
+ gl_Position = vec4(aPos, 1);
+ vTextureCoord = aVertexTextureCoord;
+ }
+`
+
+const fs = `
+ varying highp vec2 vTextureCoord;
+ uniform sampler2D uSampler;
+
+ void main(void) {
+ gl_FragColor = texture2D(uSampler, vTextureCoord);
+ }
+`
+
+const vertex = [
+ -1, -1, 0.0,
+ 1, -1, 0.0,
+ 1, 1, 0.0,
+ -1, 1, 0.0
+]
+
+const vertexIndice = [
+ 0, 1, 2,
+ 0, 2, 3
+]
+
+const texCoords = [
+ 0.0, 0.0,
+ 1.0, 0.0,
+ 1.0, 1.0,
+ 0.0, 1.0
+]
+function createShader(gl, src, type) {
+ const shader = gl.createShader(type)
+ gl.shaderSource(shader, src)
+ gl.compileShader(shader)
+
+ if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
+ console.error('Error compiling shader: ' + gl.getShaderInfoLog(shader))
+ }
+ return shader
+}
+
+const buffers = {}
+
+function createRenderer(canvas, width, height) {
+ const gl = canvas.getContext("webgl")
+ if (!gl) {
+ console.error('Unable to get webgl context.')
+ return
+ }
+
+ const info = wx.getSystemInfoSync()
+ gl.canvas.width = info.pixelRatio * width
+ gl.canvas.height = info.pixelRatio * height
+ gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight)
+
+ const vertexShader = createShader(gl, vs, gl.VERTEX_SHADER)
+ const fragmentShader = createShader(gl, fs, gl.FRAGMENT_SHADER)
+
+ const program = gl.createProgram()
+ gl.attachShader(program, vertexShader)
+ gl.attachShader(program, fragmentShader)
+ gl.linkProgram(program)
+
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
+ console.error('Unable to initialize the shader program.')
+ return
+ }
+
+ gl.useProgram(program)
+
+ const texture = gl.createTexture()
+ gl.activeTexture(gl.TEXTURE0)
+ gl.bindTexture(gl.TEXTURE_2D, texture)
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true)
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)
+ gl.bindTexture(gl.TEXTURE_2D, null)
+
+ buffers.vertexBuffer = gl.createBuffer()
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffers.vertexBuffer)
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertex), gl.STATIC_DRAW)
+
+ buffers.vertexIndiceBuffer = gl.createBuffer()
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers.vertexIndiceBuffer)
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vertexIndice), gl.STATIC_DRAW)
+
+ const aVertexPosition = gl.getAttribLocation(program, 'aPos')
+ gl.vertexAttribPointer(aVertexPosition, 3, gl.FLOAT, false, 0, 0)
+ gl.enableVertexAttribArray(aVertexPosition)
+
+ buffers.trianglesTexCoordBuffer = gl.createBuffer()
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffers.trianglesTexCoordBuffer)
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(texCoords), gl.STATIC_DRAW)
+
+ const vertexTexCoordAttribute = gl.getAttribLocation(program, "aVertexTextureCoord")
+ gl.enableVertexAttribArray(vertexTexCoordAttribute)
+ gl.vertexAttribPointer(vertexTexCoordAttribute, 2, gl.FLOAT, false, 0, 0)
+
+ const samplerUniform = gl.getUniformLocation(program, 'uSampler')
+ gl.uniform1i(samplerUniform, 0)
+
+ return (arrayBuffer, width, height) => {
+ gl.bindTexture(gl.TEXTURE_2D, texture)
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, arrayBuffer)
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0)
+ }
+}
+
+
Page({
onShareAppMessage() {
return {
@@ -11,10 +130,48 @@ Page({
videoSrc: '',
position: 'back',
mode: 'scanCode',
- result: {}
+ result: {},
+ frameWidth: 0,
+ frameHeight: 0,
+ width: 288,
+ height: 358,
+ showCanvas: false,
},
- onLoad() {
+
+ onReady() {
this.ctx = wx.createCameraContext()
+ // const selector = wx.createSelectorQuery();
+ // selector.select('#webgl')
+ // .node(this.init)
+ // .exec()
+ },
+ init(res) {
+ if (this.listener) {
+ this.listener.stop()
+ }
+ const canvas = res.node
+ const render = createRenderer(canvas, this.data.width, this.data.height);
+
+ // if (!render || typeof render !== 'function') return
+
+ this.listener = this.ctx.onCameraFrame((frame) => {
+
+ render(new Uint8Array(frame.data), frame.width, frame.height);
+
+ const {
+ frameWidth,
+ frameHeight,
+ } = this.data;
+
+ if (frameWidth === frame.width && frameHeight == frame.height) return;
+ this.setData({
+ frameWidth: frame.width,
+ frameHeight: frame.height,
+
+ })
+
+ })
+ this.listener.start()
},
takePhoto() {
this.ctx.takePhoto({
@@ -51,5 +208,21 @@ Page({
},
error(e) {
console.log(e.detail)
+ },
+
+ handleShowCanvas() {
+ const that = this;
+
+ this.setData({
+ showCanvas: !this.data.showCanvas
+ }, () => {
+ if (this.data.showCanvas) {
+ const selector = wx.createSelectorQuery();
+ selector.select('#webgl')
+ .node(this.init)
+ .exec()
+ }
+ })
+
}
})
diff --git a/miniprogram/page/component/pages/camera/camera.wxml b/miniprogram/page/component/pages/camera/camera.wxml
index 35d46ed1..d3fd4ce2 100644
--- a/miniprogram/page/component/pages/camera/camera.wxml
+++ b/miniprogram/page/component/pages/camera/camera.wxml
@@ -6,13 +6,30 @@
+ camera 组件
+
+ 使用实时数据帧在 canvas 组件的展示
+
+ 帧高度:{{ frameHeight }} 帧宽度:{{ frameWidth }}
+
+
+
+
+
+
@@ -25,11 +42,11 @@
-
+
- 预览
+ 点击录像或拍照即可在下方预览效果
diff --git a/miniprogram/page/component/pages/camera/camera.wxss b/miniprogram/page/component/pages/camera/camera.wxss
index fac09706..ba884d25 100644
--- a/miniprogram/page/component/pages/camera/camera.wxss
+++ b/miniprogram/page/component/pages/camera/camera.wxss
@@ -31,4 +31,9 @@ form {
align-items: center;
padding: 20rpx 0;
min-height: 60rpx;
+}
+
+.info-container {
+ margin: 24rpx;
+ text-align: center;
}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/canvas/canvas.js b/miniprogram/page/component/pages/canvas/canvas.js
index 42242865..4bafa925 100644
--- a/miniprogram/page/component/pages/canvas/canvas.js
+++ b/miniprogram/page/component/pages/canvas/canvas.js
@@ -1,3 +1,32 @@
+//WebGL
+const vs = `
+ precision mediump float;
+
+ attribute vec2 vertPosition;
+ attribute vec3 vertColor;
+ varying vec3 fragColor;
+
+ void main() {
+ gl_Position = vec4(vertPosition, 0.0, 1.0);
+ fragColor = vertColor;
+ }
+`
+
+const fs = `
+ precision mediump float;
+
+ varying vec3 fragColor;
+ void main() {
+ gl_FragColor = vec4(fragColor, 1.0);
+ }
+`
+
+const triangleVertices = [
+ 0.0, 0.5, 1.0, 1.0, 0.0,
+ -0.5, -0.5, 0.7, 0.0, 1.0,
+ 0.5, -0.5, 0.1, 1.0, 0.6
+];
+
Page({
onShareAppMessage() {
return {
@@ -7,6 +36,7 @@ Page({
},
onReady() {
+ // canvas
this.position = {
x: 150,
y: 150,
@@ -16,6 +46,63 @@ Page({
this.drawBall()
this.interval = setInterval(this.drawBall, 17)
+
+ // canvas2D
+ this.position2D = {
+ x: 150,
+ y: 150,
+ vx: 2,
+ vy: 2
+ }
+ this.x = -100;
+
+ wx.createSelectorQuery()
+ .select('#canvas2D')
+ .fields({
+ node: true,
+ size: true,
+ })
+ .exec(this.init.bind(this))
+
+ // WebGL
+ wx.createSelectorQuery()
+ .select('#canvasWebGL')
+ .node()
+ .exec((res) => {
+ const canvas = res[0].node
+ this.renderWebGL(canvas)
+ })
+ },
+
+ init(res) {
+ const width = res[0].width
+ const height = res[0].height
+
+ const canvas = res[0].node
+ const ctx = canvas.getContext('2d')
+
+ const dpr = wx.getSystemInfoSync().pixelRatio
+ canvas.width = width * dpr
+ canvas.height = height * dpr
+ ctx.scale(dpr, dpr)
+
+ const renderLoop = () => {
+ this.render(canvas, ctx)
+ canvas.requestAnimationFrame(renderLoop)
+ }
+ canvas.requestAnimationFrame(renderLoop)
+
+ const img = canvas.createImage()
+ img.onload = () => {
+ this._img = img
+ }
+ img.src = './car.png'
+ },
+
+ render(canvas, ctx) {
+ ctx.clearRect(0, 0, 305, 305)
+ this.drawBall2D(ctx)
+ this.drawCar(ctx)
},
drawBall() {
@@ -54,10 +141,111 @@ Page({
ball(300 - p.x, 300 - p.y)
ball(p.x, 300 - p.y)
ball(300 - p.x, p.y)
-
context.draw()
},
+ drawBall2D(ctx) {
+ const p = this.position2D
+ p.x += p.vx
+ p.y += p.vy
+ if (p.x >= 300) {
+ p.vx = -2
+ }
+ if (p.x <= 7) {
+ p.vx = 2
+ }
+ if (p.y >= 300) {
+ p.vy = -2
+ }
+ if (p.y <= 7) {
+ p.vy = 2
+ }
+
+ function ball(x, y) {
+ ctx.beginPath()
+ ctx.arc(x, y, 5, 0, Math.PI * 2)
+ ctx.fillStyle = '#1aad19'
+ ctx.strokeStyle = 'rgba(1,1,1,0)'
+ ctx.fill()
+ ctx.stroke()
+ }
+
+ ball(p.x, 150)
+ ball(150, p.y)
+ ball(300 - p.x, 150)
+ ball(150, 300 - p.y)
+ ball(p.x, p.y)
+ ball(300 - p.x, 300 - p.y)
+ ball(p.x, 300 - p.y)
+ ball(300 - p.x, p.y)
+ },
+
+ drawCar(ctx) {
+ if (!this._img) return
+ if (this.x > 350) {
+ this.x = -100
+ }
+ ctx.drawImage(this._img, this.x++, 150 - 25, 100, 50)
+ ctx.restore()
+ },
+
+ renderWebGL(canvas) {
+
+ const gl = canvas.getContext('webgl')
+ if (!gl) {
+ console.error('gl init failed', gl)
+ return
+ }
+ gl.viewport(0, 0, 305, 305)
+ const vertShader = gl.createShader(gl.VERTEX_SHADER)
+ gl.shaderSource(vertShader, vs)
+ gl.compileShader(vertShader)
+
+ const fragShader = gl.createShader(gl.FRAGMENT_SHADER)
+ gl.shaderSource(fragShader, fs)
+ gl.compileShader(fragShader)
+
+ const prog = gl.createProgram()
+ gl.attachShader(prog, vertShader)
+ gl.attachShader(prog, fragShader)
+ gl.deleteShader(vertShader)
+ gl.deleteShader(fragShader)
+ gl.linkProgram(prog)
+ gl.useProgram(prog)
+
+ const draw = () => {
+ const triangleVertexBufferObject = gl.createBuffer()
+ gl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexBufferObject)
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.STATIC_DRAW)
+
+ const positionAttribLocation = gl.getAttribLocation(prog, 'vertPosition')
+ const colorAttribLocation = gl.getAttribLocation(prog, 'vertColor')
+ gl.vertexAttribPointer(
+ positionAttribLocation,
+ 2,
+ gl.FLOAT,
+ gl.FALSE,
+ 5 * Float32Array.BYTES_PER_ELEMENT,
+ 0
+ )
+ gl.vertexAttribPointer(
+ colorAttribLocation,
+ 3,
+ gl.FLOAT,
+ gl.FALSE,
+ 5 * Float32Array.BYTES_PER_ELEMENT,
+ 2 * Float32Array.BYTES_PER_ELEMENT
+ )
+
+ gl.enableVertexAttribArray(positionAttribLocation)
+ gl.enableVertexAttribArray(colorAttribLocation)
+ gl.drawArrays(gl.TRIANGLES, 0, 3)
+ canvas.requestAnimationFrame(draw)
+ }
+
+ canvas.requestAnimationFrame(draw)
+ },
+
onUnload() {
clearInterval(this.interval)
}
diff --git a/miniprogram/page/component/pages/canvas/canvas.wxml b/miniprogram/page/component/pages/canvas/canvas.wxml
index 5888f3d3..7e90e498 100644
--- a/miniprogram/page/component/pages/canvas/canvas.wxml
+++ b/miniprogram/page/component/pages/canvas/canvas.wxml
@@ -5,8 +5,34 @@
-
-
+
+
+ Canvas
+
+
+
+
+
+
+
+
+
+
+ Canvas 2D
+
+
+
+
+
+
+
+
+
+ WebGL
+
+
+
+
diff --git a/miniprogram/page/component/pages/canvas/canvas.wxss b/miniprogram/page/component/pages/canvas/canvas.wxss
index ba0da4a9..0f6f41e1 100644
--- a/miniprogram/page/component/pages/canvas/canvas.wxss
+++ b/miniprogram/page/component/pages/canvas/canvas.wxss
@@ -1,5 +1,8 @@
+@import '../../../common//lib/weui.wxss';
+
.canvas {
width: 305px;
height: 305px;
- background-color: #fff;
-}
+ background-color: var(--weui-BG-1);
+ margin-top: 60rpx;
+}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/canvas/car.png b/miniprogram/page/component/pages/canvas/car.png
new file mode 100644
index 00000000..de30d86b
Binary files /dev/null and b/miniprogram/page/component/pages/canvas/car.png differ
diff --git a/miniprogram/page/component/pages/editor/editor.js b/miniprogram/page/component/pages/editor/editor.js
index 4456d3a7..af31ef28 100644
--- a/miniprogram/page/component/pages/editor/editor.js
+++ b/miniprogram/page/component/pages/editor/editor.js
@@ -1,7 +1,3 @@
-const util = require('../../../../util/util.js')
-
-const compareVersion = util.compareVersion
-
Page({
onShareAppMessage() {
return {
@@ -9,12 +5,15 @@ Page({
path: 'page/component/pages/editor/editor'
}
},
-
data: {
formats: {},
- bottom: 0,
readOnly: false,
placeholder: '开始输入...',
+ editorHeight: 300,
+ keyboardHeight: 0,
+ isIOS: false,
+ safeHeight: 0,
+ toolBarHeight: 50,
},
readOnlyChange() {
this.setData({
@@ -22,62 +21,92 @@ Page({
})
},
onLoad() {
- this.canUse = true
- wx.loadFontFace({
- family: 'Pacifico',
- source: 'url("https://sungd.github.io/Pacifico.ttf")',
- success: console.log
- })
- const {SDKVersion} = wx.getSystemInfoSync()
+ const { platform, safeArea, model, screenHeight} = wx.getSystemInfoSync()
+ let safeHeight;
+ if (safeArea) {
+ safeHeight = (screenHeight - safeArea.bottom);
+ } else {
+ safeHeight = 32;
+ }
+ this._safeHeight = safeHeight;
+ let isIOS = platform === 'ios'
+ this.setData({ isIOS, safeHeight, toolBarHeight: isIOS ? safeHeight + 50 : 50 })
+ const that = this
+ this.updatePosition(0)
+ let keyboardHeight = 0
+ wx.onKeyboardHeightChange(res => {
+ if (res.height === keyboardHeight) {
+ return
+ }
+ const duration = res.height > 0 ? res.duration * 1000 : 0
+ keyboardHeight = res.height
+ setTimeout(() => {
+ wx.pageScrollTo({
+ scrollTop: 0,
+ success() {
+ that.updatePosition(keyboardHeight)
+ that.editorCtx.scrollIntoView()
+ }
+ })
+ }, duration)
- if (compareVersion(SDKVersion, '2.7.0') >= 0) {
- //
+ })
+ },
+ updatePosition(keyboardHeight) {
+ const toolbarHeight = 50
+ const { windowHeight, platform } = wx.getSystemInfoSync()
+ let editorHeight = keyboardHeight > 0 ? (windowHeight - keyboardHeight - toolbarHeight) : windowHeight
+ if (keyboardHeight === 0) {
+ this.setData({
+ editorHeight, keyboardHeight,
+ toolBarHeight: this.data.isIOS ? 50 + this._safeHeight : 50,
+ safeHeight: this._safeHeight,
+ })
} else {
- this.canUse = false
- // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
- wx.showModal({
- title: '提示',
- content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
+ this.setData({ editorHeight, keyboardHeight,
+ toolBarHeight: 50,
+ safeHeight: 0,
})
}
},
-
+ calNavigationBarAndStatusBar() {
+ const systemInfo = wx.getSystemInfoSync()
+ const { statusBarHeight, platform } = systemInfo
+ const isIOS = platform === 'ios'
+ const navigationBarHeight = isIOS ? 44 : 48
+ return statusBarHeight + navigationBarHeight
+ },
onEditorReady() {
const that = this
wx.createSelectorQuery().select('#editor').context(function (res) {
that.editorCtx = res.context
}).exec()
},
-
- undo() {
- this.editorCtx.undo()
- },
- redo() {
- this.editorCtx.redo()
+ blur() {
+ this.editorCtx.blur()
},
format(e) {
- if (!this.canUse) return
- const {name, value} = e.target.dataset
+ let { name, value } = e.target.dataset
if (!name) return
// console.log('format', name, value)
this.editorCtx.format(name, value)
- },
+ },
onStatusChange(e) {
const formats = e.detail
- this.setData({formats})
+ this.setData({ formats })
},
insertDivider() {
this.editorCtx.insertDivider({
- success() {
+ success: function () {
console.log('insert divider success')
}
})
},
clear() {
this.editorCtx.clear({
- success() {
- console.log('clear success')
+ success: function (res) {
+ console.log("clear success")
}
})
},
@@ -95,14 +124,15 @@ Page({
const that = this
wx.chooseImage({
count: 1,
- success() {
+ success: function (res) {
that.editorCtx.insertImage({
- src: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1543767268337&di=5a3bbfaeb30149b2afd33a3c7aaa4ead&imgtype=0&src=http%3A%2F%2Fimg02.tooopen.com%2Fimages%2F20151031%2Ftooopen_sy_147004931368.jpg',
+ src: res.tempFilePaths[0],
data: {
id: 'abcd',
role: 'god'
},
- success() {
+ width: '80%',
+ success: function () {
console.log('insert image success')
}
})
diff --git a/miniprogram/page/component/pages/editor/editor.json b/miniprogram/page/component/pages/editor/editor.json
index 485ea9b2..6d9c3fc0 100644
--- a/miniprogram/page/component/pages/editor/editor.json
+++ b/miniprogram/page/component/pages/editor/editor.json
@@ -1,3 +1,4 @@
{
- "navigationBarTitleText": "editor"
+ "navigationBarTitleText": "editor",
+ "disableScroll": true
}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/editor/editor.wxml b/miniprogram/page/component/pages/editor/editor.wxml
index 36ed9eaf..1b9f1fcd 100644
--- a/miniprogram/page/component/pages/editor/editor.wxml
+++ b/miniprogram/page/component/pages/editor/editor.wxml
@@ -1,58 +1,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/editor/editor.wxss b/miniprogram/page/component/pages/editor/editor.wxss
index e79e58f6..116b9a01 100644
--- a/miniprogram/page/component/pages/editor/editor.wxss
+++ b/miniprogram/page/component/pages/editor/editor.wxss
@@ -1,41 +1,50 @@
-@import "../../../common/lib/weui.wxss";
-@import "./assets/iconfont.wxss"
+@import "../../../weui/components/weui-wxss/dist/style/weui.wxss";
+@import "./assets/iconfont.wxss";
-.wrapper {
- padding: 5px;
+.container {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+}
+
+.ql-container {
+ box-sizing: border-box;
+ width: 100%;
+ height: 100%;
+ font-size: 16px;
+ line-height: 1.5;
+ overflow: auto;
+ padding: 10px 10px 20px 10px;
+ border: 1px solid #ECECEC;
+}
+
+.ql-active {
+ color: #22C704;
}
.iconfont {
display: inline-block;
- padding: 8px 8px;
- width: 24px;
- height: 24px;
+ width: 30px;
+ height: 30px;
cursor: pointer;
font-size: 20px;
}
.toolbar {
box-sizing: border-box;
- /* border: 1px solid #ccc; */
- border-bottom: 0;
- font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
-}
-
-
-.ql-container {
- box-sizing: border-box;
- padding: 12px 15px;
+ padding: 0 10px;
+ /* height: 50px; */
width: 100%;
- min-height: 30vh;
- height: auto;
- /* border-top: 1px solid #ccc;
- border-bottom: 1px solid #ccc; */
- background: #fff;
- margin-top: 20px;
- font-size: 16px;
- line-height: 1.5;
+ position: fixed;
+ left: 0;
+ right: 100%;
+ bottom: 0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ border: 1px solid #ECECEC;
+ border-left: none;
+ border-right: none;
}
-.ql-active {
- color: #06c;
-}
diff --git a/miniprogram/page/component/pages/image/image.js b/miniprogram/page/component/pages/image/image.js
index 8cbcb9b7..ab437292 100644
--- a/miniprogram/page/component/pages/image/image.js
+++ b/miniprogram/page/component/pages/image/image.js
@@ -1,4 +1,3 @@
-const config = require('../../../../config')
Page({
onShareAppMessage() {
@@ -7,7 +6,23 @@ Page({
path: 'page/component/pages/image/image'
}
},
+ onLoad() {
+ wx.cloud.getTempFileURL({
+ fileList: [{
+ fileID: 'cloud://release-b86096.7265-release-b86096-1258211818/开发者社区.webp',
+ maxAge: 60 * 60,
+ }]
+ }).then(res => {
+ console.log(res);
+ this.setData({
+ webpImageUrl: res.fileList[0].tempFileURL
+ })
+ }).catch(error => {
+ console.log('CLOUD:image 临时链接获取失败')
+ })
+ },
data: {
- imageUrl: config.downloadExampleUrl
+ imageUrl: 'cloud://release-b86096.7265-release-b86096-1258211818/demo.jpg',
+ webpImageURL: '',
}
})
diff --git a/miniprogram/page/component/pages/image/image.wxml b/miniprogram/page/component/pages/image/image.wxml
index d1070d7f..318edf7d 100644
--- a/miniprogram/page/component/pages/image/image.wxml
+++ b/miniprogram/page/component/pages/image/image.wxml
@@ -17,6 +17,12 @@
+
+ Webp Image
+
+
+
+
diff --git a/miniprogram/page/component/pages/image/image.wxss b/miniprogram/page/component/pages/image/image.wxss
index 1c3d01c1..26b85a8b 100644
--- a/miniprogram/page/component/pages/image/image.wxss
+++ b/miniprogram/page/component/pages/image/image.wxss
@@ -4,6 +4,6 @@
.image {
margin-top: 30rpx;
- width: 580rpx;
- height: 208rpx;
+ width: 690rpx;
+ height: 250rpx;
}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/live-player/live-player.js b/miniprogram/page/component/pages/live-player/live-player.js
new file mode 100644
index 00000000..c118b476
--- /dev/null
+++ b/miniprogram/page/component/pages/live-player/live-player.js
@@ -0,0 +1,85 @@
+Page({
+ onShareAppMessage() {
+ return {
+ title: 'live-player',
+ path: 'page/component/pages/live-player/live-player'
+ }
+ },
+ data: {
+ videoSrc: ""
+ },
+ onReady(res) {
+ this.ctx = wx.createLivePlayerContext('player')
+ },
+ handleScanQRCode() {
+ wx.scanCode({
+ complete: (res) => {
+ const { result } = res;
+ this.setData({
+ videoSrc: result
+ })
+ },
+ })
+ },
+ handleLivePlayerStateChange(e) {
+ console.log('live-player code:', e.detail.code)
+ },
+ handleLivePlayerError(e) {
+ console.error('live-player error:', e.detail.errMsg)
+ },
+ handlePlay() {
+ this.ctx.play({
+ success: res => {
+ console.log('play success')
+ },
+ fail: res => {
+ console.log('play fail')
+ }
+ })
+ },
+ handlePause() {
+ this.ctx.pause({
+ success: res => {
+ console.log('pause success')
+ },
+ fail: res => {
+ console.log('pause fail')
+ }
+ })
+ },
+ handleStop() {
+ this.ctx.stop({
+ success: res => {
+ console.log('stop success')
+ },
+ fail: res => {
+ console.log('stop fail')
+ }
+ })
+ },
+ handleResume() {
+ this.ctx.resume({
+ success: res => {
+ console.log('resume success')
+ },
+ fail: res => {
+ console.log('resume fail')
+ }
+ })
+ },
+ handleMute() {
+ this.ctx.mute({
+ success: res => {
+ console.log('mute success')
+ },
+ fail: res => {
+ console.log('mute fail')
+ }
+ })
+ },
+ handleVideoSrcInput(e) {
+ this.setData({
+ videoSrc: e.detail.value
+ })
+ }
+})
diff --git a/miniprogram/page/component/pages/live-player/live-player.json b/miniprogram/page/component/pages/live-player/live-player.json
new file mode 100644
index 00000000..7695d2e0
--- /dev/null
+++ b/miniprogram/page/component/pages/live-player/live-player.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "live-player"
+}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/live-player/live-player.wxml b/miniprogram/page/component/pages/live-player/live-player.wxml
new file mode 100644
index 00000000..6dcebdaa
--- /dev/null
+++ b/miniprogram/page/component/pages/live-player/live-player.wxml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 视频地址 (支持flv, rtmp):
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/live-player/live-player.wxss b/miniprogram/page/component/pages/live-player/live-player.wxss
new file mode 100644
index 00000000..96d1725d
--- /dev/null
+++ b/miniprogram/page/component/pages/live-player/live-player.wxss
@@ -0,0 +1,20 @@
+live-player {
+ display: flex;
+ width: 100%;
+ height: 350rpx;
+}
+
+.page-body-button {
+ margin-bottom: 30rpx;
+}
+
+.page-url {
+ margin: 0 auto 30rpx;
+ width: 90%;
+
+}
+
+input {
+ width: 90%;
+ margin: 0 auto 30rpx;
+}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/live-pusher/live-pusher.js b/miniprogram/page/component/pages/live-pusher/live-pusher.js
new file mode 100644
index 00000000..9bdbd1df
--- /dev/null
+++ b/miniprogram/page/component/pages/live-pusher/live-pusher.js
@@ -0,0 +1,85 @@
+Page({
+ onShareAppMessage() {
+ return {
+ title: 'live-pusher',
+ path: 'page/component/pages/live-pusher/live-pusher'
+ }
+ },
+ data: {
+ videoSrc: '',
+ },
+ onReady(res) {
+ this.ctx = wx.createLivePusherContext('pusher')
+ },
+ handleLivePusherStateChange(e) {
+ console.log('live-pusher code:', e.detail.code)
+ },
+ handleLivePusherError(e) {
+ console.error('live-pusher error:', e.detail.errMsg)
+ },
+ handleStart() {
+ this.ctx.start({
+ success: res => {
+ console.log('start success')
+ },
+ fail: res => {
+ console.log('start fail')
+ }
+ })
+ },
+ handleScanQRCode() {
+ wx.scanCode({
+ complete: (res) => {
+ const { result } = res;
+ this.setData({
+ videoSrc: result
+ })
+ },
+ })
+ },
+ handlePause() {
+ this.ctx.pause({
+ success: res => {
+ console.log('pause success')
+ },
+ fail: res => {
+ console.log('pause fail')
+ }
+ })
+ },
+ handleStop() {
+ this.ctx.stop({
+ success: res => {
+ console.log('stop success')
+ },
+ fail: res => {
+ console.log('stop fail')
+ }
+ })
+ },
+ handleResume() {
+ this.ctx.resume({
+ success: res => {
+ console.log('resume success')
+ },
+ fail: res => {
+ console.log('resume fail')
+ }
+ })
+ },
+ handleSwitchCamera() {
+ this.ctx.switchCamera({
+ success: res => {
+ console.log('switch camera success')
+ },
+ fail: res => {
+ console.log('switch camera fail')
+ }
+ })
+ },
+ handleVideoSrcInput(e) {
+ this.setData({
+ videoSrc: e.detail.value
+ })
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/live-pusher/live-pusher.json b/miniprogram/page/component/pages/live-pusher/live-pusher.json
new file mode 100644
index 00000000..06592b5e
--- /dev/null
+++ b/miniprogram/page/component/pages/live-pusher/live-pusher.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "live-pusher"
+}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/live-pusher/live-pusher.wxml b/miniprogram/page/component/pages/live-pusher/live-pusher.wxml
new file mode 100644
index 00000000..1e1b4781
--- /dev/null
+++ b/miniprogram/page/component/pages/live-pusher/live-pusher.wxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+ 视频地址 (支持rtmp):
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram/page/component/pages/live-pusher/live-pusher.wxss b/miniprogram/page/component/pages/live-pusher/live-pusher.wxss
new file mode 100644
index 00000000..33f5cfbd
--- /dev/null
+++ b/miniprogram/page/component/pages/live-pusher/live-pusher.wxss
@@ -0,0 +1,19 @@
+live-pusher {
+ display: flex;
+ margin: 12rpx auto;
+ height: 350rpx;
+}
+
+.page-body-button {
+ margin-bottom: 30rpx;
+}
+.page-url {
+ margin: 0 auto 30rpx;
+ width: 90%;
+}
+
+input {
+ width: 90%;
+ margin: 0 auto 30rpx;
+}
+
diff --git a/miniprogram/page/component/pages/map/map.wxml b/miniprogram/page/component/pages/map/map.wxml
index c9a76951..02a06850 100644
--- a/miniprogram/page/component/pages/map/map.wxml
+++ b/miniprogram/page/component/pages/map/map.wxml
@@ -5,7 +5,7 @@
- 当前组件使用了墨渊底图样式,查看更多样式。
+ 当前组件使用了墨渊底图样式,查看查看更多。
diff --git a/miniprogram/page/component/pages/official-account/official-account.js b/miniprogram/page/component/pages/official-account/official-account.js
new file mode 100644
index 00000000..b3f124ff
--- /dev/null
+++ b/miniprogram/page/component/pages/official-account/official-account.js
@@ -0,0 +1,66 @@
+// miniprogram/page/component/pages/official-account/official-account.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/official-account/official-account.json b/miniprogram/page/component/pages/official-account/official-account.json
new file mode 100644
index 00000000..8835af06
--- /dev/null
+++ b/miniprogram/page/component/pages/official-account/official-account.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/official-account/official-account.wxml b/miniprogram/page/component/pages/official-account/official-account.wxml
new file mode 100644
index 00000000..7d9ebfa8
--- /dev/null
+++ b/miniprogram/page/component/pages/official-account/official-account.wxml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram/page/component/pages/official-account/official-account.wxss b/miniprogram/page/component/pages/official-account/official-account.wxss
new file mode 100644
index 00000000..ba1da3ac
--- /dev/null
+++ b/miniprogram/page/component/pages/official-account/official-account.wxss
@@ -0,0 +1 @@
+/* miniprogram/page/component/pages/official-account/official-account.wxss */
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/scroll-view/scroll-view.js b/miniprogram/page/component/pages/scroll-view/scroll-view.js
index 57a93832..4985f41b 100644
--- a/miniprogram/page/component/pages/scroll-view/scroll-view.js
+++ b/miniprogram/page/component/pages/scroll-view/scroll-view.js
@@ -1,6 +1,72 @@
const order = ['demo1', 'demo2', 'demo3']
Page({
+
+ onLoad() {
+ this.animate('#scroll-sample-object1', [{
+ borderRadius: '0',
+ offset: 0,
+ }, {
+ borderRadius: '25%',
+ offset: .5,
+ }, {
+ borderRadius: '50%',
+ offset: 1
+ }], 2000, {
+ scrollSource: '#scroll-view_D',
+ timeRange: 2000,
+ startScrollOffset: 0,
+ endScrollOffset: 150,
+ })
+
+ this.animate('#scroll-sample-object2', [{
+ opacity: 1,
+ offset: 0,
+ }, {
+ opacity: .5,
+ offset: .5,
+ }, {
+ opacity: .3,
+ offset: 1
+ }], 2000, {
+ scrollSource: '#scroll-view_D',
+ timeRange: 2000,
+ startScrollOffset: 150,
+ endScrollOffset: 300,
+ })
+
+ this.animate('#scroll-sample-object3', [{
+ background: "white",
+ offset: 0,
+ }, {
+ background: "yellow",
+ offset: 1
+ }], 2000, {
+ scrollSource: '#scroll-view_D',
+ timeRange: 2000,
+ startScrollOffset: 300,
+ endScrollOffset: 400,
+ })
+ },
+ onPulling(e) {
+ console.log('onPulling:', e)
+ },
+ onRefresh() {
+ if (this._freshing) return
+ this._freshing = true
+ setTimeout(() => {
+ this.setData({
+ triggered: false,
+ })
+ this._freshing = false
+ }, 3000)
+ },
+ onRestore(e) {
+ console.log('onRestore:', e)
+ },
+ onAbort(e) {
+ console.log('onAbort', e)
+ },
onShareAppMessage() {
return {
title: 'scroll-view',
@@ -9,7 +75,8 @@ Page({
},
data: {
- toView: 'green'
+ toView: 'green',
+ triggered: false,
},
upper(e) {
diff --git a/miniprogram/page/component/pages/scroll-view/scroll-view.json b/miniprogram/page/component/pages/scroll-view/scroll-view.json
index 6134e3a9..3c15209d 100644
--- a/miniprogram/page/component/pages/scroll-view/scroll-view.json
+++ b/miniprogram/page/component/pages/scroll-view/scroll-view.json
@@ -1,3 +1,5 @@
{
- "navigationBarTitleText": "scroll-view"
+ "navigationBarTitleText": "scroll-view",
+ "pageOrientation": "auto"
+
}
diff --git a/miniprogram/page/component/pages/scroll-view/scroll-view.wxml b/miniprogram/page/component/pages/scroll-view/scroll-view.wxml
index df5dfbc1..cf083b39 100644
--- a/miniprogram/page/component/pages/scroll-view/scroll-view.wxml
+++ b/miniprogram/page/component/pages/scroll-view/scroll-view.wxml
@@ -1,3 +1,4 @@
+
@@ -29,7 +30,85 @@
-
+
+
+ 自定义下拉刷新\n自定义:
+
+
+
+
+
+ 下拉刷新
+
+
+
+
+
+
+
+
+
+
+ 默认:
+
+
+
+
+
+
+
+
+
+
+
+ 滚动驱动动画
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+module.exports = {
+ onPulling: function(evt, instance) {
+ var p = Math.min(evt.detail.dy / 80, 1)
+ console.log(p)
+ var view = instance.selectComponent('.refresh-container')
+ view.setStyle({
+ opacity: p,
+ transform: "scale(" + p + ")"
+ })
+ }
+}
+
+
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/scroll-view/scroll-view.wxss b/miniprogram/page/component/pages/scroll-view/scroll-view.wxss
index 5a97e25a..85a26610 100644
--- a/miniprogram/page/component/pages/scroll-view/scroll-view.wxss
+++ b/miniprogram/page/component/pages/scroll-view/scroll-view.wxss
@@ -12,3 +12,49 @@
width: 100%;
height: 300rpx;
}
+
+.demo-text-1{
+ position: relative;
+ align-items: center;
+ justify-content: center;
+ background-color: #1AAD19;
+ color: #FFFFFF;
+ font-size: 36rpx;
+}
+.demo-text-1:before{
+ content: 'A';
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
+.demo-text-2{
+ position: relative;
+ align-items: center;
+ justify-content: center;
+ background-color: #2782D7;
+ color: #FFFFFF;
+ font-size: 36rpx;
+}
+.demo-text-2:before{
+ content: 'B';
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
+.demo-text-3{
+ position: relative;
+ align-items: center;
+ justify-content: center;
+ background-color: #F1F1F1;
+ color: #353535;
+ font-size: 36rpx;
+}
+.demo-text-3:before{
+ content: 'C';
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
diff --git a/miniprogram/page/component/pages/slider/slider.wxss b/miniprogram/page/component/pages/slider/slider.wxss
index 4dd580fa..82b76422 100644
--- a/miniprogram/page/component/pages/slider/slider.wxss
+++ b/miniprogram/page/component/pages/slider/slider.wxss
@@ -1 +1,5 @@
-/* page/component/pages/slider/slider.wxss */
\ No newline at end of file
+/* page/component/pages/slider/slider.wxss */
+
+slider {
+ margin: 0;
+}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/textarea/textarea.wxss b/miniprogram/page/component/pages/textarea/textarea.wxss
index d8214af1..a09b82b6 100644
--- a/miniprogram/page/component/pages/textarea/textarea.wxss
+++ b/miniprogram/page/component/pages/textarea/textarea.wxss
@@ -4,5 +4,4 @@ textarea {
}
.textarea-wrp {
padding: 0 25rpx;
- background-color: #fff;
}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/video/picture-in-picture.js b/miniprogram/page/component/pages/video/picture-in-picture.js
new file mode 100644
index 00000000..00e1eee7
--- /dev/null
+++ b/miniprogram/page/component/pages/video/picture-in-picture.js
@@ -0,0 +1,23 @@
+Page({
+ data: {
+ },
+ onLoad(options) {
+
+ },
+ onReady() {
+
+ },
+ onShareAppMessage() {
+ return {
+ title: '小窗模式',
+ path: 'page/component/pages/picture-in-picture/picture-in-picture'
+ }
+ },
+ // onShareAppMessage() {
+ // return {
+ // title: 'video',
+ // path: 'page/component/pages/video/video'
+ // }
+ // },
+});
+
diff --git a/miniprogram/page/component/pages/video/picture-in-picture.json b/miniprogram/page/component/pages/video/picture-in-picture.json
new file mode 100644
index 00000000..fc5b2a49
--- /dev/null
+++ b/miniprogram/page/component/pages/video/picture-in-picture.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "video"
+}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/video/picture-in-picture.wxml b/miniprogram/page/component/pages/video/picture-in-picture.wxml
new file mode 100644
index 00000000..be266ee3
--- /dev/null
+++ b/miniprogram/page/component/pages/video/picture-in-picture.wxml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/miniprogram/page/component/pages/video/picture-in-picture.wxss b/miniprogram/page/component/pages/video/picture-in-picture.wxss
new file mode 100644
index 00000000..e69de29b
diff --git a/miniprogram/page/component/pages/video/video.js b/miniprogram/page/component/pages/video/video.js
index 5a3aa4a7..df90e3ef 100644
--- a/miniprogram/page/component/pages/video/video.js
+++ b/miniprogram/page/component/pages/video/video.js
@@ -20,8 +20,13 @@ Page({
this.videoContext = wx.createVideoContext('myVideo')
},
+ onHide() {
+
+ },
+
inputValue: '',
data: {
+ enableAutoRotation: true,
src: '',
danmuList:
[{
@@ -32,7 +37,7 @@ Page({
text: '第 3s 出现的弹幕',
color: '#ff00ff',
time: 3
- }]
+ }],
},
bindInputBlur(e) {
@@ -53,6 +58,17 @@ Page({
})
},
+ bindVideoEnterPictureInPicture() {
+ console.log('进入小窗模式')
+ },
+
+ bindVideoLeavePictureInPicture() {
+ console.log('退出小窗模式')
+ },
+
+ bindPlayVideo() {
+ this.videoContext.play()
+ },
bindSendDanmu() {
this.videoContext.sendDanmu({
text: this.inputValue,
@@ -63,5 +79,10 @@ Page({
videoErrorCallback(e) {
console.log('视频错误信息:')
console.log(e.detail.errMsg)
+ },
+ handleSwitchChange(e) {
+ this.setData({
+ enableAutoRotation: e.detail.value
+ })
}
})
diff --git a/miniprogram/page/component/pages/video/video.wxml b/miniprogram/page/component/pages/video/video.wxml
index f492492e..b03a5c32 100644
--- a/miniprogram/page/component/pages/video/video.wxml
+++ b/miniprogram/page/component/pages/video/video.wxml
@@ -6,8 +6,29 @@
-
-
+
+
+ 开启自动旋转
+
+
+
+
@@ -21,6 +42,12 @@
+
+
+
+
+
+
diff --git a/miniprogram/page/component/pages/video/video.wxss b/miniprogram/page/component/pages/video/video.wxss
index a558bd89..e13d529d 100644
--- a/miniprogram/page/component/pages/video/video.wxss
+++ b/miniprogram/page/component/pages/video/video.wxss
@@ -1,9 +1,23 @@
@import "../../../common/lib/weui.wxss";
+video {
+ width: 690rpx;
+}
.weui-cells{
- margin-top: 80rpx;
+ margin: 40rpx 30rpx 0;
text-align: left;
}
.weui-label{
width: 5em;
+}
+.auto-rotate-container {
+ margin: 40rpx 40rpx 0;
+ display: flex;
+ justify-content: space-between;
+}
+
+.video-container {
+ margin: 12rpx 6rpx;
+ display: flex;
+ justify-content: center;
}
\ No newline at end of file
diff --git a/miniprogram/page/component/pages/view/view.wxml b/miniprogram/page/component/pages/view/view.wxml
index a34d0dc4..54efd7ce 100644
--- a/miniprogram/page/component/pages/view/view.wxml
+++ b/miniprogram/page/component/pages/view/view.wxml
@@ -3,7 +3,6 @@
-
@@ -28,6 +27,5 @@
-
diff --git a/miniprogram/page/component/pages/view/view.wxss b/miniprogram/page/component/pages/view/view.wxss
index d4acc0b5..c4c5ee6e 100644
--- a/miniprogram/page/component/pages/view/view.wxss
+++ b/miniprogram/page/component/pages/view/view.wxss
@@ -11,4 +11,4 @@
margin: 0 auto;
width: 300rpx;
height: 200rpx;
-}
\ No newline at end of file
+}
diff --git a/miniprogram/page/component/resources/kind/canvas_dark.png b/miniprogram/page/component/resources/kind/canvas_dark.png
new file mode 100644
index 00000000..bd1a875e
Binary files /dev/null and b/miniprogram/page/component/resources/kind/canvas_dark.png differ
diff --git a/miniprogram/page/component/resources/kind/content_dark.png b/miniprogram/page/component/resources/kind/content_dark.png
new file mode 100644
index 00000000..b7fa9f1a
Binary files /dev/null and b/miniprogram/page/component/resources/kind/content_dark.png differ
diff --git a/miniprogram/page/component/resources/kind/form_dark.png b/miniprogram/page/component/resources/kind/form_dark.png
new file mode 100644
index 00000000..ee3859c1
Binary files /dev/null and b/miniprogram/page/component/resources/kind/form_dark.png differ
diff --git a/miniprogram/page/component/resources/kind/map_dark.png b/miniprogram/page/component/resources/kind/map_dark.png
new file mode 100644
index 00000000..ea1e745a
Binary files /dev/null and b/miniprogram/page/component/resources/kind/map_dark.png differ
diff --git a/miniprogram/page/component/resources/kind/media_dark.png b/miniprogram/page/component/resources/kind/media_dark.png
new file mode 100644
index 00000000..86f339de
Binary files /dev/null and b/miniprogram/page/component/resources/kind/media_dark.png differ
diff --git a/miniprogram/page/component/resources/kind/nav_dark.png b/miniprogram/page/component/resources/kind/nav_dark.png
new file mode 100644
index 00000000..ce6422b1
Binary files /dev/null and b/miniprogram/page/component/resources/kind/nav_dark.png differ
diff --git a/miniprogram/page/component/resources/kind/obstacle-free.png b/miniprogram/page/component/resources/kind/obstacle-free.png
new file mode 100644
index 00000000..7e7e8437
Binary files /dev/null and b/miniprogram/page/component/resources/kind/obstacle-free.png differ
diff --git a/miniprogram/page/component/resources/kind/obstacle-free_dark.png b/miniprogram/page/component/resources/kind/obstacle-free_dark.png
new file mode 100644
index 00000000..a01b62ee
Binary files /dev/null and b/miniprogram/page/component/resources/kind/obstacle-free_dark.png differ
diff --git a/miniprogram/page/component/resources/kind/open_dark.png b/miniprogram/page/component/resources/kind/open_dark.png
new file mode 100644
index 00000000..2688e170
Binary files /dev/null and b/miniprogram/page/component/resources/kind/open_dark.png differ
diff --git a/miniprogram/page/component/resources/kind/view_dark.png b/miniprogram/page/component/resources/kind/view_dark.png
new file mode 100644
index 00000000..21e3c15c
Binary files /dev/null and b/miniprogram/page/component/resources/kind/view_dark.png differ
diff --git a/miniprogram/page/weui/base/CustomPage.js b/miniprogram/page/weui/base/CustomPage.js
new file mode 100644
index 00000000..b9a1ea95
--- /dev/null
+++ b/miniprogram/page/weui/base/CustomPage.js
@@ -0,0 +1,27 @@
+import themeMixin from './behaviors/theme'
+
+const CustomPage = function (options) {
+ return Page(
+ Object.assign({}, options, {
+ behaviors: [themeMixin].concat(options.behaviors || []),
+ onLoad(query) {
+ const app = getApp()
+ if(this.themeChanged) {
+ this.themeChanged(app.globalData.theme)
+ app.watchThemeChange && app.watchThemeChange(this.themeChanged);
+ options.onLoad && options.onLoad.call(this, query)
+ }
+ },
+ onUnload() {
+ const app = getApp()
+ if(this.themeChanged) {
+ app.unWatchThemeChange && app.unWatchThemeChange(this.themeChanged)
+ options.onUnload && options.onUnload.call(this)
+ }
+
+ }
+ })
+ )
+}
+
+export default CustomPage
diff --git a/miniprogram/page/weui/base/behaviors/theme.js b/miniprogram/page/weui/base/behaviors/theme.js
new file mode 100644
index 00000000..f84a928c
--- /dev/null
+++ b/miniprogram/page/weui/base/behaviors/theme.js
@@ -0,0 +1,12 @@
+module.exports = Behavior({
+ data: {
+ theme: 'light'
+ },
+ methods: {
+ themeChanged(theme) {
+ this.setData({
+ theme
+ })
+ }
+ }
+})
diff --git a/miniprogram/page/weui/components/actionsheet/actionsheet.js b/miniprogram/page/weui/components/actionsheet/actionsheet.js
index 25e9fae9..2d6138a4 100644
--- a/miniprogram/page/weui/components/actionsheet/actionsheet.js
+++ b/miniprogram/page/weui/components/actionsheet/actionsheet.js
@@ -96,70 +96,88 @@ module.exports =
Component({
options: {
multipleSlots: true,
+ // 在组件定义时的选项中启用多slot支持
addGlobalClass: true
- },
+ },
properties: {
title: {
+ // 标题
type: String,
value: ''
},
showCancel: {
+ // 是否显示取消按钮
type: Boolean,
value: true
},
cancelText: {
+ // 取消按钮文案
type: String,
value: '取消'
- },
- maskClass: {
+ },
+ maskClass: {
+ // 遮罩层class
type: String,
value: ''
- },
- extClass: {
+ },
+ extClass: {
+ // 弹出窗 class
type: String,
value: ''
- },
- maskClosable: {
+ },
+ maskClosable: {
+ // 点击遮罩 关闭 actionsheet
type: Boolean,
value: true
- },
- mask: {
+ },
+ mask: {
+ // 是否需要 遮罩层
type: Boolean,
value: true
- },
- show: {
+ },
+ show: {
+ // 是否开启 actionsheet
type: Boolean,
value: false
- },
- actions: {
+ },
+ actions: {
+ // actions 列表
type: Array,
value: [],
+ // {text, extClass}
observer: '_groupChange'
- }
+ }
},
methods: {
- _groupChange: function _groupChange(e) {
+ _groupChange(e) {
+ // 支持 一维数组 写法
if (e.length > 0 && typeof e[0] !== 'string' && !(e[0] instanceof Array)) {
- this.setData({
- actions: [this.data.actions]
- });
+ this.setData({
+ actions: [this.data.actions]
+ });
}
- },
- buttonTap: function buttonTap(e) {
- var _e$currentTarget$data = e.currentTarget.dataset,
- value = _e$currentTarget$data.value,
- groupindex = _e$currentTarget$data.groupindex,
- index = _e$currentTarget$data.index;
-
- this.triggerEvent('actiontap', { value: value, groupindex: groupindex, index: index });
- },
- closeActionSheet: function closeActionSheet(e) {
- var type = e.currentTarget.dataset.type;
-
+ },
+ buttonTap(e) {
+ const {
+ value,
+ groupindex,
+ index
+ } = e.currentTarget.dataset;
+ this.triggerEvent('actiontap', {
+ value,
+ groupindex,
+ index
+ });
+ },
+ closeActionSheet(e) {
+ const {
+ type
+ } = e.currentTarget.dataset;
if (this.data.maskClosable || type) {
+ // 点击 action 里面的 取消
this.setData({
- show: false
- });
+ show: false
+ }); // 关闭回调事件
this.triggerEvent('close');
}
}
diff --git a/miniprogram/page/weui/components/actionsheet/actionsheet.wxml b/miniprogram/page/weui/components/actionsheet/actionsheet.wxml
index 62d10f70..622275ad 100644
--- a/miniprogram/page/weui/components/actionsheet/actionsheet.wxml
+++ b/miniprogram/page/weui/components/actionsheet/actionsheet.wxml
@@ -22,7 +22,7 @@
-
-
-
+
diff --git a/miniprogram/page/weui/components/form-page/form-page.wxss b/miniprogram/page/weui/components/form-page/form-page.wxss
index dcc182db..e69de29b 100644
--- a/miniprogram/page/weui/components/form-page/form-page.wxss
+++ b/miniprogram/page/weui/components/form-page/form-page.wxss
@@ -1 +0,0 @@
-.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cells:before,.weui-cells__group_form .weui-cell:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px;color:rgba(0,0,0,0.9)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:#FA5151}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,0.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:#06AE56;background-color:#F2F2F2}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-form{padding:56px 0 0;padding:calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:flex;flex-direction:column;min-height:100%;box-sizing:border-box;line-height:1.4;background-color:#FFFFFF}.weui-form a:not(.weui-btn){color:#576B95}.weui-form .weui-footer,.weui-form .weui-footer__link{font-size:12px}.weui-form .weui-agree{padding:0}.weui-form__text-area{padding:0 32px;color:rgba(0,0,0,0.9);text-align:center}.weui-form__control-area{flex:1;margin:48px 0}.weui-form__tips-area,.weui-form__extra-area{margin-bottom:24px;text-align:center}.weui-form__opr-area{margin-bottom:64px}.weui-form__opr-area:last-child{margin-bottom:96px}.weui-form__title{font-size:22px;font-weight:700;line-height:1.36}.weui-form__desc{font-size:17px;margin-top:16px}.weui-form__tips{color:rgba(0,0,0,0.5);font-size:12px}
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/gallery/gallery.js b/miniprogram/page/weui/components/gallery/gallery.js
index 4d14d2e6..dff2e891 100644
--- a/miniprogram/page/weui/components/gallery/gallery.js
+++ b/miniprogram/page/weui/components/gallery/gallery.js
@@ -129,39 +129,50 @@ Component({
data: {
currentImgs: []
},
- ready: function ready() {
- var data = this.data;
- this.setData({ currentImgs: data.imgUrls });
- },
+ ready() {
+ const data = this.data;
+ this.setData({
+ currentImgs: data.imgUrls
+ });
+ },
methods: {
- change: function change(e) {
+ change(e) {
this.setData({
- current: e.detail.current
+ current: e.detail.current
});
- this.triggerEvent('change', { current: e.detail.current }, {});
+ this.triggerEvent('change', {
+ current: e.detail.current
+ }, {});
},
- deleteImg: function deleteImg() {
- var data = this.data;
- var imgs = data.currentImgs;
- var url = imgs.splice(data.current, 1);
- this.triggerEvent('delete', { url: url[0], index: data.current }, {});
+ deleteImg() {
+ const data = this.data;
+ const imgs = data.currentImgs;
+ const url = imgs.splice(data.current, 1);
+ this.triggerEvent('delete', {
+ url: url[0],
+ index: data.current
+ }, {});
+
if (imgs.length === 0) {
- this.hideGallery();
- return;
+ // @ts-ignore
+ this.hideGallery();
+ return;
}
+
this.setData({
- current: 0,
- currentImgs: imgs
+ current: 0,
+ currentImgs: imgs
});
- },
- hideGallery: function hideGallery() {
- var data = this.data;
+ },
+ hideGallery() {
+ const data = this.data;
+
if (data.hideOnClick) {
- this.setData({
- show: false
- });
- this.triggerEvent('hide', {}, {});
+ this.setData({
+ show: false
+ });
+ this.triggerEvent('hide', {}, {});
}
}
}
diff --git a/miniprogram/page/weui/components/gallery/gallery.wxml b/miniprogram/page/weui/components/gallery/gallery.wxml
index 2529a716..c2b20867 100644
--- a/miniprogram/page/weui/components/gallery/gallery.wxml
+++ b/miniprogram/page/weui/components/gallery/gallery.wxml
@@ -1,13 +1,13 @@
{{current+1}}/{{currentImgs.length}}
-
+
- 删除
+ 删除
diff --git a/miniprogram/page/weui/components/gallery/gallery.wxss b/miniprogram/page/weui/components/gallery/gallery.wxss
index 5e6caa4f..c6010c55 100644
--- a/miniprogram/page/weui/components/gallery/gallery.wxss
+++ b/miniprogram/page/weui/components/gallery/gallery.wxss
@@ -1 +1 @@
-.weui-gallery{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000000;z-index:1000;-webkit-flex-direction:column;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;opacity:0;visibility:hidden;transition:opacity .3s}.weui-gallery_show{display:-webkit-box;display:-webkit-flex;display:flex;visibility:visible;opacity:1}.weui-gallery__img__wrp{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;font-size:0}.weui-gallery__img{background:center center no-repeat;background-size:contain;position:absoulte;width:100%;height:100%}.weui-gallery__opr{background-color:#0D0D0D;color:#FFFFFF;line-height:60px;min-height:60px;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);text-align:center}.weui-gallery__opr navigator{color:#FFFFFF}.weui-gallery__del{display:block}.weui-gallery__info{color:#FFFFFF;font-size:17px;line-height:60px;min-height:60px;text-align:center}
\ No newline at end of file
+.weui-gallery{display:none}.weui-gallery_show.weui-gallery{display:flex}
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/grids/grids.js b/miniprogram/page/weui/components/grids/grids.js
new file mode 100644
index 00000000..6d826654
--- /dev/null
+++ b/miniprogram/page/weui/components/grids/grids.js
@@ -0,0 +1,152 @@
+
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // create a fake namespace object
+/******/ // mode & 1: value is a module id, require it
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = __webpack_require__(value);
+/******/ if(mode & 8) return value;
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ return ns;
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 23);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 23:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Component({
+ options: {
+ addGlobalClass: true,
+ pureDataPattern: /^_/
+ },
+ properties: {
+ extClass: {
+ type: String,
+ value: ''
+ },
+ grids: {
+ type: Array,
+ value: [],
+ }
+ },
+ data: {
+ innerGrids: [],
+ _defaultGridProps: {
+ target: 'self',
+ url: '',
+ openType: 'navigate',
+ delta: 1,
+ appId: '',
+ path: '',
+ extraData: '',
+ version: 'release',
+ hoverClass: 'navigator-hover',
+ hoverStopPropagation: false,
+ hoverStartTime: 50,
+ hoverStayTime: 600,
+
+ bindsuccess() {},
+
+ bindfail() {},
+
+ bindcomplete() {}
+
+ }
+ },
+
+ ready() {},
+
+ lifetimes: {
+ attached() {
+ if (this.data.grids) {
+ this.setData({
+ innerGrids: this.data.grids.map(grid => Object.assign({}, this.data._defaultGridProps, grid))
+ });
+ }
+ }
+
+ }
+});
+
+/***/ })
+
+/******/ });
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/grids/grids.json b/miniprogram/page/weui/components/grids/grids.json
new file mode 100644
index 00000000..e8cfaaf8
--- /dev/null
+++ b/miniprogram/page/weui/components/grids/grids.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/grids/grids.wxml b/miniprogram/page/weui/components/grids/grids.wxml
new file mode 100644
index 00000000..ba07467f
--- /dev/null
+++ b/miniprogram/page/weui/components/grids/grids.wxml
@@ -0,0 +1,27 @@
+@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ {{item.text}}
+
+
+
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/grids/grids.wxss b/miniprogram/page/weui/components/grids/grids.wxss
new file mode 100644
index 00000000..9896a212
--- /dev/null
+++ b/miniprogram/page/weui/components/grids/grids.wxss
@@ -0,0 +1 @@
+.weui-grid .weui-grid__icon_img{width:100%;height:100%}
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.js b/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.js
index 9f7c6ebd..720b9377 100644
--- a/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.js
+++ b/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.js
@@ -142,21 +142,27 @@ Component({
}
},
methods: {
- close: function close(e) {
- var type = e.currentTarget.dataset.type;
-
- if (this.data.maskClosable || type === 'close') {
- this.setData({
- show: false
- });
- this.triggerEvent('close');
- }
+ close(e) {
+ const {
+ type
+ } = e.currentTarget.dataset;
+ if (this.data.maskClosable || type === 'close') {
+ this.setData({
+ show: false
+ }); // 关闭弹窗回调事件
+ this.triggerEvent('close');
+ }
},
- buttonTap: function buttonTap(e) {
- var index = e.currentTarget.dataset.index;
-
- this.triggerEvent('buttontap', { index: index, item: this.data.buttons[index] }, {});
- }
+
+ buttonTap(e) {
+ const {
+ index
+ } = e.currentTarget.dataset;
+ this.triggerEvent('buttontap', {
+ index,
+ item: this.data.buttons[index]
+ }, {});
+ }
}
});
diff --git a/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.wxml b/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.wxml
index 7a74a5c9..b8c757c9 100644
--- a/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.wxml
+++ b/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.wxml
@@ -29,13 +29,12 @@
-
diff --git a/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.wxss b/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.wxss
index 93f2fe25..8d892987 100644
--- a/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.wxss
+++ b/miniprogram/page/weui/components/half-screen-dialog/half-screen-dialog.wxss
@@ -1 +1 @@
-.weui-half-screen-dialog{position:fixed;left:0;right:0;bottom:0;max-height:75%;z-index:5000;line-height:1.4;background-color:#FFFFFF;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden;padding:0 24px;padding:0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));padding:0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))}.weui-half-screen-dialog__hd{font-size:8px;height:8em;display:flex;align-items:center}.weui-half-screen-dialog__hd .weui-icon-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.weui-half-screen-dialog__hd__side{position:relative;left:-8px}.weui-half-screen-dialog__hd__main{flex:1}.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main{text-align:center;padding:0 40px}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side{right:-8px;left:auto}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn{right:0}.weui-half-screen-dialog__title{display:block;color:rgba(0,0,0,0.9);font-weight:700;font-size:15px}.weui-half-screen-dialog__subtitle{display:block;color:rgba(0,0,0,0.5);font-size:10px}.weui-half-screen-dialog__bd{word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;overflow-y:auto}.weui-half-screen-dialog__desc{padding-top:4px;font-size:17px;font-weight:700;color:rgba(0,0,0,0.9);line-height:1.4}.weui-half-screen-dialog__tips{padding-top:16px;font-size:14px;color:rgba(0,0,0,0.3);line-height:1.4}.weui-half-screen-dialog__ft{padding:40px 24px 32px;text-align:center}.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn{display:inline-block;vertical-align:top;margin:0 8px;width:120px}.weui-icon-btn{background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;background-size:100%;border:0;outline:0;font-size:0}.weui-icon-btn_goback{width:12px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M26 39.438L24.955 40.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42l7.666-7.79L26 24.563 18.682 32 26 39.438z'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_close{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Cpath id='33cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a' d='M8 6.943L1.807.75.75 1.807 6.943 8 .75 14.193l1.057 1.057L8 9.057l6.193 6.193 1.057-1.057L9.057 8l6.193-6.193L14.193.75z'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cuse fill='%23000' fill-opacity='.9' transform='translate(20 24)' xlink:href='%2333cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_more{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-374 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M380.75 32a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zm5.25-1.75a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E %3C/g%3E%3C/svg%3E")}.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.6)}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-mask,.weui-half-screen-dialog{transition:all .3s}.weui-hidden .weui-mask{visibility:hidden;opacity:0}.weui-hidden .weui-half-screen-dialog{transform:translateY(100%)}.weui-show .weui-mask{opacity:1;visibility:visible}.weui-show .weui-half-screen-dialog{transform:translateY(0%)}
\ No newline at end of file
+.weui-mask,.weui-half-screen-dialog{transition:all .3s}.weui-hidden .weui-mask{visibility:hidden;opacity:0}.weui-hidden .weui-half-screen-dialog{transform:translateY(100%)}.weui-show .weui-mask{opacity:1;visibility:visible}.weui-show .weui-half-screen-dialog{transform:translateY(0%)}
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/icon/icon.js b/miniprogram/page/weui/components/icon/icon.js
index 4b030ed0..40d54b03 100644
--- a/miniprogram/page/weui/components/icon/icon.js
+++ b/miniprogram/page/weui/components/icon/icon.js
@@ -93,9 +93,17 @@ module.exports =
"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-var base64_1 = __webpack_require__(11);
-var icondata_1 = __webpack_require__(12);
+var _base = _interopRequireDefault(__webpack_require__(11));
+
+var _icondata = _interopRequireDefault(__webpack_require__(12));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const getFixedIconType = function (type) {
+ // 兼容旧版本 typo
+ return type === 'field' ? 'filled' : type;
+};
+
Component({
options: {
addGlobalClass: true
@@ -130,19 +138,22 @@ Component({
width: 20
},
methods: {
- _genSrcByIcon: function _genSrcByIcon(v) {
- this._genSrc(icondata_1.default[v][this.data.type]);
- },
- _genSrcByType: function _genSrcByType(v) {
- this._genSrc(icondata_1.default[this.data.icon][v]);
- },
- _genSrc: function _genSrc(rawData) {
- if (!rawData) return;
- var base64 = base64_1.default.encode(rawData);
- this.setData({
- src: 'data:image/svg+xml;base64,' + base64
- });
- }
+ _genSrcByIcon(v) {
+ this._genSrc(_icondata.default[v][getFixedIconType(this.data.type)]);
+ },
+
+ _genSrcByType(v) {
+ this._genSrc(_icondata.default[this.data.icon][getFixedIconType(v)]);
+ },
+ _genSrc(rawData) {
+ if (!rawData) return; // type 不存在
+
+ const base64 = _base.default.encode(rawData);
+
+ this.setData({
+ src: 'data:image/svg+xml;base64,' + base64
+ });
+ }
}
});
diff --git a/miniprogram/page/weui/components/index-list/index-list.js b/miniprogram/page/weui/components/index-list/index-list.js
new file mode 100644
index 00000000..0a9d1a98
--- /dev/null
+++ b/miniprogram/page/weui/components/index-list/index-list.js
@@ -0,0 +1,154 @@
+const throttle = function throttle(func, wait, options) {
+ let context = void 0;
+ let args = void 0;
+ let result = void 0;
+ let timeout = null;
+ let previous = 0;
+ if (!options) options = {};
+ const later = function later() {
+ previous = options.leading === false ? 0 : Date.now();
+ timeout = null;
+ result = func.apply(context, args);
+ if (!timeout) context = args = null;
+ };
+ return function () {
+ const now = Date.now();
+ if (!previous && options.leading === false) previous = now;
+ const remaining = wait - (now - previous);
+ context = this;
+ args = arguments;
+ if (remaining <= 0 || remaining > wait) {
+ clearTimeout(timeout);
+ timeout = null;
+ previous = now;
+ result = func.apply(context, args);
+ if (!timeout) context = args = null;
+ } else if (!timeout && options.trailing !== false) {
+ timeout = setTimeout(later, remaining);
+ }
+ return result;
+ };
+};
+
+Component({
+ behaviors: [],
+ options: {
+ addGlobalClass: true,
+ pureDataPattern: /^_/
+ },
+ properties: {
+ list: {
+ type: Array,
+ value: [],
+ observer: function observer(newVal) {
+ const _this = this;
+
+ if (newVal.length === 0) return;
+ const data = this.data;
+ const alphabet = data.list.map(function (item) {
+ return item.alpha;
+ });
+ this.setData({
+ alphabet: alphabet,
+ current: alphabet[0]
+ }, function () {
+ _this.computedSize();
+ });
+ }
+ },
+ vibrated: {
+ type: Boolean,
+ value: true
+ }
+ },
+
+ data: {
+ windowHeight: 612,
+ current: 'A',
+ intoView: '',
+ touching: false,
+ alphabet: [],
+ _tops: [],
+ _anchorItemH: 0,
+ _anchorItemW: 0,
+ _anchorTop: 0,
+ _listUpperBound: 0
+ },
+
+ lifetimes: {
+ created() {
+
+ },
+ attached() {
+ this.__scrollTo = throttle(this._scrollTo, 100, {});
+ this.__onScroll = throttle(this._onScroll, 100, {});
+
+ const _wx$getSystemInfoSync = wx.getSystemInfoSync(), windowHeight = _wx$getSystemInfoSync.windowHeight;
+
+ this.setData({ windowHeight: windowHeight });
+ },
+ },
+ methods: {
+ choose(e) {
+ const item = e.target.dataset.item;
+ this.triggerEvent('choose', { item: item });
+ },
+ scrollTo(e) {
+ this.__scrollTo(e);
+ },
+ _scrollTo(e) {
+ const data = this.data;
+ const clientY = e.changedTouches[0].clientY;
+ const index = Math.floor((clientY - data._anchorTop) / data._anchorItemH);
+ const current = data.alphabet[index];
+ this.setData({ current: current, intoView: current, touching: true });
+ if (data.vibrated) wx.vibrateShort();
+ },
+ computedSize() {
+ const data = this.data;
+ const query = this.createSelectorQuery();
+ query.selectAll('.city_list_item').boundingClientRect(function (rects) {
+ const result = rects;
+ data._tops = result.map(function (item) {
+ return item.top;
+ });
+ }).exec();
+ query.select('.anchor-list').boundingClientRect(function (rect) {
+ data._anchorItemH = rect.height / data.alphabet.length;
+ data._anchorItemW = rect.width;
+ data._anchorTop = rect.top;
+ }).exec();
+ query.select('.page-select-city').boundingClientRect(function (rect) {
+ data._listUpperBound = rect.top;
+ });
+ },
+ removeTouching: function removeTouching() {
+ const _this2 = this;
+
+ setTimeout(function () {
+ _this2.setData({ touching: false });
+ }, 150);
+ },
+ onScroll: function onScroll(e) {
+ this.__onScroll(e);
+ },
+ _onScroll: function _onScroll(e) {
+ const data = this.data;
+ const _tops = data._tops, alphabet = data.alphabet;
+
+ const scrollTop = e.detail.scrollTop;
+ let current = '';
+ if (scrollTop < _tops[0]) {
+ current = alphabet[0];
+ } else {
+ for (let i = 0, len = _tops.length; i < len - 1; i++) {
+ if (scrollTop >= _tops[i] && scrollTop < _tops[i + 1]) {
+ current = alphabet[i];
+ }
+ }
+ }
+ if (!current) current = alphabet[alphabet.length - 1];
+ this.setData({ current: current });
+ }
+ }
+});
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/index-list/index-list.json b/miniprogram/page/weui/components/index-list/index-list.json
new file mode 100644
index 00000000..e8cfaaf8
--- /dev/null
+++ b/miniprogram/page/weui/components/index-list/index-list.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/index-list/index-list.wxml b/miniprogram/page/weui/components/index-list/index-list.wxml
new file mode 100644
index 00000000..3ef23749
--- /dev/null
+++ b/miniprogram/page/weui/components/index-list/index-list.wxml
@@ -0,0 +1,33 @@
+
+
+
+
+
+ {{item.alpha}}
+
+
+
+
+ {{subItem.name}}
+
+
+
+
+
+
+
+
+
+
+
+ {{alpha}}
+ {{alpha}}
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/index-list/index-list.wxss b/miniprogram/page/weui/components/index-list/index-list.wxss
new file mode 100644
index 00000000..8b20b362
--- /dev/null
+++ b/miniprogram/page/weui/components/index-list/index-list.wxss
@@ -0,0 +1,216 @@
+.wx-flex {
+ display: flex;
+ align-items: center
+}
+
+.wx-flex__item {
+ flex: 1
+}
+
+.thin-border-bottom {
+ position: relative
+}
+
+.thin-border-bottom:after {
+ content: "";
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 1px;
+ border-bottom: 1px solid #EAEAEA;
+ color: #e5e5e5;
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5);
+ z-index: 2
+}
+
+.thin-border-top {
+ position: relative
+}
+
+.thin-border-top:after {
+ content: "";
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ height: 1px;
+ border-bottom: 1px solid #EAEAEA;
+ color: #e5e5e5;
+ -webkit-transform-origin: 0 0;
+ transform-origin: 0 0;
+ -webkit-transform: scaleY(.5);
+ transform: scaleY(.5);
+ z-index: 2
+}
+
+.square-tag {
+ color: #9a9a9a;
+ text-align: center;
+ height: 30px;
+ line-height: 30px;
+ box-sizing: border-box;
+ border-radius: 2px;
+ background-color: #f7f7f7;
+ font-size: 24rpx;
+ position: relative
+}
+
+.square-tag:after {
+ content: "";
+ width: 200%;
+ height: 200%;
+ border: 1px solid #f7f7f7;
+ transform: scale(.5);
+ transform-origin: 0 0;
+ position: absolute;
+ left: 0;
+ top: 0;
+ box-sizing: border-box;
+ border-radius: 4px
+}
+
+.square-tag.selected {
+ background: rgba(26, 173, 25, 0.1);
+ color: #1AAD19
+}
+
+.square-tag.selected:after {
+ border: 1px solid #1AAD19
+}
+
+.select-city__hd {
+ padding: 0 30rpx;
+ position: fixed;
+ height: 50px;
+ background-color: #fff;
+ left: 0;
+ right: 0;
+ z-index: 990
+}
+
+.select-city__hd.thin-border-bottom:after {
+ left: 24rpx;
+ right: 24rpx
+}
+
+.current-city__name {
+ display: inline-block;
+ margin-right: 20rpx;
+ margin-left: 12rpx
+}
+
+.city-group_part .city-group__content {
+ padding: 0 30rpx
+}
+
+.city-group_part .city-group__title {
+ padding-bottom: 24rpx
+}
+
+.city-group__title {
+ padding: 24rpx 24rpx 12rpx
+}
+
+.city-group__content {
+ font-size: 0
+}
+
+.square-tag {
+ width: 200rpx;
+ display: inline-block;
+ margin-right: 24rpx;
+ margin-bottom: 24rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ font-size: 30rpx;
+ color: #000;
+ background-color: rgba(0, 0, 0, 0.02);
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis
+}
+
+.city-group__item {
+ padding: 30rpx 24rpx;
+ font-size: 30rpx
+}
+
+.city-group__item.thin-border-bottom:after {
+ left: 24rpx
+}
+
+.city-group_all {
+ padding-bottom: 100rpx
+}
+
+.fixed__top {
+ position: fixed;
+ top: 0
+}
+
+.anchor-bar__wrp {
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ width: 60rpx;
+ z-index: 999
+}
+
+.anchor-item {
+ font-size: 0;
+ text-align: center;
+ position: relative
+}
+
+.anchor-item__inner {
+ line-height: 28rpx;
+ height: 28rpx;
+ width: 28rpx;
+ border-radius: 50%;
+ display: inline-block;
+ font-size: 20rpx;
+ margin: 2rpx 0;
+ font-weight: 500
+}
+
+.tapped .anchor-item__pop {
+ display: block
+}
+
+.anchor-item__pop {
+ position: absolute;
+ font-size: 64rpx;
+ width: 100rpx;
+ height: 100rpx;
+ line-height: 100rpx;
+ color: #fff;
+ background-color: #C9C9C9;
+ border-radius: 50%;
+ right: 80rpx;
+ top: 50%;
+ transform: translateY(-50%);
+ display: none
+}
+
+.anchor-item__pop:after {
+ content: "";
+ display: block;
+ position: absolute;
+ width: 0;
+ height: 0;
+ left: 80rpx;
+ border: 40rpx solid;
+ border-color: transparent transparent transparent #C9C9C9;
+ top: 50%;
+ transform: translateY(-50%)
+}
+
+.anchor-item.selected .anchor-item__inner {
+ color: #fff;
+ background-color: #1aad19
+}
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/index.js b/miniprogram/page/weui/components/index.js
index e24a3fd5..781674b9 100644
--- a/miniprogram/page/weui/components/index.js
+++ b/miniprogram/page/weui/components/index.js
@@ -82,18 +82,18 @@ module.exports =
/******/
/******/
/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 26);
+/******/ return __webpack_require__(__webpack_require__.s = 27);
/******/ })
/************************************************************************/
/******/ ({
-/***/ 26:
+/***/ 27:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
+exports.__esModule = true;
/***/ })
diff --git a/miniprogram/page/weui/components/index.json b/miniprogram/page/weui/components/index.json
deleted file mode 100755
index d3b37efa..00000000
--- a/miniprogram/page/weui/components/index.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "usingComponents": {
- "actionsheet": "./actionsheet/actionsheet",
- "form-page": "./form-page/form-page",
- "navigation-bar": "./navigation-bar/navigation-bar",
- "form": "./form/form",
- "cell": "./cell/cell",
- "icon": "./icon/icon",
- "toptips": "./toptips/toptips",
- "loading": "./loading/loading",
- "tabbar": "./tabbar/tabbar",
- "cells": "./cells/cells",
- "half-screen-dialog": "./half-screen-dialog/half-screen-dialog",
- "slideview": "./slideview/slideview",
- "msg": "./msg/msg",
- "dialog": "./dialog/dialog",
- "uploader": "./uploader/uploader",
- "gallery": "./gallery/gallery",
- "checkbox": "./checkbox/checkbox",
- "badge": "./badge/badge",
- "searchbar": "./searchbar/searchbar",
- "checkbox-group": "./checkbox-group/checkbox-group"
- }
-}
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/loading/loading.js b/miniprogram/page/weui/components/loading/loading.js
index 3c38b7ad..6f5384dd 100644
--- a/miniprogram/page/weui/components/loading/loading.js
+++ b/miniprogram/page/weui/components/loading/loading.js
@@ -105,26 +105,28 @@ Component({
show: {
type: Boolean,
value: true,
- observer: function observer(newValue) {
+ observer(newValue) {
this._computedStyle(newValue, this.data.animated);
}
},
animated: {
type: Boolean,
value: false,
- observer: function observer(newValue) {
+ observer(newValue) {
this._computedStyle(this.data.show, newValue);
}
},
duration: {
+ // 过渡动画时间
type: Number,
value: 350
},
type: {
type: String,
- value: 'dot-gray'
+ value: 'dot-gray' // 取值dot-white、dot-gray、circle
},
tips: {
+ // type是circle的时候才有效
type: String,
value: '加载中'
}
@@ -135,45 +137,49 @@ Component({
displayStyle: 'none'
},
methods: {
- _computedStyle: function _computedStyle(show, animated) {
- if (!show) {
- if (!animated) {
- this.setData({
- displayStyle: 'none'
- });
- } else {
- this._startAnimation();
- }
+ _computedStyle(show, animated) {
+ if (!show) {
+ if (!animated) {
+ this.setData({
+ displayStyle: 'none'
+ });
} else {
- this.setData({
- displayStyle: ''
- });
+ this._startAnimation();
}
+ } else {
+ this.setData({
+ displayStyle: ''
+ });
+ }
},
- _startAnimation: function _startAnimation() {
- var _this = this;
-
- setTimeout(function () {
- var data = _this.data;
- var animation = data.animationInstance;
- animation.height(0).step();
- _this.setData({
- animationData: animation.export()
- });
- }, 0);
- }
- },
- lifetimes: {
- attached: function attached() {
- var data = this.data;
- var animationInstance = wx.createAnimation({
- duration: data.duration,
- timingFunction: 'ease'
+
+ _startAnimation() {
+ setTimeout(() => {
+ const data = this.data;
+ const animation = data.animationInstance;
+ animation.height(0).step();
+ this.setData({
+ animationData: animation.export()
});
- this.setData({ animationInstance: animationInstance });
- this._computedStyle(this.data.show, this.data.animated);
+ }, 0);
+ }
+
+ },
+ lifetimes: {
+ attached() {
+ const data = this.data;
+ const animationInstance = wx.createAnimation({
+ duration: data.duration,
+ timingFunction: 'ease'
+ });
+ this.setData({
+ animationInstance
+ });
+
+ this._computedStyle(this.data.show, this.data.animated);
}
- }
+
+ }
});
/***/ })
diff --git a/miniprogram/page/weui/components/loading/loading.wxss b/miniprogram/page/weui/components/loading/loading.wxss
index f5aa1496..f84136a8 100644
--- a/miniprogram/page/weui/components/loading/loading.wxss
+++ b/miniprogram/page/weui/components/loading/loading.wxss
@@ -1 +1 @@
-.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;animation:weuiLoading 1s steps(12, end) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@keyframes weuiLoading{0%{transform:rotate3d(0, 0, 1, 0deg)}100%{transform:rotate3d(0, 0, 1, 360deg)}}.weui-loadmore{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.weui-loadmore__tips{display:inline-block;vertical-align:middle}.weui-loadmore_line{border-top:1px solid rgba(0,0,0,0.1);margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-0.9em;padding:0 .55em;background-color:#FFFFFF;color:rgba(0,0,0,0.5)}.weui-loadmore__tips_in-dot{position:relative;padding:0 .16em;width:4px;height:1.6em}.weui-loadmore__tips_in-dot:before{content:" ";position:absolute;top:50%;left:50%;margin-top:-1px;margin-left:-2px;width:4px;height:4px;border-radius:50%;background-color:rgba(0,0,0,0.1)}.wx_dot_loading,.wx_dot_loading:before,.wx_dot_loading:after{display:inline-block;vertical-align:middle;width:6px;height:6px;-webkit-border-radius:50%;border-radius:50%;background-color:rgba(0,0,0,0.3);font-size:0;animation:dot2 1.6s step-start infinite}.wx_dot_loading{position:relative}.wx_dot_loading:before{content:"";position:absolute;left:-12px;background-color:rgba(0,0,0,0.1);animation:dot1 1.6s step-start infinite}.wx_dot_loading:after{content:"";position:absolute;right:-12px;background-color:rgba(0,0,0,0.5);animation:dot3 1.6s step-start infinite}@keyframes dot1{0%,100%{background-color:rgba(0,0,0,0.1)}30%{background-color:rgba(0,0,0,0.5)}60%{background-color:rgba(0,0,0,0.3)}}@keyframes dot2{0%,100%{background-color:rgba(0,0,0,0.3)}30%{background-color:rgba(0,0,0,0.1)}60%{background-color:rgba(0,0,0,0.5)}}@keyframes dot3{0%,100%{background-color:rgba(0,0,0,0.5)}30%{background-color:rgba(0,0,0,0.3)}60%{background-color:rgba(0,0,0,0.1)}}.wx_dot_loading_white{background-color:rgba(255,255,255,0.3);animation:dotw2 1.6s step-start infinite}.wx_dot_loading_white:before{background-color:rgba(255,255,255,0.5);animation:dotw1 1.6s step-start infinite}.wx_dot_loading_white:after{background-color:rgba(255,255,255,0.1);animation:dotw3 1.6s step-start infinite}@keyframes dotw1{0%,100%{background-color:rgba(255,255,255,0.5)}30%{background-color:rgba(255,255,255,0.1)}60%{background-color:rgba(255,255,255,0.3)}}@keyframes dotw2{0%,100%{background-color:rgba(255,255,255,0.3)}30%{background-color:rgba(255,255,255,0.5)}60%{background-color:rgba(255,255,255,0.1)}}@keyframes dotw3{0%,100%{background-color:rgba(255,255,255,0.1)}30%{background-color:rgba(255,255,255,0.3)}60%{background-color:rgba(255,255,255,0.5)}}.wx_loading_view{display:flex;justify-content:center;align-items:center;overflow:hidden}.loading{color:rgba(255,255,255,0.9);font-size:17px;text-align:center}.loading_view_translation{transition:height .2s .3s ease}
\ No newline at end of file
+.wx_loading_view{display:flex;justify-content:center;align-items:center;overflow:hidden}.loading{color:rgba(255,255,255,0.9);font-size:17px;text-align:center}.loading_view_translation{transition:height .2s .3s ease}
\ No newline at end of file
diff --git a/miniprogram/page/weui/components/msg/msg.js b/miniprogram/page/weui/components/msg/msg.js
index 6bc37ad0..88574f7f 100644
--- a/miniprogram/page/weui/components/msg/msg.js
+++ b/miniprogram/page/weui/components/msg/msg.js
@@ -108,6 +108,7 @@ Component({
value: ''
},
icon: {
+ // 可以自行设置 icon, 设置icon 之后,type 失效
type: String,
value: ''
},
@@ -120,6 +121,7 @@ Component({
value: ''
},
size: {
+ // 可以自行设置 icon, 设置icon 之后,type 失效
type: Number,
value: 64
}
diff --git a/miniprogram/page/weui/components/msg/msg.wxml b/miniprogram/page/weui/components/msg/msg.wxml
index edc3148f..34436837 100644
--- a/miniprogram/page/weui/components/msg/msg.wxml
+++ b/miniprogram/page/weui/components/msg/msg.wxml
@@ -1,8 +1,7 @@
-
-
+
{{title}}
@@ -16,6 +15,11 @@
+
+
+
+
+