diff --git a/.eslintrc.js b/.eslintrc.mjs
similarity index 100%
rename from .eslintrc.js
rename to .eslintrc.mjs
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 01376cff..e69de29b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,35 +0,0 @@
-name: WeChat MiniProgram Demo CI/CD
-
-on:
- pull_request:
- types: [closed]
- branches:
- - master
-jobs:
- upload:
- if: github.event.pull_request.merged == true && github.repository == 'wechat-miniprogram/miniprogram-demo'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
- submodules: 'recursive'
- token: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Clone submodule
- run: git submodule status
-
- - name: Install dependencies
- run: npm install
-
- - name: Run package script
- run: npm run init
-
- - name: Upload MiniProgram
- env:
- WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }}
- run: |
- mkdir -p ./build
- echo "$WX_PRIVATE_KEY" > ./build/key
- chmod +x ./build/ci.js
- node ./build/ci.js --skip-key-write
diff --git a/.github/workflows/pr-lint-check.yml b/.github/workflows/pr-lint-check.yml
new file mode 100644
index 00000000..624684bf
--- /dev/null
+++ b/.github/workflows/pr-lint-check.yml
@@ -0,0 +1,19 @@
+name: PR Lint Check
+
+on:
+ pull_request:
+ branches: feat-wzy-cs
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Node.js
+ uses: actions/setup-node@v2
+ with:
+ node-version: '16'
+ - name: Install dependencies
+ run: npm install
+ - name: Run lint
+ run: npm run lint
\ No newline at end of file
diff --git a/build/ci.js b/build/ci.js
index 00c2998c..e69de29b 100644
--- a/build/ci.js
+++ b/build/ci.js
@@ -1,57 +0,0 @@
-import path from 'path'
-import { fileURLToPath } from 'url'
-import fs from 'fs'
-import ci from 'miniprogram-ci'
-import packageJson from '../package.json' with { type: 'json' }
-const __filename = fileURLToPath(import.meta.url)
-const __dirname = path.dirname(__filename)
-const privateKeyPath = path.resolve(__dirname, './key')
-
-// 检查私钥文件是否已存在
-if (!fs.existsSync(privateKeyPath)) {
- const privateKeyContent = process.env.WX_PRIVATE_KEY
- if (!privateKeyContent) {
- throw new Error('未找到私钥内容,请确保已正确配置 GitHub Secrets')
- }
- console.log('>>>>写入私钥文件:', privateKeyPath);
- fs.writeFileSync(privateKeyPath, privateKeyContent)
-}
-
-const project = new ci.Project({
- appid: 'wxe5f52902cf4de896',
- type: 'miniProgram',
- projectPath: path.resolve(__dirname, '../'),
- privateKeyPath: path.resolve(__dirname, './key'),
- ignores: [path.resolve(__dirname, '../miniprogram/node_modules/**/*')]
-})
-const robotNumber = 2
-const params = {
- onProgressUpdate: console.log,
- robot: robotNumber,
- version: packageJson.version,
- desc: packageJson.bundleDescription,
- setting: {
- es7: true,
- minifyJS: true,
- minifyWXML: true,
- minifyWXSS: true,
- codeProtect: false,
- autoPrefixWXSS: true,
- ignoreUploadUnusedFiles: true
- },
-}
-await ci.packNpm(project, {})
-ci.upload({
- project,
- ...params
-}).then(res => {
- console.debug('>>>>upload res', res)
-}).catch(err => {
- console.error('>>>>upload error', err)
- throw err
-}).finally(() => {
- // 删除临时私钥文件
- fs.unlinkSync(privateKeyPath)
-})
-
-
diff --git a/miniprogram/app.json b/miniprogram/app.json
index 8fed0aa4..56ed7ef5 100644
--- a/miniprogram/app.json
+++ b/miniprogram/app.json
@@ -9,27 +9,7 @@
"usingComponents": {
"mp-navigation-bar": "/component/navigation-bar/navigation-bar"
},
- "chatTools": [
- {
- "root": "packageChatTool",
- "entryPagePath": "pages/activity_create/index",
- "desc": "群签到工具",
- "scopes": [
- "scope.userLocation"
- ]
- }
- ],
"subpackages": [
- {
- "root": "packageChatTool",
- "pages": [
- "pages/activity_detail/index",
- "pages/activity_create/index"
- ],
- "entry": "entry.js",
- "independent": true,
- "renderer": "skyline"
- },
{
"root": "packageComponent",
"pages": [
@@ -52,18 +32,6 @@
"pages/content/progress/progress",
"pages/content/rich-text/rich-text",
"pages/content/selection/selection",
- "pages/form/button/button",
- "pages/form/checkbox/checkbox",
- "pages/form/form/form",
- "pages/form/input/input",
- "pages/form/label/label",
- "pages/form/picker/picker",
- "pages/form/picker-view/picker-view",
- "pages/form/radio/radio",
- "pages/form/slider/slider",
- "pages/form/switch/switch",
- "pages/form/textarea/textarea",
- "pages/form/editor/editor",
"pages/nav/navigator/navigator",
"pages/nav/navigator/navigate",
"pages/nav/navigator/redirect",
@@ -85,119 +53,6 @@
"pages/doc-web-view/doc-web-view"
]
},
- {
- "root": "packageAPI",
- "pages": [
- "pages/api/login/login",
- "pages/api/get-user-info/get-user-info",
- "pages/api/request-payment/request-payment",
- "pages/api/jump/jump",
- "pages/api/share/share",
- "pages/api/share-button/share-button",
- "pages/api/custom-message/custom-message",
- "pages/api/subscribe-message/subscribe-message",
- "pages/api/choose-address/choose-address",
- "pages/api/choose-invoice-title/choose-invoice-title",
- "pages/api/soter-authentication/soter-authentication",
- "pages/api/setting/setting",
- "pages/ar/visionkit-basic/visionkit-basic",
- "pages/ar/visionkit-basic-v2/visionkit-basic-v2",
- "pages/ar/plane-ar/plane-ar",
- "pages/ar/plane-ar-v2/plane-ar-v2",
- "pages/ar/plane-ar-v2-options/plane-ar-v2-options",
- "pages/ar/plane-ar-v2-marker/plane-ar-v2-marker",
- "pages/ar/plane-ar-v2-depth/plane-ar-v2-depth",
- "pages/ar/plane-ar-3dof/plane-ar-3dof",
- "pages/ar/2dmarker-ar/2dmarker-ar",
- "pages/ar/3dmarker-ar/3dmarker-ar",
- "pages/ar/osd-ar/osd-ar",
- "pages/ar/face-detect/face-detect",
- "pages/ar/face-detect-3d/face-detect-3d",
- "pages/ar/face-detect-3d-glasses/face-detect-3d-glasses",
- "pages/ar/body-detect/body-detect",
- "pages/ar/body-detect-3d/body-detect-3d",
- "pages/ar/hand-detect/hand-detect",
- "pages/ar/hand-detect-3d/hand-detect-3d",
- "pages/ar/depth-detect/depth-detect",
- "pages/ar/cameraBuffer-detect/cameraBuffer-detect",
- "pages/ar/cameraBuffer-jpg/cameraBuffer-jpg",
- "pages/ar/ocr-detect/ocr-detect",
- "pages/ar/shoe-detect/shoe-detect",
- "pages/ar/photo-shoe-detect/photo-shoe-detect",
- "pages/ar/photo-ocr-detect/photo-ocr-detect",
- "pages/ar/photo-idcard-detect/photo-idcard-detect",
- "pages/ar/photo-hand-detect/photo-hand-detect",
- "pages/ar/photo-body-detect/photo-body-detect",
- "pages/ar/photo-face-detect/photo-face-detect",
- "pages/ar/photo-depth-detect/photo-depth-detect",
- "pages/ar/gaussian-splatting/gaussian-splatting",
- "pages/ar/gaussian-splatting/gaussian-splatting-ar",
- "pages/page/set-navigation-bar-title/set-navigation-bar-title",
- "pages/page/navigation-bar-loading/navigation-bar-loading",
- "pages/page/navigator/navigator",
- "pages/page/pull-down-refresh/pull-down-refresh",
- "pages/page/animation/animation",
- "pages/page/action-sheet/action-sheet",
- "pages/page/modal/modal",
- "pages/page/toast/toast",
- "pages/page/canvas/canvas",
- "pages/page/get-wxml-node-info/get-wxml-node-info",
- "pages/page/page-scroll/page-scroll",
- "pages/page/intersection-observer/intersection-observer",
- "pages/device/clipboard-data/clipboard-data",
- "pages/device/bluetooth/bluetooth",
- "pages/device/bluetooth/slave/slave",
- "pages/device/screen-brightness/screen-brightness",
- "pages/device/vibrate/vibrate",
- "pages/device/add-contact/add-contact",
- "pages/device/wifi/wifi",
- "pages/device/get-network-type/get-network-type",
- "pages/device/on-network-status-change/on-network-status-change",
- "pages/device/get-system-info/get-system-info",
- "pages/device/on-compass-change/on-compass-change",
- "pages/device/make-phone-call/make-phone-call",
- "pages/device/scan-code/scan-code",
- "pages/device/on-accelerometer-change/on-accelerometer-change",
- "pages/device/capture-screen/capture-screen",
- "pages/device/ibeacon/ibeacon",
- "pages/device/get-battery-info/get-battery-info",
- "pages/media/image/image",
- "pages/media/voice/voice",
- "pages/media/file/file",
- "pages/media/load-font-face/load-font-face",
- "pages/media/background-audio/background-audio",
- "pages/media/video/video",
- "pages/media/audio/audio",
- "pages/media/media-container/media-container",
- "pages/location/get-location/get-location",
- "pages/location/open-location/open-location",
- "pages/location/choose-location/choose-location",
- "pages/network/request/request",
- "pages/network/web-socket/web-socket",
- "pages/network/upload-file/upload-file",
- "pages/network/download-file/download-file",
- "pages/network/mdns/mdns",
- "pages/network/udp-socket/udp-socket",
- "pages/storage/storage/storage",
- "pages/storage/get-background-fetch-data/get-background-fetch-data",
- "pages/storage/get-background-prefetch-data/get-background-prefetch-data",
- "pages/performance/get-performance/get-performance",
- "pages/worker/worker/worker",
- "pages/framework/two-way-bindings/two-way-bindings",
- "pages/framework/wxs/wxs",
- "pages/framework/resizable/resizable",
- "pages/framework/wxs/movable",
- "pages/framework/wxs/sidebar",
- "pages/framework/wxs/stick-top",
- "pages/framework/wxs/nearby",
- "pages/ai/mobilenet/index",
- "pages/ai/style-trans/index",
- "pages/ai/mobilenet_int8/index",
- "pages/chattool/activity_assist/activity_assist",
- "pages/chattool/material_open/material_open",
- "pages/chattool/material_view/material_view"
- ]
- },
{
"root": "packageCloud",
"pages": [
@@ -401,18 +256,6 @@
"packageComponent"
]
},
- "page/API/index": {
- "network": "all",
- "packages": [
- "packageAPI"
- ]
- },
- "packageAPI/pages/chattool/activity_assist/activity_assist": {
- "network": "all",
- "packages": [
- "packageChatTool"
- ]
- },
"page/cloud/index": {
"network": "all",
"packages": [
@@ -512,21 +355,5 @@
},
"renderer": "skyline",
"componentFramework": "glass-easel",
- "appBar": {},
- "supportedMaterials": [
- {
- "materialType": "image/*",
- "name": "用${nickname}打开",
- "desc": "聊天内容长按打开",
- "path": "packageAPI/pages/chattool/material_open/material_open"
- }
- ],
- "multiSelectSupportedMaterials": [
- {
- "materialType": ["image/*"],
- "desc": "聊天内容长按多选打开",
- "path": "packageAPI/pages/chattool/material_open/material_open",
- "scopes": []
- }
- ]
+ "appBar": {}
}
\ No newline at end of file
diff --git a/miniprogram/package.json b/miniprogram/package.json
index 09e68a21..a5081aca 100644
--- a/miniprogram/package.json
+++ b/miniprogram/package.json
@@ -12,7 +12,6 @@
"dependencies": {
"miniprogram-barrage": "^1.1.0",
"miniprogram-recycle-view": "^0.1.5",
- "wxml-to-canvas": "^1.1.1",
- "threejs-miniprogram": "0.0.3"
+ "wxml-to-canvas": "^1.1.1"
}
}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.d.ts
deleted file mode 100644
index 30d14dc0..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.d.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-export default class CellGroup extends SuperComponent {
- externalClasses: string[];
- relations: RelationsOptions;
- properties: import("./type").TdCellGroupProps;
- data: {
- prefix: string;
- classPrefix: string;
- };
- methods: {
- updateLastChid(): void;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.js b/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.js
deleted file mode 100644
index 966ceece..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.js
+++ /dev/null
@@ -1,43 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-cell-group`;
-let CellGroup = class CellGroup extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-title`];
- this.relations = {
- '../cell/cell': {
- type: 'child',
- linked() {
- this.updateLastChid();
- },
- unlinked() {
- this.updateLastChid();
- },
- },
- };
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- };
- this.methods = {
- updateLastChid() {
- const items = this.$children;
- items.forEach((child, index) => child.setData({ isLastChild: index === items.length - 1 }));
- },
- };
- }
-};
-CellGroup = __decorate([
- wxComponent()
-], CellGroup);
-export default CellGroup;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.json b/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.json
deleted file mode 100644
index 79f27309..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared"
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.wxml
deleted file mode 100644
index 404f3f31..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.wxml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- {{ title }}
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.wxss
deleted file mode 100644
index 2076b12a..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/cell-group.wxss
+++ /dev/null
@@ -1,71 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-cell-group {
- position: relative;
-}
-.t-cell-group__title {
- font-family: PingFangSC-Regular;
- font-size: var(--td-cell-group-title-font-size, 28rpx);
- color: var(--td-cell-group-title-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
- text-align: left;
- line-height: var(--td-cell-group-title-line-height, 90rpx);
- background-color: var(--td-cell-group-title-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
- padding-left: var(--td-cell-group-title-padding-left, 32rpx);
-}
-.t-cell-group--bordered::before {
- position: absolute;
- box-sizing: border-box;
- content: ' ';
- pointer-events: none;
- right: 0;
- left: 0;
- top: 0;
- border-top: 1px solid var(--td-cell-group-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
- transform: scaleY(0.5);
- transform-origin: 0 0;
- transform-origin: top;
- z-index: 1;
-}
-.t-cell-group--bordered::after {
- position: absolute;
- box-sizing: border-box;
- content: ' ';
- pointer-events: none;
- right: 0;
- left: 0;
- bottom: 0;
- border-bottom: 1px solid var(--td-cell-group-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
- transform: scaleY(0.5);
- transform-origin: bottom;
- z-index: 1;
-}
-.t-cell-group--card {
- margin: 0 32rpx;
- border-radius: var(--td-radius-large, 18rpx);
- overflow: hidden;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/props.d.ts
deleted file mode 100644
index 4c4a9d09..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdCellGroupProps } from './type';
-declare const props: TdCellGroupProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/props.js
deleted file mode 100644
index c8d887e8..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/props.js
+++ /dev/null
@@ -1,17 +0,0 @@
-const props = {
- bordered: {
- type: Boolean,
- },
- externalClasses: {
- type: Array,
- },
- theme: {
- type: String,
- value: 'default',
- },
- title: {
- type: String,
- value: '',
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/type.d.ts
deleted file mode 100644
index 4c111da3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/type.d.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-export interface TdCellGroupProps {
- bordered?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- style?: {
- type: StringConstructor;
- value?: string;
- };
- externalClasses?: {
- type: ArrayConstructor;
- value?: ['t-class'];
- };
- theme?: {
- type: StringConstructor;
- value?: 'default' | 'card';
- };
- title?: {
- type: StringConstructor;
- value?: string;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell-group/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/cell/README.en-US.md
deleted file mode 100644
index e71073e8..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/README.en-US.md
+++ /dev/null
@@ -1,81 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Cell Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-align | String | middle | options: top/middle/bottom | N
-arrow | Boolean / Object | false | \- | N
-bordered | Boolean | true | \- | N
-description | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-hover | Boolean | - | \- | N
-image | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-jump-type | String | navigateTo | options: switchTab/reLaunch/redirectTo/navigateTo | N
-left-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-note | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-required | Boolean | false | \- | N
-right-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-title | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-url | String | - | \- | N
-
-### Cell Events
-
-name | params | description
--- | -- | --
-click | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
-### Cell External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-center | \-
-t-class-description | \-
-t-class-hover | \-
-t-class-image | \-
-t-class-left | \-
-t-class-left-icon | \-
-t-class-note | \-
-t-class-right | \-
-t-class-right-icon | \-
-t-class-title | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-cell-group-border-color | @border-color | -
---td-cell-group-title-bg-color | @bg-color-secondarycontainer | -
---td-cell-group-title-color | @font-gray-3 | -
---td-cell-group-title-font-size | 28rpx | -
---td-cell-group-title-line-height | 90rpx | -
---td-cell-group-title-padding-left | 32rpx | -
---td-cell-bg-color | @bg-color-container | -
---td-cell-border-color | @component-stroke | -
---td-cell-border-width | 1px | -
---td-cell-border-left-space | @cell-horizontal-padding | -
---td-cell-border-right-space | 0 | -
---td-cell-description-color | @font-gray-2 | -
---td-cell-description-font-size | @font-size-base | -
---td-cell-description-line-height | 44rpx | -
---td-cell-height | auto | -
---td-cell-horizontal-padding | 32rpx | -
---td-cell-hover-color | @bg-color-secondarycontainer | -
---td-cell-image-height | 96rpx | -
---td-cell-image-width | 96rpx | -
---td-cell-left-icon-color | @brand-color | -
---td-cell-left-icon-font-size | 48rpx | -
---td-cell-line-height | 48rpx | -
---td-cell-note-color | @font-gray-3 | -
---td-cell-note-font-size | @font-size-m | -
---td-cell-required-color | @error-color-6 | -
---td-cell-required-font-size | @font-size-m | -
---td-cell-right-icon-color | @font-gray-3 | -
---td-cell-right-icon-font-size | 48rpx | -
---td-cell-title-color | @font-gray-1 | -
---td-cell-title-font-size | @font-size-m | -
---td-cell-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/cell/README.md
deleted file mode 100644
index 6488542c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/README.md
+++ /dev/null
@@ -1,126 +0,0 @@
----
-title: Cell 单元格
-description: 用于各个类别行的信息展示。
-spline: data
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-cell": "tdesign-miniprogram/cell/cell",
- "t-cell-group": "tdesign-miniprogram/cell-group/cell-group"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 类型
-
-单行单元格
-
-
-
-{{ base }}
-
-多行单元格
-
-
-
-{{ multiple }}
-
-### 样式
-
-卡片单元格
-
-{{ theme }}
-
-## API
-
-### Cell Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-align | String | middle | 内容的对齐方式,默认居中对齐。可选项:top/middle/bottom | N
-arrow | Boolean / Object | false | 是否显示右侧箭头 | N
-bordered | Boolean | true | 是否显示下边框 | N
-description | String / Slot | - | 下方内容描述。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-hover | Boolean | - | 是否开启点击反馈 | N
-image | String / Slot | - | 主图。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-jump-type | String | navigateTo | 链接跳转类型。可选项:switchTab/reLaunch/redirectTo/navigateTo | N
-left-icon | String / Object / Slot | - | 左侧图标,出现在单元格标题的左侧。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-note | String / Slot | - | 和标题同行的说明文字。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-required | Boolean | false | 是否显示表单必填星号 | N
-right-icon | String / Object / Slot | - | 最右侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-title | String / Slot | - | 标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-url | String | - | 点击后跳转链接地址。如果值为空,则表示不需要跳转 | N
-
-### Cell Events
-
-名称 | 参数 | 描述
--- | -- | --
-click | - | 右侧内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
-### Cell External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-center | 中间(`title`, `description`)内容样式类
-t-class-description | 下方描述内容样式类
-t-class-hover | 悬停样式类
-t-class-image | 图片样式类
-t-class-left | 左侧内容样式类
-t-class-left-icon | 左侧图标样式类
-t-class-note | 右侧说明文字样式类
-t-class-right | 右侧内容样式类
-t-class-right-icon | 右侧图标样式类
-t-class-title | 标题样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-cell-group-border-color | @component-stroke | -
---td-cell-group-title-bg-color | @bg-color-secondarycontainer | -
---td-cell-group-title-color | @font-gray-3 | -
---td-cell-group-title-font-size | 28rpx | -
---td-cell-group-title-line-height | 90rpx | -
---td-cell-group-title-padding-left | 32rpx | -
---td-cell-bg-color | @bg-color-container | -
---td-cell-border-color | @component-stroke | -
---td-cell-border-width | 1px | -
---td-cell-border-left-space | @cell-horizontal-padding | -
---td-cell-border-right-space | 0 | -
---td-cell-description-color | @font-gray-2 | -
---td-cell-description-font-size | @font-size-base | -
---td-cell-description-line-height | 44rpx | -
---td-cell-height | auto | -
---td-cell-horizontal-padding | 32rpx | -
---td-cell-hover-color | @bg-color-secondarycontainer | -
---td-cell-image-height | 96rpx | -
---td-cell-image-width | 96rpx | -
---td-cell-left-icon-color | @brand-color | -
---td-cell-left-icon-font-size | 48rpx | -
---td-cell-line-height | 48rpx | -
---td-cell-note-color | @font-gray-3 | -
---td-cell-note-font-size | @font-size-m | -
---td-cell-required-color | @error-color-6 | -
---td-cell-required-font-size | @font-size-m | -
---td-cell-right-icon-color | @font-gray-3 | -
---td-cell-right-icon-font-size | 48rpx | -
---td-cell-title-color | @font-gray-1 | -
---td-cell-title-font-size | @font-size-m | -
---td-cell-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.d.ts
deleted file mode 100644
index d6a89102..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.d.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-export default class Cell extends SuperComponent {
- externalClasses: string[];
- relations: RelationsOptions;
- options: {
- multipleSlots: boolean;
- };
- properties: import("./type").TdCellProps;
- data: {
- prefix: string;
- classPrefix: string;
- isLastChild: boolean;
- };
- observers: {
- leftIcon(v: any): void;
- rightIcon(v: any): void;
- arrow(v: any): void;
- };
- setIcon(name: any, value: any, defaultValue: any): void;
- onClick(e: any): void;
- jumpLink(urlKey?: string, link?: string): void;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.js b/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.js
deleted file mode 100644
index c7c5ec5e..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.js
+++ /dev/null
@@ -1,75 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { calcIcon } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-cell`;
-let Cell = class Cell extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [
- `${prefix}-class`,
- `${prefix}-class-title`,
- `${prefix}-class-description`,
- `${prefix}-class-note`,
- `${prefix}-class-hover`,
- `${prefix}-class-image`,
- `${prefix}-class-left`,
- `${prefix}-class-left-icon`,
- `${prefix}-class-center`,
- `${prefix}-class-right`,
- `${prefix}-class-right-icon`,
- ];
- this.relations = {
- '../cell-group/cell-group': {
- type: 'parent',
- },
- };
- this.options = {
- multipleSlots: true,
- };
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- isLastChild: false,
- };
- this.observers = {
- leftIcon(v) {
- this.setIcon('_leftIcon', v, '');
- },
- rightIcon(v) {
- this.setIcon('_rightIcon', v, '');
- },
- arrow(v) {
- this.setIcon('_arrow', v, 'chevron-right');
- },
- };
- }
- setIcon(name, value, defaultValue) {
- this.setData({
- [name]: calcIcon(value, defaultValue),
- });
- }
- onClick(e) {
- this.triggerEvent('click', e.detail);
- this.jumpLink();
- }
- jumpLink(urlKey = 'url', link = 'jumpType') {
- const url = this.data[urlKey];
- const jumpType = this.data[link];
- if (url) {
- wx[jumpType]({ url });
- }
- }
-};
-Cell = __decorate([
- wxComponent()
-], Cell);
-export default Cell;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.json b/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.json
deleted file mode 100644
index b7d275dd..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon",
- "t-image": "../image/image"
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.wxml
deleted file mode 100644
index c65c9a67..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.wxml
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ title}}
-
-
- *
-
-
-
-
- {{description}}
-
-
-
-
-
- {{note}}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.wxss
deleted file mode 100644
index ffee90a2..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/cell.wxss
+++ /dev/null
@@ -1,122 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-cell {
- position: relative;
- display: flex;
- box-sizing: border-box;
- width: 100%;
- padding: var(--td-cell-vertical-padding, 32rpx) var(--td-cell-horizontal-padding, 32rpx);
- line-height: var(--td-cell-line-height, 48rpx);
- height: var(--td-cell-height, auto);
- background-color: var(--td-cell-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-cell::after {
- position: absolute;
- box-sizing: border-box;
- content: ' ';
- pointer-events: none;
- right: 0;
- left: 0;
- bottom: 0;
- border-bottom: var(--td-cell-border-width, 1px) solid var(--td-cell-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
- transform: scaleY(0.5);
- transform-origin: bottom;
- left: var(--td-cell-border-left-space, var(--td-cell-horizontal-padding, 32rpx));
- right: var(--td-cell-border-right-space, 0);
-}
-.t-cell--borderless::after {
- display: none;
-}
-.t-cell__description {
- font-size: var(--td-cell-description-font-size, var(--td-font-size-base, 28rpx));
- line-height: var(--td-cell-description-line-height, 44rpx);
- color: var(--td-cell-description-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
-}
-.t-cell__description-text {
- margin-top: calc(var(--td-spacer, 16rpx) / 2);
-}
-.t-cell__note {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- color: var(--td-cell-note-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
- font-size: var(--td-cell-note-font-size, var(--td-font-size-m, 32rpx));
-}
-.t-cell__title,
-.t-cell__note {
- flex: 1 1 auto;
-}
-.t-cell__title:empty,
-.t-cell__note:empty {
- display: none;
-}
-.t-cell__title-text {
- display: flex;
- font-size: var(--td-cell-title-font-size, var(--td-font-size-m, 32rpx));
- color: var(--td-cell-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- font-weight: 400;
-}
-.t-cell__left,
-.t-cell__right {
- display: flex;
- align-items: center;
-}
-.t-cell__left:not(:empty) {
- margin-right: var(--td-spacer, 16rpx);
-}
-.t-cell__left-icon {
- color: var(--td-cell-left-icon-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- font-size: var(--td-cell-left-icon-font-size, 48rpx);
-}
-.t-cell__left-image {
- height: var(--td-cell-image-height, 96rpx);
- width: var(--td-cell-image-width, 96rpx);
-}
-.t-cell__right {
- margin-left: calc(var(--td-spacer, 16rpx) / 2);
-}
-.t-cell__right-icon {
- color: var(--td-cell-right-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
- font-size: var(--td-cell-right-icon-font-size, 48rpx);
-}
-.t-cell--hover {
- background-color: var(--td-cell-hover-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
-}
-.t-cell--required {
- font-size: var(--td-cell-required-font-size, var(--td-font-size-m, 32rpx));
- color: var(--td-cell-required-color, var(--td-error-color-6, #d54941));
-}
-.t-cell--middle {
- align-items: center;
-}
-.t-cell--top {
- align-items: flex-start;
-}
-.t-cell--bottom {
- align-items: flex-end;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/cell/props.d.ts
deleted file mode 100644
index ad657e51..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdCellProps } from './type';
-declare const props: TdCellProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/cell/props.js
deleted file mode 100644
index c5382532..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/props.js
+++ /dev/null
@@ -1,48 +0,0 @@
-const props = {
- align: {
- type: String,
- value: 'middle',
- },
- arrow: {
- type: null,
- value: false,
- },
- bordered: {
- type: Boolean,
- value: true,
- },
- description: {
- type: String,
- },
- hover: {
- type: Boolean,
- },
- image: {
- type: String,
- },
- jumpType: {
- type: String,
- value: 'navigateTo',
- },
- leftIcon: {
- type: null,
- },
- note: {
- type: String,
- },
- required: {
- type: Boolean,
- value: false,
- },
- rightIcon: {
- type: null,
- },
- title: {
- type: String,
- },
- url: {
- type: String,
- value: '',
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/cell/type.d.ts
deleted file mode 100644
index 7ba22586..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/type.d.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-export interface TdCellProps {
- align?: {
- type: StringConstructor;
- value?: 'top' | 'middle' | 'bottom';
- };
- arrow?: {
- type: null;
- value?: boolean | object;
- };
- bordered?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- description?: {
- type: StringConstructor;
- value?: string;
- };
- hover?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- image?: {
- type: StringConstructor;
- value?: string;
- };
- jumpType?: {
- type: StringConstructor;
- value?: 'switchTab' | 'reLaunch' | 'redirectTo' | 'navigateTo';
- };
- leftIcon?: {
- type: null;
- value?: string | object;
- };
- note?: {
- type: StringConstructor;
- value?: string;
- };
- required?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- rightIcon?: {
- type: null;
- value?: string | object;
- };
- title?: {
- type: StringConstructor;
- value?: string;
- };
- url?: {
- type: StringConstructor;
- value?: string;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/cell/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/cell/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/col/README.en-US.md
deleted file mode 100644
index 7ad8352e..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/README.en-US.md
+++ /dev/null
@@ -1,21 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Col Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-offset | String / Number | - | \- | N
-span | String / Number | - | \- | N
-
-
-### Row Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-gutter | String / Number | - | \- | N
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/col/README.md
deleted file mode 100644
index 32473012..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
----
-title: Layout 布局
-description: 以规则的网格阵列来指导和规范页面中的版面布局以及信息分布,提高界面内布局的一致性,节约成本。
-spline: base
-isComponent: true
----
-
-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-row": "tdesign-miniprogram/row/row",
- "t-col": "tdesign-miniprogram/col/col"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-
-### 组件类型
-
-基础
-
-{{ base }}
-
-
-增加间距
-
-{{ offset }}
-
-
-
-## API
-
-### Col Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-offset | String / Number | - | 列的偏移量(默认单位px) | N
-span | String / Number | - | 列的宽度(默认单位px) | N
-
-
-### Row Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-gutter | String / Number | - | 列之间的间距(默认单位px) | N
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.d.ts
deleted file mode 100644
index ecebf641..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-export default class Col extends SuperComponent {
- externalClasses: string[];
- properties: import("./type").TdColProps;
- data: {
- prefix: string;
- classPrefix: string;
- };
- relations: RelationsOptions;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.js b/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.js
deleted file mode 100644
index cbaecddc..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.js
+++ /dev/null
@@ -1,31 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-col`;
-let Col = class Col extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`];
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- };
- this.relations = {
- '../row/row': {
- type: 'parent',
- },
- };
- }
-};
-Col = __decorate([
- wxComponent()
-], Col);
-export default Col;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.json b/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.json
deleted file mode 100644
index 4f0a3f08..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {}
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.wxml
deleted file mode 100644
index cd7f3312..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.wxml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.wxs b/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.wxs
deleted file mode 100644
index 1822c0b1..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.wxs
+++ /dev/null
@@ -1,17 +0,0 @@
-var utils = require('../common/utils.wxs');
-
-function getColStyles(gutter, style, customStyle) {
- var _style = '';
- if (gutter) {
- _style = utils._style({
- 'padding-right': utils.addUnit(gutter / 2),
- 'padding-left': utils.addUnit(gutter / 2),
- });
- }
-
- return utils._style([style, customStyle]) + _style;
-}
-
-module.exports = {
- getColStyles: getColStyles,
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.wxss
deleted file mode 100644
index 8d6d0b91..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/col.wxss
+++ /dev/null
@@ -1,176 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-col {
- display: block;
- box-sizing: border-box;
- min-height: 1px;
-}
-.t-col--1 {
- width: 4.16666667%;
-}
-.t-col--offset-1 {
- margin-left: 4.16666667%;
-}
-.t-col--2 {
- width: 8.33333333%;
-}
-.t-col--offset-2 {
- margin-left: 8.33333333%;
-}
-.t-col--3 {
- width: 12.5%;
-}
-.t-col--offset-3 {
- margin-left: 12.5%;
-}
-.t-col--4 {
- width: 16.66666667%;
-}
-.t-col--offset-4 {
- margin-left: 16.66666667%;
-}
-.t-col--5 {
- width: 20.83333333%;
-}
-.t-col--offset-5 {
- margin-left: 20.83333333%;
-}
-.t-col--6 {
- width: 25%;
-}
-.t-col--offset-6 {
- margin-left: 25%;
-}
-.t-col--7 {
- width: 29.16666667%;
-}
-.t-col--offset-7 {
- margin-left: 29.16666667%;
-}
-.t-col--8 {
- width: 33.33333333%;
-}
-.t-col--offset-8 {
- margin-left: 33.33333333%;
-}
-.t-col--9 {
- width: 37.5%;
-}
-.t-col--offset-9 {
- margin-left: 37.5%;
-}
-.t-col--10 {
- width: 41.66666667%;
-}
-.t-col--offset-10 {
- margin-left: 41.66666667%;
-}
-.t-col--11 {
- width: 45.83333333%;
-}
-.t-col--offset-11 {
- margin-left: 45.83333333%;
-}
-.t-col--12 {
- width: 50%;
-}
-.t-col--offset-12 {
- margin-left: 50%;
-}
-.t-col--13 {
- width: 54.16666667%;
-}
-.t-col--offset-13 {
- margin-left: 54.16666667%;
-}
-.t-col--14 {
- width: 58.33333333%;
-}
-.t-col--offset-14 {
- margin-left: 58.33333333%;
-}
-.t-col--15 {
- width: 62.5%;
-}
-.t-col--offset-15 {
- margin-left: 62.5%;
-}
-.t-col--16 {
- width: 66.66666667%;
-}
-.t-col--offset-16 {
- margin-left: 66.66666667%;
-}
-.t-col--17 {
- width: 70.83333333%;
-}
-.t-col--offset-17 {
- margin-left: 70.83333333%;
-}
-.t-col--18 {
- width: 75%;
-}
-.t-col--offset-18 {
- margin-left: 75%;
-}
-.t-col--19 {
- width: 79.16666667%;
-}
-.t-col--offset-19 {
- margin-left: 79.16666667%;
-}
-.t-col--20 {
- width: 83.33333333%;
-}
-.t-col--offset-20 {
- margin-left: 83.33333333%;
-}
-.t-col--21 {
- width: 87.5%;
-}
-.t-col--offset-21 {
- margin-left: 87.5%;
-}
-.t-col--22 {
- width: 91.66666667%;
-}
-.t-col--offset-22 {
- margin-left: 91.66666667%;
-}
-.t-col--23 {
- width: 95.83333333%;
-}
-.t-col--offset-23 {
- margin-left: 95.83333333%;
-}
-.t-col--24 {
- width: 100%;
-}
-.t-col--offset-24 {
- margin-left: 100%;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/col/props.d.ts
deleted file mode 100644
index 15de965a..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdColProps } from './type';
-declare const props: TdColProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/col/props.js
deleted file mode 100644
index 05857f37..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/props.js
+++ /dev/null
@@ -1,9 +0,0 @@
-const props = {
- offset: {
- type: null,
- },
- span: {
- type: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/col/type.d.ts
deleted file mode 100644
index af55fa43..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/type.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-export interface TdColProps {
- offset?: {
- type: null;
- value?: string | number;
- };
- span?: {
- type: null;
- value?: string | number;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/col/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/col/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/col/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.d.ts
deleted file mode 100644
index 4ae0ff47..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.d.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-import type { TdCollapsePanelProps } from './type';
-export interface CollapsePanelProps extends TdCollapsePanelProps {
-}
-export default class CollapsePanel extends SuperComponent {
- externalClasses: string[];
- options: {
- multipleSlots: boolean;
- };
- relations: RelationsOptions;
- properties: TdCollapsePanelProps;
- data: {
- prefix: string;
- expanded: boolean;
- classPrefix: string;
- classBasePrefix: string;
- ultimateExpandIcon: boolean;
- ultimateDisabled: boolean;
- };
- observers: {
- disabled(v: any): void;
- };
- methods: {
- updateExpanded(activeValues?: any[]): void;
- updateStyle(expanded: boolean): Promise;
- onClick(): void;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.js b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.js
deleted file mode 100644
index 27b3214f..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.js
+++ /dev/null
@@ -1,95 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { getRect } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-collapse-panel`;
-let CollapsePanel = class CollapsePanel extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-content`, `${prefix}-class-header`];
- this.options = {
- multipleSlots: true,
- };
- this.relations = {
- '../collapse/collapse': {
- type: 'ancestor',
- linked(target) {
- const { value, expandIcon, disabled } = target.properties;
- this.setData({
- ultimateExpandIcon: this.properties.expandIcon == null ? expandIcon : this.properties.expandIcon,
- ultimateDisabled: this.properties.disabled == null ? disabled : this.properties.disabled,
- });
- this.updateExpanded(value);
- },
- },
- };
- this.properties = props;
- this.data = {
- prefix,
- expanded: false,
- classPrefix: name,
- classBasePrefix: prefix,
- ultimateExpandIcon: false,
- ultimateDisabled: false,
- };
- this.observers = {
- disabled(v) {
- this.setData({ ultimateDisabled: !!v });
- },
- };
- this.methods = {
- updateExpanded(activeValues = []) {
- if (!this.$parent) {
- return;
- }
- const { value } = this.properties;
- const { defaultExpandAll } = this.$parent.data;
- const expanded = defaultExpandAll ? !this.data.expanded : activeValues.includes(value);
- if (expanded === this.properties.expanded)
- return;
- this.setData({ expanded });
- this.updateStyle(expanded);
- },
- updateStyle(expanded) {
- return getRect(this, `.${name}__content`)
- .then((rect) => rect.height)
- .then((height) => {
- const animation = wx.createAnimation({
- duration: 0,
- timingFunction: 'ease-in-out',
- });
- if (expanded) {
- animation.height(height).top(0).step({ duration: 300 }).height('auto').step();
- }
- else {
- animation.height(height).top(1).step({ duration: 1 }).height(0).step({ duration: 300 });
- }
- this.setData({ animation: animation.export() });
- });
- },
- onClick() {
- const { ultimateDisabled } = this.data;
- const { value } = this.properties;
- if (ultimateDisabled)
- return;
- if (this.$parent.data.defaultExpandAll) {
- this.updateExpanded();
- }
- else {
- this.$parent.switch(value);
- }
- },
- };
- }
-};
-CollapsePanel = __decorate([
- wxComponent()
-], CollapsePanel);
-export default CollapsePanel;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.json b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.json
deleted file mode 100644
index e33d33e8..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-cell": "../cell/cell"
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.wxml
deleted file mode 100644
index 577ca8ee..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.wxml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{content}}
-
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.wxss
deleted file mode 100644
index 92cccc6c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/collapse-panel.wxss
+++ /dev/null
@@ -1,191 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-collapse-panel {
- background-color: var(--td-collapse-panel-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-collapse-panel--disabled {
- pointer-events: none;
-}
-.t-collapse-panel--disabled .t-collapse-panel__content,
-.t-collapse-panel--disabled .t-collapse-panel__header {
- opacity: 0.3;
-}
-.t-collapse-panel--top {
- display: flex;
- flex-direction: column-reverse;
-}
-.t-collapse-panel__header {
- position: relative;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding-left: var(--td-collapse-horizontal-padding, 32rpx);
- height: var(--td-collapse-header-height, auto);
- color: var(--td-collapse-header-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
-}
-.t-collapse-panel__header--top {
- position: relative;
-}
-.t-collapse-panel__header--top::after {
- content: '';
- display: block;
- position: absolute;
- top: 0;
- bottom: unset;
- left: unset;
- right: unset;
- background-color: var(--td-collapse-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-collapse-panel__header--top::after {
- height: 1px;
- left: 0;
- right: 0;
- transform: scaleY(0.5);
-}
-.t-collapse-panel__header--bottom {
- position: relative;
-}
-.t-collapse-panel__header--bottom::after {
- content: '';
- display: block;
- position: absolute;
- top: unset;
- bottom: 0;
- left: unset;
- right: unset;
- background-color: var(--td-collapse-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-collapse-panel__header--bottom::after {
- height: 1px;
- left: 0;
- right: 0;
- transform: scaleY(0.5);
-}
-.t-collapse-panel__header::after {
- left: 32rpx;
-}
-.t-collapse-panel__header-right {
- display: inline-flex;
- align-items: center;
- height: 100%;
-}
-.t-collapse-panel__header-icon {
- height: 100%;
- padding-left: 8px;
- width: 44px;
- padding-right: 8px;
- color: var(--td-collapse-icon-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
-}
-.t-collapse-panel__extra {
- font-size: var(--td-collapse-extra-font-size, var(--td-font-size-m, 32rpx));
-}
-.t-collapse-panel__body {
- position: relative;
-}
-.t-collapse-panel__body::after {
- content: '';
- display: block;
- position: absolute;
- top: unset;
- bottom: 0;
- left: unset;
- right: unset;
- background-color: var(--td-collapse-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-collapse-panel__body::after {
- height: 1px;
- left: 0;
- right: 0;
- transform: scaleY(0.5);
-}
-.t-collapse-panel__wrapper {
- height: 0;
- overflow: hidden;
-}
-.t-collapse-panel__content {
- color: var(--td-collapse-content-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- font-size: var(--td-collapse-content-font-size, var(--td-font-size-base, 28rpx));
- padding: var(--td-collapse-content-padding, 32rpx);
- line-height: var(--td-collapse-content-line-height, 1.5);
-}
-.t-collapse-panel__content--disabled {
- color: var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
-}
-.t-collapse-panel__content--expanded.t-collapse-panel__content--bottom {
- position: relative;
-}
-.t-collapse-panel__content--expanded.t-collapse-panel__content--bottom::after {
- content: '';
- display: block;
- position: absolute;
- top: unset;
- bottom: 0;
- left: unset;
- right: unset;
- background-color: var(--td-collapse-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-collapse-panel__content--expanded.t-collapse-panel__content--bottom::after {
- height: 1px;
- left: 0;
- right: 0;
- transform: scaleY(0.5);
-}
-.t-collapse-panel__content--expanded.t-collapse-panel__content--top {
- position: relative;
-}
-.t-collapse-panel__content--expanded.t-collapse-panel__content--top::after {
- content: '';
- display: block;
- position: absolute;
- top: 0;
- bottom: unset;
- left: unset;
- right: unset;
- background-color: var(--td-collapse-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-collapse-panel__content--expanded.t-collapse-panel__content--top::after {
- height: 1px;
- left: 0;
- right: 0;
- transform: scaleY(0.5);
-}
-.t-collapse-panel__arrow--top {
- transform: rotate(180deg);
-}
-.class-title {
- font-size: var(--td-collapse-title-font-size, var(--td-font-size-m, 32rpx));
-}
-.class-title--disabled {
- color: var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
-}
-.class-note--disabled {
- color: var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
-}
-.class-right-icon--disabled {
- color: var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26)));
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/props.d.ts
deleted file mode 100644
index 829dbea4..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdCollapsePanelProps } from './type';
-declare const props: TdCollapsePanelProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/props.js
deleted file mode 100644
index 429cd0ae..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/props.js
+++ /dev/null
@@ -1,33 +0,0 @@
-const props = {
- content: {
- type: String,
- },
- disabled: {
- type: null,
- value: undefined,
- },
- expandIcon: {
- type: null,
- value: undefined,
- },
- externalClasses: {
- type: Array,
- },
- header: {
- type: String,
- },
- headerLeftIcon: {
- type: String,
- },
- headerRightContent: {
- type: String,
- },
- placement: {
- type: String,
- value: 'bottom',
- },
- value: {
- type: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/type.d.ts
deleted file mode 100644
index 98342531..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/type.d.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-export interface TdCollapsePanelProps {
- content?: {
- type: StringConstructor;
- value?: string;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- expandIcon?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- externalClasses?: {
- type: ArrayConstructor;
- value?: ['t-class', 't-class-header', 't-class-content'];
- };
- header?: {
- type: StringConstructor;
- value?: string;
- };
- headerLeftIcon?: {
- type: StringConstructor;
- value?: string;
- };
- headerRightContent?: {
- type: StringConstructor;
- value?: string;
- };
- placement?: {
- type: StringConstructor;
- value?: 'bottom' | 'top';
- };
- value?: {
- type: null;
- value?: string | number;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse-panel/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/README.en-US.md
deleted file mode 100644
index f1edbfff..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/README.en-US.md
+++ /dev/null
@@ -1,65 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Collapse Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-default-expand-all | Boolean | false | \- | N
-disabled | Boolean | - | \- | N
-expand-icon | Boolean | true | \- | N
-expand-mutex | Boolean | false | \- | N
-theme | String | default | options: default/card | N
-value | Array | [] | Typescript:`CollapseValue` `type CollapseValue = Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/collapse/type.ts) | N
-default-value | Array | undefined | uncontrolled property。Typescript:`CollapseValue` `type CollapseValue = Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/collapse/type.ts) | N
-
-### Collapse Events
-
-name | params | description
--- | -- | --
-change | `(value: CollapseValue)` | \-
-
-
-### CollapsePanel Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-disabled | Boolean | undefined | \- | N
-expand-icon | Boolean / Slot | undefined | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-header | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-header-left-icon | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-header-right-content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-placement | String | bottom | `0.34.0`。options: bottom/top | N
-value | String / Number | - | \- | N
-### CollapsePanel External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-content | \-
-t-class-header | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-collapse-border-color | @border-level-1-color | -
---td-collapse-content-font-size | @font-size-base | -
---td-collapse-content-line-height | 1.5 | -
---td-collapse-content-padding | 32rpx | -
---td-collapse-content-text-color | @text-color-primary | -
---td-collapse-extra-font-size | @font-size-m | -
---td-collapse-header-height | auto | -
---td-collapse-header-text-color | @text-color-primary | -
---td-collapse-header-text-disabled-color | @text-color-disabled | -
---td-collapse-horizontal-padding | 32rpx | -
---td-collapse-icon-color | @font-gray-3 | -
---td-collapse-panel-bg-color | @bg-color-container | -
---td-collapse-title-font-size | @font-size-m | -
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/README.md
deleted file mode 100644
index 22a33521..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/README.md
+++ /dev/null
@@ -1,119 +0,0 @@
----
-title: Collapse 折叠面板
-description: 用于对复杂区域进行分组和隐藏 常用于订单信息展示等
-spline: data
-isComponent: true
----
-
-


-
-
-
- 该组件于 0.7.3 版本上线,请留意版本。
-
-
-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-collapse": "tdesign-miniprogram/collapse/collapse",
- "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 类型
-
-基础折叠面板
-
-{{ base }}
-
-
-带操作说明
-
-{{ action }}
-
-手风琴模式
-
-{{ accordion }}
-
-### 样式
-
-卡片折叠面板
-
-{{ theme }}
-
-## API
-
-### Collapse Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-default-expand-all | Boolean | false | 默认是否展开全部 | N
-disabled | Boolean | - | 是否禁用面板展开/收起操作 | N
-expand-icon | Boolean | true | 展开图标 | N
-expand-mutex | Boolean | false | 每个面板互斥展开,每次只展开一个面板 | N
-theme | String | default | 折叠面板风格。可选项:default/card | N
-value | Array | [] | 展开的面板集合。TS 类型:`CollapseValue` `type CollapseValue = Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/collapse/type.ts) | N
-default-value | Array | undefined | 展开的面板集合。非受控属性。TS 类型:`CollapseValue` `type CollapseValue = Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/collapse/type.ts) | N
-
-### Collapse Events
-
-名称 | 参数 | 描述
--- | -- | --
-change | `(value: CollapseValue)` | 切换面板时触发,返回变化的值
-
-
-### CollapsePanel Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-content | String / Slot | - | 折叠面板内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-disabled | Boolean | undefined | 禁止当前面板展开,优先级大于 Collapse 的同名属性 | N
-expand-icon | Boolean / Slot | undefined | 当前折叠面板展开图标,优先级大于 Collapse 的同名属性。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-header | String / Slot | - | 面板头内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-header-left-icon | String / Slot | - | 面板头左侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-header-right-content | String / Slot | - | 面板头的右侧区域,一般用于呈现面板操作。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-placement | String | bottom | `0.34.0`。选项卡内容的位置。可选项:bottom/top | N
-value | String / Number | - | 当前面板唯一标识,如果值为空则取当前面下标兜底作为唯一标识 | N
-### CollapsePanel External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-content | 内容样式类
-t-class-header | 头部样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-collapse-border-color | @border-level-1-color | -
---td-collapse-content-font-size | @font-size-base | -
---td-collapse-content-line-height | 1.5 | -
---td-collapse-content-padding | 32rpx | -
---td-collapse-content-text-color | @text-color-primary | -
---td-collapse-extra-font-size | @font-size-m | -
---td-collapse-header-height | auto | -
---td-collapse-header-text-color | @text-color-primary | -
---td-collapse-header-text-disabled-color | @text-color-disabled | -
---td-collapse-horizontal-padding | 32rpx | -
---td-collapse-icon-color | @font-gray-3 | -
---td-collapse-panel-bg-color | @bg-color-container | -
---td-collapse-title-font-size | @font-size-m | -
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.d.ts
deleted file mode 100644
index 9fcf0ce0..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.d.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-import type { CollapseValue, TdCollapseProps } from './type';
-export interface CollapseProps extends TdCollapseProps {
-}
-export default class Collapse extends SuperComponent {
- externalClasses: string[];
- relations: RelationsOptions;
- controlledProps: {
- key: string;
- event: string;
- }[];
- properties: TdCollapseProps;
- data: {
- prefix: string;
- classPrefix: string;
- };
- observers: {
- 'value, expandMutex '(): void;
- };
- methods: {
- updateExpanded(): void;
- switch(panelValue: CollapseValue): void;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.js b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.js
deleted file mode 100644
index cf6631f1..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-collapse`;
-let Collapse = class Collapse extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`];
- this.relations = {
- '../collapse-panel/collapse-panel': {
- type: 'descendant',
- },
- };
- this.controlledProps = [
- {
- key: 'value',
- event: 'change',
- },
- ];
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- };
- this.observers = {
- 'value, expandMutex '() {
- this.updateExpanded();
- },
- };
- this.methods = {
- updateExpanded() {
- this.$children.forEach((child) => {
- child.updateExpanded(this.properties.value);
- });
- },
- switch(panelValue) {
- const { expandMutex, value: activeValues } = this.properties;
- let value = [];
- const hit = activeValues.indexOf(panelValue);
- if (hit > -1) {
- value = activeValues.filter((item) => item !== panelValue);
- }
- else {
- value = expandMutex ? [panelValue] : activeValues.concat(panelValue);
- }
- this._trigger('change', { value });
- },
- };
- }
-};
-Collapse = __decorate([
- wxComponent()
-], Collapse);
-export default Collapse;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.json b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.json
deleted file mode 100644
index 79f27309..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared"
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.wxml
deleted file mode 100644
index 24b87709..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.wxml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.wxss
deleted file mode 100644
index 62a6a017..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/collapse.wxss
+++ /dev/null
@@ -1,32 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-collapse--card {
- margin: 0 32rpx;
- border-radius: var(--td-radius-large, 18rpx);
- overflow: hidden;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/index.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/index.d.ts
deleted file mode 100644
index 69a68c14..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export { default as Collapse } from './collapse';
-export * from './type';
-export * from './props';
-export { CollapseProps } from './collapse';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/index.js b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/index.js
deleted file mode 100644
index 53d34475..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export { default as Collapse } from './collapse';
-export * from './type';
-export * from './props';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/props.d.ts
deleted file mode 100644
index 8ab2059b..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdCollapseProps } from './type';
-declare const props: TdCollapseProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/props.js
deleted file mode 100644
index 3dfb2420..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/props.js
+++ /dev/null
@@ -1,30 +0,0 @@
-const props = {
- defaultExpandAll: {
- type: Boolean,
- value: false,
- },
- disabled: {
- type: Boolean,
- },
- expandIcon: {
- type: Boolean,
- value: true,
- },
- expandMutex: {
- type: Boolean,
- value: false,
- },
- theme: {
- type: String,
- value: 'default',
- },
- value: {
- type: Array,
- value: null,
- },
- defaultValue: {
- type: Array,
- value: [],
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/type.d.ts
deleted file mode 100644
index 8599bc1b..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/type.d.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-export interface TdCollapseProps {
- defaultExpandAll?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- expandIcon?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- expandMutex?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- theme?: {
- type: StringConstructor;
- value?: 'default' | 'card';
- };
- value?: {
- type: ArrayConstructor;
- value?: CollapseValue;
- };
- defaultValue?: {
- type: ArrayConstructor;
- value?: CollapseValue;
- };
-}
-export declare type CollapseValue = Array;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/collapse/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/bus.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/bus.d.ts
deleted file mode 100644
index fddbb54d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/bus.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export default class Bus {
- listeners: Map;
- emitted: Set;
- constructor();
- on(evtName: string, listener: any): void;
- emit(evtName: string): void;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/bus.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/bus.js
deleted file mode 100644
index 5a6c8898..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/bus.js
+++ /dev/null
@@ -1,22 +0,0 @@
-export default class Bus {
- constructor() {
- this.listeners = new Map();
- this.emitted = new Set();
- }
- on(evtName, listener) {
- if (this.emitted.has(evtName)) {
- listener();
- return;
- }
- const target = this.listeners.get(evtName) || [];
- target.push(listener);
- this.listeners.set(evtName, target);
- }
- emit(evtName) {
- const listeners = this.listeners.get(evtName);
- if (listeners) {
- listeners.forEach((func) => func());
- }
- this.emitted.add(evtName);
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/common.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/common.d.ts
deleted file mode 100644
index 12f8f81f..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/common.d.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-export declare type Classes = Array;
-export interface Styles {
- [css: string]: string | number;
-}
-export declare type ImageEvent = any;
-export declare type PlainObject = {
- [key: string]: any;
-};
-export declare type OptionData = {
- label?: string;
- value?: string | number;
-} & PlainObject;
-export declare type TreeOptionData = {
- children?: Array> | boolean;
- label?: string;
- text?: string;
- value?: T;
- content?: string;
-} & PlainObject;
-export declare type SizeEnum = 'small' | 'medium' | 'large';
-export declare type ShapeEnum = 'circle' | 'round';
-export declare type HorizontalAlignEnum = 'left' | 'center' | 'right';
-export declare type VerticalAlignEnum = 'top' | 'middle' | 'bottom';
-export declare type LayoutEnum = 'vertical' | 'horizontal';
-export declare type ClassName = {
- [className: string]: any;
-} | ClassName[] | string;
-export declare type CSSSelector = string;
-export interface KeysType {
- value?: string;
- label?: string;
- disabled?: string;
-}
-export interface TreeKeysType extends KeysType {
- children?: string;
-}
-export interface HTMLElementAttributes {
- [attribute: string]: string;
-}
-export interface TScroll {
- bufferSize?: number;
- isFixedRowHeight?: boolean;
- rowHeight?: number;
- threshold?: number;
- type: 'lazy' | 'virtual';
-}
-export declare type InfinityScroll = TScroll;
-export interface ScrollToElementParams {
- index?: number;
- top?: number;
- time?: number;
- behavior?: 'auto' | 'smooth';
-}
-export interface ComponentScrollToElementParams extends ScrollToElementParams {
- key?: string | number;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/common.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/common.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/common.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/component.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/component.d.ts
deleted file mode 100644
index a8d86aee..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/component.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-///
-declare const TComponent: typeof Component;
-export default TComponent;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/component.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/component.js
deleted file mode 100644
index 4e01a69e..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/component.js
+++ /dev/null
@@ -1,5 +0,0 @@
-const TComponent = (options) => {
- options.options = Object.assign({ multipleSlots: true, addGlobalClass: true }, options.options);
- return Component(options);
-};
-export default TComponent;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/config.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/config.d.ts
deleted file mode 100644
index 68879b46..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/config.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-declare const _default: {
- prefix: string;
-};
-export default _default;
-export declare const prefix = "t";
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/config.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/config.js
deleted file mode 100644
index c0dfab2b..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/config.js
+++ /dev/null
@@ -1,4 +0,0 @@
-export default {
- prefix: "t",
-};
-export const prefix = "t";
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/index.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/index.wxss
deleted file mode 100644
index 1d532d2d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/index.wxss
+++ /dev/null
@@ -1,27 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/index.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/index.d.ts
deleted file mode 100644
index 7640e5a0..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/index.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import type { TDate, TCalendarType, TCalendarValue } from './type';
-export default class TCalendar {
- firstDayOfWeek: number;
- value: TCalendarValue | TCalendarValue[];
- type: TCalendarType;
- minDate: Date;
- maxDate: Date;
- format: (day: TDate) => TDate;
- constructor(options?: {});
- getTrimValue(): Date | Date[];
- getDays(): any[];
- getMonths(): any[];
- select({ cellType, year, month, date }: {
- cellType: any;
- year: any;
- month: any;
- date: any;
- }): Date | TCalendarValue[];
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/index.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/index.js
deleted file mode 100644
index 0d35176c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/index.js
+++ /dev/null
@@ -1,128 +0,0 @@
-import { getDateRect, isSameDate, getMonthDateRect, isValidDate, getDate } from '../date';
-export default class TCalendar {
- constructor(options = {}) {
- this.type = 'single';
- Object.assign(this, options);
- if (!this.minDate)
- this.minDate = getDate();
- if (!this.maxDate)
- this.maxDate = getDate(6);
- }
- getTrimValue() {
- const { value, type } = this;
- const format = (val) => {
- if (val instanceof Date)
- return val;
- if (typeof val === 'number')
- return new Date(val);
- return new Date();
- };
- if (type === 'single' && isValidDate(value))
- return format(value);
- if (type === 'multiple' || type === 'range') {
- if (Array.isArray(value)) {
- const isValid = value.every((item) => isValidDate(item));
- return isValid ? value.map((item) => format(item)) : [];
- }
- return [];
- }
- }
- getDays() {
- const raw = '日一二三四五六';
- const ans = [];
- let i = this.firstDayOfWeek % 7;
- while (ans.length < 7) {
- ans.push(raw[i]);
- i = (i + 1) % 7;
- }
- return ans;
- }
- getMonths() {
- const ans = [];
- const selectedDate = this.getTrimValue();
- const { minDate, maxDate, type, format } = this;
- let { year: minYear, month: minMonth, time: minTime } = getDateRect(minDate);
- const { year: maxYear, month: maxMonth, time: maxTime } = getDateRect(maxDate);
- const calcType = (year, month, date) => {
- const curDate = new Date(year, month, date, 23, 59, 59);
- if (type === 'single' && selectedDate) {
- if (isSameDate({ year, month, date }, selectedDate))
- return 'selected';
- }
- if (type === 'multiple' && selectedDate) {
- const hit = selectedDate.some((item) => isSameDate({ year, month, date }, item));
- if (hit) {
- return 'selected';
- }
- }
- if (type === 'range' && selectedDate) {
- if (Array.isArray(selectedDate)) {
- const [startDate, endDate] = selectedDate;
- if (startDate && isSameDate({ year, month, date }, startDate))
- return 'start';
- if (endDate && isSameDate({ year, month, date }, endDate))
- return 'end';
- if (startDate && endDate && curDate.getTime() > startDate.getTime() && curDate.getTime() < endDate.getTime())
- return 'centre';
- }
- }
- const minCurDate = new Date(year, month, date, 0, 0, 0);
- if (curDate.getTime() < minTime || minCurDate.getTime() > maxTime) {
- return 'disabled';
- }
- return '';
- };
- while (minYear < maxYear || (minYear === maxYear && minMonth <= maxMonth)) {
- const target = getMonthDateRect(new Date(minYear, minMonth, 1));
- const months = [];
- for (let i = 1; i <= 31; i++) {
- if (i > target.lastDate)
- break;
- const dateObj = {
- date: new Date(minYear, minMonth, i),
- day: i,
- type: calcType(minYear, minMonth, i),
- };
- months.push(format ? format(dateObj) : dateObj);
- }
- ans.push({
- year: minYear,
- month: minMonth,
- months,
- weekdayOfFirstDay: target.weekdayOfFirstDay,
- });
- const curDate = getDateRect(new Date(minYear, minMonth + 1, 1));
- minYear = curDate.year;
- minMonth = curDate.month;
- }
- return ans;
- }
- select({ cellType, year, month, date }) {
- const { type } = this;
- const selectedDate = this.getTrimValue();
- if (cellType === 'disabled')
- return;
- const selected = new Date(year, month, date);
- this.value = selected;
- if (type === 'range' && Array.isArray(selectedDate)) {
- if (selectedDate.length === 1 && selected > selectedDate[0]) {
- this.value = [selectedDate[0], selected];
- }
- else {
- this.value = [selected];
- }
- }
- else if (type === 'multiple' && Array.isArray(selectedDate)) {
- const newVal = [...selectedDate];
- const index = selectedDate.findIndex((item) => isSameDate(item, selected));
- if (index > -1) {
- newVal.splice(index, 1);
- }
- else {
- newVal.push(selected);
- }
- this.value = newVal;
- }
- return this.value;
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/type.d.ts
deleted file mode 100644
index 621b9496..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/type.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export interface TDate {
- date: Date;
- day: number;
- type: TDateType;
- className?: string;
- prefix?: string;
- suffix?: string;
-}
-export declare type TCalendarValue = number | Date;
-export declare type TDateType = 'selected' | 'disabled' | 'start' | 'centre' | 'end' | '';
-export declare type TCalendarType = 'single' | 'multiple' | 'range';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/calendar/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/cmyk.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/cmyk.d.ts
deleted file mode 100644
index d0e92a83..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/cmyk.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export declare const rgb2cmyk: (red: number, green: number, blue: number) => number[];
-export declare const cmyk2rgb: (cyan: number, magenta: number, yellow: number, black: number) => {
- r: number;
- g: number;
- b: number;
-};
-export declare const cmykInputToColor: (input: string) => string;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/cmyk.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/cmyk.js
deleted file mode 100644
index d6273beb..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/cmyk.js
+++ /dev/null
@@ -1,57 +0,0 @@
-export const rgb2cmyk = (red, green, blue) => {
- let computedC = 0;
- let computedM = 0;
- let computedY = 0;
- let computedK = 0;
- const r = parseInt(`${red}`.replace(/\s/g, ''), 10);
- const g = parseInt(`${green}`.replace(/\s/g, ''), 10);
- const b = parseInt(`${blue}`.replace(/\s/g, ''), 10);
- if (r === 0 && g === 0 && b === 0) {
- computedK = 1;
- return [0, 0, 0, 1];
- }
- computedC = 1 - r / 255;
- computedM = 1 - g / 255;
- computedY = 1 - b / 255;
- const minCMY = Math.min(computedC, Math.min(computedM, computedY));
- computedC = (computedC - minCMY) / (1 - minCMY);
- computedM = (computedM - minCMY) / (1 - minCMY);
- computedY = (computedY - minCMY) / (1 - minCMY);
- computedK = minCMY;
- return [computedC, computedM, computedY, computedK];
-};
-export const cmyk2rgb = (cyan, magenta, yellow, black) => {
- let c = cyan / 100;
- let m = magenta / 100;
- let y = yellow / 100;
- const k = black / 100;
- c = c * (1 - k) + k;
- m = m * (1 - k) + k;
- y = y * (1 - k) + k;
- let r = 1 - c;
- let g = 1 - m;
- let b = 1 - y;
- r = Math.round(255 * r);
- g = Math.round(255 * g);
- b = Math.round(255 * b);
- return {
- r,
- g,
- b,
- };
-};
-const REG_CMYK_STRING = /cmyk\((\d+%?),(\d+%?),(\d+%?),(\d+%?)\)/;
-const toNumber = (str) => Math.max(0, Math.min(255, parseInt(str, 10)));
-export const cmykInputToColor = (input) => {
- if (/cmyk/i.test(input)) {
- const str = input.replace(/\s/g, '');
- const match = str.match(REG_CMYK_STRING);
- const c = toNumber(match[1]);
- const m = toNumber(match[2]);
- const y = toNumber(match[3]);
- const k = toNumber(match[4]);
- const { r, g, b } = cmyk2rgb(c, m, y, k);
- return `rgb(${r}, ${g}, ${b})`;
- }
- return input;
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/color.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/color.d.ts
deleted file mode 100644
index 49b30fa3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/color.d.ts
+++ /dev/null
@@ -1,107 +0,0 @@
-import tinyColor from 'tinycolor2';
-import { GradientColors, GradientColorPoint } from './gradient';
-export interface ColorObject {
- alpha: number;
- css: string;
- hex: string;
- hex8: string;
- hsl: string;
- hsla: string;
- hsv: string;
- hsva: string;
- rgb: string;
- rgba: string;
- saturation: number;
- value: number;
- isGradient: boolean;
- linearGradient?: string;
-}
-interface ColorStates {
- s: number;
- v: number;
- h: number;
- a: number;
-}
-interface GradientStates {
- colors: GradientColorPoint[];
- degree: number;
- selectedId: string;
- css?: string;
-}
-export declare const gradientColors2string: (object: GradientColors) => string;
-export declare const getColorWithoutAlpha: (color: string) => string;
-export declare const genId: () => string;
-export declare const genGradientPoint: (left: number, color: string) => GradientColorPoint;
-export declare class Color {
- states: ColorStates;
- originColor: string;
- isGradient: boolean;
- gradientStates: GradientStates;
- constructor(input: string);
- update(input: string): void;
- get saturation(): number;
- set saturation(value: number);
- get value(): number;
- set value(value: number);
- get hue(): number;
- set hue(value: number);
- get alpha(): number;
- set alpha(value: number);
- get rgb(): string;
- get rgba(): string;
- get hsv(): string;
- get hsva(): string;
- get hsl(): string;
- get hsla(): string;
- get hex(): string;
- get hex8(): string;
- get cmyk(): string;
- get css(): string;
- get linearGradient(): string;
- get gradientColors(): GradientColorPoint[];
- set gradientColors(colors: GradientColorPoint[]);
- get gradientSelectedId(): string;
- set gradientSelectedId(id: string);
- get gradientDegree(): number;
- set gradientDegree(degree: number);
- get gradientSelectedPoint(): GradientColorPoint;
- getFormatsColorMap(): {
- HEX: string;
- CMYK: string;
- RGB: string;
- RGBA: string;
- HSL: string;
- HSLA: string;
- HSV: string;
- HSVA: string;
- CSS: string;
- HEX8: string;
- };
- updateCurrentGradientColor(): false | this;
- updateStates(input: string): void;
- getRgba(): {
- r: number;
- g: number;
- b: number;
- a: number;
- };
- getCmyk(): {
- c: number;
- m: number;
- y: number;
- k: number;
- };
- getHsva(): tinyColor.ColorFormats.HSVA;
- getHsla(): tinyColor.ColorFormats.HSLA;
- equals(color: string): boolean;
- static isValid(color: string): boolean;
- static hsva2color(h: number, s: number, v: number, a: number): string;
- static hsla2color(h: number, s: number, l: number, a: number): string;
- static rgba2color(r: number, g: number, b: number, a: number): string;
- static hex2color(hex: string, a: number): string;
- static object2color(object: any, format: string): string;
- static isGradientColor: (input: string) => boolean;
- static compare: (color1: string, color2: string) => boolean;
-}
-export declare const getColorObject: (color: Color) => ColorObject;
-export default Color;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/color.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/color.js
deleted file mode 100644
index 847ec5bd..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/color.js
+++ /dev/null
@@ -1,334 +0,0 @@
-import tinyColor from 'tinycolor2';
-import { cmykInputToColor, rgb2cmyk } from './cmyk';
-import { parseGradientString, isGradientColor } from './gradient';
-const mathRound = Math.round;
-const hsv2rgba = (states) => tinyColor(states).toRgb();
-const hsv2hsva = (states) => tinyColor(states).toHsv();
-const hsv2hsla = (states) => tinyColor(states).toHsl();
-export const gradientColors2string = (object) => {
- const { points, degree } = object;
- const colorsStop = points
- .sort((pA, pB) => pA.left - pB.left)
- .map((p) => `${p.color} ${Math.round(p.left * 100) / 100}%`);
- return `linear-gradient(${degree}deg,${colorsStop.join(',')})`;
-};
-export const getColorWithoutAlpha = (color) => tinyColor(color).setAlpha(1).toHexString();
-export const genId = () => (1 + Math.random() * 4294967295).toString(16);
-export const genGradientPoint = (left, color) => ({
- id: genId(),
- left,
- color,
-});
-export class Color {
- constructor(input) {
- this.states = {
- s: 100,
- v: 100,
- h: 100,
- a: 1,
- };
- this.gradientStates = {
- colors: [],
- degree: 0,
- selectedId: null,
- css: '',
- };
- this.update(input);
- }
- update(input) {
- var _a, _b;
- const gradientColors = parseGradientString(input);
- if (this.isGradient && !gradientColors) {
- const colorHsv = tinyColor(input).toHsv();
- this.states = colorHsv;
- this.updateCurrentGradientColor();
- return;
- }
- this.originColor = input;
- this.isGradient = false;
- let colorInput = input;
- if (gradientColors) {
- this.isGradient = true;
- const object = gradientColors;
- const points = object.points.map((c) => genGradientPoint(c.left, c.color));
- this.gradientStates = {
- colors: points,
- degree: object.degree,
- selectedId: ((_a = points[0]) === null || _a === void 0 ? void 0 : _a.id) || null,
- };
- this.gradientStates.css = this.linearGradient;
- colorInput = (_b = this.gradientSelectedPoint) === null || _b === void 0 ? void 0 : _b.color;
- }
- this.updateStates(colorInput);
- }
- get saturation() {
- return this.states.s;
- }
- set saturation(value) {
- this.states.s = Math.max(0, Math.min(100, value));
- this.updateCurrentGradientColor();
- }
- get value() {
- return this.states.v;
- }
- set value(value) {
- this.states.v = Math.max(0, Math.min(100, value));
- this.updateCurrentGradientColor();
- }
- get hue() {
- return this.states.h;
- }
- set hue(value) {
- this.states.h = Math.max(0, Math.min(360, value));
- this.updateCurrentGradientColor();
- }
- get alpha() {
- return this.states.a;
- }
- set alpha(value) {
- this.states.a = Math.max(0, Math.min(1, Math.round(value * 100) / 100));
- this.updateCurrentGradientColor();
- }
- get rgb() {
- const { r, g, b } = hsv2rgba(this.states);
- return `rgb(${mathRound(r)}, ${mathRound(g)}, ${mathRound(b)})`;
- }
- get rgba() {
- const { r, g, b, a } = hsv2rgba(this.states);
- return `rgba(${mathRound(r)}, ${mathRound(g)}, ${mathRound(b)}, ${a})`;
- }
- get hsv() {
- const { h, s, v } = this.getHsva();
- return `hsv(${h}, ${s}%, ${v}%)`;
- }
- get hsva() {
- const { h, s, v, a } = this.getHsva();
- return `hsva(${h}, ${s}%, ${v}%, ${a})`;
- }
- get hsl() {
- const { h, s, l } = this.getHsla();
- return `hsl(${h}, ${s}%, ${l}%)`;
- }
- get hsla() {
- const { h, s, l, a } = this.getHsla();
- return `hsla(${h}, ${s}%, ${l}%, ${a})`;
- }
- get hex() {
- return tinyColor(this.states).toHexString();
- }
- get hex8() {
- return tinyColor(this.states).toHex8String();
- }
- get cmyk() {
- const { c, m, y, k } = this.getCmyk();
- return `cmyk(${c}, ${m}, ${y}, ${k})`;
- }
- get css() {
- if (this.isGradient) {
- return this.linearGradient;
- }
- return this.rgba;
- }
- get linearGradient() {
- const { gradientColors, gradientDegree } = this;
- return gradientColors2string({
- points: gradientColors,
- degree: gradientDegree,
- });
- }
- get gradientColors() {
- return this.gradientStates.colors;
- }
- set gradientColors(colors) {
- this.gradientStates.colors = colors;
- this.gradientStates.css = this.linearGradient;
- }
- get gradientSelectedId() {
- return this.gradientStates.selectedId;
- }
- set gradientSelectedId(id) {
- var _a;
- if (id === this.gradientSelectedId) {
- return;
- }
- this.gradientStates.selectedId = id;
- this.updateStates((_a = this.gradientSelectedPoint) === null || _a === void 0 ? void 0 : _a.color);
- }
- get gradientDegree() {
- return this.gradientStates.degree;
- }
- set gradientDegree(degree) {
- this.gradientStates.degree = Math.max(0, Math.min(360, degree));
- this.gradientStates.css = this.linearGradient;
- }
- get gradientSelectedPoint() {
- const { gradientColors, gradientSelectedId } = this;
- return gradientColors.find((color) => color.id === gradientSelectedId);
- }
- getFormatsColorMap() {
- return {
- HEX: this.hex,
- CMYK: this.cmyk,
- RGB: this.rgb,
- RGBA: this.rgba,
- HSL: this.hsl,
- HSLA: this.hsla,
- HSV: this.hsv,
- HSVA: this.hsva,
- CSS: this.css,
- HEX8: this.hex8,
- };
- }
- updateCurrentGradientColor() {
- const { isGradient, gradientColors, gradientSelectedId } = this;
- const { length } = gradientColors;
- const current = this.gradientSelectedPoint;
- if (!isGradient || length === 0 || !current) {
- return false;
- }
- const index = gradientColors.findIndex((color) => color.id === gradientSelectedId);
- const newColor = Object.assign(Object.assign({}, current), { color: this.rgba });
- gradientColors.splice(index, 1, newColor);
- this.gradientColors = gradientColors.slice();
- return this;
- }
- updateStates(input) {
- const color = tinyColor(cmykInputToColor(input));
- const hsva = color.toHsv();
- this.states = hsva;
- }
- getRgba() {
- const { r, g, b, a } = hsv2rgba(this.states);
- return {
- r: mathRound(r),
- g: mathRound(g),
- b: mathRound(b),
- a,
- };
- }
- getCmyk() {
- const { r, g, b } = this.getRgba();
- const [c, m, y, k] = rgb2cmyk(r, g, b);
- return {
- c: mathRound(c * 100),
- m: mathRound(m * 100),
- y: mathRound(y * 100),
- k: mathRound(k * 100),
- };
- }
- getHsva() {
- let { h, s, v, a } = hsv2hsva(this.states);
- h = mathRound(h);
- s = mathRound(s * 100);
- v = mathRound(v * 100);
- a *= 1;
- return {
- h,
- s,
- v,
- a,
- };
- }
- getHsla() {
- let { h, s, l, a } = hsv2hsla(this.states);
- h = mathRound(h);
- s = mathRound(s * 100);
- l = mathRound(l * 100);
- a *= 1;
- return {
- h,
- s,
- l,
- a,
- };
- }
- equals(color) {
- return tinyColor.equals(this.rgba, color);
- }
- static isValid(color) {
- if (parseGradientString(color)) {
- return true;
- }
- return tinyColor(color).isValid();
- }
- static hsva2color(h, s, v, a) {
- return tinyColor({
- h,
- s,
- v,
- a,
- }).toHsvString();
- }
- static hsla2color(h, s, l, a) {
- return tinyColor({
- h,
- s,
- l,
- a,
- }).toHslString();
- }
- static rgba2color(r, g, b, a) {
- return tinyColor({
- r,
- g,
- b,
- a,
- }).toHsvString();
- }
- static hex2color(hex, a) {
- const color = tinyColor(hex);
- color.setAlpha(a);
- return color.toHexString();
- }
- static object2color(object, format) {
- if (format === 'CMYK') {
- const { c, m, y, k } = object;
- return `cmyk(${c}, ${m}, ${y}, ${k})`;
- }
- const color = tinyColor(object, {
- format,
- });
- return color.toRgbString();
- }
-}
-Color.isGradientColor = (input) => !!isGradientColor(input);
-Color.compare = (color1, color2) => {
- const isGradientColor1 = Color.isGradientColor(color1);
- const isGradientColor2 = Color.isGradientColor(color2);
- if (isGradientColor1 && isGradientColor2) {
- const gradientColor1 = gradientColors2string(parseGradientString(color1));
- const gradientColor2 = gradientColors2string(parseGradientString(color2));
- return gradientColor1 === gradientColor2;
- }
- if (!isGradientColor1 && !isGradientColor2) {
- return tinyColor.equals(color1, color2);
- }
- return false;
-};
-const COLOR_OBJECT_OUTPUT_KEYS = [
- 'alpha',
- 'css',
- 'hex',
- 'hex8',
- 'hsl',
- 'hsla',
- 'hsv',
- 'hsva',
- 'rgb',
- 'rgba',
- 'saturation',
- 'value',
- 'isGradient',
-];
-export const getColorObject = (color) => {
- if (!color) {
- return null;
- }
- const colorObject = Object.create(null);
- COLOR_OBJECT_OUTPUT_KEYS.forEach((key) => (colorObject[key] = color[key]));
- if (color.isGradient) {
- colorObject.linearGradient = color.linearGradient;
- }
- return colorObject;
-};
-export default Color;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/gradient.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/gradient.d.ts
deleted file mode 100644
index 3f496b0b..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/gradient.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export interface GradientColorPoint {
- id?: string;
- color?: string;
- left?: number;
-}
-export interface GradientColors {
- points: GradientColorPoint[];
- degree: number;
-}
-export declare const isGradientColor: (input: string) => null | RegExpExecArray;
-export declare const parseGradientString: (input: string) => GradientColors | boolean;
-export default parseGradientString;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/gradient.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/gradient.js
deleted file mode 100644
index 18eacb20..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/gradient.js
+++ /dev/null
@@ -1,119 +0,0 @@
-import isString from 'lodash/isString';
-import isNull from 'lodash/isNull';
-import tinyColor from 'tinycolor2';
-const combineRegExp = (regexpList, flags) => {
- let source = '';
- for (let i = 0; i < regexpList.length; i++) {
- if (isString(regexpList[i])) {
- source += regexpList[i];
- }
- else {
- source += regexpList[i].source;
- }
- }
- return new RegExp(source, flags);
-};
-const generateRegExp = () => {
- const searchFlags = 'gi';
- const rAngle = /(?:[+-]?\d*\.?\d+)(?:deg|grad|rad|turn)/;
- const rSideCornerCapture = /to\s+((?:(?:left|right|top|bottom)(?:\s+(?:top|bottom|left|right))?))/;
- const rComma = /\s*,\s*/;
- const rColorHex = /#(?:[a-f0-9]{6}|[a-f0-9]{3})/;
- const rDigits3 = /\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)/;
- const rDigits4 = /\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*,\s*\d*\.?\d+\)/;
- const rValue = /(?:[+-]?\d*\.?\d+)(?:%|[a-z]+)?/;
- const rKeyword = /[_a-z-][_a-z0-9-]*/;
- const rColor = combineRegExp(['(?:', rColorHex, '|', '(?:rgb|hsl)', rDigits3, '|', '(?:rgba|hsla)', rDigits4, '|', rKeyword, ')'], '');
- const rColorStop = combineRegExp([rColor, '(?:\\s+', rValue, '(?:\\s+', rValue, ')?)?'], '');
- const rColorStopList = combineRegExp(['(?:', rColorStop, rComma, ')*', rColorStop], '');
- const rLineCapture = combineRegExp(['(?:(', rAngle, ')|', rSideCornerCapture, ')'], '');
- const rGradientSearch = combineRegExp(['(?:(', rLineCapture, ')', rComma, ')?(', rColorStopList, ')'], searchFlags);
- const rColorStopSearch = combineRegExp(['\\s*(', rColor, ')', '(?:\\s+', '(', rValue, '))?', '(?:', rComma, '\\s*)?'], searchFlags);
- return {
- gradientSearch: rGradientSearch,
- colorStopSearch: rColorStopSearch,
- };
-};
-const parseGradient = (regExpLib, input) => {
- let result;
- let matchColorStop;
- let stopResult;
- regExpLib.gradientSearch.lastIndex = 0;
- const matchGradient = regExpLib.gradientSearch.exec(input);
- if (!isNull(matchGradient)) {
- result = {
- original: matchGradient[0],
- colorStopList: [],
- };
- if (matchGradient[1]) {
- result.line = matchGradient[1];
- }
- if (matchGradient[2]) {
- result.angle = matchGradient[2];
- }
- if (matchGradient[3]) {
- result.sideCorner = matchGradient[3];
- }
- regExpLib.colorStopSearch.lastIndex = 0;
- matchColorStop = regExpLib.colorStopSearch.exec(matchGradient[4]);
- while (!isNull(matchColorStop)) {
- stopResult = {
- color: matchColorStop[1],
- };
- if (matchColorStop[2]) {
- stopResult.position = matchColorStop[2];
- }
- result.colorStopList.push(stopResult);
- matchColorStop = regExpLib.colorStopSearch.exec(matchGradient[4]);
- }
- }
- return result;
-};
-const REGEXP_LIB = generateRegExp();
-const REG_GRADIENT = /.*gradient\s*\(((?:\([^)]*\)|[^)(]*)*)\)/gim;
-export const isGradientColor = (input) => {
- REG_GRADIENT.lastIndex = 0;
- return REG_GRADIENT.exec(input);
-};
-const sideCornerDegreeMap = {
- top: 0,
- right: 90,
- bottom: 180,
- left: 270,
- 'top left': 225,
- 'left top': 225,
- 'top right': 135,
- 'right top': 135,
- 'bottom left': 315,
- 'left bottom': 315,
- 'bottom right': 45,
- 'right bottom': 45,
-};
-export const parseGradientString = (input) => {
- const match = isGradientColor(input);
- if (!match) {
- return false;
- }
- const gradientColors = {
- points: [],
- degree: 0,
- };
- const result = parseGradient(REGEXP_LIB, match[1]);
- if (result.original.trim() !== match[1].trim()) {
- return false;
- }
- const points = result.colorStopList.map(({ color, position }) => {
- const point = Object.create(null);
- point.color = tinyColor(color).toRgbString();
- point.left = parseFloat(position);
- return point;
- });
- gradientColors.points = points;
- let degree = parseInt(result.angle, 10);
- if (Number.isNaN(degree)) {
- degree = sideCornerDegreeMap[result.sideCorner] || 90;
- }
- gradientColors.degree = degree;
- return gradientColors;
-};
-export default parseGradientString;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/index.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/index.d.ts
deleted file mode 100644
index ad18475c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './cmyk';
-export * from './color';
-export * from './gradient';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/index.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/index.js
deleted file mode 100644
index ad18475c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/color-picker/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './cmyk';
-export * from './color';
-export * from './gradient';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/date.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/date.d.ts
deleted file mode 100644
index e123831f..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/date.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-export declare type CompareDate = Date | number | {
- year: number;
- month: number;
- date: number;
-};
-export declare const getDateRect: (date: Date | number) => {
- year: number;
- month: number;
- date: number;
- day: number;
- time: number;
-};
-export declare const isSameDate: (date1: CompareDate, date2: CompareDate) => boolean;
-export declare const getMonthDateRect: (date: Date | number) => {
- year: number;
- month: number;
- weekdayOfFirstDay: number;
- lastDate: number;
-};
-export declare const isValidDate: (val: any) => boolean;
-export declare const getDate: (...args: any[]) => any;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/date.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/date.js
deleted file mode 100644
index 3ac46b37..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/shared/date.js
+++ /dev/null
@@ -1,41 +0,0 @@
-export const getDateRect = (date) => {
- const _date = new Date(date);
- return {
- year: _date.getFullYear(),
- month: _date.getMonth(),
- date: _date.getDate(),
- day: _date.getDay(),
- time: _date.getTime(),
- };
-};
-export const isSameDate = (date1, date2) => {
- if (date1 instanceof Date || typeof date1 === 'number')
- date1 = getDateRect(date1);
- if (date2 instanceof Date || typeof date2 === 'number')
- date2 = getDateRect(date2);
- const keys = ['year', 'month', 'date'];
- return keys.every((key) => date1[key] === date2[key]);
-};
-export const getMonthDateRect = (date) => {
- const { year, month } = getDateRect(date);
- const firstDay = new Date(year, month, 1);
- const weekdayOfFirstDay = firstDay.getDay();
- const lastDate = new Date(+new Date(year, month + 1, 1) - 24 * 3600 * 1000).getDate();
- return {
- year,
- month,
- weekdayOfFirstDay,
- lastDate,
- };
-};
-export const isValidDate = (val) => typeof val === 'number' || val instanceof Date;
-export const getDate = (...args) => {
- const now = new Date();
- if (args.length === 0)
- return now;
- if (args.length === 1 && args[0] <= 1000) {
- const { year, month, date } = getDateRect(now);
- return new Date(year, month + args[0], date);
- }
- return Date.apply(null, args);
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/control.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/control.d.ts
deleted file mode 100644
index ed3f4a08..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/control.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-declare type ControlInstance = {
- controlled: boolean;
- initValue: any;
- set(newVal: any, extObj?: Object, fn?: any): void;
- get(): any;
- change(newVal: any, customChangeData?: any, customUpdateFn?: any): void;
-};
-declare type ControlOption = {
- valueKey?: string;
- defaultValueKey?: string;
- changeEventName?: string;
- strict?: boolean;
-};
-declare function useControl(this: any, option?: ControlOption): ControlInstance;
-export { ControlOption, ControlInstance, useControl };
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/control.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/control.js
deleted file mode 100644
index 03c9e772..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/control.js
+++ /dev/null
@@ -1,40 +0,0 @@
-const defaultOption = {
- valueKey: 'value',
- defaultValueKey: 'defaultValue',
- changeEventName: 'change',
- strict: true,
-};
-function useControl(option = {}) {
- const { valueKey, defaultValueKey, changeEventName, strict } = Object.assign(Object.assign({}, defaultOption), option);
- const props = this.properties || {};
- const value = props[valueKey];
- const defaultValue = props[strict ? defaultValueKey : valueKey];
- let controlled = false;
- if (strict && typeof value !== 'undefined' && value !== null) {
- controlled = true;
- }
- const set = (newVal, extObj, fn) => {
- this.setData(Object.assign({ [`_${valueKey}`]: newVal }, extObj), fn);
- };
- return {
- controlled,
- initValue: controlled ? value : defaultValue,
- set,
- get: () => {
- return this.data[`_${valueKey}`];
- },
- change: (newVal, customChangeData, customUpdateFn) => {
- this.triggerEvent(changeEventName, typeof customChangeData !== 'undefined' ? customChangeData : newVal);
- if (controlled) {
- return;
- }
- if (typeof customUpdateFn === 'function') {
- customUpdateFn();
- }
- else {
- set(newVal);
- }
- },
- };
-}
-export { useControl };
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/flatTool.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/flatTool.d.ts
deleted file mode 100644
index 4183d793..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/flatTool.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-export declare const getPrototypeOf: (obj: any) => any;
-export declare const isObject: (something: any) => boolean;
-export declare const iterateInheritedPrototype: (callback: (proto: Record) => boolean | void, fromCtor: any, toCtor: any, includeToCtor?: boolean) => void;
-export interface ClassInstanceToObjectOptions {
- bindTo?: any;
- excludes?: string[];
- till?: any;
- enumerable?: 0 | boolean;
- configurable?: 0 | boolean;
- writable?: 0 | boolean;
-}
-export declare const toObject: (something: any, options?: ClassInstanceToObjectOptions) => {
- [key: string]: any;
-};
-export declare const isPlainObject: (something: any) => boolean;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/flatTool.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/flatTool.js
deleted file mode 100644
index 045abd77..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/flatTool.js
+++ /dev/null
@@ -1,57 +0,0 @@
-export const getPrototypeOf = function (obj) {
- return Object.getPrototypeOf ? Object.getPrototypeOf(obj) : obj.__proto__;
-};
-export const isObject = function isObject(something) {
- const type = typeof something;
- return something !== null && (type === 'function' || type === 'object');
-};
-export const iterateInheritedPrototype = function iterateInheritedPrototype(callback, fromCtor, toCtor, includeToCtor = true) {
- let proto = fromCtor.prototype || fromCtor;
- const toProto = toCtor.prototype || toCtor;
- while (proto) {
- if (!includeToCtor && proto === toProto)
- break;
- if (callback(proto) === false)
- break;
- if (proto === toProto)
- break;
- proto = getPrototypeOf(proto);
- }
-};
-export const toObject = function toObject(something, options = {}) {
- const obj = {};
- if (!isObject(something))
- return obj;
- const excludes = options.excludes || ['constructor'];
- const { enumerable = true, configurable = 0, writable = 0 } = options;
- const defaultDesc = {};
- if (enumerable !== 0)
- defaultDesc.enumerable = enumerable;
- if (configurable !== 0)
- defaultDesc.configurable = configurable;
- if (writable !== 0)
- defaultDesc.writable = writable;
- iterateInheritedPrototype((proto) => {
- Object.getOwnPropertyNames(proto).forEach((key) => {
- if (excludes.indexOf(key) >= 0)
- return;
- if (Object.prototype.hasOwnProperty.call(obj, key))
- return;
- const desc = Object.getOwnPropertyDescriptor(proto, key);
- const fnKeys = ['get', 'set', 'value'];
- fnKeys.forEach((k) => {
- if (typeof desc[k] === 'function') {
- const oldFn = desc[k];
- desc[k] = function (...args) {
- return oldFn.apply(Object.prototype.hasOwnProperty.call(options, 'bindTo') ? options.bindTo : this, args);
- };
- }
- });
- Object.defineProperty(obj, key, Object.assign(Object.assign({}, desc), defaultDesc));
- });
- }, something, options.till || Object, false);
- return obj;
-};
-export const isPlainObject = function isPlainObject(something) {
- return Object.prototype.toString.call(something) === '[object Object]';
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/index.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/index.d.ts
deleted file mode 100644
index 94e7ce12..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export * from './superComponent';
-export * from './flatTool';
-export * from './instantiationDecorator';
-export * from './control';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/index.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/index.js
deleted file mode 100644
index 94e7ce12..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-export * from './superComponent';
-export * from './flatTool';
-export * from './instantiationDecorator';
-export * from './control';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/instantiationDecorator.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/instantiationDecorator.d.ts
deleted file mode 100644
index 3a06f2c6..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/instantiationDecorator.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { SuperComponent } from './superComponent';
-export declare const toComponent: (options: Record) => Record;
-export declare const wxComponent: () => (constructor: new () => SuperComponent) => void;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/instantiationDecorator.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/instantiationDecorator.js
deleted file mode 100644
index d9b15b72..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/instantiationDecorator.js
+++ /dev/null
@@ -1,139 +0,0 @@
-import { isPlainObject, toObject } from './flatTool';
-import { canUseVirtualHost } from '../version';
-const RawLifeCycles = ['Created', 'Attached', 'Ready', 'Moved', 'Detached', 'Error'];
-const NativeLifeCycles = RawLifeCycles.map((k) => k.toLowerCase());
-const ComponentNativeProps = [
- 'properties',
- 'data',
- 'observers',
- 'methods',
- 'behaviors',
- ...NativeLifeCycles,
- 'relations',
- 'externalClasses',
- 'options',
- 'lifetimes',
- 'pageLifeTimes',
- 'definitionFilter',
-];
-export const toComponent = function toComponent(options) {
- const { relations, behaviors = [], externalClasses = [] } = options;
- if (options.properties) {
- Object.keys(options.properties).forEach((k) => {
- let opt = options.properties[k];
- if (!isPlainObject(opt)) {
- opt = { type: opt };
- }
- options.properties[k] = opt;
- });
- const ariaProps = [
- { key: 'ariaHidden', type: Boolean },
- { key: 'ariaRole', type: String },
- { key: 'ariaLabel', type: String },
- { key: 'ariaLabelledby', type: String },
- { key: 'ariaDescribedby', type: String },
- { key: 'ariaBusy', type: Boolean },
- ];
- ariaProps.forEach(({ key, type }) => {
- options.properties[key] = {
- type,
- };
- });
- options.properties.style = { type: String, value: '' };
- options.properties.customStyle = { type: String, value: '' };
- }
- if (!options.methods)
- options.methods = {};
- if (!options.lifetimes)
- options.lifetimes = {};
- const inits = {};
- if (relations) {
- const getRelations = (relation, path) => Behavior({
- created() {
- Object.defineProperty(this, `$${relation}`, {
- get: () => {
- const nodes = this.getRelationNodes(path) || [];
- return relation === 'parent' ? nodes[0] : nodes;
- },
- });
- },
- });
- const map = {};
- Object.keys(relations).forEach((path) => {
- const comp = relations[path];
- const relation = ['parent', 'ancestor'].includes(comp.type) ? 'parent' : 'children';
- const mixin = getRelations(relation, path);
- map[relation] = mixin;
- });
- behaviors.push(...Object.keys(map).map((key) => map[key]));
- }
- options.behaviors = [...behaviors];
- options.externalClasses = ['class', ...externalClasses];
- Object.getOwnPropertyNames(options).forEach((k) => {
- const desc = Object.getOwnPropertyDescriptor(options, k);
- if (!desc)
- return;
- if (NativeLifeCycles.indexOf(k) < 0 && typeof desc.value === 'function') {
- Object.defineProperty(options.methods, k, desc);
- delete options[k];
- }
- else if (ComponentNativeProps.indexOf(k) < 0) {
- inits[k] = desc;
- }
- else if (NativeLifeCycles.indexOf(k) >= 0) {
- options.lifetimes[k] = options[k];
- }
- });
- if (Object.keys(inits).length) {
- const oldCreated = options.lifetimes.created;
- const oldAttached = options.lifetimes.attached;
- const { controlledProps = [] } = options;
- options.lifetimes.created = function (...args) {
- Object.defineProperties(this, inits);
- if (oldCreated)
- oldCreated.apply(this, args);
- };
- options.lifetimes.attached = function (...args) {
- if (oldAttached)
- oldAttached.apply(this, args);
- controlledProps.forEach(({ key }) => {
- const defaultKey = `default${key.replace(/^(\w)/, (m, m1) => m1.toUpperCase())}`;
- const props = this.properties;
- if (props[key] == null) {
- this._selfControlled = true;
- }
- if (props[key] == null && props[defaultKey] != null) {
- this.setData({
- [key]: props[defaultKey],
- });
- }
- });
- };
- options.methods._trigger = function (evtName, detail, opts) {
- const target = controlledProps.find((item) => item.event == evtName);
- if (target) {
- const { key } = target;
- if (this._selfControlled) {
- this.setData({
- [key]: detail[key],
- });
- }
- }
- this.triggerEvent(evtName, detail, opts);
- };
- }
- return options;
-};
-export const wxComponent = function wxComponent() {
- return function (constructor) {
- class WxComponent extends constructor {
- }
- const current = new WxComponent();
- current.options = current.options || {};
- if (canUseVirtualHost()) {
- current.options.virtualHost = true;
- }
- const obj = toComponent(toObject(current));
- Component(obj);
- };
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/superComponent.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/superComponent.d.ts
deleted file mode 100644
index 4455e199..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/superComponent.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-///
-export interface ComponentsOptionsType extends WechatMiniprogram.Component.ComponentOptions {
- styleIsolation?: 'isolated' | 'apply-shared' | 'shared' | 'page-isolated' | 'page-apply-shared' | 'page-shared';
-}
-export interface RelationsOptions {
- [componentName: string]: WechatMiniprogram.Component.RelationOption;
-}
-export interface SuperComponent extends WechatMiniprogram.Component.Lifetimes, WechatMiniprogram.Component.OtherOption, WechatMiniprogram.Component.InstanceMethods {
- properties: P;
- data: D;
- options: ComponentsOptionsType;
- methods: M | Record any>;
- $global: Function;
- [x: string]: any;
-}
-export declare class SuperComponent {
- readonly app: any;
- constructor();
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/superComponent.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/superComponent.js
deleted file mode 100644
index 3cb17dc7..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/src/superComponent.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export class SuperComponent {
- constructor() {
- this.app = getApp();
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/_variables.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/_variables.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/base.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/base.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/icons.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/icons.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/index.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/index.wxss
deleted file mode 100644
index 1d532d2d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/index.wxss
+++ /dev/null
@@ -1,27 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/mixins/_clearfix.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/mixins/_clearfix.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/mixins/_cursor.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/mixins/_cursor.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/mixins/_ellipsis.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/mixins/_ellipsis.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/mixins/_hairline.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/mixins/_hairline.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/mixins/_index.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/mixins/_index.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_components.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_components.wxss
deleted file mode 100644
index b77525c9..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_components.wxss
+++ /dev/null
@@ -1,10 +0,0 @@
-@media (prefers-color-scheme: dark) {
- page,
- .page {
- --td-button-primary-disabled-color: var(--td-font-white-4);
- --td-skeleton-animation-gradient: rgba(255, 255, 255, 0.06);
- --td-slider-dot-bg-color: var(--td-gray-color-4);
- --td-slider-dot-disabled-bg-color: var(--td-gray-color-11);
- --td-slider-dot-disabled-border-color: var(--td-gray-color-12);
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_dark.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_dark.wxss
deleted file mode 100644
index 5dca755d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_dark.wxss
+++ /dev/null
@@ -1,123 +0,0 @@
-@media (prefers-color-scheme: dark) {
- page,
- .page {
- --td-primary-color-1: #1b2f51;
- --td-primary-color-2: #173463;
- --td-primary-color-3: #143975;
- --td-primary-color-4: #103d88;
- --td-primary-color-5: #0d429a;
- --td-primary-color-6: #054bbe;
- --td-primary-color-7: #2667d4;
- --td-primary-color-8: #4582e6;
- --td-primary-color-9: #699ef5;
- --td-primary-color-10: #96bbf8;
- --td-warning-color-1: #4f2a1d;
- --td-warning-color-2: #582f21;
- --td-warning-color-3: #733c23;
- --td-warning-color-4: #a75d2b;
- --td-warning-color-5: #cf6e2d;
- --td-warning-color-6: #dc7633;
- --td-warning-color-7: #e8935c;
- --td-warning-color-8: #ecbf91;
- --td-warning-color-9: #eed7bf;
- --td-warning-color-10: #f3e9dc;
- --td-error-color-1: #472324;
- --td-error-color-2: #5e2a2d;
- --td-error-color-3: #703439;
- --td-error-color-4: #83383e;
- --td-error-color-5: #a03f46;
- --td-error-color-6: #c64751;
- --td-error-color-7: #de6670;
- --td-error-color-8: #ec888e;
- --td-error-color-9: #edb1b6;
- --td-error-color-10: #eeced0;
- --td-success-color-1: #193a2a;
- --td-success-color-2: #1a4230;
- --td-success-color-3: #17533d;
- --td-success-color-4: #0d7a55;
- --td-success-color-5: #059465;
- --td-success-color-6: #43af8a;
- --td-success-color-7: #46bf96;
- --td-success-color-8: #80d2b6;
- --td-success-color-9: #b4e1d3;
- --td-success-color-10: #deede8;
- --td-gray-color-1: #f3f3f3;
- --td-gray-color-2: #eee;
- --td-gray-color-3: #e8e8e8;
- --td-gray-color-4: #ddd;
- --td-gray-color-5: #c6c6c6;
- --td-gray-color-6: #a6a6a6;
- --td-gray-color-7: #8b8b8b;
- --td-gray-color-8: #777;
- --td-gray-color-9: #5e5e5e;
- --td-gray-color-10: #4b4b4b;
- --td-gray-color-11: #383838;
- --td-gray-color-12: #2c2c2c;
- --td-gray-color-13: #242424;
- --td-gray-color-14: #181818;
- --td-font-white-1: rgba(255, 255, 255, 0.9);
- --td-font-white-2: rgba(255, 255, 255, 0.55);
- --td-font-white-3: rgba(255, 255, 255, 0.35);
- --td-font-white-4: rgba(255, 255, 255, 0.22);
- --td-font-gray-1: rgba(0, 0, 0, 0.9);
- --td-font-gray-2: rgba(0, 0, 0, 0.6);
- --td-font-gray-3: rgba(0, 0, 0, 0.4);
- --td-font-gray-4: rgba(0, 0, 0, 0.26);
- --td-brand-color: var(--td-primary-color-8);
- --td-warning-color: var(--td-warning-color-5);
- --td-error-color: var(--td-error-color-6);
- --td-success-color: var(--td-success-color-5);
- --td-brand-color-focus: var(--td-primary-color-1);
- --td-brand-color-active: var(--td-primary-color-9);
- --td-brand-color-disabled: var(--td-primary-color-3);
- --td-brand-color-light: var(--td-primary-color-1);
- --td-brand-color-light-active: var(--td-primary-color-2);
- --td-warning-color-focus: var(--td-warning-color-2);
- --td-warning-color-active: var(--td-warning-color-4);
- --td-warning-color-disabled: var(--td-warning-color-3);
- --td-warning-color-light: var(--td-warning-color-1);
- --td-warning-color-light-active: var(--td-warning-color-2);
- --td-error-color-focus: var(--td-error-color-2);
- --td-error-color-active: var(--td-error-color-5);
- --td-error-color-disabled: var(--td-error-color-3);
- --td-error-color-light: var(--td-error-color-1);
- --td-error-color-light-active: var(--td-error-color-2);
- --td-success-color-focus: var(--td-success-color-2);
- --td-success-color-active: var(--td-success-color-4);
- --td-success-color-disabled: var(--td-success-color-3);
- --td-success-color-light: var(--td-success-color-1);
- --td-success-color-light-active: var(--td-success-color-2);
- --td-mask-active: rgba(0, 0, 0, 0.4);
- --td-mask-disabled: rgba(0, 0, 0, 0.6);
- --td-bg-color-page: var(--td-gray-color-14);
- --td-bg-color-container: var(--td-gray-color-13);
- --td-bg-color-secondarycontainer: var(--td-gray-color-12);
- --td-bg-color-component: var(--td-gray-color-11);
- --td-bg-color-container-active: var(--td-gray-color-12);
- --td-bg-color-secondarycontainer-active: var(--td-gray-color-11);
- --td-bg-color-component-active: var(--td-gray-color-10);
- --td-bg-color-component-disabled: var(--td-gray-color-12);
- --td-bg-color-specialcomponent: transparent;
- --td-text-color-primary: var(--td-font-white-1);
- --td-text-color-secondary: var(--td-font-white-2);
- --td-text-color-placeholder: var(--td-font-white-3);
- --td-text-color-disabled: var(--td-font-white-4);
- --td-text-color-anti: var(--td-font-white-1);
- --td-text-color-brand: var(--td-primary-color-8);
- --td-text-color-link: var(--td-primary-color-8);
- --td-border-level-1-color: var(--td-gray-color-11);
- --td-component-stroke: var(--td-gray-color-11);
- --td-border-level-2-color: var(--td-gray-color-9);
- --td-component-border: var(--td-gray-color-9);
- --td-shadow-1: 0 4px 6px rgba(0, 0, 0, 0.06), 0 1px 10px rgba(0, 0, 0, 8%), 0 2px 4px rgba(0, 0, 0, 12%);
- --td-shadow-2: 0 8px 10px rgba(0, 0, 0, 0.12), 0 3px 14px rgba(0, 0, 0, 10%), 0 5px 5px rgba(0, 0, 0, 16%);
- --td-shadow-3: 0 16px 24px rgba(0, 0, 0, 0.14), 0 6px 30px rgba(0, 0, 0, 12%), 0 8px 10px rgba(0, 0, 0, 20%);
- --td-shadow-inset-top: inset 0 0.5px 0 #5e5e5e;
- --td-shadow-inset-right: inset 0.5px 0 0 #5e5e5e;
- --td-shadow-inset-bottom: inset 0 -0.5px 0 #5e5e5e;
- --td-shadow-inset-left: inset -0.5px 0 0 #5e5e5e;
- --td-table-shadow-color: rgba(0, 0, 0, 0.55);
- --td-scrollbar-color: rgba(255, 255, 255, 0.1);
- --td-scroll-track-color: #333;
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_font.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_font.wxss
deleted file mode 100644
index f0cf5a1c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_font.wxss
+++ /dev/null
@@ -1,33 +0,0 @@
-page,
-.page {
- --td-font-family: PingFang SC, Microsoft YaHei, Arial Regular;
- --td-font-family-medium: PingFang SC, Microsoft YaHei, Arial Medium;
- --td-font-size-link-small: 24rpx;
- --td-font-size-link-medium: 28rpx;
- --td-font-size-link-large: 32rpx;
- --td-font-size-mark-extra-small: 20rpx;
- --td-font-size-mark-small: 24rpx;
- --td-font-size-mark-medium: 28rpx;
- --td-font-size-mark-large: 32rpx;
- --td-font-size-body-extra-small: 20rpx;
- --td-font-size-body-small: 24rpx;
- --td-font-size-body-medium: 28rpx;
- --td-font-size-body-large: 32rpx;
- --td-font-size-title-small: 28rpx;
- --td-font-size-title-medium: 32rpx;
- --td-font-size-title-large: 36rpx;
- --td-font-size-title-extra-large: 40rpx;
- --td-font-size-headline-small: 48rpx;
- --td-font-size-headline-medium: 56rpx;
- --td-font-size-headline-large: 72rpx;
- --td-font-size-display-medium: 96rpx;
- --td-font-size-display-large: 128rpx;
- --td-font-size: 20rpx;
- --td-font-size-xs: var(--td-font-size-body-extra-small);
- --td-font-size-s: var(--td-font-size-body-small);
- --td-font-size-base: var(--td-font-size-title-small);
- --td-font-size-m: var(--td-font-size-title-medium);
- --td-font-size-l: var(--td-font-size-title-large);
- --td-font-size-xl: var(--td-font-size-title-extra-large);
- --td-font-size-xxl: var(--td-font-size-headline-large);
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_index.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_index.wxss
deleted file mode 100644
index c128adf9..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_index.wxss
+++ /dev/null
@@ -1,313 +0,0 @@
-@media (prefers-color-scheme: light) {
- page,
- .page {
- --td-primary-color-1: #f2f3ff;
- --td-primary-color-2: #d9e1ff;
- --td-primary-color-3: #b5c7ff;
- --td-primary-color-4: #8eabff;
- --td-primary-color-5: #618dff;
- --td-primary-color-6: #366ef4;
- --td-primary-color-7: #0052d9;
- --td-primary-color-8: #003cab;
- --td-primary-color-9: #002a7c;
- --td-primary-color-10: #001a57;
- --td-warning-color-1: #fff1e9;
- --td-warning-color-2: #ffd9c2;
- --td-warning-color-3: #ffb98c;
- --td-warning-color-4: #fa9550;
- --td-warning-color-5: #e37318;
- --td-warning-color-6: #be5a00;
- --td-warning-color-7: #954500;
- --td-warning-color-8: #713300;
- --td-warning-color-9: #532300;
- --td-warning-color-10: #3b1700;
- --td-error-color-1: #fff0ed;
- --td-error-color-2: #ffd8d2;
- --td-error-color-3: #ffb9b0;
- --td-error-color-4: #ff9285;
- --td-error-color-5: #f6685d;
- --td-error-color-6: #d54941;
- --td-error-color-7: #ad352f;
- --td-error-color-8: #881f1c;
- --td-error-color-9: #68070a;
- --td-error-color-10: #490002;
- --td-success-color-1: #e3f9e9;
- --td-success-color-2: #c6f3d7;
- --td-success-color-3: #92dab2;
- --td-success-color-4: #56c08d;
- --td-success-color-5: #2ba471;
- --td-success-color-6: #008858;
- --td-success-color-7: #006c45;
- --td-success-color-8: #005334;
- --td-success-color-9: #003b23;
- --td-success-color-10: #002515;
- --td-gray-color-1: #f3f3f3;
- --td-gray-color-2: #eeeeee;
- --td-gray-color-3: #e7e7e7;
- --td-gray-color-4: #dcdcdc;
- --td-gray-color-5: #c5c5c5;
- --td-gray-color-6: #a6a6a6;
- --td-gray-color-7: #8b8b8b;
- --td-gray-color-8: #777777;
- --td-gray-color-9: #5e5e5e;
- --td-gray-color-10: #4b4b4b;
- --td-gray-color-11: #383838;
- --td-gray-color-12: #2c2c2c;
- --td-gray-color-13: #242424;
- --td-gray-color-14: #181818;
- --td-font-white-1: #ffffff;
- --td-font-white-2: rgba(255, 255, 255, 0.55);
- --td-font-white-3: rgba(255, 255, 255, 0.35);
- --td-font-white-4: rgba(255, 255, 255, 0.22);
- --td-font-gray-1: rgba(0, 0, 0, 0.9);
- --td-font-gray-2: rgba(0, 0, 0, 0.6);
- --td-font-gray-3: rgba(0, 0, 0, 0.4);
- --td-font-gray-4: rgba(0, 0, 0, 0.26);
- --td-brand-color: var(--td-primary-color-7);
- --td-warning-color: var(--td-warning-color-5);
- --td-error-color: var(--td-error-color-6);
- --td-success-color: var(--td-success-color-5);
- --td-brand-color-focus: var(--td-primary-color-1);
- --td-brand-color-active: var(--td-primary-color-8);
- --td-brand-color-disabled: var(--td-primary-color-3);
- --td-brand-color-light: var(--td-primary-color-1);
- --td-brand-color-light-active: var(--td-primary-color-2);
- --td-warning-color-active: var(--td-warning-color-6);
- --td-warning-color-disabled: var(--td-warning-color-3);
- --td-warning-color-focus: var(--td-warning-color-2);
- --td-warning-color-light: var(--td-warning-color-1);
- --td-warning-color-light-active: var(--td-warning-color-2);
- --td-error-color-focus: var(--td-error-color-2);
- --td-error-color-active: var(--td-error-color-7);
- --td-error-color-disabled: var(--td-error-color-3);
- --td-error-color-light: var(--td-error-color-1);
- --td-error-color-light-active: var(--td-error-color-2);
- --td-success-color-focus: var(--td-success-color-2);
- --td-success-color-active: var(--td-success-color-6);
- --td-success-color-disabled: var(--td-success-color-3);
- --td-success-color-light: var(--td-success-color-1);
- --td-success-color-light-active: var(--td-success-color-2);
- --td-mask-active: rgba(0, 0, 0, 0.6);
- --td-mask-disabled: rgba(255, 255, 255, 0.6);
- --td-bg-color-page: var(--td-gray-color-1);
- --td-bg-color-container: var(--td-font-white-1);
- --td-bg-color-container-active: var(--td-gray-color-3);
- --td-bg-color-secondarycontainer: var(--td-gray-color-1);
- --td-bg-color-secondarycontainer-active: var(--td-gray-color-4);
- --td-bg-color-component: var(--td-gray-color-3);
- --td-bg-color-component-active: var(--td-gray-color-6);
- --td-bg-color-component-disabled: var(--td-gray-color-2);
- --td-bg-color-secondarycomponent: var(--td-gray-color-4);
- --td-bg-color-secondarycomponent-active: var(--td-gray-color-6);
- --td-bg-color-specialcomponent: #fff;
- --td-text-color-primary: var(--td-font-gray-1);
- --td-text-color-secondary: var(--td-font-gray-2);
- --td-text-color-placeholder: var(--td-font-gray-3);
- --td-text-color-disabled: var(--td-font-gray-4);
- --td-text-color-anti: var(--td-font-white-1);
- --td-text-color-brand: var(--td-brand-color);
- --td-text-color-link: var(--td-brand-color);
- --td-border-level-1-color: var(--td-gray-color-3);
- --td-component-stroke: var(--td-gray-color-3);
- --td-border-level-2-color: var(--td-gray-color-4);
- --td-component-border: var(--td-gray-color-4);
- --td-shadow-1: 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 8%), 0 2px 4px -1px rgba(0, 0, 0, 12%);
- --td-shadow-2: 0 3px 14px 2px rgba(0, 0, 0, 0.05), 0 8px 10px 1px rgba(0, 0, 0, 6%), 0 5px 5px -3px rgba(0, 0, 0, 10%);
- --td-shadow-3: 0 6px 30px 5px rgba(0, 0, 0, 0.05), 0 16px 24px 2px rgba(0, 0, 0, 4%),
- 0 8px 10px -5px rgba(0, 0, 0, 8%);
- --td-shadow-4: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
- --td-shadow-inset-top: inset 0 0.5px 0 #dcdcdc;
- --td-shadow-inset-right: inset 0.5px 0 0 #dcdcdc;
- --td-shadow-inset-bottom: inset 0 -0.5px 0 #dcdcdc;
- --td-shadow-inset-left: inset -0.5px 0 0 #dcdcdc;
- --td-table-shadow-color: rgba(0, 0, 0, 0.08);
- --td-scrollbar-color: rgba(0, 0, 0, 0.1);
- --td-scrollbar-hover-color: rgba(0, 0, 0, 0.3);
- --td-scroll-track-color: #fff;
- }
-}
-@media (prefers-color-scheme: dark) {
- page,
- .page {
- --td-primary-color-1: #1b2f51;
- --td-primary-color-2: #173463;
- --td-primary-color-3: #143975;
- --td-primary-color-4: #103d88;
- --td-primary-color-5: #0d429a;
- --td-primary-color-6: #054bbe;
- --td-primary-color-7: #2667d4;
- --td-primary-color-8: #4582e6;
- --td-primary-color-9: #699ef5;
- --td-primary-color-10: #96bbf8;
- --td-warning-color-1: #4f2a1d;
- --td-warning-color-2: #582f21;
- --td-warning-color-3: #733c23;
- --td-warning-color-4: #a75d2b;
- --td-warning-color-5: #cf6e2d;
- --td-warning-color-6: #dc7633;
- --td-warning-color-7: #e8935c;
- --td-warning-color-8: #ecbf91;
- --td-warning-color-9: #eed7bf;
- --td-warning-color-10: #f3e9dc;
- --td-error-color-1: #472324;
- --td-error-color-2: #5e2a2d;
- --td-error-color-3: #703439;
- --td-error-color-4: #83383e;
- --td-error-color-5: #a03f46;
- --td-error-color-6: #c64751;
- --td-error-color-7: #de6670;
- --td-error-color-8: #ec888e;
- --td-error-color-9: #edb1b6;
- --td-error-color-10: #eeced0;
- --td-success-color-1: #193a2a;
- --td-success-color-2: #1a4230;
- --td-success-color-3: #17533d;
- --td-success-color-4: #0d7a55;
- --td-success-color-5: #059465;
- --td-success-color-6: #43af8a;
- --td-success-color-7: #46bf96;
- --td-success-color-8: #80d2b6;
- --td-success-color-9: #b4e1d3;
- --td-success-color-10: #deede8;
- --td-gray-color-1: #f3f3f3;
- --td-gray-color-2: #eee;
- --td-gray-color-3: #e8e8e8;
- --td-gray-color-4: #ddd;
- --td-gray-color-5: #c6c6c6;
- --td-gray-color-6: #a6a6a6;
- --td-gray-color-7: #8b8b8b;
- --td-gray-color-8: #777;
- --td-gray-color-9: #5e5e5e;
- --td-gray-color-10: #4b4b4b;
- --td-gray-color-11: #383838;
- --td-gray-color-12: #2c2c2c;
- --td-gray-color-13: #242424;
- --td-gray-color-14: #181818;
- --td-font-white-1: rgba(255, 255, 255, 0.9);
- --td-font-white-2: rgba(255, 255, 255, 0.55);
- --td-font-white-3: rgba(255, 255, 255, 0.35);
- --td-font-white-4: rgba(255, 255, 255, 0.22);
- --td-font-gray-1: rgba(0, 0, 0, 0.9);
- --td-font-gray-2: rgba(0, 0, 0, 0.6);
- --td-font-gray-3: rgba(0, 0, 0, 0.4);
- --td-font-gray-4: rgba(0, 0, 0, 0.26);
- --td-brand-color: var(--td-primary-color-8);
- --td-warning-color: var(--td-warning-color-5);
- --td-error-color: var(--td-error-color-6);
- --td-success-color: var(--td-success-color-5);
- --td-brand-color-focus: var(--td-primary-color-1);
- --td-brand-color-active: var(--td-primary-color-9);
- --td-brand-color-disabled: var(--td-primary-color-3);
- --td-brand-color-light: var(--td-primary-color-1);
- --td-brand-color-light-active: var(--td-primary-color-2);
- --td-warning-color-focus: var(--td-warning-color-2);
- --td-warning-color-active: var(--td-warning-color-4);
- --td-warning-color-disabled: var(--td-warning-color-3);
- --td-warning-color-light: var(--td-warning-color-1);
- --td-warning-color-light-active: var(--td-warning-color-2);
- --td-error-color-focus: var(--td-error-color-2);
- --td-error-color-active: var(--td-error-color-5);
- --td-error-color-disabled: var(--td-error-color-3);
- --td-error-color-light: var(--td-error-color-1);
- --td-error-color-light-active: var(--td-error-color-2);
- --td-success-color-focus: var(--td-success-color-2);
- --td-success-color-active: var(--td-success-color-4);
- --td-success-color-disabled: var(--td-success-color-3);
- --td-success-color-light: var(--td-success-color-1);
- --td-success-color-light-active: var(--td-success-color-2);
- --td-mask-active: rgba(0, 0, 0, 0.4);
- --td-mask-disabled: rgba(0, 0, 0, 0.6);
- --td-bg-color-page: var(--td-gray-color-14);
- --td-bg-color-container: var(--td-gray-color-13);
- --td-bg-color-secondarycontainer: var(--td-gray-color-12);
- --td-bg-color-component: var(--td-gray-color-11);
- --td-bg-color-container-active: var(--td-gray-color-12);
- --td-bg-color-secondarycontainer-active: var(--td-gray-color-11);
- --td-bg-color-component-active: var(--td-gray-color-10);
- --td-bg-color-component-disabled: var(--td-gray-color-12);
- --td-bg-color-specialcomponent: transparent;
- --td-text-color-primary: var(--td-font-white-1);
- --td-text-color-secondary: var(--td-font-white-2);
- --td-text-color-placeholder: var(--td-font-white-3);
- --td-text-color-disabled: var(--td-font-white-4);
- --td-text-color-anti: var(--td-font-white-1);
- --td-text-color-brand: var(--td-primary-color-8);
- --td-text-color-link: var(--td-primary-color-8);
- --td-border-level-1-color: var(--td-gray-color-11);
- --td-component-stroke: var(--td-gray-color-11);
- --td-border-level-2-color: var(--td-gray-color-9);
- --td-component-border: var(--td-gray-color-9);
- --td-shadow-1: 0 4px 6px rgba(0, 0, 0, 0.06), 0 1px 10px rgba(0, 0, 0, 8%), 0 2px 4px rgba(0, 0, 0, 12%);
- --td-shadow-2: 0 8px 10px rgba(0, 0, 0, 0.12), 0 3px 14px rgba(0, 0, 0, 10%), 0 5px 5px rgba(0, 0, 0, 16%);
- --td-shadow-3: 0 16px 24px rgba(0, 0, 0, 0.14), 0 6px 30px rgba(0, 0, 0, 12%), 0 8px 10px rgba(0, 0, 0, 20%);
- --td-shadow-inset-top: inset 0 0.5px 0 #5e5e5e;
- --td-shadow-inset-right: inset 0.5px 0 0 #5e5e5e;
- --td-shadow-inset-bottom: inset 0 -0.5px 0 #5e5e5e;
- --td-shadow-inset-left: inset -0.5px 0 0 #5e5e5e;
- --td-table-shadow-color: rgba(0, 0, 0, 0.55);
- --td-scrollbar-color: rgba(255, 255, 255, 0.1);
- --td-scroll-track-color: #333;
- }
-}
-page,
-.page {
- --td-radius-small: 6rpx;
- --td-radius-default: 12rpx;
- --td-radius-large: 18rpx;
- --td-radius-extra-large: 24rpx;
- --td-radius-round: 999px;
- --td-radius-circle: 50%;
-}
-page,
-.page {
- --td-font-family: PingFang SC, Microsoft YaHei, Arial Regular;
- --td-font-family-medium: PingFang SC, Microsoft YaHei, Arial Medium;
- --td-font-size-link-small: 24rpx;
- --td-font-size-link-medium: 28rpx;
- --td-font-size-link-large: 32rpx;
- --td-font-size-mark-extra-small: 20rpx;
- --td-font-size-mark-small: 24rpx;
- --td-font-size-mark-medium: 28rpx;
- --td-font-size-mark-large: 32rpx;
- --td-font-size-body-extra-small: 20rpx;
- --td-font-size-body-small: 24rpx;
- --td-font-size-body-medium: 28rpx;
- --td-font-size-body-large: 32rpx;
- --td-font-size-title-small: 28rpx;
- --td-font-size-title-medium: 32rpx;
- --td-font-size-title-large: 36rpx;
- --td-font-size-title-extra-large: 40rpx;
- --td-font-size-headline-small: 48rpx;
- --td-font-size-headline-medium: 56rpx;
- --td-font-size-headline-large: 72rpx;
- --td-font-size-display-medium: 96rpx;
- --td-font-size-display-large: 128rpx;
- --td-font-size: 20rpx;
- --td-font-size-xs: var(--td-font-size-body-extra-small);
- --td-font-size-s: var(--td-font-size-body-small);
- --td-font-size-base: var(--td-font-size-title-small);
- --td-font-size-m: var(--td-font-size-title-medium);
- --td-font-size-l: var(--td-font-size-title-large);
- --td-font-size-xl: var(--td-font-size-title-extra-large);
- --td-font-size-xxl: var(--td-font-size-headline-large);
-}
-page,
-.page {
- --td-spacer: 16rpx;
- --td-spacer-1: 24rpx;
- --td-spacer-2: 32rpx;
- --td-spacer-3: 48rpx;
- --td-spacer-4: 64rpx;
- --td-spacer-5: 96rpx;
- --td-spacer-6: 160rpx;
-}
-@media (prefers-color-scheme: dark) {
- page,
- .page {
- --td-button-primary-disabled-color: var(--td-font-white-4);
- --td-skeleton-animation-gradient: rgba(255, 255, 255, 0.06);
- --td-slider-dot-bg-color: var(--td-gray-color-4);
- --td-slider-dot-disabled-bg-color: var(--td-gray-color-11);
- --td-slider-dot-disabled-border-color: var(--td-gray-color-12);
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_light.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_light.wxss
deleted file mode 100644
index a63aa420..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_light.wxss
+++ /dev/null
@@ -1,128 +0,0 @@
-@media (prefers-color-scheme: light) {
- page,
- .page {
- --td-primary-color-1: #f2f3ff;
- --td-primary-color-2: #d9e1ff;
- --td-primary-color-3: #b5c7ff;
- --td-primary-color-4: #8eabff;
- --td-primary-color-5: #618dff;
- --td-primary-color-6: #366ef4;
- --td-primary-color-7: #0052d9;
- --td-primary-color-8: #003cab;
- --td-primary-color-9: #002a7c;
- --td-primary-color-10: #001a57;
- --td-warning-color-1: #fff1e9;
- --td-warning-color-2: #ffd9c2;
- --td-warning-color-3: #ffb98c;
- --td-warning-color-4: #fa9550;
- --td-warning-color-5: #e37318;
- --td-warning-color-6: #be5a00;
- --td-warning-color-7: #954500;
- --td-warning-color-8: #713300;
- --td-warning-color-9: #532300;
- --td-warning-color-10: #3b1700;
- --td-error-color-1: #fff0ed;
- --td-error-color-2: #ffd8d2;
- --td-error-color-3: #ffb9b0;
- --td-error-color-4: #ff9285;
- --td-error-color-5: #f6685d;
- --td-error-color-6: #d54941;
- --td-error-color-7: #ad352f;
- --td-error-color-8: #881f1c;
- --td-error-color-9: #68070a;
- --td-error-color-10: #490002;
- --td-success-color-1: #e3f9e9;
- --td-success-color-2: #c6f3d7;
- --td-success-color-3: #92dab2;
- --td-success-color-4: #56c08d;
- --td-success-color-5: #2ba471;
- --td-success-color-6: #008858;
- --td-success-color-7: #006c45;
- --td-success-color-8: #005334;
- --td-success-color-9: #003b23;
- --td-success-color-10: #002515;
- --td-gray-color-1: #f3f3f3;
- --td-gray-color-2: #eeeeee;
- --td-gray-color-3: #e7e7e7;
- --td-gray-color-4: #dcdcdc;
- --td-gray-color-5: #c5c5c5;
- --td-gray-color-6: #a6a6a6;
- --td-gray-color-7: #8b8b8b;
- --td-gray-color-8: #777777;
- --td-gray-color-9: #5e5e5e;
- --td-gray-color-10: #4b4b4b;
- --td-gray-color-11: #383838;
- --td-gray-color-12: #2c2c2c;
- --td-gray-color-13: #242424;
- --td-gray-color-14: #181818;
- --td-font-white-1: #ffffff;
- --td-font-white-2: rgba(255, 255, 255, 0.55);
- --td-font-white-3: rgba(255, 255, 255, 0.35);
- --td-font-white-4: rgba(255, 255, 255, 0.22);
- --td-font-gray-1: rgba(0, 0, 0, 0.9);
- --td-font-gray-2: rgba(0, 0, 0, 0.6);
- --td-font-gray-3: rgba(0, 0, 0, 0.4);
- --td-font-gray-4: rgba(0, 0, 0, 0.26);
- --td-brand-color: var(--td-primary-color-7);
- --td-warning-color: var(--td-warning-color-5);
- --td-error-color: var(--td-error-color-6);
- --td-success-color: var(--td-success-color-5);
- --td-brand-color-focus: var(--td-primary-color-1);
- --td-brand-color-active: var(--td-primary-color-8);
- --td-brand-color-disabled: var(--td-primary-color-3);
- --td-brand-color-light: var(--td-primary-color-1);
- --td-brand-color-light-active: var(--td-primary-color-2);
- --td-warning-color-active: var(--td-warning-color-6);
- --td-warning-color-disabled: var(--td-warning-color-3);
- --td-warning-color-focus: var(--td-warning-color-2);
- --td-warning-color-light: var(--td-warning-color-1);
- --td-warning-color-light-active: var(--td-warning-color-2);
- --td-error-color-focus: var(--td-error-color-2);
- --td-error-color-active: var(--td-error-color-7);
- --td-error-color-disabled: var(--td-error-color-3);
- --td-error-color-light: var(--td-error-color-1);
- --td-error-color-light-active: var(--td-error-color-2);
- --td-success-color-focus: var(--td-success-color-2);
- --td-success-color-active: var(--td-success-color-6);
- --td-success-color-disabled: var(--td-success-color-3);
- --td-success-color-light: var(--td-success-color-1);
- --td-success-color-light-active: var(--td-success-color-2);
- --td-mask-active: rgba(0, 0, 0, 0.6);
- --td-mask-disabled: rgba(255, 255, 255, 0.6);
- --td-bg-color-page: var(--td-gray-color-1);
- --td-bg-color-container: var(--td-font-white-1);
- --td-bg-color-container-active: var(--td-gray-color-3);
- --td-bg-color-secondarycontainer: var(--td-gray-color-1);
- --td-bg-color-secondarycontainer-active: var(--td-gray-color-4);
- --td-bg-color-component: var(--td-gray-color-3);
- --td-bg-color-component-active: var(--td-gray-color-6);
- --td-bg-color-component-disabled: var(--td-gray-color-2);
- --td-bg-color-secondarycomponent: var(--td-gray-color-4);
- --td-bg-color-secondarycomponent-active: var(--td-gray-color-6);
- --td-bg-color-specialcomponent: #fff;
- --td-text-color-primary: var(--td-font-gray-1);
- --td-text-color-secondary: var(--td-font-gray-2);
- --td-text-color-placeholder: var(--td-font-gray-3);
- --td-text-color-disabled: var(--td-font-gray-4);
- --td-text-color-anti: var(--td-font-white-1);
- --td-text-color-brand: var(--td-brand-color);
- --td-text-color-link: var(--td-brand-color);
- --td-border-level-1-color: var(--td-gray-color-3);
- --td-component-stroke: var(--td-gray-color-3);
- --td-border-level-2-color: var(--td-gray-color-4);
- --td-component-border: var(--td-gray-color-4);
- --td-shadow-1: 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 8%), 0 2px 4px -1px rgba(0, 0, 0, 12%);
- --td-shadow-2: 0 3px 14px 2px rgba(0, 0, 0, 0.05), 0 8px 10px 1px rgba(0, 0, 0, 6%), 0 5px 5px -3px rgba(0, 0, 0, 10%);
- --td-shadow-3: 0 6px 30px 5px rgba(0, 0, 0, 0.05), 0 16px 24px 2px rgba(0, 0, 0, 4%),
- 0 8px 10px -5px rgba(0, 0, 0, 8%);
- --td-shadow-4: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
- --td-shadow-inset-top: inset 0 0.5px 0 #dcdcdc;
- --td-shadow-inset-right: inset 0.5px 0 0 #dcdcdc;
- --td-shadow-inset-bottom: inset 0 -0.5px 0 #dcdcdc;
- --td-shadow-inset-left: inset -0.5px 0 0 #dcdcdc;
- --td-table-shadow-color: rgba(0, 0, 0, 0.08);
- --td-scrollbar-color: rgba(0, 0, 0, 0.1);
- --td-scrollbar-hover-color: rgba(0, 0, 0, 0.3);
- --td-scroll-track-color: #fff;
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_radius.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_radius.wxss
deleted file mode 100644
index d559d996..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_radius.wxss
+++ /dev/null
@@ -1,9 +0,0 @@
-page,
-.page {
- --td-radius-small: 6rpx;
- --td-radius-default: 12rpx;
- --td-radius-large: 18rpx;
- --td-radius-extra-large: 24rpx;
- --td-radius-round: 999px;
- --td-radius-circle: 50%;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_spacer.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_spacer.wxss
deleted file mode 100644
index bda90f9d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/theme/_spacer.wxss
+++ /dev/null
@@ -1,10 +0,0 @@
-page,
-.page {
- --td-spacer: 16rpx;
- --td-spacer-1: 24rpx;
- --td-spacer-2: 32rpx;
- --td-spacer-3: 48rpx;
- --td-spacer-4: 64rpx;
- --td-spacer-5: 96rpx;
- --td-spacer-6: 160rpx;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/utilities/_animation.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/utilities/_animation.wxss
deleted file mode 100644
index a04e7c52..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/utilities/_animation.wxss
+++ /dev/null
@@ -1,8 +0,0 @@
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/utilities/_float.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/utilities/_float.wxss
deleted file mode 100644
index e88ef0ed..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/utilities/_float.wxss
+++ /dev/null
@@ -1,6 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/utilities/_index.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/utilities/_index.wxss
deleted file mode 100644
index 1d532d2d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/style/utilities/_index.wxss
+++ /dev/null
@@ -1,27 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/badge.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/badge.wxml
deleted file mode 100644
index df8c7177..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/badge.wxml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/button.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/button.wxml
deleted file mode 100644
index d16a178c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/button.wxml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/icon.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/icon.wxml
deleted file mode 100644
index 0fafa2c0..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/icon.wxml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/image.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/image.wxml
deleted file mode 100644
index 43fe5244..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/template/image.wxml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/utils.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/utils.d.ts
deleted file mode 100644
index 88c86d03..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/utils.d.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-///
-///
-///
-export declare const systemInfo: WechatMiniprogram.WindowInfo | WechatMiniprogram.SystemInfo;
-export declare const appBaseInfo: WechatMiniprogram.AppBaseInfo | WechatMiniprogram.SystemInfo;
-export declare const deviceInfo: WechatMiniprogram.DeviceInfo | WechatMiniprogram.SystemInfo;
-declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
-export declare const debounce: (func: any, wait?: number) => (...rest: any[]) => void;
-export declare const throttle: (func: any, wait?: number, options?: any) => (...args: any[]) => void;
-export declare const classNames: (...args: any[]) => string;
-export declare const styles: (styleObj: any) => string;
-export declare const getAnimationFrame: (context: any, cb: Function) => any;
-export declare const getRect: (context: any, selector: string, needAll?: boolean) => Promise;
-export declare const isNumber: (value: any) => boolean;
-export declare const isNull: (value: any) => boolean;
-export declare const isUndefined: (value: any) => boolean;
-export declare const isDef: (value: any) => boolean;
-export declare const addUnit: (value?: string | number) => string | undefined;
-export declare const getCharacterLength: (type: string, char: string | number, max?: number) => {
- length: number;
- characters: string;
-};
-export declare const chunk: (arr: any[], size: number) => any[][];
-export declare const getInstance: (context?: Context, selector?: string) => WechatMiniprogram.Component.TrivialInstance;
-export declare const unitConvert: (value: number | string | null | undefined) => number;
-export declare const setIcon: (iconName: any, icon: any, defaultIcon: any) => {
- [x: string]: any;
-};
-export declare const isBool: (val: any) => boolean;
-export declare const isObject: (val: any) => boolean;
-export declare const isString: (val: any) => boolean;
-export declare const toCamel: (str: any) => any;
-export declare const getCurrentPage: () => T & WechatMiniprogram.OptionalInterface & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods & WechatMiniprogram.Page.Data & WechatMiniprogram.IAnyObject;
-export declare const uniqueFactory: (compName: any) => () => string;
-export declare const calcIcon: (icon: string | Record, defaultIcon?: string) => string | Record;
-export declare const isOverSize: (size: any, sizeLimit: any) => boolean;
-export declare const rpx2px: (rpx: any) => number;
-export declare const nextTick: () => Promise;
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/utils.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/utils.js
deleted file mode 100644
index 920b3ca4..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/utils.js
+++ /dev/null
@@ -1,248 +0,0 @@
-import { prefix } from './config';
-import { getWindowInfo, getAppBaseInfo, getDeviceInfo } from './wechat';
-export const systemInfo = getWindowInfo();
-export const appBaseInfo = getAppBaseInfo();
-export const deviceInfo = getDeviceInfo();
-export const debounce = function (func, wait = 500) {
- let timerId;
- return function (...rest) {
- if (timerId) {
- clearTimeout(timerId);
- }
- timerId = setTimeout(() => {
- func.apply(this, rest);
- }, wait);
- };
-};
-export const throttle = (func, wait = 100, options = null) => {
- let previous = 0;
- let timerid = null;
- if (!options) {
- options = {
- leading: true,
- };
- }
- return function (...args) {
- const now = Date.now();
- if (!previous && !options.leading)
- previous = now;
- const remaining = wait - (now - previous);
- const context = this;
- if (remaining <= 0) {
- if (timerid) {
- clearTimeout(timerid);
- timerid = null;
- }
- previous = now;
- func.apply(context, args);
- }
- };
-};
-export const classNames = function (...args) {
- const hasOwn = {}.hasOwnProperty;
- const classes = [];
- args.forEach((arg) => {
- if (!arg)
- return;
- const argType = typeof arg;
- if (argType === 'string' || argType === 'number') {
- classes.push(arg);
- }
- else if (Array.isArray(arg) && arg.length) {
- const inner = classNames(...arg);
- if (inner) {
- classes.push(inner);
- }
- }
- else if (argType === 'object') {
- for (const key in arg) {
- if (hasOwn.call(arg, key) && arg[key]) {
- classes.push(key);
- }
- }
- }
- });
- return classes.join(' ');
-};
-export const styles = function (styleObj) {
- return Object.keys(styleObj)
- .map((styleKey) => `${styleKey}: ${styleObj[styleKey]}`)
- .join('; ');
-};
-export const getAnimationFrame = function (context, cb) {
- return context
- .createSelectorQuery()
- .selectViewport()
- .boundingClientRect()
- .exec(() => {
- cb();
- });
-};
-export const getRect = function (context, selector, needAll = false) {
- return new Promise((resolve, reject) => {
- context
- .createSelectorQuery()[needAll ? 'selectAll' : 'select'](selector)
- .boundingClientRect((rect) => {
- if (rect) {
- resolve(rect);
- }
- else {
- reject(rect);
- }
- })
- .exec();
- });
-};
-export const isNumber = function (value) {
- return /^\d+(\.\d+)?$/.test(value);
-};
-export const isNull = function (value) {
- return value === null;
-};
-export const isUndefined = (value) => typeof value === 'undefined';
-export const isDef = function (value) {
- return !isUndefined(value) && !isNull(value);
-};
-export const addUnit = function (value) {
- if (!isDef(value)) {
- return undefined;
- }
- value = String(value);
- return isNumber(value) ? `${value}px` : value;
-};
-export const getCharacterLength = (type, char, max) => {
- const str = String(char !== null && char !== void 0 ? char : '');
- if (str.length === 0) {
- return {
- length: 0,
- characters: '',
- };
- }
- if (type === 'maxcharacter') {
- let len = 0;
- for (let i = 0; i < str.length; i += 1) {
- let currentStringLength = 0;
- if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
- currentStringLength = 2;
- }
- else {
- currentStringLength = 1;
- }
- if (len + currentStringLength > max) {
- return {
- length: len,
- characters: str.slice(0, i),
- };
- }
- len += currentStringLength;
- }
- return {
- length: len,
- characters: str,
- };
- }
- else if (type === 'maxlength') {
- const length = str.length > max ? max : str.length;
- return {
- length,
- characters: str.slice(0, length),
- };
- }
- return {
- length: str.length,
- characters: str,
- };
-};
-export const chunk = (arr, size) => Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => arr.slice(i * size, i * size + size));
-export const getInstance = function (context, selector) {
- if (!context) {
- const pages = getCurrentPages();
- const page = pages[pages.length - 1];
- context = page.$$basePage || page;
- }
- const instance = context ? context.selectComponent(selector) : null;
- if (!instance) {
- console.warn('未找到组件,请检查selector是否正确');
- return null;
- }
- return instance;
-};
-export const unitConvert = (value) => {
- var _a;
- if (typeof value === 'string') {
- if (value.includes('rpx')) {
- return (parseInt(value, 10) * ((_a = systemInfo === null || systemInfo === void 0 ? void 0 : systemInfo.screenWidth) !== null && _a !== void 0 ? _a : 750)) / 750;
- }
- return parseInt(value, 10);
- }
- return value !== null && value !== void 0 ? value : 0;
-};
-export const setIcon = (iconName, icon, defaultIcon) => {
- if (icon) {
- if (typeof icon === 'string') {
- return {
- [`${iconName}Name`]: icon,
- [`${iconName}Data`]: {},
- };
- }
- else if (typeof icon === 'object') {
- return {
- [`${iconName}Name`]: '',
- [`${iconName}Data`]: icon,
- };
- }
- else {
- return {
- [`${iconName}Name`]: defaultIcon,
- [`${iconName}Data`]: {},
- };
- }
- }
- return {
- [`${iconName}Name`]: '',
- [`${iconName}Data`]: {},
- };
-};
-export const isBool = (val) => typeof val === 'boolean';
-export const isObject = (val) => typeof val === 'object' && val != null;
-export const isString = (val) => typeof val === 'string';
-export const toCamel = (str) => str.replace(/-(\w)/g, (match, m1) => m1.toUpperCase());
-export const getCurrentPage = function () {
- const pages = getCurrentPages();
- return pages[pages.length - 1];
-};
-export const uniqueFactory = (compName) => {
- let number = 0;
- return () => `${prefix}_${compName}_${number++}`;
-};
-export const calcIcon = (icon, defaultIcon) => {
- if (icon && ((isBool(icon) && defaultIcon) || isString(icon))) {
- return { name: isBool(icon) ? defaultIcon : icon };
- }
- if (isObject(icon)) {
- return icon;
- }
- return null;
-};
-export const isOverSize = (size, sizeLimit) => {
- var _a;
- if (!sizeLimit)
- return false;
- const base = 1000;
- const unitMap = {
- B: 1,
- KB: base,
- MB: base * base,
- GB: base * base * base,
- };
- const computedSize = typeof sizeLimit === 'number' ? sizeLimit * base : (sizeLimit === null || sizeLimit === void 0 ? void 0 : sizeLimit.size) * unitMap[(_a = sizeLimit === null || sizeLimit === void 0 ? void 0 : sizeLimit.unit) !== null && _a !== void 0 ? _a : 'KB'];
- return size > computedSize;
-};
-export const rpx2px = (rpx) => Math.floor((systemInfo.windowWidth * rpx) / 750);
-export const nextTick = () => {
- return new Promise((resolve) => {
- wx.nextTick(() => {
- resolve();
- });
- });
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/utils.wxs b/miniprogram/packageAPI/components/tdesign-miniprogram/common/utils.wxs
deleted file mode 100644
index 1e023ebc..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/utils.wxs
+++ /dev/null
@@ -1,142 +0,0 @@
-/* utils */
-
-/**
- * addUnit */
-// 为 css 添加单位
-function addUnit(value) {
- var REGEXP = getRegExp('^-?\d+(.\d+)?$');
- if (value == null) {
- return undefined;
- }
- return REGEXP.test('' + value) ? value + 'px' : value;
-}
-
-function isString(string) {
- return string && string.constructor === 'String';
-}
-
-function isArray(array) {
- return array && array.constructor === 'Array';
-}
-
-function isObject(obj) {
- return obj && obj.constructor === 'Object';
-}
-
-var isNoEmptyObj = function (obj) {
- return isObject(obj) && JSON.stringify(obj) !== '{}';
-};
-
-function includes(arr, value) {
- if (!arr || !isArray(arr)) return false;
-
- var i = 0;
- var len = arr.length;
-
- for (; i < len; i++) {
- if (arr[i] === value) return true;
- }
- return false;
-}
-
-function cls(base, arr) {
- var res = [base];
- var i = 0;
- for (var size = arr.length; i < size; i++) {
- var item = arr[i];
-
- if (item && item.constructor === 'Array') {
- var key = arr[i][0];
- var value = arr[i][1];
-
- if (value) {
- res.push(base + '--' + key);
- }
- } else if (typeof item === 'string' || typeof item === 'number') {
- if (item) {
- res.push(base + '--' + item);
- }
- }
- }
- return res.join(' ');
-}
-
-function getBadgeAriaLabel(options) {
- var maxCount = options.maxCount || 99;
- if (options.dot) {
- return '有新的消息';
- }
- if (options.count === '...') {
- return '有很多消息';
- }
- if (isNaN(options.count)) {
- return options.count;
- }
- var str1 = '有' + maxCount + '+条消息';
- var str2 = '有' + options.count + '条消息';
- return Number(options.count) > maxCount ? str1 : str2;
-}
-
-function endsWith(str, endStr) {
- return str.slice(-endStr.length) === endStr ? str : str + endStr;
-}
-
-function keys(obj) {
- return JSON.stringify(obj)
- .replace(getRegExp('{|}|"', 'g'), '')
- .split(',')
- .map(function (item) {
- return item.split(':')[0];
- });
-}
-
-function kebabCase(str) {
- return str
- .replace(getRegExp('[A-Z]', 'g'), function (ele) {
- return '-' + ele;
- })
- .toLowerCase();
-}
-
-function _style(styles) {
- if (isArray(styles)) {
- return styles
- .filter(function (item) {
- return item != null && item !== '';
- })
- .map(function (item) {
- return isArray(item) ? _style(item) : endsWith(item, ';');
- })
- .join(' ');
- }
-
- if (isObject(styles)) {
- return keys(styles)
- .filter(function (key) {
- return styles[key] != null && styles[key] !== '';
- })
- .map(function (key) {
- return [kebabCase(key), [styles[key]]].join(':');
- })
- .join(';');
- }
-
- return styles;
-}
-
-function isValidIconName(str) {
- return getRegExp('^[A-Za-z0-9\-]+$').test(str);
-}
-
-module.exports = {
- addUnit: addUnit,
- isString: isString,
- isArray: isArray,
- isObject: isObject,
- isNoEmptyObj: isNoEmptyObj,
- includes: includes,
- cls: cls,
- getBadgeAriaLabel: getBadgeAriaLabel,
- _style: _style,
- isValidIconName: isValidIconName,
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/version.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/version.d.ts
deleted file mode 100644
index 0f9c6e9d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/version.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export declare function compareVersion(v1: any, v2: any): 0 | 1 | -1;
-export declare function canIUseFormFieldButton(): boolean;
-export declare function canUseVirtualHost(): boolean;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/version.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/version.js
deleted file mode 100644
index 2dc8e6b2..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/version.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import { getAppBaseInfo } from './wechat';
-let systemInfo;
-function getSystemInfo() {
- if (systemInfo == null) {
- systemInfo = getAppBaseInfo();
- }
- return systemInfo;
-}
-export 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]);
- const num2 = parseInt(v2[i]);
- if (num1 > num2) {
- return 1;
- }
- else if (num1 < num2) {
- return -1;
- }
- }
- return 0;
-}
-function judgeByVersion(version) {
- const currentSDKVersion = getSystemInfo().SDKVersion;
- return compareVersion(currentSDKVersion, version) >= 0;
-}
-export function canIUseFormFieldButton() {
- return judgeByVersion('2.10.3');
-}
-export function canUseVirtualHost() {
- return judgeByVersion('2.19.2');
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/wechat.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/common/wechat.d.ts
deleted file mode 100644
index db570692..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/wechat.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export declare const getObserver: (context: any, selector: string) => Promise;
-export declare const getWindowInfo: () => WechatMiniprogram.WindowInfo | WechatMiniprogram.SystemInfo;
-export declare const getAppBaseInfo: () => WechatMiniprogram.SystemInfo | WechatMiniprogram.AppBaseInfo;
-export declare const getDeviceInfo: () => WechatMiniprogram.SystemInfo | WechatMiniprogram.DeviceInfo;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/common/wechat.js b/miniprogram/packageAPI/components/tdesign-miniprogram/common/wechat.js
deleted file mode 100644
index 7feabc93..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/common/wechat.js
+++ /dev/null
@@ -1,19 +0,0 @@
-export const getObserver = (context, selector) => {
- return new Promise((resolve, reject) => {
- context
- .createIntersectionObserver(context)
- .relativeToViewport()
- .observe(selector, (res) => {
- resolve(res);
- });
- });
-};
-export const getWindowInfo = () => {
- return wx.getWindowInfo ? wx.getWindowInfo() : wx.getSystemInfoSync();
-};
-export const getAppBaseInfo = () => {
- return wx.getAppBaseInfo ? wx.getAppBaseInfo() : wx.getSystemInfoSync();
-};
-export const getDeviceInfo = () => {
- return wx.getDeviceInfo ? wx.getDeviceInfo() : wx.getSystemInfoSync();
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/README.en-US.md
deleted file mode 100644
index 9518e7e9..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/README.en-US.md
+++ /dev/null
@@ -1,43 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### CountDown Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-auto-start | Boolean | true | \- | N
-content | String / Slot | 'default' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-format | String | HH:mm:ss | \- | N
-millisecond | Boolean | false | \- | N
-size | String | 'medium' | `0.5.1`。options: small/medium/large | N
-split-with-unit | Boolean | false | `0.5.1` | N
-theme | String | 'default' | `0.5.1`。options: default/round/square | N
-time | Number | 0 | required | Y
-
-### CountDown Events
-
-name | params | description
--- | -- | --
-change | `(time: TimeData)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/count-down/type.ts)。
`interface TimeData { days: number; hours: number; minutes: number; seconds: number; milliseconds: number }`
-finish | \- | \-
-### CountDown External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-count | \-
-t-class-split | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-countdown-bg-color | @error-color-6 | -
---td-countdown-default-color | @font-gray-1 | -
---td-countdown-round-border-radius | @radius-circle | -
---td-countdown-round-color | @font-white-1 | -
---td-countdown-square-border-radius | @radius-small | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/README.md
deleted file mode 100644
index 72efb6d2..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
----
-title: CountDown 倒计时
-description: 用于实时展示倒计时数值。
-spline: data
-isComponent: true
----
-
-


-
-> CountDown 组件用于实时展示倒计时数值。
-如果需要与站点演示一致的数字字体效果,推荐您到 数字字体章节,将 TCloudNumber 字体下载并将包含的 TCloudNumberVF.ttf 做为 TCloudNumber 字体资源引入到具体项目中使用。
-
-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-count-down": "tdesign-miniprogram/count-down/count-down"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 基础倒计时
-
-{{ base }}
-
-### 调整尺寸
-
-{{ size }}
-
-## API
-
-### CountDown Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-auto-start | Boolean | true | 是否自动开始倒计时 | N
-content | String / Slot | 'default' | 最终倒计时的展示内容,值为'default'时使用默认的格式,否则使用自定义样式插槽。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-format | String | HH:mm:ss | 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒 | N
-millisecond | Boolean | false | 是否开启毫秒级渲染 | N
-size | String | 'medium' | `0.5.1`。倒计时尺寸。可选项:small/medium/large | N
-split-with-unit | Boolean | false | `0.5.1`。使用时间单位分割 | N
-theme | String | 'default' | `0.5.1`。倒计时风格。可选项:default/round/square | N
-time | Number | 0 | 必需。倒计时时长,单位毫秒 | Y
-
-### CountDown Events
-
-名称 | 参数 | 描述
--- | -- | --
-change | `(time: TimeData)` | 时间变化时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/count-down/type.ts)。
`interface TimeData { days: number; hours: number; minutes: number; seconds: number; milliseconds: number }`
-finish | \- | 倒计时结束时触发
-### CountDown External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-count | 计数样式类
-t-class-split | 分隔线样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-countdown-bg-color | @error-color-6 | -
---td-countdown-default-color | @font-gray-1 | -
---td-countdown-round-border-radius | @radius-circle | -
---td-countdown-round-color | @font-white-1 | -
---td-countdown-square-border-radius | @radius-small | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.d.ts
deleted file mode 100644
index 60bd7f29..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.d.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class CountDown extends SuperComponent {
- externalClasses: string[];
- properties: import("./type").TdCountDownProps;
- observers: {
- time(): void;
- };
- data: {
- prefix: string;
- classPrefix: string;
- timeDataUnit: {
- DD: string;
- HH: string;
- mm: string;
- ss: string;
- SSS: string;
- };
- timeData: import("./utils").TimeData;
- formattedTime: string;
- };
- timeoutId: null | number;
- lifetimes: {
- detached(): void;
- };
- methods: {
- start(): void;
- pause(): void;
- reset(): void;
- getTime(): number;
- updateTime(remain: number): void;
- doCount(): void;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.js b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.js
deleted file mode 100644
index 3582cb4e..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.js
+++ /dev/null
@@ -1,100 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { isSameSecond, parseFormat, parseTimeData, TimeDataUnit } from './utils';
-const { prefix } = config;
-const name = `${prefix}-count-down`;
-let CountDown = class CountDown extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-count`, `${prefix}-class-split`];
- this.properties = props;
- this.observers = {
- time() {
- this.reset();
- },
- };
- this.data = {
- prefix,
- classPrefix: name,
- timeDataUnit: TimeDataUnit,
- timeData: parseTimeData(0),
- formattedTime: '0',
- };
- this.timeoutId = null;
- this.lifetimes = {
- detached() {
- if (this.timeoutId) {
- clearTimeout(this.timeoutId);
- this.timeoutId = null;
- }
- },
- };
- this.methods = {
- start() {
- if (this.counting) {
- return;
- }
- this.counting = true;
- this.endTime = Date.now() + this.remain;
- this.doCount();
- },
- pause() {
- this.counting = false;
- this.timeoutId && clearTimeout(this.timeoutId);
- },
- reset() {
- this.pause();
- this.remain = this.properties.time;
- this.updateTime(this.remain);
- if (this.properties.autoStart) {
- this.start();
- }
- },
- getTime() {
- return Math.max(this.endTime - Date.now(), 0);
- },
- updateTime(remain) {
- const { format } = this.properties;
- this.remain = remain;
- const timeData = parseTimeData(remain);
- this.triggerEvent('change', timeData);
- const { timeText } = parseFormat(remain, format);
- const timeRange = format.split(':');
- this.setData({
- timeRange,
- timeData,
- formattedTime: timeText.replace(/:/g, ' : '),
- });
- if (remain === 0) {
- this.pause();
- this.triggerEvent('finish');
- }
- },
- doCount() {
- this.timeoutId = setTimeout(() => {
- const time = this.getTime();
- if (this.properties.millisecond) {
- this.updateTime(time);
- }
- else if (!isSameSecond(time, this.remain) || time === 0) {
- this.updateTime(time);
- }
- if (time !== 0) {
- this.doCount();
- }
- }, 33);
- },
- };
- }
-};
-CountDown = __decorate([
- wxComponent()
-], CountDown);
-export default CountDown;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.json b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.json
deleted file mode 100644
index f783dae7..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon"
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.wxml
deleted file mode 100644
index 7add47e9..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.wxml
+++ /dev/null
@@ -1,22 +0,0 @@
-
- module.exports.format = function(num) { return num < 10 ? '0' + num : num; }
-
-
-
-
- {{formattedTime}}
-
-
- {{this.format(timeData[timeRange[index]])}}
- {{splitWithUnit ? timeDataUnit[timeRange[index]] : ':'}}
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.wxss
deleted file mode 100644
index d774c977..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/count-down.wxss
+++ /dev/null
@@ -1,137 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-count-down--small.t-count-down--default {
- font-size: var(--td-font-size-base, 28rpx);
-}
-.t-count-down--small.t-count-down--round > .t-count-down__item {
- font-size: var(--td-font-size-s, 24rpx);
-}
-.t-count-down--small.t-count-down--square > .t-count-down__item {
- font-size: var(--td-font-size-s, 24rpx);
-}
-.t-count-down--small.t-count-down--round > .t-count-down__item,
-.t-count-down--small.t-count-down--square > .t-count-down__item {
- width: 40rpx;
- height: 40rpx;
-}
-.t-count-down--small.t-count-down--round > .t-count-down__split--dot,
-.t-count-down--small.t-count-down--square > .t-count-down__split--dot {
- margin: 0 4rpx;
- font-size: var(--td-font-size-base, 28rpx);
- font-weight: 700;
-}
-.t-count-down--small.t-count-down--round > .t-count-down__split--text,
-.t-count-down--small.t-count-down--square > .t-count-down__split--text {
- margin: 0 8rpx;
- font-size: var(--td-font-size, 20rpx);
-}
-.t-count-down--medium.t-count-down--default {
- font-size: var(--td-font-size-m, 32rpx);
-}
-.t-count-down--medium.t-count-down--round > .t-count-down__item {
- font-size: var(--td-font-size-base, 28rpx);
-}
-.t-count-down--medium.t-count-down--square > .t-count-down__item {
- font-size: var(--td-font-size-base, 28rpx);
-}
-.t-count-down--medium.t-count-down--round > .t-count-down__item,
-.t-count-down--medium.t-count-down--square > .t-count-down__item {
- width: 48rpx;
- height: 48rpx;
-}
-.t-count-down--medium.t-count-down--round > .t-count-down__split--dot,
-.t-count-down--medium.t-count-down--square > .t-count-down__split--dot {
- margin: 0 6rpx;
- font-size: var(--td-font-size-m, 32rpx);
- font-weight: 700;
-}
-.t-count-down--medium.t-count-down--round > .t-count-down__split--text,
-.t-count-down--medium.t-count-down--square > .t-count-down__split--text {
- margin: 0 10rpx;
- font-size: var(--td-font-size-s, 24rpx);
-}
-.t-count-down--large.t-count-down--default {
- font-size: 36rpx;
-}
-.t-count-down--large.t-count-down--round > .t-count-down__item {
- font-size: var(--td-font-size-m, 32rpx);
-}
-.t-count-down--large.t-count-down--square > .t-count-down__item {
- font-size: var(--td-font-size-m, 32rpx);
-}
-.t-count-down--large.t-count-down--round > .t-count-down__item,
-.t-count-down--large.t-count-down--square > .t-count-down__item {
- width: 56rpx;
- height: 56rpx;
-}
-.t-count-down--large.t-count-down--round > .t-count-down__split--dot,
-.t-count-down--large.t-count-down--square > .t-count-down__split--dot {
- margin: 0 12rpx;
- font-size: 36rpx;
- font-weight: 700;
-}
-.t-count-down--large.t-count-down--round > .t-count-down__split--text,
-.t-count-down--large.t-count-down--square > .t-count-down__split--text {
- margin: 0 12rpx;
- font-size: var(--td-font-size-base, 28rpx);
-}
-.t-count-down {
- font-family: TCloudNumber, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Hiragino Sans GB, Microsoft YaHei UI, Microsoft YaHei, Source Han Sans CN, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
- display: flex;
-}
-.t-count-down .t-count-down__item,
-.t-count-down .t-count-down__split {
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.t-count-down--square > .t-count-down__split--dot,
-.t-count-down--round > .t-count-down__split--dot {
- color: var(--td-error-color-6, #d54941);
-}
-.t-count-down--square > .t-count-down__split--text,
-.t-count-down--round > .t-count-down__split--text {
- color: var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
-}
-.t-count-down--default {
- color: var(--td-countdown-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
-}
-.t-count-down--square {
- color: var(--td-countdown-round-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
-}
-.t-count-down--square > .t-count-down__item {
- border-radius: var(--td-countdown-square-border-radius, var(--td-radius-small, 6rpx));
- background: var(--td-countdown-bg-color, var(--td-error-color-6, #d54941));
-}
-.t-count-down--round {
- color: var(--td-countdown-round-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
-}
-.t-count-down--round > .t-count-down__item {
- border-radius: var(--td-countdown-round-border-radius, var(--td-radius-circle, 50%));
- background: var(--td-countdown-bg-color, var(--td-error-color-6, #d54941));
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/props.d.ts
deleted file mode 100644
index 8cab4af9..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdCountDownProps } from './type';
-declare const props: TdCountDownProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/props.js
deleted file mode 100644
index 3b67feaf..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/props.js
+++ /dev/null
@@ -1,36 +0,0 @@
-const props = {
- autoStart: {
- type: Boolean,
- value: true,
- },
- content: {
- type: String,
- value: 'default',
- },
- format: {
- type: String,
- value: 'HH:mm:ss',
- },
- millisecond: {
- type: Boolean,
- value: false,
- },
- size: {
- type: String,
- value: 'medium',
- },
- splitWithUnit: {
- type: Boolean,
- value: false,
- },
- theme: {
- type: String,
- value: 'default',
- },
- time: {
- type: Number,
- value: 0,
- required: true,
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/type.d.ts
deleted file mode 100644
index 2d362a66..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/type.d.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-export interface TdCountDownProps {
- autoStart?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- content?: {
- type: StringConstructor;
- value?: string;
- };
- format?: {
- type: StringConstructor;
- value?: string;
- };
- millisecond?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- size?: {
- type: StringConstructor;
- value?: 'small' | 'medium' | 'large';
- };
- splitWithUnit?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- theme?: {
- type: StringConstructor;
- value?: 'default' | 'round' | 'square';
- };
- time: {
- type: NumberConstructor;
- value?: number;
- required?: boolean;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/utils.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/utils.d.ts
deleted file mode 100644
index 18c1fac1..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/utils.d.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-export interface TimeData {
- DD: number;
- HH: number;
- mm: number;
- ss: number;
- SSS: number;
-}
-export declare const TimeDataUnit: {
- DD: string;
- HH: string;
- mm: string;
- ss: string;
- SSS: string;
-};
-export declare const parseTimeData: (time: number) => TimeData;
-export declare const isSameSecond: (time1: number, time2: number) => boolean;
-export declare type TTimeList = {
- digit: string;
- unit: string;
- match: string;
-}[];
-export declare const parseFormat: (time: number, format: string) => {
- timeText: string;
- timeList: TTimeList;
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/utils.js b/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/utils.js
deleted file mode 100644
index 4aa6dc31..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/count-down/utils.js
+++ /dev/null
@@ -1,61 +0,0 @@
-export const TimeDataUnit = {
- DD: '天',
- HH: '时',
- mm: '分',
- ss: '秒',
- SSS: '毫秒',
-};
-const SECOND = 1000;
-const MINUTE = 60 * SECOND;
-const HOUR = 60 * MINUTE;
-const DAY = 24 * HOUR;
-export const parseTimeData = function (time) {
- const days = Math.floor(time / DAY);
- const hours = Math.floor((time % DAY) / HOUR);
- const minutes = Math.floor((time % HOUR) / MINUTE);
- const seconds = Math.floor((time % MINUTE) / SECOND);
- const milliseconds = Math.floor(time % SECOND);
- return {
- DD: days,
- HH: hours,
- mm: minutes,
- ss: seconds,
- SSS: milliseconds,
- };
-};
-export const isSameSecond = function (time1, time2) {
- return Math.floor(time1 / 1000) === Math.floor(time2 / 1000);
-};
-export const parseFormat = function (time, format) {
- const obj = {
- 'D+': Math.floor(time / 86400000),
- 'H+': Math.floor((time % 86400000) / 3600000),
- 'm+': Math.floor((time % 3600000) / 60000),
- 's+': Math.floor((time % 60000) / 1000),
- 'S+': Math.floor(time % 1000),
- };
- const timeList = [];
- let timeText = format;
- Object.keys(obj).forEach((prop) => {
- if (new RegExp(`(${prop})`).test(timeText)) {
- timeText = timeText.replace(RegExp.$1, (match, offset, source) => {
- const v = `${obj[prop]}`;
- let digit = v;
- if (match.length > 1) {
- digit = (match.replace(new RegExp(match[0], 'g'), '0') + v).substr(v.length);
- }
- const unit = source.substr(offset + match.length);
- const last = timeList[timeList.length - 1];
- if (last) {
- const index = last.unit.indexOf(match);
- if (index !== -1) {
- last.unit = last.unit.substr(0, index);
- }
- }
- timeList.push({ digit, unit, match });
- return digit;
- });
- }
- });
- return { timeText, timeList };
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/icon/README.en-US.md
deleted file mode 100644
index b408f55c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/README.en-US.md
+++ /dev/null
@@ -1,26 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-
-### Icon Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-color | String | - | \- | N
-name | String | - | required | Y
-prefix | String | - | \- | N
-size | String / Number | - | \- | N
-
-### Icon Events
-
-name | params | description
--- | -- | --
-click | \- | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
-### Icon External Classes
-
-className | Description
--- | --
-t-class | \-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/icon/README.md
deleted file mode 100644
index c93e1f6e..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/README.md
+++ /dev/null
@@ -1,114 +0,0 @@
----
-title: Icon 图标
-description: 图标。
-spline: base
-isComponent: true
----
-
-


-
-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-icon": "tdesign-miniprogram/icon/icon"
-}
-```
-
-## 常见问题
-
-
-
- 控制台告警:Failed to load font
- 👇
-
-
- 告警属于开发者工具的 bug,可以忽略,具体可以看 官网文档
-
-
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-
-### 基础组件图标
-
-{{ base }}
-
-### 自定义组件图标
-
-{{ custom }}
-
-自定义图标用法,下面以 `iconfont` 为例
-
-#### 准备图标文件
-
-文件后缀应为`.wxss`,如下方代码块所示:
-
-```css
-@font-face {
- font-family: 'icon'; // 使用自定义的字体名称
- ···
-}
-
-.icon {
- font-family: 'icon' !important; // 字体名称
- ···
-}
-
-.icon-a-0:before { // icon 图标。注意 FontClass 前缀与 font-family 保持一致
- content: '\e64d';
-}
-```
-- 添加所需图标,下载图标。图标库一般会提供 **在线链接** 或者 **下载至本地** 等使用方式。**在线链接** 方式会指向一个 `.css` 文件,可以下载或复制其内容,将其修改成后缀名为 `.wxss` 的文件
-- 将 `.wxss` 文件中的 `FontClass/Symbol前缀` 与 `Font Family` 两项内容保持一致,如: `FontClass/Symbol` 前缀为 `icon-`,则 `Font Family` 为 `icon`。
-
-> 注:若是采用 `下载至本地` 方式,需关注 `.css` 和 `.ttf` 文件。由于微信小程序不支持处理 `ttf、woff、eot` 等文件,但支持 `base64`,所以需要将 `.ttf` 文件转换为 `base64` (可借助转换工具,如 [transfonter.org](https://transfonter.org/),会得到一个 `stylesheet.css` 文件),然后将 `.css` 文件中的 `@font-face {}` 内容替换为 `stylesheet.css` 中的 `base64` 内容,最后将 `.css` 文件修改后缀为 `.wxss`
-
-#### 引入自定义图标
-
-- 全局引入:在项目 `app.wxss`,使用 `@import` 引入上述的 `.wxss` 文件
-- 局部引入:在 `page` 对应的 `.wxss` 中,使用 `@import` 引入上述的 `.wxss` 文件
-
-#### 自定义图标的使用
-
- `` 组件中的 `prefix` 属性值与前面设置的 `Font Family` 保持一致,即 `prefix="icon"`,`name` 属性值为自定义图标名称,如图标的 `className` 为 `icon-a-1h`,则 `name="a-1h"`。
-
-### 图片链接
-
-{{ iconImage }}
-
-### 全部图标
-
-
-
-## API
-
-### Icon Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-color | String | - | 图标颜色 | N
-name | String | - | 必需。图标名称或图片链接 | Y
-prefix | String | - | 自定义图标前缀 | N
-size | String / Number | - | 图标大小, 如 `20`, `20px`, `48rpx`, 默认单位是 `px` | N
-
-### Icon Events
-
-名称 | 参数 | 描述
--- | -- | --
-click | \- | 点击图标时触发。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
-### Icon External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.d.ts
deleted file mode 100644
index 6ebff861..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.d.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class Icon extends SuperComponent {
- externalClasses: string[];
- properties: import("./type").TdIconProps;
- data: {
- componentPrefix: string;
- classPrefix: string;
- isImage: boolean;
- iconStyle: any;
- };
- observers: {
- 'name, color, size, style'(): void;
- };
- methods: {
- onTap(event: any): void;
- setIconStyle(): Promise;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.js b/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.js
deleted file mode 100644
index 935f9d40..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.js
+++ /dev/null
@@ -1,68 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { styles, addUnit, getRect } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-icon`;
-let Icon = class Icon extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`];
- this.properties = props;
- this.data = {
- componentPrefix: prefix,
- classPrefix: name,
- isImage: false,
- iconStyle: undefined,
- };
- this.observers = {
- 'name, color, size, style'() {
- this.setIconStyle();
- },
- };
- this.methods = {
- onTap(event) {
- this.triggerEvent('click', event.detail);
- },
- setIconStyle() {
- return __awaiter(this, void 0, void 0, function* () {
- const { name, color, size, classPrefix } = this.data;
- const isImage = name.indexOf('/') !== -1;
- const sizeValue = addUnit(size);
- const colorStyle = color ? { color: color } : {};
- const fontStyle = size ? { 'font-size': sizeValue } : {};
- const iconStyle = Object.assign(Object.assign({}, colorStyle), fontStyle);
- if (isImage) {
- const { height } = yield getRect(this, `.${classPrefix}`);
- const iconSize = sizeValue || addUnit(height);
- iconStyle.width = iconSize;
- iconStyle.height = iconSize;
- }
- this.setData({
- isImage,
- iconStyle: `${styles(iconStyle)}`,
- });
- });
- },
- };
- }
-};
-Icon = __decorate([
- wxComponent()
-], Icon);
-export default Icon;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.json b/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.json
deleted file mode 100644
index 4f0a3f08..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {}
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.wxml
deleted file mode 100644
index bfa4de83..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.wxml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.wxss
deleted file mode 100644
index c4beb9dd..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/icon.wxss
+++ /dev/null
@@ -1,3677 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-@font-face {
- font-family: t;
- src: url('https://tdesign.gtimg.com/icon/0.2.1/fonts/t.eot'), url('https://tdesign.gtimg.com/icon/0.2.1/fonts/t.eot?#iefix') format('ded-opentype'), url('https://tdesign.gtimg.com/icon/0.2.1/fonts/t.woff') format('woff'), url('https://tdesign.gtimg.com/icon/0.2.1/fonts/t.ttf') format('truetype'), url('https://tdesign.gtimg.com/icon/0.2.1/fonts/t.svg') format('svg');
- /* iOS 4.1- */
- font-weight: normal;
- font-style: normal;
-}
-.t-icon--image {
- width: 100%;
- height: 100%;
-}
-.t-icon__image {
- vertical-align: top;
- width: 100%;
- height: 100%;
-}
-.t-icon-base {
- font-style: normal;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
- line-height: 1;
- text-align: center;
- display: block;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-.t-icon {
- /* stylelint-disable-next-line declaration-no-important */
- font-family: t !important;
- /* prevent issues with browser extensions that change fonts */
-}
-.t-icon-activity:before {
- content: '\E001';
-}
-.t-icon-add-and-subtract:before {
- content: '\E002';
-}
-.t-icon-add-circle:before {
- content: '\E003';
-}
-.t-icon-add-rectangle:before {
- content: '\E004';
-}
-.t-icon-add:before {
- content: '\E005';
-}
-.t-icon-address-book:before {
- content: '\E006';
-}
-.t-icon-adjustment:before {
- content: '\E007';
-}
-.t-icon-airplay-wave:before {
- content: '\E008';
-}
-.t-icon-alarm-add:before {
- content: '\E009';
-}
-.t-icon-alarm-off:before {
- content: '\E00A';
-}
-.t-icon-alarm:before {
- content: '\E00B';
-}
-.t-icon-align-top:before {
- content: '\E00C';
-}
-.t-icon-align-vertical:before {
- content: '\E00D';
-}
-.t-icon-alpha:before {
- content: '\E00E';
-}
-.t-icon-analytics:before {
- content: '\E00F';
-}
-.t-icon-anchor:before {
- content: '\E010';
-}
-.t-icon-angry:before {
- content: '\E011';
-}
-.t-icon-animation-1:before {
- content: '\E012';
-}
-.t-icon-animation:before {
- content: '\E013';
-}
-.t-icon-anticlockwise:before {
- content: '\E014';
-}
-.t-icon-api:before {
- content: '\E015';
-}
-.t-icon-app:before {
- content: '\E016';
-}
-.t-icon-apple:before {
- content: '\E017';
-}
-.t-icon-application:before {
- content: '\E018';
-}
-.t-icon-architecture-hui-style:before {
- content: '\E019';
-}
-.t-icon-archway-1:before {
- content: '\E01A';
-}
-.t-icon-archway:before {
- content: '\E01B';
-}
-.t-icon-arrow-down-circle:before {
- content: '\E01C';
-}
-.t-icon-arrow-down-rectangle:before {
- content: '\E01D';
-}
-.t-icon-arrow-down:before {
- content: '\E01E';
-}
-.t-icon-arrow-left-circle:before {
- content: '\E01F';
-}
-.t-icon-arrow-left-down-circle:before {
- content: '\E020';
-}
-.t-icon-arrow-left-down:before {
- content: '\E021';
-}
-.t-icon-arrow-left-right-1:before {
- content: '\E022';
-}
-.t-icon-arrow-left-right-2:before {
- content: '\E023';
-}
-.t-icon-arrow-left-right-3:before {
- content: '\E024';
-}
-.t-icon-arrow-left-right-circle:before {
- content: '\E025';
-}
-.t-icon-arrow-left-up-circle:before {
- content: '\E026';
-}
-.t-icon-arrow-left-up:before {
- content: '\E027';
-}
-.t-icon-arrow-left:before {
- content: '\E028';
-}
-.t-icon-arrow-right-circle:before {
- content: '\E029';
-}
-.t-icon-arrow-right-down-circle:before {
- content: '\E02A';
-}
-.t-icon-arrow-right-down:before {
- content: '\E02B';
-}
-.t-icon-arrow-right-up-circle:before {
- content: '\E02C';
-}
-.t-icon-arrow-right-up:before {
- content: '\E02D';
-}
-.t-icon-arrow-right:before {
- content: '\E02E';
-}
-.t-icon-arrow-triangle-down-filled:before {
- content: '\E02F';
-}
-.t-icon-arrow-triangle-down:before {
- content: '\E030';
-}
-.t-icon-arrow-triangle-up-filled:before {
- content: '\E031';
-}
-.t-icon-arrow-triangle-up:before {
- content: '\E032';
-}
-.t-icon-arrow-up-circle:before {
- content: '\E033';
-}
-.t-icon-arrow-up-down-1:before {
- content: '\E034';
-}
-.t-icon-arrow-up-down-2:before {
- content: '\E035';
-}
-.t-icon-arrow-up-down-3:before {
- content: '\E036';
-}
-.t-icon-arrow-up-down-circle:before {
- content: '\E037';
-}
-.t-icon-arrow-up:before {
- content: '\E038';
-}
-.t-icon-artboard:before {
- content: '\E039';
-}
-.t-icon-article:before {
- content: '\E03A';
-}
-.t-icon-assignment-checked:before {
- content: '\E03B';
-}
-.t-icon-assignment-code:before {
- content: '\E03C';
-}
-.t-icon-assignment-error:before {
- content: '\E03D';
-}
-.t-icon-assignment-user:before {
- content: '\E03E';
-}
-.t-icon-assignment:before {
- content: '\E03F';
-}
-.t-icon-attach:before {
- content: '\E040';
-}
-.t-icon-attic-1:before {
- content: '\E041';
-}
-.t-icon-attic:before {
- content: '\E042';
-}
-.t-icon-audio:before {
- content: '\E043';
-}
-.t-icon-awkward:before {
- content: '\E044';
-}
-.t-icon-backtop-rectangle:before {
- content: '\E045';
-}
-.t-icon-backtop:before {
- content: '\E046';
-}
-.t-icon-backup:before {
- content: '\E047';
-}
-.t-icon-backward:before {
- content: '\E048';
-}
-.t-icon-bad-laugh:before {
- content: '\E049';
-}
-.t-icon-bamboo-shoot:before {
- content: '\E04A';
-}
-.t-icon-banana:before {
- content: '\E04B';
-}
-.t-icon-barbecue:before {
- content: '\E04C';
-}
-.t-icon-barcode-1:before {
- content: '\E04D';
-}
-.t-icon-barcode:before {
- content: '\E04E';
-}
-.t-icon-base-station:before {
- content: '\E04F';
-}
-.t-icon-battery-add:before {
- content: '\E050';
-}
-.t-icon-battery-charging:before {
- content: '\E051';
-}
-.t-icon-battery-low:before {
- content: '\E052';
-}
-.t-icon-battery:before {
- content: '\E053';
-}
-.t-icon-bean:before {
- content: '\E054';
-}
-.t-icon-beer:before {
- content: '\E055';
-}
-.t-icon-beta:before {
- content: '\E056';
-}
-.t-icon-bifurcate:before {
- content: '\E057';
-}
-.t-icon-bill:before {
- content: '\E058';
-}
-.t-icon-blockchain:before {
- content: '\E059';
-}
-.t-icon-bluetooth:before {
- content: '\E05A';
-}
-.t-icon-bone:before {
- content: '\E05B';
-}
-.t-icon-book-open:before {
- content: '\E05C';
-}
-.t-icon-book:before {
- content: '\E05D';
-}
-.t-icon-bookmark-add:before {
- content: '\E05E';
-}
-.t-icon-bookmark-checked:before {
- content: '\E05F';
-}
-.t-icon-bookmark-double:before {
- content: '\E060';
-}
-.t-icon-bookmark-minus:before {
- content: '\E061';
-}
-.t-icon-bookmark:before {
- content: '\E062';
-}
-.t-icon-braces:before {
- content: '\E063';
-}
-.t-icon-brackets:before {
- content: '\E064';
-}
-.t-icon-bread:before {
- content: '\E065';
-}
-.t-icon-bridge-1:before {
- content: '\E066';
-}
-.t-icon-bridge-2:before {
- content: '\E067';
-}
-.t-icon-bridge-3:before {
- content: '\E068';
-}
-.t-icon-bridge-4:before {
- content: '\E069';
-}
-.t-icon-bridge-5:before {
- content: '\E06A';
-}
-.t-icon-bridge-6:before {
- content: '\E06B';
-}
-.t-icon-bridge:before {
- content: '\E06C';
-}
-.t-icon-brightness-1:before {
- content: '\E06D';
-}
-.t-icon-brightness:before {
- content: '\E06E';
-}
-.t-icon-broccoli:before {
- content: '\E06F';
-}
-.t-icon-browse-gallery:before {
- content: '\E070';
-}
-.t-icon-browse-off:before {
- content: '\E071';
-}
-.t-icon-browse:before {
- content: '\E072';
-}
-.t-icon-brush:before {
- content: '\E073';
-}
-.t-icon-bug-report:before {
- content: '\E074';
-}
-.t-icon-bug:before {
- content: '\E075';
-}
-.t-icon-building-1:before {
- content: '\E076';
-}
-.t-icon-building-2:before {
- content: '\E077';
-}
-.t-icon-building-3:before {
- content: '\E078';
-}
-.t-icon-building-4:before {
- content: '\E079';
-}
-.t-icon-building-5:before {
- content: '\E07A';
-}
-.t-icon-building:before {
- content: '\E07B';
-}
-.t-icon-bulletpoint:before {
- content: '\E07C';
-}
-.t-icon-button:before {
- content: '\E07D';
-}
-.t-icon-cabbage:before {
- content: '\E07E';
-}
-.t-icon-cake:before {
- content: '\E07F';
-}
-.t-icon-calculation-1:before {
- content: '\E080';
-}
-.t-icon-calculation:before {
- content: '\E081';
-}
-.t-icon-calculator-1:before {
- content: '\E082';
-}
-.t-icon-calculator:before {
- content: '\E083';
-}
-.t-icon-calendar-1:before {
- content: '\E084';
-}
-.t-icon-calendar-2:before {
- content: '\E085';
-}
-.t-icon-calendar-edit:before {
- content: '\E086';
-}
-.t-icon-calendar-event:before {
- content: '\E087';
-}
-.t-icon-calendar:before {
- content: '\E088';
-}
-.t-icon-call-1:before {
- content: '\E089';
-}
-.t-icon-call-cancel:before {
- content: '\E08A';
-}
-.t-icon-call-forwarded:before {
- content: '\E08B';
-}
-.t-icon-call-incoming:before {
- content: '\E08C';
-}
-.t-icon-call-off:before {
- content: '\E08D';
-}
-.t-icon-call:before {
- content: '\E08E';
-}
-.t-icon-calm-1:before {
- content: '\E08F';
-}
-.t-icon-calm:before {
- content: '\E090';
-}
-.t-icon-camera-1:before {
- content: '\E091';
-}
-.t-icon-camera-2:before {
- content: '\E092';
-}
-.t-icon-camera-off:before {
- content: '\E093';
-}
-.t-icon-camera:before {
- content: '\E094';
-}
-.t-icon-candy:before {
- content: '\E095';
-}
-.t-icon-card:before {
- content: '\E096';
-}
-.t-icon-cardmembership:before {
- content: '\E097';
-}
-.t-icon-caret-down-small:before {
- content: '\E098';
-}
-.t-icon-caret-down:before {
- content: '\E099';
-}
-.t-icon-caret-left-small:before {
- content: '\E09A';
-}
-.t-icon-caret-left:before {
- content: '\E09B';
-}
-.t-icon-caret-right-small:before {
- content: '\E09C';
-}
-.t-icon-caret-right:before {
- content: '\E09D';
-}
-.t-icon-caret-up-small:before {
- content: '\E09E';
-}
-.t-icon-caret-up:before {
- content: '\E09F';
-}
-.t-icon-cart-add:before {
- content: '\E0A0';
-}
-.t-icon-cart:before {
- content: '\E0A1';
-}
-.t-icon-cast:before {
- content: '\E0A2';
-}
-.t-icon-castle-1:before {
- content: '\E0A3';
-}
-.t-icon-castle-2:before {
- content: '\E0A4';
-}
-.t-icon-castle-3:before {
- content: '\E0A5';
-}
-.t-icon-castle-4:before {
- content: '\E0A6';
-}
-.t-icon-castle-5:before {
- content: '\E0A7';
-}
-.t-icon-castle-6:before {
- content: '\E0A8';
-}
-.t-icon-castle-7:before {
- content: '\E0A9';
-}
-.t-icon-castle:before {
- content: '\E0AA';
-}
-.t-icon-cat:before {
- content: '\E0AB';
-}
-.t-icon-catalog:before {
- content: '\E0AC';
-}
-.t-icon-cd:before {
- content: '\E0AD';
-}
-.t-icon-celsius:before {
- content: '\E0AE';
-}
-.t-icon-center-focus-strong:before {
- content: '\E0AF';
-}
-.t-icon-centimeter:before {
- content: '\E0B0';
-}
-.t-icon-certificate-1:before {
- content: '\E0B1';
-}
-.t-icon-certificate:before {
- content: '\E0B2';
-}
-.t-icon-chart-3d:before {
- content: '\E0B3';
-}
-.t-icon-chart-add:before {
- content: '\E0B4';
-}
-.t-icon-chart-analytics:before {
- content: '\E0B5';
-}
-.t-icon-chart-area-multi:before {
- content: '\E0B6';
-}
-.t-icon-chart-area:before {
- content: '\E0B7';
-}
-.t-icon-chart-bar:before {
- content: '\E0B8';
-}
-.t-icon-chart-bubble:before {
- content: '\E0B9';
-}
-.t-icon-chart-column:before {
- content: '\E0BA';
-}
-.t-icon-chart-combo:before {
- content: '\E0BB';
-}
-.t-icon-chart-line-data-1:before {
- content: '\E0BC';
-}
-.t-icon-chart-line-data:before {
- content: '\E0BD';
-}
-.t-icon-chart-line-multi:before {
- content: '\E0BE';
-}
-.t-icon-chart-line:before {
- content: '\E0BF';
-}
-.t-icon-chart-maximum:before {
- content: '\E0C0';
-}
-.t-icon-chart-median:before {
- content: '\E0C1';
-}
-.t-icon-chart-minimum:before {
- content: '\E0C2';
-}
-.t-icon-chart-pie:before {
- content: '\E0C3';
-}
-.t-icon-chart-radar:before {
- content: '\E0C4';
-}
-.t-icon-chart-radial:before {
- content: '\E0C5';
-}
-.t-icon-chart-ring-1:before {
- content: '\E0C6';
-}
-.t-icon-chart-ring:before {
- content: '\E0C7';
-}
-.t-icon-chart-scatter:before {
- content: '\E0C8';
-}
-.t-icon-chart-stacked:before {
- content: '\E0C9';
-}
-.t-icon-chart:before {
- content: '\E0CA';
-}
-.t-icon-chat-add:before {
- content: '\E0CB';
-}
-.t-icon-chat-bubble-1:before {
- content: '\E0CC';
-}
-.t-icon-chat-bubble-add:before {
- content: '\E0CD';
-}
-.t-icon-chat-bubble-error:before {
- content: '\E0CE';
-}
-.t-icon-chat-bubble-help:before {
- content: '\E0CF';
-}
-.t-icon-chat-bubble-history:before {
- content: '\E0D0';
-}
-.t-icon-chat-bubble-locked:before {
- content: '\E0D1';
-}
-.t-icon-chat-bubble-smile:before {
- content: '\E0D2';
-}
-.t-icon-chat-bubble:before {
- content: '\E0D3';
-}
-.t-icon-chat-checked:before {
- content: '\E0D4';
-}
-.t-icon-chat-clear:before {
- content: '\E0D5';
-}
-.t-icon-chat-double:before {
- content: '\E0D6';
-}
-.t-icon-chat-error:before {
- content: '\E0D7';
-}
-.t-icon-chat-heart:before {
- content: '\E0D8';
-}
-.t-icon-chat-message:before {
- content: '\E0D9';
-}
-.t-icon-chat-off:before {
- content: '\E0DA';
-}
-.t-icon-chat-poll:before {
- content: '\E0DB';
-}
-.t-icon-chat-setting:before {
- content: '\E0DC';
-}
-.t-icon-chat:before {
- content: '\E0DD';
-}
-.t-icon-check-circle-filled:before {
- content: '\E0DE';
-}
-.t-icon-check-circle:before {
- content: '\E0DF';
-}
-.t-icon-check-double:before {
- content: '\E0E0';
-}
-.t-icon-check-rectangle-filled:before {
- content: '\E0E1';
-}
-.t-icon-check-rectangle:before {
- content: '\E0E2';
-}
-.t-icon-check:before {
- content: '\E0E3';
-}
-.t-icon-cheese:before {
- content: '\E0E4';
-}
-.t-icon-cherry:before {
- content: '\E0E5';
-}
-.t-icon-chevron-down-circle:before {
- content: '\E0E6';
-}
-.t-icon-chevron-down-double-s:before {
- content: '\E0E7';
-}
-.t-icon-chevron-down-double:before {
- content: '\E0E8';
-}
-.t-icon-chevron-down-rectangle:before {
- content: '\E0E9';
-}
-.t-icon-chevron-down-s:before {
- content: '\E0EA';
-}
-.t-icon-chevron-down:before {
- content: '\E0EB';
-}
-.t-icon-chevron-left-circle:before {
- content: '\E0EC';
-}
-.t-icon-chevron-left-double-s:before {
- content: '\E0ED';
-}
-.t-icon-chevron-left-double:before {
- content: '\E0EE';
-}
-.t-icon-chevron-left-rectangle:before {
- content: '\E0EF';
-}
-.t-icon-chevron-left-s:before {
- content: '\E0F0';
-}
-.t-icon-chevron-left:before {
- content: '\E0F1';
-}
-.t-icon-chevron-right-circle:before {
- content: '\E0F2';
-}
-.t-icon-chevron-right-double-s:before {
- content: '\E0F3';
-}
-.t-icon-chevron-right-double:before {
- content: '\E0F4';
-}
-.t-icon-chevron-right-rectangle:before {
- content: '\E0F5';
-}
-.t-icon-chevron-right-s:before {
- content: '\E0F6';
-}
-.t-icon-chevron-right:before {
- content: '\E0F7';
-}
-.t-icon-chevron-up-circle:before {
- content: '\E0F8';
-}
-.t-icon-chevron-up-double-s:before {
- content: '\E0F9';
-}
-.t-icon-chevron-up-double:before {
- content: '\E0FA';
-}
-.t-icon-chevron-up-rectangle:before {
- content: '\E0FB';
-}
-.t-icon-chevron-up-s:before {
- content: '\E0FC';
-}
-.t-icon-chevron-up:before {
- content: '\E0FD';
-}
-.t-icon-chicken:before {
- content: '\E0FE';
-}
-.t-icon-chili:before {
- content: '\E0FF';
-}
-.t-icon-chimney-1:before {
- content: '\E100';
-}
-.t-icon-chimney-2:before {
- content: '\E101';
-}
-.t-icon-chimney:before {
- content: '\E102';
-}
-.t-icon-chinese-cabbage:before {
- content: '\E103';
-}
-.t-icon-church:before {
- content: '\E104';
-}
-.t-icon-circle:before {
- content: '\E105';
-}
-.t-icon-city-1:before {
- content: '\E106';
-}
-.t-icon-city-10:before {
- content: '\E107';
-}
-.t-icon-city-11:before {
- content: '\E108';
-}
-.t-icon-city-12:before {
- content: '\E109';
-}
-.t-icon-city-13:before {
- content: '\E10A';
-}
-.t-icon-city-14:before {
- content: '\E10B';
-}
-.t-icon-city-15:before {
- content: '\E10C';
-}
-.t-icon-city-2:before {
- content: '\E10D';
-}
-.t-icon-city-3:before {
- content: '\E10E';
-}
-.t-icon-city-4:before {
- content: '\E10F';
-}
-.t-icon-city-5:before {
- content: '\E110';
-}
-.t-icon-city-6:before {
- content: '\E111';
-}
-.t-icon-city-7:before {
- content: '\E112';
-}
-.t-icon-city-8:before {
- content: '\E113';
-}
-.t-icon-city-9:before {
- content: '\E114';
-}
-.t-icon-city-ancient-1:before {
- content: '\E115';
-}
-.t-icon-city-ancient-2:before {
- content: '\E116';
-}
-.t-icon-city-ancient:before {
- content: '\E117';
-}
-.t-icon-city:before {
- content: '\E118';
-}
-.t-icon-clear-formatting-1:before {
- content: '\E119';
-}
-.t-icon-clear-formatting:before {
- content: '\E11A';
-}
-.t-icon-clear:before {
- content: '\E11B';
-}
-.t-icon-close-circle-filled:before {
- content: '\E11C';
-}
-.t-icon-close-circle:before {
- content: '\E11D';
-}
-.t-icon-close-octagon:before {
- content: '\E11E';
-}
-.t-icon-close-rectangle:before {
- content: '\E11F';
-}
-.t-icon-close:before {
- content: '\E120';
-}
-.t-icon-cloud-download:before {
- content: '\E121';
-}
-.t-icon-cloud-upload:before {
- content: '\E122';
-}
-.t-icon-cloud:before {
- content: '\E123';
-}
-.t-icon-cloudy-day:before {
- content: '\E124';
-}
-.t-icon-cloudy-night-rain:before {
- content: '\E125';
-}
-.t-icon-cloudy-night:before {
- content: '\E126';
-}
-.t-icon-cloudy-rain:before {
- content: '\E127';
-}
-.t-icon-cloudy-sunny:before {
- content: '\E128';
-}
-.t-icon-code-1:before {
- content: '\E129';
-}
-.t-icon-code-off:before {
- content: '\E12A';
-}
-.t-icon-code:before {
- content: '\E12B';
-}
-.t-icon-cola:before {
- content: '\E12C';
-}
-.t-icon-collage:before {
- content: '\E12D';
-}
-.t-icon-collection:before {
- content: '\E12E';
-}
-.t-icon-color-invert:before {
- content: '\E12F';
-}
-.t-icon-combination:before {
- content: '\E130';
-}
-.t-icon-command:before {
- content: '\E131';
-}
-.t-icon-compass-1:before {
- content: '\E132';
-}
-.t-icon-compass:before {
- content: '\E133';
-}
-.t-icon-component-breadcrumb:before {
- content: '\E134';
-}
-.t-icon-component-checkbox:before {
- content: '\E135';
-}
-.t-icon-component-divider-horizontal:before {
- content: '\E136';
-}
-.t-icon-component-divider-vertical:before {
- content: '\E137';
-}
-.t-icon-component-dropdown:before {
- content: '\E138';
-}
-.t-icon-component-grid:before {
- content: '\E139';
-}
-.t-icon-component-input:before {
- content: '\E13A';
-}
-.t-icon-component-layout:before {
- content: '\E13B';
-}
-.t-icon-component-radio:before {
- content: '\E13C';
-}
-.t-icon-component-space:before {
- content: '\E13D';
-}
-.t-icon-component-steps:before {
- content: '\E13E';
-}
-.t-icon-component-switch:before {
- content: '\E13F';
-}
-.t-icon-constraint:before {
- content: '\E140';
-}
-.t-icon-contrast-1:before {
- content: '\E141';
-}
-.t-icon-contrast:before {
- content: '\E142';
-}
-.t-icon-control-platform:before {
- content: '\E143';
-}
-.t-icon-cooperate:before {
- content: '\E144';
-}
-.t-icon-coordinate-system:before {
- content: '\E145';
-}
-.t-icon-copy:before {
- content: '\E146';
-}
-.t-icon-copyright:before {
- content: '\E147';
-}
-.t-icon-corn:before {
- content: '\E148';
-}
-.t-icon-coupon:before {
- content: '\E149';
-}
-.t-icon-course:before {
- content: '\E14A';
-}
-.t-icon-cpu:before {
- content: '\E14B';
-}
-.t-icon-crack:before {
- content: '\E14C';
-}
-.t-icon-creditcard-add:before {
- content: '\E14D';
-}
-.t-icon-creditcard-off:before {
- content: '\E14E';
-}
-.t-icon-creditcard:before {
- content: '\E14F';
-}
-.t-icon-crooked-smile:before {
- content: '\E150';
-}
-.t-icon-cry-and-laugh:before {
- content: '\E151';
-}
-.t-icon-cry-loudly:before {
- content: '\E152';
-}
-.t-icon-css3:before {
- content: '\E153';
-}
-.t-icon-cucumber:before {
- content: '\E154';
-}
-.t-icon-currency-exchange:before {
- content: '\E155';
-}
-.t-icon-cursor:before {
- content: '\E156';
-}
-.t-icon-curtain:before {
- content: '\E157';
-}
-.t-icon-curve:before {
- content: '\E158';
-}
-.t-icon-cut-1:before {
- content: '\E159';
-}
-.t-icon-cut:before {
- content: '\E15A';
-}
-.t-icon-dam-1:before {
- content: '\E15B';
-}
-.t-icon-dam-2:before {
- content: '\E15C';
-}
-.t-icon-dam-3:before {
- content: '\E15D';
-}
-.t-icon-dam-4:before {
- content: '\E15E';
-}
-.t-icon-dam-5:before {
- content: '\E15F';
-}
-.t-icon-dam-6:before {
- content: '\E160';
-}
-.t-icon-dam-7:before {
- content: '\E161';
-}
-.t-icon-dam:before {
- content: '\E162';
-}
-.t-icon-dart-board:before {
- content: '\E163';
-}
-.t-icon-dashboard-1:before {
- content: '\E164';
-}
-.t-icon-dashboard:before {
- content: '\E165';
-}
-.t-icon-data-base:before {
- content: '\E166';
-}
-.t-icon-data-checked:before {
- content: '\E167';
-}
-.t-icon-data-display:before {
- content: '\E168';
-}
-.t-icon-data-error:before {
- content: '\E169';
-}
-.t-icon-data-search:before {
- content: '\E16A';
-}
-.t-icon-data:before {
- content: '\E16B';
-}
-.t-icon-delete-1:before {
- content: '\E16C';
-}
-.t-icon-delete-time:before {
- content: '\E16D';
-}
-.t-icon-delete:before {
- content: '\E16E';
-}
-.t-icon-delta:before {
- content: '\E16F';
-}
-.t-icon-depressed:before {
- content: '\E170';
-}
-.t-icon-desktop-1:before {
- content: '\E171';
-}
-.t-icon-desktop:before {
- content: '\E172';
-}
-.t-icon-despise:before {
- content: '\E173';
-}
-.t-icon-device:before {
- content: '\E174';
-}
-.t-icon-discount-filled:before {
- content: '\E175';
-}
-.t-icon-discount:before {
- content: '\E176';
-}
-.t-icon-dissatisfaction:before {
- content: '\E177';
-}
-.t-icon-divide:before {
- content: '\E178';
-}
-.t-icon-dividers-1:before {
- content: '\E179';
-}
-.t-icon-dividers:before {
- content: '\E17A';
-}
-.t-icon-doge:before {
- content: '\E17B';
-}
-.t-icon-double-storey:before {
- content: '\E17C';
-}
-.t-icon-download-1:before {
- content: '\E17D';
-}
-.t-icon-download:before {
- content: '\E17E';
-}
-.t-icon-downscale:before {
- content: '\E17F';
-}
-.t-icon-drag-drop:before {
- content: '\E180';
-}
-.t-icon-drag-move:before {
- content: '\E181';
-}
-.t-icon-drink:before {
- content: '\E182';
-}
-.t-icon-drumstick:before {
- content: '\E183';
-}
-.t-icon-dv:before {
- content: '\E184';
-}
-.t-icon-dvd:before {
- content: '\E185';
-}
-.t-icon-earphone:before {
- content: '\E186';
-}
-.t-icon-earth:before {
- content: '\E187';
-}
-.t-icon-edit-1:before {
- content: '\E188';
-}
-.t-icon-edit-2:before {
- content: '\E189';
-}
-.t-icon-edit-off:before {
- content: '\E18A';
-}
-.t-icon-edit:before {
- content: '\E18B';
-}
-.t-icon-education:before {
- content: '\E18C';
-}
-.t-icon-eggplant:before {
- content: '\E18D';
-}
-.t-icon-ellipsis:before {
- content: '\E18E';
-}
-.t-icon-emo-emotional:before {
- content: '\E18F';
-}
-.t-icon-enter:before {
- content: '\E190';
-}
-.t-icon-equal:before {
- content: '\E191';
-}
-.t-icon-error-circle-filled:before {
- content: '\E192';
-}
-.t-icon-error-circle:before {
- content: '\E193';
-}
-.t-icon-error-triangle:before {
- content: '\E194';
-}
-.t-icon-error:before {
- content: '\E195';
-}
-.t-icon-excited-1:before {
- content: '\E196';
-}
-.t-icon-excited:before {
- content: '\E197';
-}
-.t-icon-expand-horizontal:before {
- content: '\E198';
-}
-.t-icon-expand-vertical:before {
- content: '\E199';
-}
-.t-icon-explore-off:before {
- content: '\E19A';
-}
-.t-icon-explore:before {
- content: '\E19B';
-}
-.t-icon-exposure:before {
- content: '\E19C';
-}
-.t-icon-extension-off:before {
- content: '\E19D';
-}
-.t-icon-extension:before {
- content: '\E19E';
-}
-.t-icon-face-retouching:before {
- content: '\E19F';
-}
-.t-icon-fact-check:before {
- content: '\E1A0';
-}
-.t-icon-fahrenheit-scale:before {
- content: '\E1A1';
-}
-.t-icon-feel-at-ease:before {
- content: '\E1A2';
-}
-.t-icon-ferocious:before {
- content: '\E1A3';
-}
-.t-icon-ferris-wheel:before {
- content: '\E1A4';
-}
-.t-icon-file-1:before {
- content: '\E1A5';
-}
-.t-icon-file-add-1:before {
- content: '\E1A6';
-}
-.t-icon-file-add:before {
- content: '\E1A7';
-}
-.t-icon-file-attachment:before {
- content: '\E1A8';
-}
-.t-icon-file-blocked:before {
- content: '\E1A9';
-}
-.t-icon-file-code-1:before {
- content: '\E1AA';
-}
-.t-icon-file-code:before {
- content: '\E1AB';
-}
-.t-icon-file-copy:before {
- content: '\E1AC';
-}
-.t-icon-file-download:before {
- content: '\E1AD';
-}
-.t-icon-file-excel:before {
- content: '\E1AE';
-}
-.t-icon-file-export:before {
- content: '\E1AF';
-}
-.t-icon-file-icon:before {
- content: '\E1B0';
-}
-.t-icon-file-image:before {
- content: '\E1B1';
-}
-.t-icon-file-import:before {
- content: '\E1B2';
-}
-.t-icon-file-locked:before {
- content: '\E1B3';
-}
-.t-icon-file-minus:before {
- content: '\E1B4';
-}
-.t-icon-file-music:before {
- content: '\E1B5';
-}
-.t-icon-file-onenote:before {
- content: '\E1B6';
-}
-.t-icon-file-outlook:before {
- content: '\E1B7';
-}
-.t-icon-file-paste:before {
- content: '\E1B8';
-}
-.t-icon-file-pdf:before {
- content: '\E1B9';
-}
-.t-icon-file-powerpoint:before {
- content: '\E1BA';
-}
-.t-icon-file-restore:before {
- content: '\E1BB';
-}
-.t-icon-file-safety:before {
- content: '\E1BC';
-}
-.t-icon-file-search:before {
- content: '\E1BD';
-}
-.t-icon-file-setting:before {
- content: '\E1BE';
-}
-.t-icon-file-teams:before {
- content: '\E1BF';
-}
-.t-icon-file-unknown:before {
- content: '\E1C0';
-}
-.t-icon-file-unlocked:before {
- content: '\E1C1';
-}
-.t-icon-file-word:before {
- content: '\E1C2';
-}
-.t-icon-file-zip:before {
- content: '\E1C3';
-}
-.t-icon-file:before {
- content: '\E1C4';
-}
-.t-icon-fill-color-1:before {
- content: '\E1C5';
-}
-.t-icon-fill-color:before {
- content: '\E1C6';
-}
-.t-icon-film-1:before {
- content: '\E1C7';
-}
-.t-icon-film:before {
- content: '\E1C8';
-}
-.t-icon-filter-1:before {
- content: '\E1C9';
-}
-.t-icon-filter-2:before {
- content: '\E1CA';
-}
-.t-icon-filter-3:before {
- content: '\E1CB';
-}
-.t-icon-filter-clear:before {
- content: '\E1CC';
-}
-.t-icon-filter-off:before {
- content: '\E1CD';
-}
-.t-icon-filter:before {
- content: '\E1CE';
-}
-.t-icon-fingerprint-1:before {
- content: '\E1CF';
-}
-.t-icon-fingerprint-2:before {
- content: '\E1D0';
-}
-.t-icon-fingerprint-3:before {
- content: '\E1D1';
-}
-.t-icon-fingerprint:before {
- content: '\E1D2';
-}
-.t-icon-fish:before {
- content: '\E1D3';
-}
-.t-icon-flag-1:before {
- content: '\E1D4';
-}
-.t-icon-flag-2:before {
- content: '\E1D5';
-}
-.t-icon-flag-3:before {
- content: '\E1D6';
-}
-.t-icon-flag-4:before {
- content: '\E1D7';
-}
-.t-icon-flag:before {
- content: '\E1D8';
-}
-.t-icon-flashlight:before {
- content: '\E1D9';
-}
-.t-icon-flight-landing:before {
- content: '\E1DA';
-}
-.t-icon-flight-takeoff:before {
- content: '\E1DB';
-}
-.t-icon-flip-smiling-face:before {
- content: '\E1DC';
-}
-.t-icon-flip-to-back:before {
- content: '\E1DD';
-}
-.t-icon-flip-to-front:before {
- content: '\E1DE';
-}
-.t-icon-focus:before {
- content: '\E1DF';
-}
-.t-icon-fog-night:before {
- content: '\E1E0';
-}
-.t-icon-fog-sunny:before {
- content: '\E1E1';
-}
-.t-icon-fog:before {
- content: '\E1E2';
-}
-.t-icon-folder-1:before {
- content: '\E1E3';
-}
-.t-icon-folder-add-1:before {
- content: '\E1E4';
-}
-.t-icon-folder-add:before {
- content: '\E1E5';
-}
-.t-icon-folder-blocked:before {
- content: '\E1E6';
-}
-.t-icon-folder-details:before {
- content: '\E1E7';
-}
-.t-icon-folder-export:before {
- content: '\E1E8';
-}
-.t-icon-folder-import:before {
- content: '\E1E9';
-}
-.t-icon-folder-locked:before {
- content: '\E1EA';
-}
-.t-icon-folder-minus:before {
- content: '\E1EB';
-}
-.t-icon-folder-move:before {
- content: '\E1EC';
-}
-.t-icon-folder-off:before {
- content: '\E1ED';
-}
-.t-icon-folder-open-1:before {
- content: '\E1EE';
-}
-.t-icon-folder-open:before {
- content: '\E1EF';
-}
-.t-icon-folder-search:before {
- content: '\E1F0';
-}
-.t-icon-folder-setting:before {
- content: '\E1F1';
-}
-.t-icon-folder-shared:before {
- content: '\E1F2';
-}
-.t-icon-folder-unlocked:before {
- content: '\E1F3';
-}
-.t-icon-folder-zip:before {
- content: '\E1F4';
-}
-.t-icon-folder:before {
- content: '\E1F5';
-}
-.t-icon-forest:before {
- content: '\E1F6';
-}
-.t-icon-fork:before {
- content: '\E1F7';
-}
-.t-icon-form:before {
- content: '\E1F8';
-}
-.t-icon-format-horizontal-align-bottom:before {
- content: '\E1F9';
-}
-.t-icon-format-horizontal-align-center:before {
- content: '\E1FA';
-}
-.t-icon-format-horizontal-align-top:before {
- content: '\E1FB';
-}
-.t-icon-format-vertical-align-center:before {
- content: '\E1FC';
-}
-.t-icon-format-vertical-align-left:before {
- content: '\E1FD';
-}
-.t-icon-format-vertical-align-right:before {
- content: '\E1FE';
-}
-.t-icon-forward:before {
- content: '\E1FF';
-}
-.t-icon-frame-1:before {
- content: '\E200';
-}
-.t-icon-frame:before {
- content: '\E201';
-}
-.t-icon-fries:before {
- content: '\E202';
-}
-.t-icon-fullscreen-1:before {
- content: '\E203';
-}
-.t-icon-fullscreen-2:before {
- content: '\E204';
-}
-.t-icon-fullscreen-exit-1:before {
- content: '\E205';
-}
-.t-icon-fullscreen-exit:before {
- content: '\E206';
-}
-.t-icon-fullscreen:before {
- content: '\E207';
-}
-.t-icon-function-curve:before {
- content: '\E208';
-}
-.t-icon-functions-1:before {
- content: '\E209';
-}
-.t-icon-functions:before {
- content: '\E20A';
-}
-.t-icon-gamepad-1:before {
- content: '\E20B';
-}
-.t-icon-gamepad:before {
- content: '\E20C';
-}
-.t-icon-gamma:before {
- content: '\E20D';
-}
-.t-icon-garlic:before {
- content: '\E20E';
-}
-.t-icon-gender-female:before {
- content: '\E20F';
-}
-.t-icon-gender-male:before {
- content: '\E210';
-}
-.t-icon-gesture-applause:before {
- content: '\E211';
-}
-.t-icon-gesture-click:before {
- content: '\E212';
-}
-.t-icon-gesture-down:before {
- content: '\E213';
-}
-.t-icon-gesture-expansion:before {
- content: '\E214';
-}
-.t-icon-gesture-left-slip:before {
- content: '\E215';
-}
-.t-icon-gesture-left:before {
- content: '\E216';
-}
-.t-icon-gesture-pray-1:before {
- content: '\E217';
-}
-.t-icon-gesture-pray:before {
- content: '\E218';
-}
-.t-icon-gesture-press:before {
- content: '\E219';
-}
-.t-icon-gesture-ranslation-1:before {
- content: '\E21A';
-}
-.t-icon-gesture-ranslation:before {
- content: '\E21B';
-}
-.t-icon-gesture-right-slip:before {
- content: '\E21C';
-}
-.t-icon-gesture-right:before {
- content: '\E21D';
-}
-.t-icon-gesture-slide-up:before {
- content: '\E21E';
-}
-.t-icon-gesture-up-1:before {
- content: '\E21F';
-}
-.t-icon-gesture-up-2:before {
- content: '\E220';
-}
-.t-icon-gesture-up-and-down:before {
- content: '\E221';
-}
-.t-icon-gesture-up:before {
- content: '\E222';
-}
-.t-icon-gesture-wipe-down:before {
- content: '\E223';
-}
-.t-icon-gift:before {
- content: '\E224';
-}
-.t-icon-giggle:before {
- content: '\E225';
-}
-.t-icon-git-branch:before {
- content: '\E226';
-}
-.t-icon-git-commit:before {
- content: '\E227';
-}
-.t-icon-git-merge:before {
- content: '\E228';
-}
-.t-icon-git-pull-request:before {
- content: '\E229';
-}
-.t-icon-git-repository-commits:before {
- content: '\E22A';
-}
-.t-icon-git-repository-private:before {
- content: '\E22B';
-}
-.t-icon-git-repository:before {
- content: '\E22C';
-}
-.t-icon-gps:before {
- content: '\E22D';
-}
-.t-icon-grape:before {
- content: '\E22E';
-}
-.t-icon-greater-than-or-equal:before {
- content: '\E22F';
-}
-.t-icon-greater-than:before {
- content: '\E230';
-}
-.t-icon-green-onion:before {
- content: '\E231';
-}
-.t-icon-grid-add:before {
- content: '\E232';
-}
-.t-icon-grid-view:before {
- content: '\E233';
-}
-.t-icon-guitar:before {
- content: '\E234';
-}
-.t-icon-hamburger:before {
- content: '\E235';
-}
-.t-icon-happy:before {
- content: '\E236';
-}
-.t-icon-hard-disk-storage:before {
- content: '\E237';
-}
-.t-icon-hard-drive:before {
- content: '\E238';
-}
-.t-icon-hashtag:before {
- content: '\E239';
-}
-.t-icon-hd:before {
- content: '\E23A';
-}
-.t-icon-heart-filled:before {
- content: '\E23B';
-}
-.t-icon-heart:before {
- content: '\E23C';
-}
-.t-icon-help-circle-filled:before {
- content: '\E23D';
-}
-.t-icon-help-circle:before {
- content: '\E23E';
-}
-.t-icon-help-rectangle:before {
- content: '\E23F';
-}
-.t-icon-help:before {
- content: '\E240';
-}
-.t-icon-highlight-1:before {
- content: '\E241';
-}
-.t-icon-highlight:before {
- content: '\E242';
-}
-.t-icon-history-setting:before {
- content: '\E243';
-}
-.t-icon-history:before {
- content: '\E244';
-}
-.t-icon-home:before {
- content: '\E245';
-}
-.t-icon-hospital-1:before {
- content: '\E246';
-}
-.t-icon-hospital:before {
- content: '\E247';
-}
-.t-icon-hotspot-wave:before {
- content: '\E248';
-}
-.t-icon-hourglass:before {
- content: '\E249';
-}
-.t-icon-houses-1:before {
- content: '\E24A';
-}
-.t-icon-houses-2:before {
- content: '\E24B';
-}
-.t-icon-houses:before {
- content: '\E24C';
-}
-.t-icon-html5:before {
- content: '\E24D';
-}
-.t-icon-https:before {
- content: '\E24E';
-}
-.t-icon-ice-cream:before {
- content: '\E24F';
-}
-.t-icon-icon:before {
- content: '\E250';
-}
-.t-icon-image-1:before {
- content: '\E251';
-}
-.t-icon-image-add:before {
- content: '\E252';
-}
-.t-icon-image-edit:before {
- content: '\E253';
-}
-.t-icon-image-error:before {
- content: '\E254';
-}
-.t-icon-image-off:before {
- content: '\E255';
-}
-.t-icon-image-search:before {
- content: '\E256';
-}
-.t-icon-image:before {
- content: '\E257';
-}
-.t-icon-indent-left:before {
- content: '\E258';
-}
-.t-icon-indent-right:before {
- content: '\E259';
-}
-.t-icon-indicator:before {
- content: '\E25A';
-}
-.t-icon-info-circle-filled:before {
- content: '\E25B';
-}
-.t-icon-info-circle:before {
- content: '\E25C';
-}
-.t-icon-ink:before {
- content: '\E25D';
-}
-.t-icon-install-desktop:before {
- content: '\E25E';
-}
-.t-icon-install-mobile:before {
- content: '\E25F';
-}
-.t-icon-install:before {
- content: '\E260';
-}
-.t-icon-institution-checked:before {
- content: '\E261';
-}
-.t-icon-institution:before {
- content: '\E262';
-}
-.t-icon-internet:before {
- content: '\E263';
-}
-.t-icon-ipod:before {
- content: '\E264';
-}
-.t-icon-joyful:before {
- content: '\E265';
-}
-.t-icon-jump-off:before {
- content: '\E266';
-}
-.t-icon-jump:before {
- content: '\E267';
-}
-.t-icon-keyboard:before {
- content: '\E268';
-}
-.t-icon-laptop:before {
- content: '\E269';
-}
-.t-icon-layers:before {
- content: '\E26A';
-}
-.t-icon-layout:before {
- content: '\E26B';
-}
-.t-icon-leaderboard:before {
- content: '\E26C';
-}
-.t-icon-lemon-slice:before {
- content: '\E26D';
-}
-.t-icon-lemon:before {
- content: '\E26E';
-}
-.t-icon-less-than-or-equal:before {
- content: '\E26F';
-}
-.t-icon-less-than:before {
- content: '\E270';
-}
-.t-icon-letters-a:before {
- content: '\E271';
-}
-.t-icon-letters-b:before {
- content: '\E272';
-}
-.t-icon-letters-c:before {
- content: '\E273';
-}
-.t-icon-letters-d:before {
- content: '\E274';
-}
-.t-icon-letters-e:before {
- content: '\E275';
-}
-.t-icon-letters-f:before {
- content: '\E276';
-}
-.t-icon-letters-g:before {
- content: '\E277';
-}
-.t-icon-letters-h:before {
- content: '\E278';
-}
-.t-icon-letters-i:before {
- content: '\E279';
-}
-.t-icon-letters-j:before {
- content: '\E27A';
-}
-.t-icon-letters-k:before {
- content: '\E27B';
-}
-.t-icon-letters-l:before {
- content: '\E27C';
-}
-.t-icon-letters-m:before {
- content: '\E27D';
-}
-.t-icon-letters-n:before {
- content: '\E27E';
-}
-.t-icon-letters-o:before {
- content: '\E27F';
-}
-.t-icon-letters-p:before {
- content: '\E280';
-}
-.t-icon-letters-q:before {
- content: '\E281';
-}
-.t-icon-letters-r:before {
- content: '\E282';
-}
-.t-icon-letters-s:before {
- content: '\E283';
-}
-.t-icon-letters-t:before {
- content: '\E284';
-}
-.t-icon-letters-u:before {
- content: '\E285';
-}
-.t-icon-letters-v:before {
- content: '\E286';
-}
-.t-icon-letters-w:before {
- content: '\E287';
-}
-.t-icon-letters-x:before {
- content: '\E288';
-}
-.t-icon-letters-y:before {
- content: '\E289';
-}
-.t-icon-letters-z:before {
- content: '\E28A';
-}
-.t-icon-lightbulb-circle:before {
- content: '\E28B';
-}
-.t-icon-lightbulb:before {
- content: '\E28C';
-}
-.t-icon-lighthouse-1:before {
- content: '\E28D';
-}
-.t-icon-lighthouse-2:before {
- content: '\E28E';
-}
-.t-icon-lighthouse:before {
- content: '\E28F';
-}
-.t-icon-lighting-circle:before {
- content: '\E290';
-}
-.t-icon-line-height:before {
- content: '\E291';
-}
-.t-icon-link-1:before {
- content: '\E292';
-}
-.t-icon-link-unlink:before {
- content: '\E293';
-}
-.t-icon-link:before {
- content: '\E294';
-}
-.t-icon-liquor:before {
- content: '\E295';
-}
-.t-icon-list-numbered:before {
- content: '\E296';
-}
-.t-icon-list:before {
- content: '\E297';
-}
-.t-icon-load:before {
- content: '\E298';
-}
-.t-icon-loading:before {
- content: '\E299';
-}
-.t-icon-location-1:before {
- content: '\E29A';
-}
-.t-icon-location-enlargement:before {
- content: '\E29B';
-}
-.t-icon-location-error:before {
- content: '\E29C';
-}
-.t-icon-location-parking-place:before {
- content: '\E29D';
-}
-.t-icon-location-reduction:before {
- content: '\E29E';
-}
-.t-icon-location-setting:before {
- content: '\E29F';
-}
-.t-icon-location:before {
- content: '\E2A0';
-}
-.t-icon-lock-off-filled:before {
- content: '\E2A1';
-}
-.t-icon-lock-off:before {
- content: '\E2A2';
-}
-.t-icon-lock-on-filled:before {
- content: '\E2A3';
-}
-.t-icon-lock-on:before {
- content: '\E2A4';
-}
-.t-icon-lock-time:before {
- content: '\E2A5';
-}
-.t-icon-login:before {
- content: '\E2A6';
-}
-.t-icon-logo-adobe-illustrate:before {
- content: '\E2A7';
-}
-.t-icon-logo-adobe-photoshop-1:before {
- content: '\E2A8';
-}
-.t-icon-logo-adobe-photoshop:before {
- content: '\E2A9';
-}
-.t-icon-logo-android:before {
- content: '\E2AA';
-}
-.t-icon-logo-apple-filled:before {
- content: '\E2AB';
-}
-.t-icon-logo-apple:before {
- content: '\E2AC';
-}
-.t-icon-logo-behance:before {
- content: '\E2AD';
-}
-.t-icon-logo-chrome-filled:before {
- content: '\E2AE';
-}
-.t-icon-logo-chrome:before {
- content: '\E2AF';
-}
-.t-icon-logo-cinema4d:before {
- content: '\E2B0';
-}
-.t-icon-logo-codepen:before {
- content: '\E2B1';
-}
-.t-icon-logo-codesandbox:before {
- content: '\E2B2';
-}
-.t-icon-logo-dribbble:before {
- content: '\E2B3';
-}
-.t-icon-logo-facebook:before {
- content: '\E2B4';
-}
-.t-icon-logo-figma:before {
- content: '\E2B5';
-}
-.t-icon-logo-framer:before {
- content: '\E2B6';
-}
-.t-icon-logo-github-filled:before {
- content: '\E2B7';
-}
-.t-icon-logo-github:before {
- content: '\E2B8';
-}
-.t-icon-logo-gitlab:before {
- content: '\E2B9';
-}
-.t-icon-logo-ie-filled:before {
- content: '\E2BA';
-}
-.t-icon-logo-ie:before {
- content: '\E2BB';
-}
-.t-icon-logo-instagram:before {
- content: '\E2BC';
-}
-.t-icon-logo-qq:before {
- content: '\E2BD';
-}
-.t-icon-logo-twitter:before {
- content: '\E2BE';
-}
-.t-icon-logo-wechat-stroke:before {
- content: '\E2BF';
-}
-.t-icon-logo-wechat:before {
- content: '\E2C0';
-}
-.t-icon-logo-wecom:before {
- content: '\E2C1';
-}
-.t-icon-logo-windows-filled:before {
- content: '\E2C2';
-}
-.t-icon-logo-windows:before {
- content: '\E2C3';
-}
-.t-icon-logo-youtube:before {
- content: '\E2C4';
-}
-.t-icon-logout:before {
- content: '\E2C5';
-}
-.t-icon-look-around:before {
- content: '\E2C6';
-}
-.t-icon-loudspeaker:before {
- content: '\E2C7';
-}
-.t-icon-mail:before {
- content: '\E2C8';
-}
-.t-icon-map-3d:before {
- content: '\E2C9';
-}
-.t-icon-map-add:before {
- content: '\E2CA';
-}
-.t-icon-map-aiming:before {
- content: '\E2CB';
-}
-.t-icon-map-blocked:before {
- content: '\E2CC';
-}
-.t-icon-map-bubble:before {
- content: '\E2CD';
-}
-.t-icon-map-cancel:before {
- content: '\E2CE';
-}
-.t-icon-map-chat:before {
- content: '\E2CF';
-}
-.t-icon-map-checked:before {
- content: '\E2D0';
-}
-.t-icon-map-collection:before {
- content: '\E2D1';
-}
-.t-icon-map-connection:before {
- content: '\E2D2';
-}
-.t-icon-map-distance:before {
- content: '\E2D3';
-}
-.t-icon-map-double:before {
- content: '\E2D4';
-}
-.t-icon-map-edit:before {
- content: '\E2D5';
-}
-.t-icon-map-grid:before {
- content: '\E2D6';
-}
-.t-icon-map-information-1:before {
- content: '\E2D7';
-}
-.t-icon-map-information-2:before {
- content: '\E2D8';
-}
-.t-icon-map-information:before {
- content: '\E2D9';
-}
-.t-icon-map-location:before {
- content: '\E2DA';
-}
-.t-icon-map-locked:before {
- content: '\E2DB';
-}
-.t-icon-map-marked:before {
- content: '\E2DC';
-}
-.t-icon-map-navigation:before {
- content: '\E2DD';
-}
-.t-icon-map-outline:before {
- content: '\E2DE';
-}
-.t-icon-map-route-planning:before {
- content: '\E2DF';
-}
-.t-icon-map-ruler:before {
- content: '\E2E0';
-}
-.t-icon-map-safety:before {
- content: '\E2E1';
-}
-.t-icon-map-search-1:before {
- content: '\E2E2';
-}
-.t-icon-map-search:before {
- content: '\E2E3';
-}
-.t-icon-map-setting:before {
- content: '\E2E4';
-}
-.t-icon-map-unlocked:before {
- content: '\E2E5';
-}
-.t-icon-map:before {
- content: '\E2E6';
-}
-.t-icon-mark-as-unread:before {
- content: '\E2E7';
-}
-.t-icon-markup:before {
- content: '\E2E8';
-}
-.t-icon-mathematics:before {
- content: '\E2E9';
-}
-.t-icon-measurement-1:before {
- content: '\E2EA';
-}
-.t-icon-measurement-2:before {
- content: '\E2EB';
-}
-.t-icon-measurement:before {
- content: '\E2EC';
-}
-.t-icon-meat-pepper:before {
- content: '\E2ED';
-}
-.t-icon-media-library:before {
- content: '\E2EE';
-}
-.t-icon-member:before {
- content: '\E2EF';
-}
-.t-icon-menu-application:before {
- content: '\E2F0';
-}
-.t-icon-menu-fold:before {
- content: '\E2F1';
-}
-.t-icon-menu-unfold:before {
- content: '\E2F2';
-}
-.t-icon-menu:before {
- content: '\E2F3';
-}
-.t-icon-merge-cells:before {
- content: '\E2F4';
-}
-.t-icon-microphone-1:before {
- content: '\E2F5';
-}
-.t-icon-microphone-2:before {
- content: '\E2F6';
-}
-.t-icon-microphone:before {
- content: '\E2F7';
-}
-.t-icon-milk:before {
- content: '\E2F8';
-}
-.t-icon-minus-circle-filled:before {
- content: '\E2F9';
-}
-.t-icon-minus-circle:before {
- content: '\E2FA';
-}
-.t-icon-minus-rectangle-filled:before {
- content: '\E2FB';
-}
-.t-icon-minus-rectangle:before {
- content: '\E2FC';
-}
-.t-icon-minus:before {
- content: '\E2FD';
-}
-.t-icon-mirror:before {
- content: '\E2FE';
-}
-.t-icon-mobile-blocked:before {
- content: '\E2FF';
-}
-.t-icon-mobile-list:before {
- content: '\E300';
-}
-.t-icon-mobile-navigation:before {
- content: '\E301';
-}
-.t-icon-mobile-shortcut:before {
- content: '\E302';
-}
-.t-icon-mobile-vibrate:before {
- content: '\E303';
-}
-.t-icon-mobile:before {
- content: '\E304';
-}
-.t-icon-mode-dark:before {
- content: '\E305';
-}
-.t-icon-mode-light:before {
- content: '\E306';
-}
-.t-icon-module:before {
- content: '\E307';
-}
-.t-icon-money:before {
- content: '\E308';
-}
-.t-icon-monument:before {
- content: '\E309';
-}
-.t-icon-moon-fall:before {
- content: '\E30A';
-}
-.t-icon-moon-rising:before {
- content: '\E30B';
-}
-.t-icon-moon:before {
- content: '\E30C';
-}
-.t-icon-more:before {
- content: '\E30D';
-}
-.t-icon-mosque-1:before {
- content: '\E30E';
-}
-.t-icon-mosque:before {
- content: '\E30F';
-}
-.t-icon-mouse:before {
- content: '\E310';
-}
-.t-icon-move-1:before {
- content: '\E311';
-}
-.t-icon-move:before {
- content: '\E312';
-}
-.t-icon-movie-clapper:before {
- content: '\E313';
-}
-.t-icon-multiply:before {
- content: '\E314';
-}
-.t-icon-museum-1:before {
- content: '\E315';
-}
-.t-icon-museum-2:before {
- content: '\E316';
-}
-.t-icon-museum:before {
- content: '\E317';
-}
-.t-icon-mushroom-1:before {
- content: '\E318';
-}
-.t-icon-mushroom:before {
- content: '\E319';
-}
-.t-icon-music-1:before {
- content: '\E31A';
-}
-.t-icon-music-2:before {
- content: '\E31B';
-}
-.t-icon-music-rectangle-add:before {
- content: '\E31C';
-}
-.t-icon-music:before {
- content: '\E31D';
-}
-.t-icon-navigation-arrow:before {
- content: '\E31E';
-}
-.t-icon-next:before {
- content: '\E31F';
-}
-.t-icon-no-expression:before {
- content: '\E320';
-}
-.t-icon-noodle:before {
- content: '\E321';
-}
-.t-icon-notification-add:before {
- content: '\E322';
-}
-.t-icon-notification-circle:before {
- content: '\E323';
-}
-.t-icon-notification-error:before {
- content: '\E324';
-}
-.t-icon-notification-filled:before {
- content: '\E325';
-}
-.t-icon-notification:before {
- content: '\E326';
-}
-.t-icon-numbers-0-1:before {
- content: '\E327';
-}
-.t-icon-numbers-0:before {
- content: '\E328';
-}
-.t-icon-numbers-1-1:before {
- content: '\E329';
-}
-.t-icon-numbers-1:before {
- content: '\E32A';
-}
-.t-icon-numbers-2-1:before {
- content: '\E32B';
-}
-.t-icon-numbers-2:before {
- content: '\E32C';
-}
-.t-icon-numbers-3-1:before {
- content: '\E32D';
-}
-.t-icon-numbers-3:before {
- content: '\E32E';
-}
-.t-icon-numbers-4-1:before {
- content: '\E32F';
-}
-.t-icon-numbers-4:before {
- content: '\E330';
-}
-.t-icon-numbers-5-1:before {
- content: '\E331';
-}
-.t-icon-numbers-5:before {
- content: '\E332';
-}
-.t-icon-numbers-6-1:before {
- content: '\E333';
-}
-.t-icon-numbers-6:before {
- content: '\E334';
-}
-.t-icon-numbers-7-1:before {
- content: '\E335';
-}
-.t-icon-numbers-7:before {
- content: '\E336';
-}
-.t-icon-numbers-8-1:before {
- content: '\E337';
-}
-.t-icon-numbers-8:before {
- content: '\E338';
-}
-.t-icon-numbers-9-1:before {
- content: '\E339';
-}
-.t-icon-numbers-9:before {
- content: '\E33A';
-}
-.t-icon-nut:before {
- content: '\E33B';
-}
-.t-icon-object-storage:before {
- content: '\E33C';
-}
-.t-icon-open-mouth:before {
- content: '\E33D';
-}
-.t-icon-opera:before {
- content: '\E33E';
-}
-.t-icon-order-adjustment-column:before {
- content: '\E33F';
-}
-.t-icon-order-ascending:before {
- content: '\E340';
-}
-.t-icon-order-descending:before {
- content: '\E341';
-}
-.t-icon-outbox:before {
- content: '\E342';
-}
-.t-icon-page-first:before {
- content: '\E343';
-}
-.t-icon-page-head:before {
- content: '\E344';
-}
-.t-icon-page-last:before {
- content: '\E345';
-}
-.t-icon-palace-1:before {
- content: '\E346';
-}
-.t-icon-palace-2:before {
- content: '\E347';
-}
-.t-icon-palace-3:before {
- content: '\E348';
-}
-.t-icon-palace-4:before {
- content: '\E349';
-}
-.t-icon-palace:before {
- content: '\E34A';
-}
-.t-icon-palette-1:before {
- content: '\E34B';
-}
-.t-icon-palette:before {
- content: '\E34C';
-}
-.t-icon-panorama-horizontal:before {
- content: '\E34D';
-}
-.t-icon-panorama-vertical:before {
- content: '\E34E';
-}
-.t-icon-pantone:before {
- content: '\E34F';
-}
-.t-icon-parabola:before {
- content: '\E350';
-}
-.t-icon-parentheses:before {
- content: '\E351';
-}
-.t-icon-paste:before {
- content: '\E352';
-}
-.t-icon-patio:before {
- content: '\E353';
-}
-.t-icon-pause-circle-filled:before {
- content: '\E354';
-}
-.t-icon-pause-circle-stroke:before {
- content: '\E355';
-}
-.t-icon-pause-circle:before {
- content: '\E356';
-}
-.t-icon-pause:before {
- content: '\E357';
-}
-.t-icon-pea:before {
- content: '\E358';
-}
-.t-icon-peach:before {
- content: '\E359';
-}
-.t-icon-pear:before {
- content: '\E35A';
-}
-.t-icon-pearl-of-the-orient:before {
- content: '\E35B';
-}
-.t-icon-pen-ball:before {
- content: '\E35C';
-}
-.t-icon-pen-brush:before {
- content: '\E35D';
-}
-.t-icon-pen-mark:before {
- content: '\E35E';
-}
-.t-icon-pen-quill:before {
- content: '\E35F';
-}
-.t-icon-pen:before {
- content: '\E360';
-}
-.t-icon-pending:before {
- content: '\E361';
-}
-.t-icon-percent:before {
- content: '\E362';
-}
-.t-icon-personal-information:before {
- content: '\E363';
-}
-.t-icon-phone-locked:before {
- content: '\E364';
-}
-.t-icon-phone-search:before {
- content: '\E365';
-}
-.t-icon-pi:before {
- content: '\E366';
-}
-.t-icon-piano:before {
- content: '\E367';
-}
-.t-icon-pin-filled:before {
- content: '\E368';
-}
-.t-icon-pin:before {
- content: '\E369';
-}
-.t-icon-play-circle-filled:before {
- content: '\E36A';
-}
-.t-icon-play-circle-stroke-add:before {
- content: '\E36B';
-}
-.t-icon-play-circle-stroke:before {
- content: '\E36C';
-}
-.t-icon-play-circle:before {
- content: '\E36D';
-}
-.t-icon-play-demo:before {
- content: '\E36E';
-}
-.t-icon-play-rectangle:before {
- content: '\E36F';
-}
-.t-icon-play:before {
- content: '\E370';
-}
-.t-icon-plus:before {
- content: '\E371';
-}
-.t-icon-popsicle:before {
- content: '\E372';
-}
-.t-icon-portrait:before {
- content: '\E373';
-}
-.t-icon-pout:before {
- content: '\E374';
-}
-.t-icon-poweroff:before {
- content: '\E375';
-}
-.t-icon-precise-monitor:before {
- content: '\E376';
-}
-.t-icon-previous:before {
- content: '\E377';
-}
-.t-icon-print:before {
- content: '\E378';
-}
-.t-icon-pumpkin:before {
- content: '\E379';
-}
-.t-icon-pyramid-maya:before {
- content: '\E37A';
-}
-.t-icon-pyramid:before {
- content: '\E37B';
-}
-.t-icon-qrcode:before {
- content: '\E37C';
-}
-.t-icon-quadratic:before {
- content: '\E37D';
-}
-.t-icon-questionnaire:before {
- content: '\E37E';
-}
-.t-icon-queue:before {
- content: '\E37F';
-}
-.t-icon-radar:before {
- content: '\E380';
-}
-.t-icon-radio-1:before {
- content: '\E381';
-}
-.t-icon-radio-2:before {
- content: '\E382';
-}
-.t-icon-radish:before {
- content: '\E383';
-}
-.t-icon-rain-heavy:before {
- content: '\E384';
-}
-.t-icon-rain-light:before {
- content: '\E385';
-}
-.t-icon-rain-medium:before {
- content: '\E386';
-}
-.t-icon-rainbow:before {
- content: '\E387';
-}
-.t-icon-rectangle:before {
- content: '\E388';
-}
-.t-icon-refresh:before {
- content: '\E389';
-}
-.t-icon-relation:before {
- content: '\E38A';
-}
-.t-icon-relativity:before {
- content: '\E38B';
-}
-.t-icon-remote-wave:before {
- content: '\E38C';
-}
-.t-icon-remove:before {
- content: '\E38D';
-}
-.t-icon-replay:before {
- content: '\E38E';
-}
-.t-icon-rice-ball:before {
- content: '\E38F';
-}
-.t-icon-rice:before {
- content: '\E390';
-}
-.t-icon-roast:before {
- content: '\E391';
-}
-.t-icon-rocket:before {
- content: '\E392';
-}
-.t-icon-rollback:before {
- content: '\E393';
-}
-.t-icon-rollfront:before {
- content: '\E394';
-}
-.t-icon-root-list:before {
- content: '\E395';
-}
-.t-icon-rotate-locked:before {
- content: '\E396';
-}
-.t-icon-rotate:before {
- content: '\E397';
-}
-.t-icon-rotation:before {
- content: '\E398';
-}
-.t-icon-round:before {
- content: '\E399';
-}
-.t-icon-router-wave:before {
- content: '\E39A';
-}
-.t-icon-rss:before {
- content: '\E39B';
-}
-.t-icon-ruler:before {
- content: '\E39C';
-}
-.t-icon-sailing-hotel:before {
- content: '\E39D';
-}
-.t-icon-sandwich:before {
- content: '\E39E';
-}
-.t-icon-saturation:before {
- content: '\E39F';
-}
-.t-icon-sausage:before {
- content: '\E3A0';
-}
-.t-icon-save:before {
- content: '\E3A1';
-}
-.t-icon-saving-pot:before {
- content: '\E3A2';
-}
-.t-icon-scan:before {
- content: '\E3A3';
-}
-.t-icon-screen-4k:before {
- content: '\E3A4';
-}
-.t-icon-screencast:before {
- content: '\E3A5';
-}
-.t-icon-screenshot:before {
- content: '\E3A6';
-}
-.t-icon-scroll-bar:before {
- content: '\E3A7';
-}
-.t-icon-sd-card-1:before {
- content: '\E3A8';
-}
-.t-icon-sd-card:before {
- content: '\E3A9';
-}
-.t-icon-search-error:before {
- content: '\E3AA';
-}
-.t-icon-search:before {
- content: '\E3AB';
-}
-.t-icon-secured:before {
- content: '\E3AC';
-}
-.t-icon-send-cancel:before {
- content: '\E3AD';
-}
-.t-icon-send:before {
- content: '\E3AE';
-}
-.t-icon-sensors-1:before {
- content: '\E3AF';
-}
-.t-icon-sensors-2:before {
- content: '\E3B0';
-}
-.t-icon-sensors-off:before {
- content: '\E3B1';
-}
-.t-icon-sensors:before {
- content: '\E3B2';
-}
-.t-icon-serenity:before {
- content: '\E3B3';
-}
-.t-icon-server:before {
- content: '\E3B4';
-}
-.t-icon-service:before {
- content: '\E3B5';
-}
-.t-icon-setting-1:before {
- content: '\E3B6';
-}
-.t-icon-setting:before {
- content: '\E3B7';
-}
-.t-icon-share-1:before {
- content: '\E3B8';
-}
-.t-icon-share:before {
- content: '\E3B9';
-}
-.t-icon-sharpness:before {
- content: '\E3BA';
-}
-.t-icon-shield-error:before {
- content: '\E3BB';
-}
-.t-icon-shimen:before {
- content: '\E3BC';
-}
-.t-icon-shop-1:before {
- content: '\E3BD';
-}
-.t-icon-shop-2:before {
- content: '\E3BE';
-}
-.t-icon-shop-3:before {
- content: '\E3BF';
-}
-.t-icon-shop-4:before {
- content: '\E3C0';
-}
-.t-icon-shop-5:before {
- content: '\E3C1';
-}
-.t-icon-shop:before {
- content: '\E3C2';
-}
-.t-icon-shrimp:before {
- content: '\E3C3';
-}
-.t-icon-shrink-horizontal:before {
- content: '\E3C4';
-}
-.t-icon-shrink-vertical:before {
- content: '\E3C5';
-}
-.t-icon-shutter:before {
- content: '\E3C6';
-}
-.t-icon-shutup:before {
- content: '\E3C7';
-}
-.t-icon-sim-card-1:before {
- content: '\E3C8';
-}
-.t-icon-sim-card-2:before {
- content: '\E3C9';
-}
-.t-icon-sim-card:before {
- content: '\E3CA';
-}
-.t-icon-sinister-smile:before {
- content: '\E3CB';
-}
-.t-icon-sip:before {
- content: '\E3CC';
-}
-.t-icon-slash:before {
- content: '\E3CD';
-}
-.t-icon-sleep:before {
- content: '\E3CE';
-}
-.t-icon-slice:before {
- content: '\E3CF';
-}
-.t-icon-slideshow:before {
- content: '\E3D0';
-}
-.t-icon-smile:before {
- content: '\E3D1';
-}
-.t-icon-sneer:before {
- content: '\E3D2';
-}
-.t-icon-snowflake:before {
- content: '\E3D3';
-}
-.t-icon-sonic:before {
- content: '\E3D4';
-}
-.t-icon-sound-down:before {
- content: '\E3D5';
-}
-.t-icon-sound-high:before {
- content: '\E3D6';
-}
-.t-icon-sound-low:before {
- content: '\E3D7';
-}
-.t-icon-sound-mute-1:before {
- content: '\E3D8';
-}
-.t-icon-sound-mute:before {
- content: '\E3D9';
-}
-.t-icon-sound-up:before {
- content: '\E3DA';
-}
-.t-icon-sound:before {
- content: '\E3DB';
-}
-.t-icon-space:before {
- content: '\E3DC';
-}
-.t-icon-speechless-1:before {
- content: '\E3DD';
-}
-.t-icon-star-filled:before {
- content: '\E3DE';
-}
-.t-icon-star:before {
- content: '\E3DF';
-}
-.t-icon-statue-of-jesus:before {
- content: '\E3E0';
-}
-.t-icon-sticky-note:before {
- content: '\E3E1';
-}
-.t-icon-stop-circle-filled:before {
- content: '\E3E2';
-}
-.t-icon-stop-circle-stroke:before {
- content: '\E3E3';
-}
-.t-icon-stop-circle:before {
- content: '\E3E4';
-}
-.t-icon-stop:before {
- content: '\E3E5';
-}
-.t-icon-store:before {
- content: '\E3E6';
-}
-.t-icon-street-road-1:before {
- content: '\E3E7';
-}
-.t-icon-street-road:before {
- content: '\E3E8';
-}
-.t-icon-subtitle:before {
- content: '\E3E9';
-}
-.t-icon-subway-line:before {
- content: '\E3EA';
-}
-.t-icon-sum:before {
- content: '\E3EB';
-}
-.t-icon-sun-fall:before {
- content: '\E3EC';
-}
-.t-icon-sun-rising:before {
- content: '\E3ED';
-}
-.t-icon-sunny:before {
- content: '\E3EE';
-}
-.t-icon-support:before {
- content: '\E3EF';
-}
-.t-icon-surprised-1:before {
- content: '\E3F0';
-}
-.t-icon-surprised:before {
- content: '\E3F1';
-}
-.t-icon-swap-left:before {
- content: '\E3F2';
-}
-.t-icon-swap-right:before {
- content: '\E3F3';
-}
-.t-icon-swap:before {
- content: '\E3F4';
-}
-.t-icon-swear-1:before {
- content: '\E3F5';
-}
-.t-icon-swear-2:before {
- content: '\E3F6';
-}
-.t-icon-system-2:before {
- content: '\E3F7';
-}
-.t-icon-system-3:before {
- content: '\E3F8';
-}
-.t-icon-system-application:before {
- content: '\E3F9';
-}
-.t-icon-system-blocked:before {
- content: '\E3FA';
-}
-.t-icon-system-code:before {
- content: '\E3FB';
-}
-.t-icon-system-components:before {
- content: '\E3FC';
-}
-.t-icon-system-coordinate:before {
- content: '\E3FD';
-}
-.t-icon-system-device:before {
- content: '\E3FE';
-}
-.t-icon-system-interface:before {
- content: '\E3FF';
-}
-.t-icon-system-location:before {
- content: '\E400';
-}
-.t-icon-system-locked:before {
- content: '\E401';
-}
-.t-icon-system-log:before {
- content: '\E402';
-}
-.t-icon-system-marked:before {
- content: '\E403';
-}
-.t-icon-system-messages:before {
- content: '\E404';
-}
-.t-icon-system-regulation:before {
- content: '\E405';
-}
-.t-icon-system-search:before {
- content: '\E406';
-}
-.t-icon-system-setting:before {
- content: '\E407';
-}
-.t-icon-system-storage:before {
- content: '\E408';
-}
-.t-icon-system-sum:before {
- content: '\E409';
-}
-.t-icon-system-unlocked:before {
- content: '\E40A';
-}
-.t-icon-tab:before {
- content: '\E40B';
-}
-.t-icon-table-1:before {
- content: '\E40C';
-}
-.t-icon-table-2:before {
- content: '\E40D';
-}
-.t-icon-table-add:before {
- content: '\E40E';
-}
-.t-icon-table-split:before {
- content: '\E40F';
-}
-.t-icon-table:before {
- content: '\E410';
-}
-.t-icon-tag:before {
- content: '\E411';
-}
-.t-icon-tangerinr:before {
- content: '\E412';
-}
-.t-icon-tape:before {
- content: '\E413';
-}
-.t-icon-task-1:before {
- content: '\E414';
-}
-.t-icon-task-add-1:before {
- content: '\E415';
-}
-.t-icon-task-add:before {
- content: '\E416';
-}
-.t-icon-task-checked:before {
- content: '\E417';
-}
-.t-icon-task-error:before {
- content: '\E418';
-}
-.t-icon-task-location:before {
- content: '\E419';
-}
-.t-icon-task-marked:before {
- content: '\E41A';
-}
-.t-icon-task-setting:before {
- content: '\E41B';
-}
-.t-icon-task-visible:before {
- content: '\E41C';
-}
-.t-icon-task:before {
- content: '\E41D';
-}
-.t-icon-tea:before {
- content: '\E41E';
-}
-.t-icon-teahouse:before {
- content: '\E41F';
-}
-.t-icon-template:before {
- content: '\E420';
-}
-.t-icon-temple:before {
- content: '\E421';
-}
-.t-icon-terminal-rectangle-1:before {
- content: '\E422';
-}
-.t-icon-terminal-rectangle:before {
- content: '\E423';
-}
-.t-icon-terminal-window:before {
- content: '\E424';
-}
-.t-icon-terminal:before {
- content: '\E425';
-}
-.t-icon-textbox:before {
- content: '\E426';
-}
-.t-icon-textformat-bold:before {
- content: '\E427';
-}
-.t-icon-textformat-color:before {
- content: '\E428';
-}
-.t-icon-textformat-italic:before {
- content: '\E429';
-}
-.t-icon-textformat-strikethrough:before {
- content: '\E42A';
-}
-.t-icon-textformat-underline:before {
- content: '\E42B';
-}
-.t-icon-textformat-wrap:before {
- content: '\E42C';
-}
-.t-icon-theaters:before {
- content: '\E42D';
-}
-.t-icon-thumb-down-1:before {
- content: '\E42E';
-}
-.t-icon-thumb-down-2:before {
- content: '\E42F';
-}
-.t-icon-thumb-down:before {
- content: '\E430';
-}
-.t-icon-thumb-up-1:before {
- content: '\E431';
-}
-.t-icon-thumb-up-2:before {
- content: '\E432';
-}
-.t-icon-thumb-up:before {
- content: '\E433';
-}
-.t-icon-thunder:before {
- content: '\E434';
-}
-.t-icon-thunderstorm-night:before {
- content: '\E435';
-}
-.t-icon-thunderstorm-sunny:before {
- content: '\E436';
-}
-.t-icon-thunderstorm:before {
- content: '\E437';
-}
-.t-icon-ticket:before {
- content: '\E438';
-}
-.t-icon-time-filled:before {
- content: '\E439';
-}
-.t-icon-time:before {
- content: '\E43A';
-}
-.t-icon-tips-double:before {
- content: '\E43B';
-}
-.t-icon-tips:before {
- content: '\E43C';
-}
-.t-icon-tomato:before {
- content: '\E43D';
-}
-.t-icon-tools-circle:before {
- content: '\E43E';
-}
-.t-icon-tools:before {
- content: '\E43F';
-}
-.t-icon-tornado:before {
- content: '\E440';
-}
-.t-icon-tower-1:before {
- content: '\E441';
-}
-.t-icon-tower-2:before {
- content: '\E442';
-}
-.t-icon-tower-3:before {
- content: '\E443';
-}
-.t-icon-tower-clock:before {
- content: '\E444';
-}
-.t-icon-tower:before {
- content: '\E445';
-}
-.t-icon-town:before {
- content: '\E446';
-}
-.t-icon-traffic-events:before {
- content: '\E447';
-}
-.t-icon-traffic:before {
- content: '\E448';
-}
-.t-icon-transform-1:before {
- content: '\E449';
-}
-.t-icon-transform-2:before {
- content: '\E44A';
-}
-.t-icon-transform-3:before {
- content: '\E44B';
-}
-.t-icon-transform:before {
- content: '\E44C';
-}
-.t-icon-translate-1:before {
- content: '\E44D';
-}
-.t-icon-translate:before {
- content: '\E44E';
-}
-.t-icon-tree-list:before {
- content: '\E44F';
-}
-.t-icon-tree-round-dot-vertical:before {
- content: '\E450';
-}
-.t-icon-tree-round-dot:before {
- content: '\E451';
-}
-.t-icon-tree-square-dot-vertical:before {
- content: '\E452';
-}
-.t-icon-tree-square-dot:before {
- content: '\E453';
-}
-.t-icon-trending-down:before {
- content: '\E454';
-}
-.t-icon-trending-up:before {
- content: '\E455';
-}
-.t-icon-tv-1:before {
- content: '\E456';
-}
-.t-icon-tv-2:before {
- content: '\E457';
-}
-.t-icon-tv:before {
- content: '\E458';
-}
-.t-icon-typography:before {
- content: '\E459';
-}
-.t-icon-uncomfortable-1:before {
- content: '\E45A';
-}
-.t-icon-uncomfortable-2:before {
- content: '\E45B';
-}
-.t-icon-uncomfortable:before {
- content: '\E45C';
-}
-.t-icon-undertake-delivery:before {
- content: '\E45D';
-}
-.t-icon-undertake-environment-protection:before {
- content: '\E45E';
-}
-.t-icon-undertake-hold-up:before {
- content: '\E45F';
-}
-.t-icon-undertake-transaction:before {
- content: '\E460';
-}
-.t-icon-undertake:before {
- content: '\E461';
-}
-.t-icon-unfold-less:before {
- content: '\E462';
-}
-.t-icon-unfold-more:before {
- content: '\E463';
-}
-.t-icon-unhappy-1:before {
- content: '\E464';
-}
-.t-icon-unhappy:before {
- content: '\E465';
-}
-.t-icon-uninstall:before {
- content: '\E466';
-}
-.t-icon-upload-1:before {
- content: '\E467';
-}
-.t-icon-upload:before {
- content: '\E468';
-}
-.t-icon-upscale:before {
- content: '\E469';
-}
-.t-icon-usb:before {
- content: '\E46A';
-}
-.t-icon-user-1:before {
- content: '\E46B';
-}
-.t-icon-user-add:before {
- content: '\E46C';
-}
-.t-icon-user-arrow-down:before {
- content: '\E46D';
-}
-.t-icon-user-arrow-left:before {
- content: '\E46E';
-}
-.t-icon-user-arrow-right:before {
- content: '\E46F';
-}
-.t-icon-user-arrow-up:before {
- content: '\E470';
-}
-.t-icon-user-avatar:before {
- content: '\E471';
-}
-.t-icon-user-blocked:before {
- content: '\E472';
-}
-.t-icon-user-business:before {
- content: '\E473';
-}
-.t-icon-user-checked-1:before {
- content: '\E474';
-}
-.t-icon-user-checked:before {
- content: '\E475';
-}
-.t-icon-user-circle:before {
- content: '\E476';
-}
-.t-icon-user-clear:before {
- content: '\E477';
-}
-.t-icon-user-error-1:before {
- content: '\E478';
-}
-.t-icon-user-invisible:before {
- content: '\E479';
-}
-.t-icon-user-list:before {
- content: '\E47A';
-}
-.t-icon-user-locked:before {
- content: '\E47B';
-}
-.t-icon-user-marked:before {
- content: '\E47C';
-}
-.t-icon-user-password:before {
- content: '\E47D';
-}
-.t-icon-user-safety:before {
- content: '\E47E';
-}
-.t-icon-user-search:before {
- content: '\E47F';
-}
-.t-icon-user-setting:before {
- content: '\E480';
-}
-.t-icon-user-talk-1:before {
- content: '\E481';
-}
-.t-icon-user-talk-off-1:before {
- content: '\E482';
-}
-.t-icon-user-talk:before {
- content: '\E483';
-}
-.t-icon-user-time:before {
- content: '\E484';
-}
-.t-icon-user-transmit:before {
- content: '\E485';
-}
-.t-icon-user-unknown:before {
- content: '\E486';
-}
-.t-icon-user-unlocked:before {
- content: '\E487';
-}
-.t-icon-user-vip:before {
- content: '\E488';
-}
-.t-icon-user-visible:before {
- content: '\E489';
-}
-.t-icon-user:before {
- content: '\E48A';
-}
-.t-icon-usergroup-add:before {
- content: '\E48B';
-}
-.t-icon-usergroup-clear:before {
- content: '\E48C';
-}
-.t-icon-usergroup:before {
- content: '\E48D';
-}
-.t-icon-vehicle:before {
- content: '\E48E';
-}
-.t-icon-verified:before {
- content: '\E48F';
-}
-.t-icon-verify:before {
- content: '\E490';
-}
-.t-icon-video-camera-1:before {
- content: '\E491';
-}
-.t-icon-video-camera-2:before {
- content: '\E492';
-}
-.t-icon-video-camera-dollar:before {
- content: '\E493';
-}
-.t-icon-video-camera-minus:before {
- content: '\E494';
-}
-.t-icon-video-camera-music:before {
- content: '\E495';
-}
-.t-icon-video-camera-off:before {
- content: '\E496';
-}
-.t-icon-video-camera:before {
- content: '\E497';
-}
-.t-icon-video-library:before {
- content: '\E498';
-}
-.t-icon-video:before {
- content: '\E499';
-}
-.t-icon-view-agenda:before {
- content: '\E49A';
-}
-.t-icon-view-column:before {
- content: '\E49B';
-}
-.t-icon-view-in-ar:before {
- content: '\E49C';
-}
-.t-icon-view-list:before {
- content: '\E49D';
-}
-.t-icon-view-module:before {
- content: '\E49E';
-}
-.t-icon-visual-recognition:before {
- content: '\E49F';
-}
-.t-icon-wallet:before {
- content: '\E4A0';
-}
-.t-icon-watch:before {
- content: '\E4A1';
-}
-.t-icon-watermelon:before {
- content: '\E4A2';
-}
-.t-icon-wave-left:before {
- content: '\E4A3';
-}
-.t-icon-wave-right:before {
- content: '\E4A4';
-}
-.t-icon-wealth-1:before {
- content: '\E4A5';
-}
-.t-icon-wealth:before {
- content: '\E4A6';
-}
-.t-icon-widget:before {
- content: '\E4A7';
-}
-.t-icon-wifi-1:before {
- content: '\E4A8';
-}
-.t-icon-wifi-off-1:before {
- content: '\E4A9';
-}
-.t-icon-wifi-off:before {
- content: '\E4AA';
-}
-.t-icon-wifi:before {
- content: '\E4AB';
-}
-.t-icon-window-1:before {
- content: '\E4AC';
-}
-.t-icon-window:before {
- content: '\E4AD';
-}
-.t-icon-windy-rain:before {
- content: '\E4AE';
-}
-.t-icon-windy:before {
- content: '\E4AF';
-}
-.t-icon-wink:before {
- content: '\E4B0';
-}
-.t-icon-work-history:before {
- content: '\E4B1';
-}
-.t-icon-work-off:before {
- content: '\E4B2';
-}
-.t-icon-work:before {
- content: '\E4B3';
-}
-.t-icon-wry-smile:before {
- content: '\E4B4';
-}
-.t-icon-zoom-in:before {
- content: '\E4B5';
-}
-.t-icon-zoom-out:before {
- content: '\E4B6';
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/icon/props.d.ts
deleted file mode 100644
index a472c016..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdIconProps } from './type';
-declare const props: TdIconProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/icon/props.js
deleted file mode 100644
index 4d0ffa25..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/props.js
+++ /dev/null
@@ -1,19 +0,0 @@
-const props = {
- color: {
- type: String,
- value: '',
- },
- name: {
- type: String,
- value: '',
- required: true,
- },
- prefix: {
- type: String,
- value: '',
- },
- size: {
- type: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/icon/type.d.ts
deleted file mode 100644
index c92226c2..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/type.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-export interface TdIconProps {
- color?: {
- type: StringConstructor;
- value?: string;
- };
- name: {
- type: StringConstructor;
- value?: string;
- required?: boolean;
- };
- prefix?: {
- type: StringConstructor;
- value?: string;
- };
- size?: {
- type: null;
- value?: string | number;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/icon/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/icon/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.en-US.md
deleted file mode 100644
index 46e7da93..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.en-US.md
+++ /dev/null
@@ -1,46 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Image Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-error | String / Slot | 'default' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-height | String / Number | - | \- | N
-lazy | Boolean | false | \- | N
-loading | String / Slot | 'default' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-mode | String | scaleToFill | options: scaleToFill/aspectFit/aspectFill/widthFix/heightFix/top/bottom/center/left/right/top left/top right/bottom left/bottom right | N
-shape | String | square | options: circle/round/square | N
-show-menu-by-longpress | Boolean | false | \- | N
-src | String | - | src attribute of `
`. image File can also be loaded | N
-t-id | String | - | `1.2.10`。image tag id | N
-webp | Boolean | false | \- | N
-width | String / Number | - | \- | N
-
-### Image Events
-
-name | params | description
--- | -- | --
-error | - | trigger on image load failed
-load | - | trigger on image loaded
-### Image External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-load | \-
-t-class-image | \-
-t-class-error | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-image-color | @font-gray-3 | -
---td-image-loading-bg-color | @bg-color-secondarycontainer | -
---td-image-loading-color | @font-gray-3 | -
---td-image-round-radius | @radius-default | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.md
deleted file mode 100644
index 55be345c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
----
-title: Image 图片
-description: 用于展示效果,主要为上下左右居中裁切、拉伸、平铺等方式。
-spline: base
-isComponent: true
----
-
-


-
-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-image": "tdesign-miniprogram/image/image"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 裁切样式
-
-{{ base }}
-
-### 加载状态
-
-{{ status }}
-
-## 常见问题
-
-
-
- 本地图片无法正确引用?
- 👇
-
-
- 建议使用绝对路径,而不是相对路径。绝对路径以 app.json 所在位置为基准。
-
-
-
-## API
-
-### Image Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-error | String / Slot | 'default' | 加载失败时显示的内容。值为 `default` 则表示使用默认加载失败风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `error`;值为其他则表示普通文本内容,如“加载失败”。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-height | String / Number | - | 高度,默认单位为`px` | N
-lazy | Boolean | false | 是否开启图片懒加载 | N
-loading | String / Slot | 'default' | 加载态内容。值为 `default` 则表示使用默认加载中风格;值为其他则表示普通文本内容,如“加载中”。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-mode | String | scaleToFill | 图片裁剪、缩放的模式;[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/image.html)。可选项:scaleToFill/aspectFit/aspectFill/widthFix/heightFix/top/bottom/center/left/right/top left/top right/bottom left/bottom right | N
-shape | String | square | 图片圆角类型。可选项:circle/round/square | N
-show-menu-by-longpress | Boolean | false | 长按图片显示发送给朋友、收藏、保存图片、搜一搜、打开名片/前往群聊/打开小程序(若图片中包含对应二维码或小程序码)的菜单。 | N
-src | String | - | 图片链接 | N
-t-id | String | - | `1.2.10`。图片标签id | N
-webp | Boolean | false | 默认不解析 webP 格式,只支持网络资源 | N
-width | String / Number | - | 宽度,默认单位为`px` | N
-
-### Image Events
-
-名称 | 参数 | 描述
--- | -- | --
-error | - | 图片加载失败时触发
-load | - | 图片加载完成时触发
-### Image External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-load | 加载样式类
-t-class-image | 图片样式类
-t-class-error | 加载失败样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-image-color | @font-gray-3 | -
---td-image-loading-bg-color | @bg-color-secondarycontainer | -
---td-image-loading-color | @font-gray-3 | -
---td-image-round-radius | @radius-default | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image-info.json b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image-info.json
deleted file mode 100644
index 7157c4c7..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image-info.json
+++ /dev/null
@@ -1,75 +0,0 @@
-{
- "key": "Image",
- "label": "图片",
- "icon": "",
- "properties": [
- {
- "key": "error",
- "type": ["String", "TNode"],
- "defaultValue": "'default'",
- "desc": "加载失败时显示的内容。值为 `default` 则表示使用默认加载失败风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `error`;值为其他则表示普通文本内容,如“加载失败”",
- "label": ""
- },
- {
- "key": "externalClasses",
- "type": ["Array"],
- "defaultValue": "",
- "desc": "组件类名,分别用于设置加载组件外层元素,中间内容等元素类名",
- "label": ""
- },
- {
- "key": "lazy",
- "type": ["Boolean"],
- "defaultValue": "false",
- "desc": "是否开启图片懒加载",
- "label": ""
- },
- {
- "key": "loading",
- "type": ["String", "TNode"],
- "defaultValue": "'default'",
- "desc": "加载态内容。值为 `default` 则表示使用默认加载中风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `loading`;值为其他则表示普通文本内容,如“加载中”",
- "label": ""
- },
- {
- "key": "MP_EXCLUDE_PROPS",
- "type": ["String"],
- "defaultValue": "",
- "desc": "为避免重复或冲突,需要过滤掉的小程序原生属性",
- "label": ""
- },
- {
- "key": "MP_PROPS",
- "type": ["String"],
- "defaultValue": "",
- "desc": "[小程序原生属性](https://developers.weixin.qq.com/miniprogram/dev/component/image.html)",
- "label": ""
- },
- {
- "key": "shape",
- "type": ["String"],
- "defaultValue": "square",
- "desc": "图片圆角类型",
- "label": ""
- },
- {
- "key": "src",
- "type": ["String"],
- "defaultValue": "",
- "desc": "图片链接",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "error",
- "desc": "图片加载失败时触发",
- "label": ""
- },
- {
- "key": "load",
- "desc": "图片加载完成时触发",
- "label": ""
- }
- ]
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.d.ts
deleted file mode 100644
index 80f4bf2a..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.d.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class Image extends SuperComponent {
- externalClasses: string[];
- options: {
- multipleSlots: boolean;
- };
- properties: import("./type").TdImageProps;
- data: {
- prefix: string;
- isLoading: boolean;
- isFailed: boolean;
- innerStyle: string;
- classPrefix: string;
- };
- preSrc: string;
- observers: {
- src(): void;
- 'width, height'(width: any, height: any): void;
- };
- methods: {
- onLoaded(e: any): void;
- onLoadError(e: any): void;
- calcSize(width: any, height: any): void;
- update(): void;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.js b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.js
deleted file mode 100644
index 0cc93cac..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.js
+++ /dev/null
@@ -1,97 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import ImageProps from './props';
-import config from '../common/config';
-import { addUnit, getRect, appBaseInfo } from '../common/utils';
-import { compareVersion } from '../common/version';
-const { prefix } = config;
-const name = `${prefix}-image`;
-let Image = class Image extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-load`, `${prefix}-class-image`, `${prefix}-class-error`];
- this.options = {
- multipleSlots: true,
- };
- this.properties = ImageProps;
- this.data = {
- prefix,
- isLoading: true,
- isFailed: false,
- innerStyle: '',
- classPrefix: name,
- };
- this.preSrc = '';
- this.observers = {
- src() {
- if (this.preSrc === this.properties.src)
- return;
- this.update();
- },
- 'width, height'(width, height) {
- this.calcSize(width, height);
- },
- };
- this.methods = {
- onLoaded(e) {
- const sdkVersion = appBaseInfo.SDKVersion;
- const { mode, tId } = this.properties;
- const isInCompatible = compareVersion(sdkVersion, '2.10.3') < 0;
- if (mode === 'heightFix' && isInCompatible) {
- const { height: picHeight, width: picWidth } = e.detail;
- getRect(this, `#${tId || 'image'}`).then((rect) => {
- const { height } = rect;
- const resultWidth = ((height / picHeight) * picWidth).toFixed(2);
- this.setData({ innerStyle: `height: ${addUnit(height)}; width: ${resultWidth}px;` });
- });
- }
- this.setData({
- isLoading: false,
- isFailed: false,
- });
- this.triggerEvent('load', e.detail);
- },
- onLoadError(e) {
- this.setData({
- isLoading: false,
- isFailed: true,
- });
- this.triggerEvent('error', e.detail);
- },
- calcSize(width, height) {
- let innerStyle = '';
- if (width) {
- innerStyle += `width: ${addUnit(width)};`;
- }
- if (height) {
- innerStyle += `height: ${addUnit(height)};`;
- }
- this.setData({
- innerStyle,
- });
- },
- update() {
- const { src } = this.properties;
- this.preSrc = src;
- if (!src) {
- this.onLoadError({ errMsg: '图片链接为空' });
- }
- else {
- this.setData({
- isLoading: true,
- isFailed: false,
- });
- }
- },
- };
- }
-};
-Image = __decorate([
- wxComponent()
-], Image);
-export default Image;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.json b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.json
deleted file mode 100644
index 1c9137b6..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-loading": "../loading/loading",
- "t-icon": "../icon/icon"
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxml
deleted file mode 100644
index be3b8506..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
- {{loading}}
-
-
-
-
-
-
-
-
-
- {{error}}
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxss
deleted file mode 100644
index 7d550a0f..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/image.wxss
+++ /dev/null
@@ -1,71 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-image {
- position: relative;
- display: inline-block;
-}
-.t-image__mask,
-.t-image__img {
- color: var(--td-image-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
- vertical-align: top;
- width: inherit;
- height: inherit;
-}
-.t-image__mask {
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: var(--td-image-loading-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
- color: var(--td-image-loading-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
-}
-.t-image--loading-text {
- width: 0;
- height: 0;
-}
-.t-image__common {
- width: 100%;
- height: 100%;
-}
-.t-image--lazy {
- position: absolute;
- top: 0;
- left: 0;
- z-index: -1;
-}
-.t-image--shape-circle {
- border-radius: 50%;
- overflow: hidden;
-}
-.t-image--shape-round {
- border-radius: var(--td-image-round-radius, var(--td-radius-default, 12rpx));
- overflow: hidden;
-}
-.t-image--shape-square {
- border-radius: 0;
- overflow: hidden;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.d.ts
deleted file mode 100644
index 0f85c43d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { TdImageProps } from './type';
-export declare type ImageProps = TdImageProps;
-export * from './props';
-export * from './image';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.js b/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.js
deleted file mode 100644
index 4fd39538..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './props';
-export * from './image';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.d.ts
deleted file mode 100644
index 0ab571bb..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdImageProps } from './type';
-declare const props: TdImageProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.js
deleted file mode 100644
index b2a17dac..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/props.js
+++ /dev/null
@@ -1,45 +0,0 @@
-const props = {
- error: {
- type: String,
- value: 'default',
- },
- height: {
- type: null,
- },
- lazy: {
- type: Boolean,
- value: false,
- },
- loading: {
- type: String,
- value: 'default',
- },
- mode: {
- type: String,
- value: 'scaleToFill',
- },
- shape: {
- type: String,
- value: 'square',
- },
- showMenuByLongpress: {
- type: Boolean,
- value: false,
- },
- src: {
- type: String,
- value: '',
- },
- tId: {
- type: String,
- value: '',
- },
- webp: {
- type: Boolean,
- value: false,
- },
- width: {
- type: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.d.ts
deleted file mode 100644
index 4279319d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.d.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-export interface TdImageProps {
- error?: {
- type: StringConstructor;
- value?: string;
- };
- height?: {
- type: null;
- value?: string | number;
- };
- lazy?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- loading?: {
- type: StringConstructor;
- value?: string;
- };
- mode?: {
- type: StringConstructor;
- value?: 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'center' | 'left' | 'right' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
- };
- shape?: {
- type: StringConstructor;
- value?: 'circle' | 'round' | 'square';
- };
- showMenuByLongpress?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- src?: {
- type: StringConstructor;
- value?: string;
- };
- tId?: {
- type: StringConstructor;
- value?: string;
- };
- webp?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- width?: {
- type: null;
- value?: string | number;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/image/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/index.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/index.d.ts
deleted file mode 100644
index 9af8cc5b..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export { default as ActionSheet, ActionSheetTheme } from './action-sheet/index';
-export { default as Dialog } from './dialog/index';
-export { default as Message } from './message/index';
-export { default as Toast } from './toast/index';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/index.js b/miniprogram/packageAPI/components/tdesign-miniprogram/index.js
deleted file mode 100644
index 9af8cc5b..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-export { default as ActionSheet, ActionSheetTheme } from './action-sheet/index';
-export { default as Dialog } from './dialog/index';
-export { default as Message } from './message/index';
-export { default as Toast } from './toast/index';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.en-US.md
deleted file mode 100644
index ac1e999f..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.en-US.md
+++ /dev/null
@@ -1,39 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Loading Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-delay | Number | 0 | \- | N
-duration | Number | 800 | \- | N
-indicator | Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-inherit-color | Boolean | false | \- | N
-layout | String | horizontal | options: horizontal/vertical | N
-loading | Boolean | true | \- | N
-pause | Boolean | false | \- | N
-progress | Number | - | \- | N
-reverse | Boolean | - | \- | N
-size | String | '40rpx' | \- | N
-text | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-theme | String | circular | options: circular/spinner/dots | N
-### Loading External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-indicator | \-
-t-class-text | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-loading-color | @brand-color | -
---td-loading-text-color | inherit | -
---td-loading-text-font-size | 24rpx | -
---td-loading-text-line-height | 40rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.md
deleted file mode 100644
index 50dad476..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/README.md
+++ /dev/null
@@ -1,95 +0,0 @@
----
-title: Loading 加载
-description: 用于表示页面或操作的加载状态,给予用户反馈的同时减缓等待的焦虑感,由一个或一组反馈动效组成。
-spline: message
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-loading": "tdesign-miniprogram/loading/loading"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 纯icon
-
-{{ base }}
-
-### icon加文字横向
-
-{{ horizontal }}
-
-### icon加文字竖向
-
-{{ vertical }}
-
-### 纯文字
-
-{{ text }}
-
-### 加载失败
-
-{{ error }}
-
-### 状态
-
-{{ status }}
-
-### 加载速度
-
-{{ duration }}
-
-### 规格
-
-{{ size }}
-
-## API
-
-### Loading Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-delay | Number | 0 | 延迟显示加载效果的时间,用于防止请求速度过快引起的加载闪烁,单位:毫秒 | N
-duration | Number | 800 | 加载动画执行完成一次的时间,单位:毫秒 | N
-indicator | Boolean / Slot | true | 加载指示符,值为 true 显示默认指示符,值为 false 则不显示,也可以自定义指示符。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-inherit-color | Boolean | false | 是否继承父元素颜色 | N
-layout | String | horizontal | 对齐方式。可选项:horizontal/vertical | N
-loading | Boolean | true | 是否处于加载状态 | N
-pause | Boolean | false | 是否暂停动画 | N
-progress | Number | - | 加载进度 | N
-reverse | Boolean | - | 加载动画是否反向 | N
-size | String | '40rpx' | 尺寸,示例:40rpx/20px | N
-text | String / Slot | - | 加载提示文案。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-theme | String | circular | 加载组件类型。可选项:circular/spinner/dots,skyline 模式下暂不支持枚举值 circular | N
-### Loading External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-indicator | 指示符样式类
-t-class-text | 文本样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-loading-color | @brand-color | -
---td-loading-text-color | inherit | -
---td-loading-text-font-size | 24rpx | -
---td-loading-text-line-height | 40rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.d.ts
deleted file mode 100644
index 2806bd66..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './props';
-export * from './type';
-export * from './loading';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.js b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.js
deleted file mode 100644
index 2806bd66..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './props';
-export * from './type';
-export * from './loading';
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.d.ts
deleted file mode 100644
index 55dd01b7..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.d.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-import type { TdLoadingProps } from './type';
-export interface LoadingProps extends TdLoadingProps {
-}
-export default class Loading extends SuperComponent {
- externalClasses: string[];
- data: {
- prefix: string;
- classPrefix: string;
- show: boolean;
- };
- options: {
- multipleSlots: boolean;
- };
- properties: {
- delay?: {
- type: NumberConstructor;
- value?: number;
- };
- duration?: {
- type: NumberConstructor;
- value?: number;
- };
- externalClasses?: {
- type: ArrayConstructor;
- value?: ["t-class", "t-class-text", "t-class-indicator"];
- };
- indicator?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- inheritColor?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- layout?: {
- type: StringConstructor;
- value?: "horizontal" | "vertical";
- };
- loading?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- pause?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- progress?: {
- type: NumberConstructor;
- value?: number;
- };
- reverse?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- size?: {
- type: StringConstructor;
- value?: string;
- };
- text?: {
- type: StringConstructor;
- value?: string;
- };
- theme?: {
- type: StringConstructor;
- value?: "circular" | "spinner" | "dots";
- };
- };
- timer: any;
- observers: {
- loading(this: any, cur: any): void;
- };
- lifetimes: {
- detached(): void;
- };
- refreshPage(): void;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.js b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.js
deleted file mode 100644
index f59a423d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-loading`;
-let Loading = class Loading extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-text`, `${prefix}-class-indicator`];
- this.data = {
- prefix,
- classPrefix: name,
- show: true,
- };
- this.options = {
- multipleSlots: true,
- };
- this.properties = Object.assign({}, props);
- this.timer = null;
- this.observers = {
- loading(cur) {
- const { delay } = this.properties;
- if (this.timer) {
- clearTimeout(this.timer);
- }
- if (cur) {
- if (delay) {
- this.timer = setTimeout(() => {
- this.setData({ show: cur });
- this.timer = null;
- }, delay);
- }
- else {
- this.setData({ show: cur });
- }
- }
- else {
- this.setData({ show: cur });
- }
- },
- };
- this.lifetimes = {
- detached() {
- clearTimeout(this.timer);
- },
- };
- }
- refreshPage() {
- this.triggerEvent('reload');
- }
-};
-Loading = __decorate([
- wxComponent()
-], Loading);
-export default Loading;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.json b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.json
deleted file mode 100644
index 4f0a3f08..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {}
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxml
deleted file mode 100644
index 094ebf1a..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{text}}
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxss
deleted file mode 100644
index c1a40bc0..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/loading.wxss
+++ /dev/null
@@ -1,219 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-loading {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- font-size: 24rpx;
-}
-.t-loading__spinner {
- position: relative;
- box-sizing: border-box;
- width: 100%;
- height: 100%;
- max-width: 100%;
- max-height: 100%;
- animation: rotate 0.8s linear infinite;
- color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-loading__spinner.reverse {
- animation-name: rotateReverse;
-}
-.t-loading__spinner--spinner {
- animation-timing-function: steps(12);
- color: var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
-}
-.t-loading__spinner--spinner .t-loading__dot {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
-}
-.t-loading__spinner--spinner .t-loading__dot::before {
- display: block;
- width: 5rpx;
- height: 25%;
- margin: 0 auto;
- background-color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- border-radius: 40%;
- content: ' ';
-}
-.t-loading__spinner--circular .t-loading__circular {
- border-radius: 100%;
- width: 100%;
- height: 100%;
- background: conic-gradient(from 180deg at 50% 50%, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, 0) 60deg, currentColor 330deg, rgba(255, 255, 255, 0) 360deg);
- mask: radial-gradient(transparent calc(50% - 1rpx), #fff 50%);
- /* stylelint-disable-next-line */
- -webkit-mask: radial-gradient(transparent calc(50% - 1rpx), #fff 50%);
-}
-.t-loading__spinner--dots {
- display: flex;
- justify-content: space-between;
- align-items: center;
- animation: none;
-}
-.t-loading__spinner--dots .t-loading__dot {
- width: 20%;
- height: 20%;
- border-radius: 50%;
- background-color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- animation-duration: 1.8s;
- animation-name: dotting;
- animation-timing-function: linear;
- animation-iteration-count: infinite;
- animation-fill-mode: both;
-}
-.t-loading__text {
- color: var(--td-loading-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- font-size: var(--td-loading-text-font-size, 24rpx);
- line-height: var(--td-loading-text-line-height, 40rpx);
-}
-.t-loading__text--vertical:not(:first-child):not(:empty) {
- margin-top: 12rpx;
-}
-.t-loading__text--horizontal:not(:first-child):not(:empty) {
- margin-left: 16rpx;
-}
-.t-loading--vertical {
- flex-direction: column;
-}
-.t-loading--horizontal {
- flex-direction: row;
- vertical-align: top;
-}
-@keyframes t-bar {
- 0% {
- width: 0;
- }
- 50% {
- width: 70%;
- }
- 100% {
- width: 80%;
- }
-}
-@keyframes t-bar-loaded {
- 0% {
- height: 6rpx;
- opacity: 1;
- width: 90%;
- }
- 50% {
- height: 6rpx;
- opacity: 1;
- width: 100%;
- }
- 100% {
- height: 0;
- opacity: 0;
- width: 100%;
- }
-}
-.t-loading__dot-1 {
- transform: rotate(30deg);
- opacity: 0;
-}
-.t-loading__dot-2 {
- transform: rotate(60deg);
- opacity: 0.08333333;
-}
-.t-loading__dot-3 {
- transform: rotate(90deg);
- opacity: 0.16666667;
-}
-.t-loading__dot-4 {
- transform: rotate(120deg);
- opacity: 0.25;
-}
-.t-loading__dot-5 {
- transform: rotate(150deg);
- opacity: 0.33333333;
-}
-.t-loading__dot-6 {
- transform: rotate(180deg);
- opacity: 0.41666667;
-}
-.t-loading__dot-7 {
- transform: rotate(210deg);
- opacity: 0.5;
-}
-.t-loading__dot-8 {
- transform: rotate(240deg);
- opacity: 0.58333333;
-}
-.t-loading__dot-9 {
- transform: rotate(270deg);
- opacity: 0.66666667;
-}
-.t-loading__dot-10 {
- transform: rotate(300deg);
- opacity: 0.75;
-}
-.t-loading__dot-11 {
- transform: rotate(330deg);
- opacity: 0.83333333;
-}
-.t-loading__dot-12 {
- transform: rotate(360deg);
- opacity: 0.91666667;
-}
-@keyframes rotate {
- from {
- transform: rotate(0deg);
- }
- to {
- transform: rotate(360deg);
- }
-}
-@keyframes rotateReverse {
- from {
- transform: rotate(360deg);
- }
- to {
- transform: rotate(0deg);
- }
-}
-@keyframes dotting {
- 0% {
- opacity: 0.15;
- }
- 1% {
- opacity: 0.8;
- }
- 33% {
- opacity: 0.8;
- }
- 34% {
- opacity: 0.15;
- }
- 100% {
- opacity: 0.15;
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.d.ts
deleted file mode 100644
index a05a6598..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdLoadingProps } from './type';
-declare const props: TdLoadingProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.js
deleted file mode 100644
index d86ae7a4..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/props.js
+++ /dev/null
@@ -1,51 +0,0 @@
-const props = {
- delay: {
- type: Number,
- value: 0,
- },
- duration: {
- type: Number,
- value: 800,
- },
- externalClasses: {
- type: Array,
- },
- indicator: {
- type: Boolean,
- value: true,
- },
- inheritColor: {
- type: Boolean,
- value: false,
- },
- layout: {
- type: String,
- value: 'horizontal',
- },
- loading: {
- type: Boolean,
- value: true,
- },
- pause: {
- type: Boolean,
- value: false,
- },
- progress: {
- type: Number,
- },
- reverse: {
- type: Boolean,
- },
- size: {
- type: String,
- value: '40rpx',
- },
- text: {
- type: String,
- },
- theme: {
- type: String,
- value: 'circular',
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.d.ts
deleted file mode 100644
index 3e319a42..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.d.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-export interface TdLoadingProps {
- delay?: {
- type: NumberConstructor;
- value?: number;
- };
- duration?: {
- type: NumberConstructor;
- value?: number;
- };
- externalClasses?: {
- type: ArrayConstructor;
- value?: ['t-class', 't-class-text', 't-class-indicator'];
- };
- indicator?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- inheritColor?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- layout?: {
- type: StringConstructor;
- value?: 'horizontal' | 'vertical';
- };
- loading?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- pause?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- progress?: {
- type: NumberConstructor;
- value?: number;
- };
- reverse?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- size?: {
- type: StringConstructor;
- value?: string;
- };
- text?: {
- type: StringConstructor;
- value?: string;
- };
- theme?: {
- type: StringConstructor;
- value?: 'circular' | 'spinner' | 'dots';
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/loading/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/page-scroll.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/page-scroll.d.ts
deleted file mode 100644
index 0e9cf2dc..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/page-scroll.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _default: (funcName?: string) => string;
-export default _default;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/page-scroll.js b/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/page-scroll.js
deleted file mode 100644
index 1d0dcba8..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/page-scroll.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import { getCurrentPage } from '../common/utils';
-const onPageScroll = function (event) {
- const page = getCurrentPage();
- if (!page)
- return;
- const { pageScroller } = page;
- pageScroller === null || pageScroller === void 0 ? void 0 : pageScroller.forEach((scroller) => {
- if (typeof scroller === 'function') {
- scroller(event);
- }
- });
-};
-export default (funcName = 'onScroll') => {
- return Behavior({
- attached() {
- var _a;
- const page = getCurrentPage();
- if (!page)
- return;
- const bindScroller = (_a = this[funcName]) === null || _a === void 0 ? void 0 : _a.bind(this);
- if (bindScroller) {
- this._pageScroller = bindScroller;
- }
- if (Array.isArray(page.pageScroller)) {
- page.pageScroller.push(bindScroller);
- }
- else {
- page.pageScroller =
- typeof page.onPageScroll === 'function' ? [page.onPageScroll.bind(page), bindScroller] : [bindScroller];
- }
- page.onPageScroll = onPageScroll;
- },
- detached() {
- var _a;
- const page = getCurrentPage();
- if (!page)
- return;
- page.pageScroller = ((_a = page.pageScroller) === null || _a === void 0 ? void 0 : _a.filter((item) => item !== this._pageScroller)) || [];
- },
- });
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/theme-change.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/theme-change.d.ts
deleted file mode 100644
index 4821f377..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/theme-change.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const themeChangeBehavior: string;
-export default themeChangeBehavior;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/theme-change.js b/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/theme-change.js
deleted file mode 100644
index 70e44edf..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/theme-change.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import { appBaseInfo } from '../common/utils';
-const themeChangeBehavior = Behavior({
- data: {
- theme: 'light',
- },
- attached() {
- this._initTheme();
- },
- methods: {
- _initTheme() {
- const that = this;
- that.setData({
- theme: appBaseInfo.theme,
- });
- wx.onThemeChange((res) => {
- that.setData({
- theme: res.theme,
- });
- });
- },
- },
-});
-export default themeChangeBehavior;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/touch.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/touch.d.ts
deleted file mode 100644
index ae80ecad..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/touch.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _default: string;
-export default _default;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/touch.js b/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/touch.js
deleted file mode 100644
index cbabccc0..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/touch.js
+++ /dev/null
@@ -1,35 +0,0 @@
-const MinDistance = 10;
-const getDirection = (x, y) => {
- if (x > y && x > MinDistance) {
- return 'horizontal';
- }
- if (y > x && y > MinDistance) {
- return 'vertical';
- }
- return '';
-};
-export default Behavior({
- methods: {
- resetTouchStatus() {
- this.direction = '';
- this.deltaX = 0;
- this.deltaY = 0;
- this.offsetX = 0;
- this.offsetY = 0;
- },
- touchStart(event) {
- this.resetTouchStatus();
- const [touch] = event.touches;
- this.startX = touch.clientX;
- this.startY = touch.clientY;
- },
- touchMove(event) {
- const [touch] = event.touches;
- this.deltaX = touch.clientX - this.startX;
- this.deltaY = touch.clientY - this.startY;
- this.offsetX = Math.abs(this.deltaX);
- this.offsetY = Math.abs(this.deltaY);
- this.direction = getDirection(this.offsetX, this.offsetY);
- },
- },
-});
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/transition.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/transition.d.ts
deleted file mode 100644
index 8c23e357..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/transition.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-export default function transition(): string;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/transition.js b/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/transition.js
deleted file mode 100644
index ee5215ae..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/transition.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import config from '../common/config';
-const { prefix } = config;
-export default function transition() {
- return Behavior({
- properties: {
- visible: {
- type: Boolean,
- value: null,
- observer: 'watchVisible',
- },
- appear: Boolean,
- name: {
- type: String,
- value: 'fade',
- },
- durations: {
- type: Number,
- optionalTypes: [Array],
- },
- },
- data: {
- transitionClass: '',
- transitionDurations: 300,
- className: '',
- realVisible: false,
- },
- created() {
- this.status = '';
- this.transitionT = 0;
- },
- attached() {
- this.durations = this.getDurations();
- if (this.data.visible) {
- this.enter();
- }
- this.inited = true;
- },
- detached() {
- clearTimeout(this.transitionT);
- },
- methods: {
- watchVisible(curr, prev) {
- if (this.inited && curr !== prev) {
- curr ? this.enter() : this.leave();
- }
- },
- getDurations() {
- const { durations } = this.data;
- if (Array.isArray(durations)) {
- return durations.map((item) => Number(item));
- }
- return [Number(durations), Number(durations)];
- },
- enter() {
- const { name } = this.data;
- const [duration] = this.durations;
- this.status = 'entering';
- this.setData({
- realVisible: true,
- transitionClass: `${prefix}-${name}-enter ${prefix}-${name}-enter-active`,
- });
- setTimeout(() => {
- this.setData({
- transitionClass: `${prefix}-${name}-enter-active ${prefix}-${name}-enter-to`,
- });
- }, 30);
- if (typeof duration === 'number' && duration > 0) {
- this.transitionT = setTimeout(this.entered.bind(this), duration + 30);
- }
- },
- entered() {
- this.customDuration = false;
- clearTimeout(this.transitionT);
- this.status = 'entered';
- this.setData({
- transitionClass: '',
- });
- },
- leave() {
- const { name } = this.data;
- const [, duration] = this.durations;
- this.status = 'leaving';
- this.setData({
- transitionClass: `${prefix}-${name}-leave ${prefix}-${name}-leave-active`,
- });
- clearTimeout(this.transitionT);
- setTimeout(() => {
- this.setData({
- transitionClass: `${prefix}-${name}-leave-active ${prefix}-${name}-leave-to`,
- });
- }, 30);
- if (typeof duration === 'number' && duration > 0) {
- this.customDuration = true;
- this.transitionT = setTimeout(this.leaved.bind(this), duration + 30);
- }
- },
- leaved() {
- this.customDuration = false;
- this.triggerEvent('leaved');
- clearTimeout(this.transitionT);
- this.status = 'leaved';
- this.setData({
- transitionClass: '',
- });
- },
- onTransitionEnd() {
- if (this.customDuration) {
- return;
- }
- clearTimeout(this.transitionT);
- if (this.status === 'entering' && this.data.visible) {
- this.entered();
- }
- else if (this.status === 'leaving' && !this.data.visible) {
- this.leaved();
- this.setData({
- realVisible: false,
- });
- }
- },
- },
- });
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/using-custom-navbar.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/using-custom-navbar.d.ts
deleted file mode 100644
index 908f7711..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/using-custom-navbar.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const useCustomNavbarBehavior: string;
-export default useCustomNavbarBehavior;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/using-custom-navbar.js b/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/using-custom-navbar.js
deleted file mode 100644
index e9bf8e3c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/mixins/using-custom-navbar.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import { systemInfo } from '../common/utils';
-const useCustomNavbarBehavior = Behavior({
- properties: {
- usingCustomNavbar: {
- type: Boolean,
- value: false,
- },
- customNavbarHeight: {
- type: Number,
- value: 0,
- },
- },
- data: {
- distanceTop: 0,
- },
- lifetimes: {
- attached() {
- if (this.properties.usingCustomNavbar) {
- this.calculateCustomNavbarDistanceTop();
- }
- },
- },
- methods: {
- calculateCustomNavbarDistanceTop() {
- const { statusBarHeight } = systemInfo;
- const menuButton = wx.getMenuButtonBoundingClientRect();
- const distance = menuButton.top + menuButton.bottom - statusBarHeight;
- this.setData({
- distanceTop: Math.max(distance, this.properties.customNavbarHeight + statusBarHeight),
- });
- },
- },
-});
-export default useCustomNavbarBehavior;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.en-US.md
deleted file mode 100644
index 500cdbbb..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.en-US.md
+++ /dev/null
@@ -1,56 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Navbar Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-animation | Boolean | true | \- | N
-capsule | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-delta | Number | 1 | \- | N
-fixed | Boolean | true | \- | N
-left | Slot | - | `0.26.0`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-left-arrow | Boolean | false | `0.26.0` | N
-title | String / Slot | - | page title。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-title-max-length | Number | - | \- | N
-visible | Boolean | true | \- | N
-
-### Navbar Events
-
-name | params | description
--- | -- | --
-complete | \- | \-
-fail | \- | \-
-go-back | \- | \-
-success | \- | \-
-### Navbar External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-capsule | \-
-t-class-center | \-
-t-class-home-icon | \-
-t-class-left | \-
-t-class-left-icon | \-
-t-class-nav-btn | \-
-t-class-title | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-navbar-bg-color | @bg-color-container | -
---td-navbar-capsule-border-color | #e3e6ea | -
---td-navbar-capsule-border-radius | 32rpx | -
---td-navbar-capsule-height | 64rpx | -
---td-navbar-capsule-width | 176rpx | -
---td-navbar-color | @font-gray-1 | -
---td-navbar-height | 96rpx | -
---td-navbar-left-arrow-size | 48rpx | -
---td-navbar-title-font-size | 36rpx | -
---td-navbar-title-font-weight | 600 | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.md
deleted file mode 100644
index ccfad352..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/README.md
+++ /dev/null
@@ -1,105 +0,0 @@
----
-title: Navbar 导航栏
-description: 用于不同页面之间切换或者跳转,位于内容区的上方,系统状态栏的下方。
-spline: navigation
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-navbar": "tdesign-miniprogram/navbar/navbar",
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-
-### 基础导航栏
-
-{{ base }}
-
-### 胶囊样式导航栏
-
-{{ back-home }}
-
-### 带搜索导航栏
-
-{{ search }}
-
-### 带图片导航栏
-
-{{ img }}
-
-### 组件样式
-
-{{ left-title }}
-
-### 自定义颜色
-
-{{ custom-color }}
-
-## API
-
-### Navbar Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-animation | Boolean | true | 是否添加动画效果 | N
-capsule | Slot | - | 左侧胶囊区域。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-delta | Number | 1 | 后退按钮后退层数,含义参考 [wx.navigateBack](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html),特殊的,传入 0 不会发生执行 wx.navigateBack | N
-fixed | Boolean | true | 是否固定在顶部 | N
-left | Slot | - | `0.26.0`。左侧内容区域。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-left-arrow | Boolean | false | `0.26.0`。是否展示左侧箭头 | N
-title | String / Slot | - | 页面标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-title-max-length | Number | - | 标题文字最大长度,超出的范围使用 `...` 表示 | N
-visible | Boolean | true | 是否显示 | N
-
-### Navbar Events
-
-名称 | 参数 | 描述
--- | -- | --
-complete | \- | navigateBack 执行完成后触发(失败或成功均会触发)
-fail | \- | navigateBack 执行失败后触发
-go-back | \- | 点击左侧箭头时触发
-success | \- | navigateBack 执行成功后触发
-### Navbar External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-capsule | 左侧胶囊区域样式类
-t-class-center | 中间内容样式类
-t-class-home-icon | 首页图标样式类
-t-class-left | 左侧内容样式类
-t-class-left-icon | 左侧图标样式类
-t-class-nav-btn | 导航按钮样式类
-t-class-title | 标题样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-navbar-bg-color | @bg-color-container | -
---td-navbar-capsule-border-color | #e3e6ea | -
---td-navbar-capsule-border-radius | 32rpx | -
---td-navbar-capsule-height | 64rpx | -
---td-navbar-capsule-width | 176rpx | -
---td-navbar-color | @font-gray-1 | -
---td-navbar-height | 96rpx | -
---td-navbar-left-arrow-size | 48rpx | -
---td-navbar-title-font-size | 36rpx | -
---td-navbar-title-font-weight | 600 | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.d.ts
deleted file mode 100644
index 45e2d20c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.d.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class Navbar extends SuperComponent {
- externalClasses: string[];
- timer: any;
- options: {
- multipleSlots: boolean;
- };
- properties: import("./type").TdNavbarProps;
- observers: {
- visible(this: Navbar, visible: any): void;
- 'title,titleMaxLength'(this: any): void;
- };
- data: {
- prefix: string;
- classPrefix: string;
- boxStyle: string;
- showTitle: string;
- hideLeft: boolean;
- hideCenter: boolean;
- };
- attached(): Promise;
- detached(): void;
- methods: {
- queryElements(capsuleRect: any): void;
- goBack(): void;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.js b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.js
deleted file mode 100644
index 32a7cd80..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.js
+++ /dev/null
@@ -1,163 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import { getRect, systemInfo } from '../common/utils';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-navbar`;
-let Navbar = class Navbar extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [
- `${prefix}-class`,
- `${prefix}-class-placeholder`,
- `${prefix}-class-content`,
- `${prefix}-class-title`,
- `${prefix}-class-left`,
- `${prefix}-class-center`,
- `${prefix}-class-left-icon`,
- `${prefix}-class-home-icon`,
- `${prefix}-class-capsule`,
- `${prefix}-class-nav-btn`,
- ];
- this.timer = null;
- this.options = {
- multipleSlots: true,
- };
- this.properties = props;
- this.observers = {
- visible(visible) {
- const { animation } = this.properties;
- const visibleClass = `${name}${visible ? '--visible' : '--hide'}`;
- this.setData({
- visibleClass: `${visibleClass}${animation ? '-animation' : ''}`,
- });
- if (this.timer) {
- clearTimeout(this.timer);
- }
- if (animation) {
- this.timer = setTimeout(() => {
- this.setData({
- visibleClass,
- });
- }, 300);
- }
- },
- 'title,titleMaxLength'() {
- const { title } = this.properties;
- const titleMaxLength = this.properties.titleMaxLength || Number.MAX_SAFE_INTEGER;
- let temp = title.slice(0, titleMaxLength);
- if (titleMaxLength < title.length)
- temp += '...';
- this.setData({
- showTitle: temp,
- });
- },
- };
- this.data = {
- prefix,
- classPrefix: name,
- boxStyle: '',
- showTitle: '',
- hideLeft: false,
- hideCenter: false,
- };
- this.methods = {
- queryElements(capsuleRect) {
- Promise.all([
- getRect(this, `.${this.data.classPrefix}__left`),
- getRect(this, `.${this.data.classPrefix}__center`),
- ]).then(([leftRect, centerRect]) => {
- if (leftRect.right > capsuleRect.left) {
- this.setData({
- hideLeft: true,
- hideCenter: true,
- });
- }
- else if (centerRect.right > capsuleRect.left) {
- this.setData({
- hideLeft: false,
- hideCenter: true,
- });
- }
- else {
- this.setData({
- hideLeft: false,
- hideCenter: false,
- });
- }
- });
- },
- goBack() {
- const { delta } = this.data;
- const that = this;
- this.triggerEvent('go-back');
- if (delta > 0) {
- wx.navigateBack({
- delta,
- fail(e) {
- that.triggerEvent('fail', e);
- },
- complete(e) {
- that.triggerEvent('complete', e);
- },
- success(e) {
- that.triggerEvent('success', e);
- },
- });
- }
- },
- };
- }
- attached() {
- return __awaiter(this, void 0, void 0, function* () {
- let rect = null;
- if (wx.getMenuButtonBoundingClientRect) {
- rect = wx.getMenuButtonBoundingClientRect();
- }
- if (!rect || !systemInfo)
- return;
- const { right } = yield getRect(this, `.${name}__left`);
- const boxStyleList = [];
- boxStyleList.push(`--td-navbar-padding-top: ${systemInfo.statusBarHeight}px`);
- if (rect && (systemInfo === null || systemInfo === void 0 ? void 0 : systemInfo.windowWidth)) {
- const maxSpacing = Math.max(right, systemInfo.windowWidth - rect.left);
- boxStyleList.push(`--td-navbar-center-left: ${maxSpacing}px`);
- boxStyleList.push(`--td-navbar-center-width: ${rect.left - maxSpacing}px`);
- boxStyleList.push(`--td-navbar-right: ${systemInfo.windowWidth - rect.left}px`);
- }
- boxStyleList.push(`--td-navbar-capsule-height: ${rect.height}px`);
- boxStyleList.push(`--td-navbar-capsule-width: ${rect.width}px`);
- boxStyleList.push(`--td-navbar-height: ${(rect.top - systemInfo.statusBarHeight) * 2 + rect.height}px`);
- this.setData({
- boxStyle: `${boxStyleList.join('; ')}`,
- });
- if (wx.onMenuButtonBoundingClientRectWeightChange) {
- wx.onMenuButtonBoundingClientRectWeightChange((res) => this.queryElements(res));
- }
- });
- }
- detached() {
- if (wx.offMenuButtonBoundingClientRectWeightChange) {
- wx.offMenuButtonBoundingClientRectWeightChange((res) => this.queryElements(res));
- }
- }
-};
-Navbar = __decorate([
- wxComponent()
-], Navbar);
-export default Navbar;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.json b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.json
deleted file mode 100644
index f783dae7..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon"
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxml
deleted file mode 100644
index 3ed1f16c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{showTitle}}
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxss
deleted file mode 100644
index 556e75f7..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/navbar.wxss
+++ /dev/null
@@ -1,134 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-navbar--fixed .t-navbar__content {
- position: fixed;
- top: 0;
- left: 0;
- z-index: 5001;
-}
-.t-navbar--visible {
- display: '';
-}
-.t-navbar--visible-animation {
- opacity: 1;
- transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
-}
-.t-navbar--hide-animation {
- opacity: 0;
- transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
-}
-.t-navbar--hide {
- display: none;
-}
-.t-navbar__placeholder {
- height: var(--td-navbar-height, 48px);
- padding-top: var(--td-navbar-padding-top, 20px);
- position: relative;
- visibility: hidden;
- box-sizing: content-box;
-}
-.t-navbar__content {
- position: relative;
- z-index: 1;
- height: var(--td-navbar-height, 48px);
- width: calc(100% - var(--td-navbar-right, 95px));
- padding-right: var(--td-navbar-right, 95px);
- padding-top: var(--td-navbar-padding-top, 20px);
- color: var(--td-navbar-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- background-color: var(--td-navbar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
- display: flex;
- align-items: center;
- box-sizing: content-box;
-}
-.t-navbar__left {
- position: relative;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- margin-left: var(--td-spacer-1, 24rpx);
- transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
-}
-.t-navbar__left-arrow {
- font-size: var(--td-navbar-left-arrow-size, 24px);
-}
-.t-navbar__left--hide {
- opacity: 0;
-}
-.t-navbar__capsule {
- box-sizing: border-box;
- width: var(--td-navbar-capsule-width, 88px);
- height: var(--td-navbar-capsule-height, 32px);
- display: flex;
- align-items: center;
-}
-.t-navbar__capsule::before {
- content: '';
- position: absolute;
- z-index: -1;
- top: 0;
- left: 0;
- width: 200%;
- height: 200%;
- transform: scale(0.5);
- transform-origin: 0 0;
- box-sizing: border-box;
- border-radius: calc(var(--td-navbar-capsule-border-radius, 16px) * 2);
- border: 2rpx solid var(--td-navbar-capsule-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-navbar__capsule:empty {
- display: none;
-}
-.t-navbar__center {
- font-size: 18px;
- text-align: center;
- position: absolute;
- bottom: 0;
- left: var(--td-navbar-center-left, var(--td-navbar-right, 95px));
- width: var(--td-navbar-center-width);
- height: var(--td-navbar-height, 48px);
- line-height: var(--td-navbar-height, 48px);
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- overflow: hidden;
- transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
-}
-.t-navbar__center:empty {
- display: none;
-}
-.t-navbar__center-title {
- font-size: var(--td-navbar-title-font-size, 18px);
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- font-weight: var(--td-navbar-title-font-weight, 600);
-}
-.t-navbar__center--hide {
- opacity: 0;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.d.ts
deleted file mode 100644
index 168bee24..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdNavbarProps } from './type';
-declare const props: TdNavbarProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.js
deleted file mode 100644
index 3906316e..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/props.js
+++ /dev/null
@@ -1,29 +0,0 @@
-const props = {
- animation: {
- type: Boolean,
- value: true,
- },
- delta: {
- type: Number,
- value: 1,
- },
- fixed: {
- type: Boolean,
- value: true,
- },
- leftArrow: {
- type: Boolean,
- value: false,
- },
- title: {
- type: String,
- },
- titleMaxLength: {
- type: Number,
- },
- visible: {
- type: Boolean,
- value: true,
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.d.ts
deleted file mode 100644
index 11a4e772..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.d.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-export interface TdNavbarProps {
- animation?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- delta?: {
- type: NumberConstructor;
- value?: number;
- };
- fixed?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- leftArrow?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- title?: {
- type: StringConstructor;
- value?: string;
- };
- titleMaxLength?: {
- type: NumberConstructor;
- value?: number;
- };
- visible?: {
- type: BooleanConstructor;
- value?: boolean;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/navbar/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/row/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/row/README.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/row/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/row/props.d.ts
deleted file mode 100644
index 34bd6972..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/row/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdRowProps } from './type';
-declare const props: TdRowProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/row/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/row/props.js
deleted file mode 100644
index 2faa4980..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/row/props.js
+++ /dev/null
@@ -1,6 +0,0 @@
-const props = {
- gutter: {
- type: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.d.ts
deleted file mode 100644
index 136e65c0..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-export default class Row extends SuperComponent {
- externalClasses: any[];
- properties: import("./type").TdRowProps;
- data: {
- prefix: string;
- };
- relations: RelationsOptions;
- observers: {
- gutter(): void;
- };
- methods: {
- setGutter(): void;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.js b/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.js
deleted file mode 100644
index a82c5c87..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.js
+++ /dev/null
@@ -1,49 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-let Row = class Row extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [];
- this.properties = props;
- this.data = {
- prefix,
- };
- this.relations = {
- '../col/col': {
- type: 'child',
- linked(target) {
- const { gutter } = this.data;
- if (gutter) {
- target.setData({ gutter });
- }
- },
- },
- };
- this.observers = {
- gutter() {
- this.setGutter();
- },
- };
- this.methods = {
- setGutter() {
- const { gutter } = this.data;
- const cols = this.$children;
- cols.forEach((col) => {
- col.setData({ gutter });
- });
- },
- };
- }
-};
-Row = __decorate([
- wxComponent()
-], Row);
-export default Row;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.json b/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.json
deleted file mode 100644
index 4f0a3f08..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {}
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.wxml
deleted file mode 100644
index 6f82c334..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.wxml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.wxs b/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.wxs
deleted file mode 100644
index 9d83b9de..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.wxs
+++ /dev/null
@@ -1,17 +0,0 @@
-var utils = require('../common/utils.wxs');
-
-function getRowStyles(gutter, style, customStyle) {
- var _style = '';
- if (gutter) {
- _style = utils._style({
- 'margin-right': utils.addUnit(-gutter / 2),
- 'margin-left': utils.addUnit(-gutter / 2),
- });
- }
-
- return utils._style([style, customStyle]) + _style;
-}
-
-module.exports = {
- getRowStyles: getRowStyles,
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.wxss
deleted file mode 100644
index 69fab887..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/row/row.wxss
+++ /dev/null
@@ -1,6 +0,0 @@
-.t-row {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- box-sizing: border-box;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/row/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/row/type.d.ts
deleted file mode 100644
index f151c1c9..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/row/type.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export interface TdRowProps {
- gutter?: {
- type: null;
- value?: string | number;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/row/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/row/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/row/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.en-US.md
deleted file mode 100644
index 26d0ba14..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.en-US.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-## API
-
-### Search Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-action | String / Slot | '' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-adjust-position | Boolean | true | \- | N
-always-embed | Boolean | false | \- | N
-center | Boolean | false | \- | N
-clearable | Boolean | true | \- | N
-confirm-hold | Boolean | false | \- | N
-confirm-type | String | search | options: send/search/next/go/done | N
-cursor | Number | - | required | Y
-cursor-spacing | Number | 0 | \- | N
-disabled | Boolean | false | \- | N
-focus | Boolean | false | \- | N
-hold-keyboard | Boolean | false | \- | N
-label | String | '' | `deprecated` | N
-left-icon | String / Slot | 'search' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-maxcharacter | Number | - | \- | N
-maxlength | Number | -1 | \- | N
-placeholder | String | '' | \- | N
-placeholder-class | String | input-placeholder | \- | N
-placeholder-style | String | - | required | Y
-result-list | Array | [] | Typescript:`Array` | N
-right-icon | String / Slot | 'close-circle-filled' | `deprecated`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-selection-end | Number | -1 | \- | N
-selection-start | Number | -1 | \- | N
-shape | String | 'square' | options: square/round | N
-type | String | 'text' | options: text/number/idcard/digit/nickname | N
-value | String | '' | \- | N
-
-### Search Events
-
-name | params | description
--- | -- | --
-action-click | `({})` | \-
-blur | `({ value: string })` | \-
-change | `({ value: string })` | \-
-clear | `({ value: string })` | \-
-focus | `({ value: string })` | \-
-submit | `({ value: string })` | \-
-### Search External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-action | \-
-t-class-clear | \-
-t-class-input | \-
-t-class-input-container | \-
-t-class-left | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-search-action-color | @brand-color | -
---td-search-bg-color | @bg-color-secondarycontainer | -
---td-search-clear-icon-color | @font-gray-3 | -
---td-search-font-size | @font-size-m | -
---td-search-height | 80rpx | -
---td-search-icon-color | @font-gray-3 | -
---td-search-label-color | @font-gray-1 | -
---td-search-padding | 16rpx 24rpx | -
---td-search-placeholder-color | @font-gray-3 | -
---td-search-square-radius | @radius-default | -
---td-search-text-color | @font-gray-1 | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.md
deleted file mode 100644
index 13a8a12a..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/README.md
+++ /dev/null
@@ -1,122 +0,0 @@
----
-title: Search 搜索框
-description: 用于用户输入搜索信息,并进行页面内容搜索。
-spline: form
-isComponent: true
----
-
-


-
-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-search": "tdesign-miniprogram/search/search"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 01 组件类型
-
-基础搜索框
-
-{{ base }}
-
-获取焦点后显示取消按钮
-
-{{ action }}
-
-### 02 组件样式
-
-搜索框形状
-
-{{ shape }}
-
-### 03 组件状态
-
-默认状态其他对齐方式
-
-{{ other }}
-
-## API
-
-### Search Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-action | String / Slot | '' | 自定义右侧操作按钮文字。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-adjust-position | Boolean | true | 键盘弹起时,是否自动上推页面 | N
-always-embed | Boolean | false | 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) | N
-center | Boolean | false | 是否居中 | N
-clearable | Boolean | true | 是否启用清除控件 | N
-confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起 | N
-confirm-type | String | search | 设置键盘右下角按钮的文字,仅在type='text'时生效。
具体释义:
`send` 右下角按钮为“发送”;
`search` 右下角按钮为“搜索”;
`next` 右下角按钮为“下一个”;
`go` 右下角按钮为“前往”;
`done` 右下角按钮为“完成”。
[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html)。可选项:send/search/next/go/done | N
-cursor | Number | - | 必需。指定 focus 时的光标位置 | Y
-cursor-spacing | Number | 0 | 搜索框聚焦时底部与键盘的距离 | N
-disabled | Boolean | false | 是否禁用 | N
-focus | Boolean | false | 是否聚焦 | N
-hold-keyboard | Boolean | false | focus时,点击页面的时候不收起键盘 | N
-label | String | '' | 已废弃。左侧文本 | N
-left-icon | String / Slot | 'search' | 左侧图标。如果需要使用 `Slot` 进行自定义,必须将该值设置为假值。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 | N
-maxlength | Number | -1 | 用户最多可以输入的文本长度,一个中文等于一个计数长度。默认为 -1,不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用 | N
-placeholder | String | '' | 占位符 | N
-placeholder-class | String | input-placeholder | 指定 placeholder 的样式类 | N
-placeholder-style | String | - | 必需。指定 placeholder 的样式 | Y
-result-list | Array | [] | 预览结果列表。TS 类型:`Array` | N
-right-icon | String / Slot | 'close-circle-filled' | 已废弃。右侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-selection-end | Number | -1 | 光标结束位置,自动聚集时有效,需与 selection-start 搭配使用 | N
-selection-start | Number | -1 | 光标起始位置,自动聚集时有效,需与 selection-end 搭配使用 | N
-shape | String | 'square' | 搜索框形状。可选项:square/round | N
-type | String | 'text' | 拉起键盘的类型。可选项:text/number/idcard/digit/nickname | N
-value | String | '' | 值 | N
-
-### Search Events
-
-名称 | 参数 | 描述
--- | -- | --
-action-click | `({})` | 点击右侧操作按钮文字时触发
-blur | `({ value: string })` | 失去焦点时触发
-change | `({ value: string })` | 值发生变化时触发
-clear | `({ value: string })` | 点击清除时触发
-focus | `({ value: string })` | 聚焦时触发
-submit | `({ value: string })` | 提交时触发
-### Search External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-action | 操作按钮样式类
-t-class-clear | 右侧图标样式类
-t-class-input | 输入框样式类
-t-class-input-container | 输入框容器样式类
-t-class-left | 左侧图标样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-search-action-color | @brand-color | -
---td-search-bg-color | @bg-color-secondarycontainer | -
---td-search-clear-icon-color | @font-gray-3 | -
---td-search-font-size | @font-size-m | -
---td-search-height | 80rpx | -
---td-search-icon-color | @font-gray-3 | -
---td-search-label-color | @font-gray-1 | -
---td-search-padding | 16rpx 24rpx | -
---td-search-placeholder-color | @font-gray-3 | -
---td-search-result-high-light-color | @brand-color | -
---td-search-square-radius | @radius-default | -
---td-search-text-color | @font-gray-1 | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.d.ts
deleted file mode 100644
index 81c5bff1..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdSearchProps } from './type';
-declare const props: TdSearchProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.js
deleted file mode 100644
index 61b3da8d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/props.js
+++ /dev/null
@@ -1,103 +0,0 @@
-const props = {
- action: {
- type: String,
- value: '',
- },
- adjustPosition: {
- type: Boolean,
- value: true,
- },
- alwaysEmbed: {
- type: Boolean,
- value: false,
- },
- center: {
- type: Boolean,
- value: false,
- },
- clearable: {
- type: Boolean,
- value: true,
- },
- confirmHold: {
- type: Boolean,
- value: false,
- },
- confirmType: {
- type: String,
- value: 'search',
- },
- cursor: {
- type: Number,
- required: true,
- },
- cursorSpacing: {
- type: Number,
- value: 0,
- },
- disabled: {
- type: Boolean,
- value: false,
- },
- focus: {
- type: Boolean,
- value: false,
- },
- holdKeyboard: {
- type: Boolean,
- value: false,
- },
- leftIcon: {
- type: String,
- value: 'search',
- },
- maxcharacter: {
- type: Number,
- },
- maxlength: {
- type: Number,
- value: -1,
- },
- placeholder: {
- type: String,
- value: '',
- },
- placeholderClass: {
- type: String,
- value: 'input-placeholder',
- },
- placeholderStyle: {
- type: String,
- value: '',
- required: true,
- },
- resultList: {
- type: Array,
- value: [],
- },
- selectionEnd: {
- type: Number,
- value: -1,
- },
- selectionStart: {
- type: Number,
- value: -1,
- },
- shape: {
- type: String,
- value: 'square',
- },
- style: {
- type: String,
- value: '',
- },
- type: {
- type: String,
- value: 'text',
- },
- value: {
- type: String,
- value: '',
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.d.ts
deleted file mode 100644
index 76ab9cb6..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.d.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class Search extends SuperComponent {
- externalClasses: string[];
- options: {
- multipleSlots: boolean;
- };
- properties: import("./type").TdSearchProps;
- observers: {
- resultList(val: any): void;
- };
- data: {
- classPrefix: string;
- prefix: string;
- isShowResultList: boolean;
- isSelected: boolean;
- };
- onInput(e: any): void;
- onFocus(e: any): void;
- onBlur(e: any): void;
- handleClear(): void;
- onConfirm(e: any): void;
- onActionClick(): void;
- onSelectResultItem(e: any): void;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.js b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.js
deleted file mode 100644
index bc6e9f67..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.js
+++ /dev/null
@@ -1,104 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { getCharacterLength } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-search`;
-let Search = class Search extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [
- `${prefix}-class`,
- `${prefix}-class-input-container`,
- `${prefix}-class-input`,
- `${prefix}-class-action`,
- `${prefix}-class-left`,
- `${prefix}-class-clear`,
- ];
- this.options = {
- multipleSlots: true,
- };
- this.properties = props;
- this.observers = {
- resultList(val) {
- const { isSelected } = this.data;
- if (val.length) {
- if (isSelected) {
- this.setData({
- isShowResultList: false,
- isSelected: false,
- });
- }
- else {
- this.setData({
- isShowResultList: true,
- });
- }
- }
- else {
- this.setData({
- isShowResultList: false,
- });
- }
- },
- };
- this.data = {
- classPrefix: name,
- prefix,
- isShowResultList: false,
- isSelected: false,
- };
- }
- onInput(e) {
- let { value } = e.detail;
- const { maxcharacter } = this.properties;
- if (maxcharacter && typeof maxcharacter === 'number' && maxcharacter > 0) {
- const { characters } = getCharacterLength('maxcharacter', value, maxcharacter);
- value = characters;
- }
- this.setData({
- value,
- });
- this.triggerEvent('change', { value });
- }
- onFocus(e) {
- const { value } = e.detail;
- this.triggerEvent('focus', { value });
- }
- onBlur(e) {
- const { value } = e.detail;
- this.triggerEvent('blur', { value });
- }
- handleClear() {
- this.setData({ value: '' });
- this.triggerEvent('clear', { value: '' });
- this.triggerEvent('change', { value: '' });
- }
- onConfirm(e) {
- const { value } = e.detail;
- this.triggerEvent('submit', { value });
- }
- onActionClick() {
- this.triggerEvent('action-click');
- }
- onSelectResultItem(e) {
- const { index } = e.currentTarget.dataset;
- const item = this.properties.resultList[index];
- this.setData({
- value: item,
- isSelected: true,
- });
- this.triggerEvent('change', { value: item });
- this.triggerEvent('selectresult', { index, item });
- }
-};
-Search = __decorate([
- wxComponent()
-], Search);
-export default Search;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.json b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.json
deleted file mode 100644
index ed5b2b62..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon",
- "t-cell": "../cell/cell"
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxml
deleted file mode 100644
index aab4903b..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{action}}
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxs b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxs
deleted file mode 100644
index ac86989c..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxs
+++ /dev/null
@@ -1,6 +0,0 @@
-var highLight = function (label, keyword) {
- return label.replace(keyword, '' + keyword + '');
-};
-module.exports = {
- highLight: highLight,
-};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxss
deleted file mode 100644
index 31f29f60..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/search.wxss
+++ /dev/null
@@ -1,108 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-search {
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-.t-search__label {
- padding: 8rpx;
- color: var(--td-search-label-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
-}
-.t-search__input-box {
- flex: 1;
- box-sizing: border-box;
- display: flex;
- height: var(--td-search-height, 80rpx);
- align-items: center;
- border: 2rpx solid var(--td-search-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
- background: var(--td-search-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
- padding: var(--td-search-padding, 16rpx 24rpx);
-}
-.t-search__input-box.t-is-focused {
- border-color: var(--td-search-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
-}
-.t-search__input-box--round {
- border-radius: calc(var(--td-search-height, 80rpx) / 2);
-}
-.t-search__input-box--square {
- border-radius: var(--td-search-square-radius, var(--td-radius-default, 12rpx));
-}
-.t-search__input-box--center {
- text-align: center;
-}
-.t-search__input-box .t-input__keyword {
- display: inline-block;
- flex: 1;
- color: var(--td-search-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- font-size: var(--td-search-font-size, var(--td-font-size-m, 32rpx));
- padding-left: 10rpx;
- min-height: 48rpx;
- line-height: 48rpx;
-}
-.t-search__input-box .t-icon {
- color: var(--td-search-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
-}
-.t-search__clear {
- position: relative;
- margin-left: 10px;
- color: var(--td-search-clear-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
-}
-.t-search__clear.relative {
- position: relative;
-}
-.t-search__clear::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-search__search-action {
- margin-left: 30rpx;
- font-size: var(--td-search-font-size, var(--td-font-size-m, 32rpx));
- color: var(--td-search-action-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-search__placeholder {
- color: var(--td-search-placeholder-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
-}
-.t-search__placeholder--center {
- text-align: center;
-}
-.t-search__result-item--highLight {
- color: var(--td-search-result-high-light-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-search__result-list .t-search__result-item {
- padding-left: 0;
-}
-.t-search__result-list .t-search__result-item::after {
- left: 0;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.d.ts
deleted file mode 100644
index 8b73ffad..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.d.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-export interface TdSearchProps {
- action?: {
- type: StringConstructor;
- value?: string;
- };
- adjustPosition?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- alwaysEmbed?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- center?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- clearable?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- confirmHold?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- confirmType?: {
- type: StringConstructor;
- value?: 'send' | 'search' | 'next' | 'go' | 'done';
- };
- cursor: {
- type: NumberConstructor;
- value?: number;
- required?: boolean;
- };
- cursorSpacing?: {
- type: NumberConstructor;
- value?: number;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- focus?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- holdKeyboard?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- leftIcon?: {
- type: StringConstructor;
- value?: string;
- };
- maxcharacter?: {
- type: NumberConstructor;
- value?: number;
- };
- maxlength?: {
- type: NumberConstructor;
- value?: number;
- };
- placeholder?: {
- type: StringConstructor;
- value?: string;
- };
- placeholderClass?: {
- type: StringConstructor;
- value?: string;
- };
- placeholderStyle: {
- type: StringConstructor;
- value?: string;
- required?: boolean;
- };
- resultList?: {
- type: ArrayConstructor;
- value?: Array;
- };
- selectionEnd?: {
- type: NumberConstructor;
- value?: number;
- };
- selectionStart?: {
- type: NumberConstructor;
- value?: number;
- };
- shape?: {
- type: StringConstructor;
- value?: 'square' | 'round';
- };
- style?: {
- type: StringConstructor;
- value?: string;
- };
- type?: {
- type: StringConstructor;
- value?: 'text' | 'number' | 'idcard' | 'digit' | 'nickname';
- };
- value?: {
- type: StringConstructor;
- value?: string;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/search/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.en-US.md
deleted file mode 100644
index 27af848b..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.en-US.md
+++ /dev/null
@@ -1,100 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Tag Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-closable | Boolean / Object / Slot | false | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-disabled | Boolean | false | \- | N
-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-max-width | String / Number | - | \- | N
-shape | String | square | options: square/round/mark | N
-size | String | medium | options: small/medium/large/extra-large | N
-theme | String | default | options: default/primary/warning/danger/success | N
-variant | String | dark | options: dark/light/outline/light-outline | N
-
-### Tag Events
-
-name | params | description
--- | -- | --
-click | - | \-
-close | - | \-
-### Tag External Classes
-
-className | Description
--- | --
-t-class | \-
-
-
-### CheckTag Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-checked | Boolean | undefined | \- | N
-default-checked | Boolean | undefined | uncontrolled property | N
-closable | Boolean | false | \- | N
-content | String / Number / Array / Slot | - | Typescript:`string \| number \| string[]` | N
-disabled | Boolean | false | \- | N
-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-shape | String | square | options: square/round/mark | N
-size | String | medium | options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-variant | String | dark | `0.26.0`。options: dark/light/outline/light-outline | N
-
-### CheckTag Events
-
-name | params | description
--- | -- | --
-change | `(checked: boolean)` | \-
-click | - | \-
-close | \- | \-
-### CheckTag External Classes
-
-className | Description
--- | --
-t-class | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-tag-close-icon-color | @font-gray-3 | -
---td-tag-danger-color | @error-color | -
---td-tag-danger-light-color | @error-color-1 | -
---td-tag-default-color | @bg-color-component | -
---td-tag-default-font-color | @font-gray-1 | -
---td-tag-default-light-color | @bg-color-secondarycontainer | -
---td-tag-disabled-background-color | @bg-color-component-disabled | -
---td-tag-disabled-border-color | @component-border | -
---td-tag-disabled-color | @font-gray-4 | -
---td-tag-extra-large-font-size | @font-size-base | -
---td-tag-extra-large-height | 80rpx | -
---td-tag-extra-large-icon-size | 32rpx | -
---td-tag-extra-large-padding | 32rpx - 1px | -
---td-tag-large-font-size | @font-size-base | -
---td-tag-large-height | 56rpx | -
---td-tag-large-icon-size | 32rpx | -
---td-tag-large-padding | 16rpx - 1px | -
---td-tag-mark-border-radius | @tag-round-border-radius | -
---td-tag-medium-font-size | @font-size-s | -
---td-tag-medium-height | 48rpx | -
---td-tag-medium-icon-size | 28rpx | -
---td-tag-medium-padding | 16rpx - 1px | -
---td-tag-outline-bg-color | @bg-color-container | -
---td-tag-primary-color | @brand-color | -
---td-tag-primary-light-color | @brand-color-light | -
---td-tag-round-border-radius | 999px | -
---td-tag-small-font-size | @font-size | -
---td-tag-small-height | 40rpx | -
---td-tag-small-icon-size | 24rpx | -
---td-tag-small-padding | 12rpx - 1px | -
---td-tag-square-border-radius | 8rpx | -
---td-tag-success-color | @success-color | -
---td-tag-success-light-color | @success-color-1 | -
---td-tag-warning-color | @warning-color | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.md
deleted file mode 100644
index 2f21c3de..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/README.md
+++ /dev/null
@@ -1,148 +0,0 @@
----
-title: Tag 标签
-description: 用于表明主体的类目,属性或状态。
-spline: data
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-tag": "tdesign-miniprogram/tag/tag",
- "t-check-tag": "tdesign-miniprogram/check-tag/check-tag"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 组件类型
-
-{{ type }}
-
-可关闭的标签
-
-{{ closable }}
-
-可点击的标签
-
-{{ checkable }}
-
-### 组件状态
-
-展示型标签
-
-{{ theme }}
-
-### 组件尺寸
-
-{{ size }}
-
-
-## API
-
-### Tag Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-closable | Boolean / Object / Slot | false | 标签是否可关闭。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-disabled | Boolean | false | 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态 | N
-icon | String / Object / Slot | - | 标签中的图标,可自定义图标呈现。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-max-width | String / Number | - | 标签最大宽度,宽度超出后会出现省略号。示例:'50px' / 80 | N
-shape | String | square | 标签类型,有三种:方形、圆角方形、标记型。可选项:square/round/mark | N
-size | String | medium | 标签尺寸。可选项:small/medium/large/extra-large | N
-theme | String | default | 组件风格,用于描述组件不同的应用场景。可选项:default/primary/warning/danger/success | N
-variant | String | dark | 标签风格变体。可选项:dark/light/outline/light-outline | N
-
-### Tag Events
-
-名称 | 参数 | 描述
--- | -- | --
-click | - | 点击时触发
-close | - | 如果关闭按钮存在,点击关闭按钮时触发
-### Tag External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-
-
-### CheckTag Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-checked | Boolean | undefined | 标签选中的状态,默认风格(theme=default)才有选中态 | N
-default-checked | Boolean | undefined | 标签选中的状态,默认风格(theme=default)才有选中态。非受控属性 | N
-closable | Boolean | false | 标签是否可关闭 | N
-content | String / Number / Array / Slot | - | 组件子元素;传入数组时:[选中内容,非选中内容]。TS 类型:`string \| number \| string[]` | N
-disabled | Boolean | false | 标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态 | N
-icon | String / Object / Slot | - | 标签图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-shape | String | square | 标签类型,有三种:方形、圆角方形、标记型。可选项:square/round/mark | N
-size | String | medium | 标签尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-variant | String | dark | `0.26.0`。标签风格变体。可选项:dark/light/outline/light-outline | N
-
-### CheckTag Events
-
-名称 | 参数 | 描述
--- | -- | --
-change | `(checked: boolean)` | 状态切换时触发
-click | - | 点击标签时触发
-close | \- | 如果关闭按钮存在,点击关闭按钮时触发
-### CheckTag External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-tag-close-icon-color | @font-gray-3 | -
---td-tag-danger-color | @error-color | -
---td-tag-danger-light-color | @error-color-1 | -
---td-tag-default-color | @bg-color-component | -
---td-tag-default-font-color | @font-gray-1 | -
---td-tag-default-light-color | @bg-color-secondarycontainer | -
---td-tag-disabled-background-color | @bg-color-component-disabled | -
---td-tag-disabled-border-color | @component-border | -
---td-tag-disabled-color | @font-gray-4 | -
---td-tag-extra-large-font-size | @font-size-base | -
---td-tag-extra-large-height | 80rpx | -
---td-tag-extra-large-icon-size | 32rpx | -
---td-tag-extra-large-padding | 32rpx - 1px | -
---td-tag-large-font-size | @font-size-base | -
---td-tag-large-height | 56rpx | -
---td-tag-large-icon-size | 32rpx | -
---td-tag-large-padding | 16rpx - 1px | -
---td-tag-mark-border-radius | @tag-round-border-radius | -
---td-tag-medium-font-size | @font-size-s | -
---td-tag-medium-height | 48rpx | -
---td-tag-medium-icon-size | 28rpx | -
---td-tag-medium-padding | 16rpx - 1px | -
---td-tag-outline-bg-color | @bg-color-container | -
---td-tag-primary-color | @brand-color | -
---td-tag-primary-light-color | @brand-color-light | -
---td-tag-round-border-radius | 999px | -
---td-tag-small-font-size | @font-size | -
---td-tag-small-height | 40rpx | -
---td-tag-small-icon-size | 24rpx | -
---td-tag-small-padding | 12rpx - 1px | -
---td-tag-square-border-radius | 8rpx | -
---td-tag-success-color | @success-color | -
---td-tag-success-light-color | @success-color-1 | -
---td-tag-warning-color | @warning-color | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.d.ts
deleted file mode 100644
index 8074655d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdTagProps } from './type';
-declare const props: TdTagProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.js
deleted file mode 100644
index 37b936b6..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/props.js
+++ /dev/null
@@ -1,36 +0,0 @@
-const props = {
- closable: {
- type: null,
- value: false,
- },
- disabled: {
- type: Boolean,
- value: false,
- },
- externalClasses: {
- type: Array,
- },
- icon: {
- type: null,
- },
- maxWidth: {
- type: null,
- },
- shape: {
- type: String,
- value: 'square',
- },
- size: {
- type: String,
- value: 'medium',
- },
- theme: {
- type: String,
- value: 'default',
- },
- variant: {
- type: String,
- value: 'dark',
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.d.ts
deleted file mode 100644
index 2c86ef09..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.d.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-///
-import { SuperComponent } from '../common/src/index';
-export default class Tag extends SuperComponent {
- data: {
- prefix: string;
- classPrefix: string;
- className: string;
- tagStyle: string;
- };
- properties: import("./type").TdTagProps;
- externalClasses: string[];
- options: WechatMiniprogram.Component.ComponentOptions;
- lifetimes: {
- attached(): void;
- };
- observers: {
- 'size, shape, theme, variant, closable, disabled'(): void;
- maxWidth(): void;
- icon(v: any): void;
- closable(v: any): void;
- };
- methods: {
- setClass(): void;
- setTagStyle(): string;
- handleClick(e: WechatMiniprogram.BaseEvent): void;
- handleClose(e: WechatMiniprogram.BaseEvent): void;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.js b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.js
deleted file mode 100644
index da271cdd..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.js
+++ /dev/null
@@ -1,93 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { wxComponent, SuperComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { classNames, isNumber, calcIcon } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-tag`;
-let Tag = class Tag extends SuperComponent {
- constructor() {
- super(...arguments);
- this.data = {
- prefix,
- classPrefix: name,
- className: '',
- tagStyle: '',
- };
- this.properties = props;
- this.externalClasses = [`${prefix}-class`];
- this.options = {
- multipleSlots: true,
- };
- this.lifetimes = {
- attached() {
- this.setClass();
- this.setTagStyle();
- },
- };
- this.observers = {
- 'size, shape, theme, variant, closable, disabled'() {
- this.setClass();
- },
- maxWidth() {
- this.setTagStyle();
- },
- icon(v) {
- this.setData({
- _icon: calcIcon(v),
- });
- },
- closable(v) {
- this.setData({
- _closable: calcIcon(v, 'close'),
- });
- },
- };
- this.methods = {
- setClass() {
- const { prefix, classPrefix } = this.data;
- const { size, shape, theme, variant, closable, disabled } = this.properties;
- const tagClass = [
- classPrefix,
- `${classPrefix}--${theme || 'default'}`,
- `${classPrefix}--${variant}`,
- closable ? `${classPrefix}--closable ${prefix}-is-closable` : '',
- disabled ? `${classPrefix}--disabled ${prefix}-is-disabled` : '',
- `${classPrefix}--${size}`,
- `${classPrefix}--${shape}`,
- ];
- const className = classNames(tagClass);
- this.setData({
- className,
- });
- },
- setTagStyle() {
- const { maxWidth } = this.properties;
- if (!maxWidth) {
- return '';
- }
- const width = isNumber(maxWidth) ? `${maxWidth}px` : maxWidth;
- this.setData({ tagStyle: `max-width:${width};` });
- },
- handleClick(e) {
- if (this.data.disabled)
- return;
- this.triggerEvent('click', e);
- },
- handleClose(e) {
- if (this.data.disabled)
- return;
- this.triggerEvent('close', e);
- },
- };
- }
-};
-Tag = __decorate([
- wxComponent()
-], Tag);
-export default Tag;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.json b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.json
deleted file mode 100644
index 6f15f575..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": ".././icon/icon"
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.wxml
deleted file mode 100644
index ac356cc2..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.wxml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.wxss
deleted file mode 100644
index 6d60d28a..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/tag.wxss
+++ /dev/null
@@ -1,244 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-tag {
- display: inline-flex;
- align-items: center;
- border: 2rpx solid transparent;
- box-sizing: border-box;
- border-radius: var(--td-tag-square-border-radius, 8rpx);
- font-size: var(--td-tag-medium-font-size, var(--td-font-size-s, 24rpx));
- user-select: none;
- vertical-align: middle;
-}
-.t-tag__text {
- word-wrap: normal;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-.t-tag__icon,
-.t-tag__icon-close {
- display: flex;
- align-items: center;
-}
-.t-tag__icon-close {
- color: var(--td-tag-close-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
-}
-.t-tag__icon:not(:empty) + .t-tag__text:not(:empty),
-.t-tag__text:not(:empty) + .t-tag__icon-close:not(:empty) {
- margin-left: 8rpx;
-}
-.t-tag.t-tag--small {
- height: var(--td-tag-small-height, 40rpx);
- line-height: var(--td-tag-small-height, 40rpx);
- padding: 0 var(--td-tag-small-padding, 11rpx);
- font-size: var(--td-tag-small-font-size, var(--td-font-size, 20rpx));
-}
-.t-tag.t-tag--small .t-icon,
-.t-tag.t-tag--small .t-icon-close {
- font-size: var(--td-tag-small-icon-size, 24rpx);
-}
-.t-tag.t-tag--small .t-tag__icon:not(:empty) + .t-tag__text:not(:empty),
-.t-tag.t-tag--small .t-tag__text:not(:empty) + .t-tag__icon-close:not(:empty) {
- margin-left: 4rpx;
-}
-.t-tag.t-tag--medium {
- height: var(--td-tag-medium-height, 48rpx);
- line-height: var(--td-tag-medium-height, 48rpx);
- padding: 0 var(--td-tag-medium-padding, 15rpx);
- font-size: var(--td-tag-medium-font-size, var(--td-font-size-s, 24rpx));
-}
-.t-tag.t-tag--medium .t-icon,
-.t-tag.t-tag--medium .t-icon-close {
- font-size: var(--td-tag-medium-icon-size, 28rpx);
-}
-.t-tag.t-tag--large {
- height: var(--td-tag-large-height, 56rpx);
- line-height: var(--td-tag-large-height, 56rpx);
- padding: 0 var(--td-tag-large-padding, 15rpx);
- font-size: var(--td-tag-large-font-size, var(--td-font-size-base, 28rpx));
-}
-.t-tag.t-tag--large .t-icon,
-.t-tag.t-tag--large .t-icon-close {
- font-size: var(--td-tag-large-icon-size, 32rpx);
-}
-.t-tag.t-tag--extra-large {
- height: var(--td-tag-extra-large-height, 80rpx);
- line-height: var(--td-tag-extra-large-height, 80rpx);
- padding: 0 var(--td-tag-extra-large-padding, 31rpx);
- font-size: var(--td-tag-extra-large-font-size, var(--td-font-size-base, 28rpx));
-}
-.t-tag.t-tag--extra-large .t-icon,
-.t-tag.t-tag--extra-large .t-icon-close {
- font-size: var(--td-tag-extra-large-icon-size, 32rpx);
-}
-.t-tag.t-tag--square {
- border-radius: var(--td-tag-square-border-radius, 8rpx);
-}
-.t-tag.t-tag--round {
- border-radius: var(--td-tag-round-border-radius, 999px);
-}
-.t-tag.t-tag--mark {
- border-radius: 0;
- border-top-right-radius: var(--td-tag-mark-border-radius, var(--td-tag-round-border-radius, 999px));
- border-bottom-right-radius: var(--td-tag-mark-border-radius, var(--td-tag-round-border-radius, 999px));
-}
-.t-tag--dark.t-tag--default {
- color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
- border-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- background-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-tag--dark.t-tag--primary {
- color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
- border-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- background-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-tag--dark.t-tag--success {
- color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
- border-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
- background-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
-}
-.t-tag--dark.t-tag--warning {
- color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
- border-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
- background-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
-}
-.t-tag--dark.t-tag--danger {
- color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
- border-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
- background-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
-}
-.t-tag--dark.t-tag--default {
- color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
-}
-.t-tag--outline.t-tag--default {
- color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- border-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- background-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
-}
-.t-tag--outline.t-tag--primary {
- color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- border-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- background-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
-}
-.t-tag--outline.t-tag--success {
- color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
- border-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
- background-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
-}
-.t-tag--outline.t-tag--warning {
- color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
- border-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
- background-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
-}
-.t-tag--outline.t-tag--danger {
- color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
- border-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
- background-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
-}
-.t-tag--outline.t-tag--default {
- color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
-}
-.t-tag--outline.t-tag--default {
- background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-tag--outline.t-tag--primary {
- background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-tag--outline.t-tag--success {
- background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-tag--outline.t-tag--warning {
- background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-tag--outline.t-tag--danger {
- background-color: var(--td-tag-outline-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-tag--light.t-tag--default {
- color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- border-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
- background-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
-}
-.t-tag--light.t-tag--primary {
- color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- border-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
- background-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
-}
-.t-tag--light.t-tag--success {
- color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
- border-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
- background-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
-}
-.t-tag--light.t-tag--warning {
- color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
- border-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
- background-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
-}
-.t-tag--light.t-tag--danger {
- color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
- border-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
- background-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
-}
-.t-tag--light.t-tag--default {
- color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
-}
-.t-tag--light-outline.t-tag--default {
- color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- border-color: var(--td-tag-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- background-color: var(--td-tag-default-light-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
-}
-.t-tag--light-outline.t-tag--primary {
- color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- border-color: var(--td-tag-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- background-color: var(--td-tag-primary-light-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
-}
-.t-tag--light-outline.t-tag--success {
- color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
- border-color: var(--td-tag-success-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
- background-color: var(--td-tag-success-light-color, var(--td-success-color-1, #e3f9e9));
-}
-.t-tag--light-outline.t-tag--warning {
- color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
- border-color: var(--td-tag-warning-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
- background-color: var(--td-tag-warning-light-color, var(--td-warning-color-1, #fff1e9));
-}
-.t-tag--light-outline.t-tag--danger {
- color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
- border-color: var(--td-tag-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
- background-color: var(--td-tag-danger-light-color, var(--td-error-color-1, #fff0ed));
-}
-.t-tag--light-outline.t-tag--default {
- color: var(--td-tag-default-font-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- border-color: var(--td-component-border, var(--td-gray-color-4, #dcdcdc));
-}
-.t-tag.t-tag--closable.t-tag--disabled {
- cursor: not-allowed;
- color: var(--td-tag-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
- background-color: var(--td-tag-disabled-background-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
- border-color: var(--td-tag-disabled-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/type.d.ts
deleted file mode 100644
index bd1147d9..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/type.d.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-export interface TdTagProps {
- closable?: {
- type: null;
- value?: boolean | object;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- externalClasses?: {
- type: ArrayConstructor;
- value?: ['t-class'];
- };
- icon?: {
- type: null;
- value?: string | object;
- };
- maxWidth?: {
- type: null;
- value?: string | number;
- };
- shape?: {
- type: StringConstructor;
- value?: 'square' | 'round' | 'mark';
- };
- size?: {
- type: StringConstructor;
- value?: 'small' | 'medium' | 'large' | 'extra-large';
- };
- theme?: {
- type: StringConstructor;
- value?: 'default' | 'primary' | 'warning' | 'danger' | 'success';
- };
- variant?: {
- type: StringConstructor;
- value?: 'dark' | 'light' | 'outline' | 'light-outline';
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/tag/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/tag/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/README.en-US.md b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/README.en-US.md
deleted file mode 100644
index 579747c8..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/README.en-US.md
+++ /dev/null
@@ -1,44 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Toast Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-direction | String | row | options: row/column | N
-duration | Number | 2000 | \- | N
-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-message | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-overlay-props | Object | - | Typescript:`OverlayProps `,[Overlay API Documents](./overlay?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/toast/type.ts) | N
-placement | String | middle | options: top/middle/bottom | N
-prevent-scroll-through | Boolean | false | \- | N
-show-overlay | Boolean | false | \- | N
-theme | String | - | options: loading/success/error | N
-using-custom-navbar | Boolean | false | \- | N
-
-### Toast Events
-
-name | params | description
--- | -- | --
-close | \- | \-
-destroy | \- | \-
-### Toast External Classes
-
-className | Description
--- | --
-t-class | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-toast-bg-color | @font-gray-2 | -
---td-toast-color | @font-white-1 | -
---td-toast-column-icon-size | 64rpx | -
---td-toast-max-width | 374rpx | -
---td-toast-radius | 8rpx | -
---td-toast-row-icon-size | 48rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/README.md b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/README.md
deleted file mode 100644
index bc6e1ee9..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
----
-title: Toast 轻提示
-description: 用于轻量级反馈或提示,不会打断用户操作。
-spline: message
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-toast": "tdesign-miniprogram/toast/toast"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 基础提示
-
-{{ base }}
-
-### 组件状态
-
-{{ theme }}
-
-### 显示遮罩
-{{ cover }}
-
-### 手动关闭
-{{ close }}
-## API
-
-### Toast Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-direction | String | row | 图标排列方式。可选项:row/column | N
-duration | Number | 2000 | 弹窗显示毫秒数 | N
-icon | String / Object / Slot | - | 自定义图标。传入对象则透传至 Icon 组件。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-message | String / Slot | - | 弹窗显示文字。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-overlay-props | Object | - | 遮罩层属性,透传至 Overlay。TS 类型:`OverlayProps `,[Overlay API Documents](./overlay?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/toast/type.ts) | N
-placement | String | middle | 弹窗展示位置。可选项: top/middle/bottom | N
-prevent-scroll-through | Boolean | false | 防止滚动穿透,即不允许点击和滚动 | N
-show-overlay | Boolean | false | 是否显示遮罩层 | N
-theme | String | - | 提示类型。可选项:loading/success/error | N
-using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
-
-### Toast Events
-
-名称 | 参数 | 描述
--- | -- | --
-close | \- | 轻提示隐藏的时候触发
-destroy | \- | 轻提示销毁的时候触发
-### Toast External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-toast-bg-color | @font-gray-2 | -
---td-toast-color | @font-white-1 | -
---td-toast-column-icon-size | 64rpx | -
---td-toast-max-width | 374rpx | -
---td-toast-radius | 8rpx | -
---td-toast-row-icon-size | 48rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/index.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/index.d.ts
deleted file mode 100644
index 4f0c188d..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/index.d.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-///
-///
-declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
-declare type ToastType = 'loading' | 'success' | 'error';
-declare type ToastPositionType = 'top' | 'middle' | 'bottom';
-declare type ToastDirectionType = 'row' | 'column';
-export declare type ToastOptionsType = {
- context?: Context;
- selector?: string;
- icon?: string;
- message?: string;
- duration?: number;
- theme?: ToastType;
- placement?: ToastPositionType;
- preventScrollThrough?: boolean;
- direction?: ToastDirectionType;
- close?: () => void;
-};
-declare function Toast(options: ToastOptionsType): void;
-declare function showToast(options?: ToastOptionsType): void;
-declare function hideToast(options?: ToastOptionsType): void;
-export { Toast as default, showToast, hideToast };
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/index.js b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/index.js
deleted file mode 100644
index 216f2083..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/index.js
+++ /dev/null
@@ -1,31 +0,0 @@
-var __rest = (this && this.__rest) || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
- t[p[i]] = s[p[i]];
- }
- return t;
-};
-import { getInstance } from '../common/utils';
-function Toast(options) {
- var _a;
- const { context, selector = '#t-toast' } = options, Options = __rest(options, ["context", "selector"]);
- const instance = getInstance(context, selector);
- if (instance) {
- instance.show(Object.assign(Object.assign({}, Options), { duration: (_a = Options.duration) !== null && _a !== void 0 ? _a : 2000 }));
- }
-}
-function showToast(options = {}) {
- Toast(options);
-}
-function hideToast(options = {}) {
- const { context, selector = '#t-toast' } = options;
- const instance = getInstance(context, selector);
- if (instance) {
- instance.hide();
- }
-}
-export { Toast as default, showToast, hideToast };
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/props.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/props.d.ts
deleted file mode 100644
index c6b0f86f..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdToastProps } from './type';
-declare const props: TdToastProps;
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/props.js b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/props.js
deleted file mode 100644
index cbdfd0cd..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/props.js
+++ /dev/null
@@ -1,39 +0,0 @@
-const props = {
- direction: {
- type: String,
- value: 'row',
- },
- duration: {
- type: Number,
- value: 2000,
- },
- icon: {
- type: null,
- },
- message: {
- type: String,
- },
- overlayProps: {
- type: Object,
- },
- placement: {
- type: String,
- value: 'middle',
- },
- preventScrollThrough: {
- type: Boolean,
- value: false,
- },
- showOverlay: {
- type: Boolean,
- value: false,
- },
- theme: {
- type: String,
- },
- usingCustomNavbar: {
- type: Boolean,
- value: false,
- },
-};
-export default props;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.d.ts
deleted file mode 100644
index ce0f9fc8..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.d.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-///
-import { SuperComponent } from '../common/src/index';
-import { ToastOptionsType } from './index';
-declare type Timer = NodeJS.Timeout | null;
-export default class Toast extends SuperComponent {
- externalClasses: string[];
- options: {
- multipleSlots: boolean;
- };
- behaviors: string[];
- hideTimer: Timer;
- data: {
- prefix: string;
- classPrefix: string;
- typeMapIcon: string;
- };
- properties: import("./type").TdToastProps;
- lifetimes: {
- detached(): void;
- };
- pageLifetimes: {
- hide(): void;
- };
- methods: {
- show(options: ToastOptionsType): void;
- hide(): void;
- destroyed(): void;
- loop(): void;
- };
-}
-export {};
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.js b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.js
deleted file mode 100644
index be660e53..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.js
+++ /dev/null
@@ -1,91 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import transition from '../mixins/transition';
-import { calcIcon } from '../common/utils';
-import useCustomNavbar from '../mixins/using-custom-navbar';
-const { prefix } = config;
-const name = `${prefix}-toast`;
-let Toast = class Toast extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`];
- this.options = {
- multipleSlots: true,
- };
- this.behaviors = [transition(), useCustomNavbar];
- this.hideTimer = null;
- this.data = {
- prefix,
- classPrefix: name,
- typeMapIcon: '',
- };
- this.properties = props;
- this.lifetimes = {
- detached() {
- this.destroyed();
- },
- };
- this.pageLifetimes = {
- hide() {
- this.hide();
- },
- };
- this.methods = {
- show(options) {
- if (this.hideTimer)
- clearTimeout(this.hideTimer);
- const iconMap = {
- loading: 'loading',
- success: 'check-circle',
- warning: 'error-circle',
- error: 'close-circle',
- };
- const typeMapIcon = iconMap[options === null || options === void 0 ? void 0 : options.theme];
- const defaultOptions = {
- direction: props.direction.value,
- duration: props.duration.value,
- icon: props.icon.value,
- message: props.message.value,
- placement: props.placement.value,
- preventScrollThrough: props.preventScrollThrough.value,
- theme: props.theme.value,
- };
- const data = Object.assign(Object.assign(Object.assign({}, defaultOptions), options), { visible: true, isLoading: (options === null || options === void 0 ? void 0 : options.theme) === 'loading', _icon: calcIcon(typeMapIcon !== null && typeMapIcon !== void 0 ? typeMapIcon : options.icon) });
- const { duration } = data;
- this.setData(data);
- if (duration > 0) {
- this.hideTimer = setTimeout(() => {
- this.hide();
- }, duration);
- }
- },
- hide() {
- var _a, _b;
- if (!this.data.visible)
- return;
- this.setData({ visible: false });
- (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.close) === null || _b === void 0 ? void 0 : _b.call(_a);
- this.triggerEvent('close');
- },
- destroyed() {
- if (this.hideTimer) {
- clearTimeout(this.hideTimer);
- this.hideTimer = null;
- }
- this.triggerEvent('destory');
- },
- loop() { },
- };
- }
-};
-Toast = __decorate([
- wxComponent()
-], Toast);
-export default Toast;
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.json b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.json
deleted file mode 100644
index bccc6a24..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon",
- "t-loading": "../loading/loading",
- "t-overlay": "../overlay/overlay"
- }
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.wxml b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.wxml
deleted file mode 100644
index 44576ffa..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.wxml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
- {{message}}
-
-
-
-
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.wxss b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.wxss
deleted file mode 100644
index a927e1ac..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/toast.wxss
+++ /dev/null
@@ -1,98 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-toast {
- position: fixed;
- right: -50%;
- left: 50%;
- transform: translate(-50%, -50%);
- z-index: 12001;
- opacity: 1;
- transition: opacity 300ms ease;
- background-color: var(--td-toast-bg-color, var(--td-font-gray-2, rgba(0, 0, 0, 0.6)));
- border-radius: var(--td-toast-radius, 8rpx);
- font-size: 28rpx;
- color: var(--td-toast-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
- max-width: var(--td-toast-max-width, 374rpx);
- width: fit-content;
- box-sizing: border-box;
-}
-.t-toast--column {
- padding: 48rpx;
- min-width: 160rpx;
- min-height: 160rpx;
- border-radius: 16rpx;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.t-toast--loading.t-toast--with-text {
- min-width: 204rpx;
- min-height: 204rpx;
- padding-top: 0;
- padding-bottom: 0;
-}
-.t-toast__content {
- align-items: center;
- line-height: 44rpx;
-}
-.t-toast__content--row {
- display: flex;
- text-align: left;
- padding: 28rpx 44rpx;
-}
-.t-toast__content--column {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-.t-toast__icon--row {
- display: flex;
- font-size: var(--td-toast-row-icon-size, 48rpx);
-}
-.t-toast__icon--column {
- font-size: var(--td-toast-column-icon-size, 64rpx);
-}
-.t-toast__text {
- overflow: hidden;
- text-overflow: ellipsis;
- -webkit-line-clamp: 3;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- white-space: pre-line;
-}
-.t-toast__text--column:not(:empty):not(:only-child) {
- margin-top: 16rpx;
-}
-.t-toast__text--row:not(:empty):not(:only-child) {
- margin-left: 16rpx;
-}
-.t-toast.t-fade-enter,
-.t-toast.t-fade-leave-to {
- opacity: 0;
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/type.d.ts b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/type.d.ts
deleted file mode 100644
index b93d02c9..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/type.d.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { OverlayProps } from '../overlay/index';
-export interface TdToastProps {
- direction?: {
- type: StringConstructor;
- value?: 'row' | 'column';
- };
- duration?: {
- type: NumberConstructor;
- value?: number;
- };
- icon?: {
- type: null;
- value?: string | object;
- };
- message?: {
- type: StringConstructor;
- value?: string;
- };
- overlayProps?: {
- type: ObjectConstructor;
- value?: OverlayProps;
- };
- placement?: {
- type: StringConstructor;
- value?: 'top' | 'middle' | 'bottom';
- };
- preventScrollThrough?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- showOverlay?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- theme?: {
- type: StringConstructor;
- value?: 'loading' | 'success' | 'error';
- };
- usingCustomNavbar?: {
- type: BooleanConstructor;
- value?: boolean;
- };
-}
diff --git a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/type.js b/miniprogram/packageAPI/components/tdesign-miniprogram/toast/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageAPI/components/tdesign-miniprogram/toast/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageAPI/image/icon_foot.png b/miniprogram/packageAPI/image/icon_foot.png
deleted file mode 100644
index 3288ee1b..00000000
Binary files a/miniprogram/packageAPI/image/icon_foot.png and /dev/null differ
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet/classify.js b/miniprogram/packageAPI/pages/ai/mobilenet/classify.js
deleted file mode 100644
index d96e0364..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet/classify.js
+++ /dev/null
@@ -1,1269 +0,0 @@
-
-const modelWidth = 224.0;
-const modelHeight = 224.0;
-const modelChannel = 3;
-
-var inferenceStart;
-var inferenceEnd;
-
-const classNames = {
- c0: "tench, Tinca tinca",
- c1: "goldfish, Carassius auratus",
- c2: "great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias",
- c3: "tiger shark, Galeocerdo cuvieri",
- c4: "hammerhead, hammerhead shark",
- c5: "electric ray, crampfish, numbfish, torpedo",
- c6: "stingray",
- c7: "cock",
- c8: "hen",
- c9: "ostrich, Struthio camelus",
- c10: "brambling, Fringilla montifringilla",
- c11: "goldfinch, Carduelis carduelis",
- c12: "house finch, linnet, Carpodacus mexicanus",
- c13: "junco, snowbird",
- c14: "indigo bunting, indigo finch, indigo bird, Passerina cyanea",
- c15: "robin, American robin, Turdus migratorius",
- c16: "bulbul",
- c17: "jay",
- c18: "magpie",
- c19: "chickadee",
- c20: "water ouzel, dipper",
- c21: "kite",
- c22: "bald eagle, American eagle, Haliaeetus leucocephalus",
- c23: "vulture",
- c24: "great grey owl, great gray owl, Strix nebulosa",
- c25: "European fire salamander, Salamandra salamandra",
- c26: "common newt, Triturus vulgaris",
- c27: "eft",
- c28: "spotted salamander, Ambystoma maculatum",
- c29: "axolotl, mud puppy, Ambystoma mexicanum",
- c30: "bullfrog, Rana catesbeiana",
- c31: "tree frog, tree-frog",
- c32: "tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui",
- c33: "loggerhead, loggerhead turtle, Caretta caretta",
- c34: "leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea",
- c35: "mud turtle",
- c36: "terrapin",
- c37: "box turtle, box tortoise",
- c38: "banded gecko",
- c39: "common iguana, iguana, Iguana iguana",
- c40: "American chameleon, anole, Anolis carolinensis",
- c41: "whiptail, whiptail lizard",
- c42: "agama",
- c43: "frilled lizard, Chlamydosaurus kingi",
- c44: "alligator lizard",
- c45: "Gila monster, Heloderma suspectum",
- c46: "green lizard, Lacerta viridis",
- c47: "African chameleon, Chamaeleo chamaeleon",
- c48: "Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis",
- c49: "African crocodile, Nile crocodile, Crocodylus niloticus",
- c50: "American alligator, Alligator mississipiensis",
- c51: "triceratops",
- c52: "thunder snake, worm snake, Carphophis amoenus",
- c53: "ringneck snake, ring-necked snake, ring snake",
- c54: "hognose snake, puff adder, sand viper",
- c55: "green snake, grass snake",
- c56: "king snake, kingsnake",
- c57: "garter snake, grass snake",
- c58: "water snake",
- c59: "vine snake",
- c60: "night snake, Hypsiglena torquata",
- c61: "boa constrictor, Constrictor constrictor",
- c62: "rock python, rock snake, Python sebae",
- c63: "Indian cobra, Naja naja",
- c64: "green mamba",
- c65: "sea snake",
- c66: "horned viper, cerastes, sand viper, horned asp, Cerastes cornutus",
- c67: "diamondback, diamondback rattlesnake, Crotalus adamanteus",
- c68: "sidewinder, horned rattlesnake, Crotalus cerastes",
- c69: "trilobite",
- c70: "harvestman, daddy longlegs, Phalangium opilio",
- c71: "scorpion",
- c72: "black and gold garden spider, Argiope aurantia",
- c73: "barn spider, Araneus cavaticus",
- c74: "garden spider, Aranea diademata",
- c75: "black widow, Latrodectus mactans",
- c76: "tarantula",
- c77: "wolf spider, hunting spider",
- c78: "tick",
- c79: "centipede",
- c80: "black grouse",
- c81: "ptarmigan",
- c82: "ruffed grouse, partridge, Bonasa umbellus",
- c83: "prairie chicken, prairie grouse, prairie fowl",
- c84: "peacock",
- c85: "quail",
- c86: "partridge",
- c87: "African grey, African gray, Psittacus erithacus",
- c88: "macaw",
- c89: "sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita",
- c90: "lorikeet",
- c91: "coucal",
- c92: "bee eater",
- c93: "hornbill",
- c94: "hummingbird",
- c95: "jacamar",
- c96: "toucan",
- c97: "drake",
- c98: "red-breasted merganser, Mergus serrator",
- c99: "goose",
- c100: "black swan, Cygnus atratus",
- c101: "tusker",
- c102: "echidna, spiny anteater, anteater",
- c103: "platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus",
- c104: "wallaby, brush kangaroo",
- c105: "koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus",
- c106: "wombat",
- c107: "jellyfish",
- c108: "sea anemone, anemone",
- c109: "brain coral",
- c110: "flatworm, platyhelminth",
- c111: "nematode, nematode worm, roundworm",
- c112: "conch",
- c113: "snail",
- c114: "slug",
- c115: "sea slug, nudibranch",
- c116: "chiton, coat-of-mail shell, sea cradle, polyplacophore",
- c117: "chambered nautilus, pearly nautilus, nautilus",
- c118: "Dungeness crab, Cancer magister",
- c119: "rock crab, Cancer irroratus",
- c120: "fiddler crab",
- c121: "king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica",
- c122: "American lobster, Northern lobster, Maine lobster, Homarus americanus",
- c123: "spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish",
- c124: "crayfish, crawfish, crawdad, crawdaddy",
- c125: "hermit crab",
- c126: "isopod",
- c127: "white stork, Ciconia ciconia",
- c128: "black stork, Ciconia nigra",
- c129: "spoonbill",
- c130: "flamingo",
- c131: "little blue heron, Egretta caerulea",
- c132: "American egret, great white heron, Egretta albus",
- c133: "bittern",
- c134: "crane",
- c135: "limpkin, Aramus pictus",
- c136: "European gallinule, Porphyrio porphyrio",
- c137: "American coot, marsh hen, mud hen, water hen, Fulica americana",
- c138: "bustard",
- c139: "ruddy turnstone, Arenaria interpres",
- c140: "red-backed sandpiper, dunlin, Erolia alpina",
- c141: "redshank, Tringa totanus",
- c142: "dowitcher",
- c143: "oystercatcher, oyster catcher",
- c144: "pelican",
- c145: "king penguin, Aptenodytes patagonica",
- c146: "albatross, mollymawk",
- c147: "grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus",
- c148: "killer whale, killer, orca, grampus, sea wolf, Orcinus orca",
- c149: "dugong, Dugong dugon",
- c150: "sea lion",
- c151: "Chihuahua",
- c152: "Japanese spaniel",
- c153: "Maltese dog, Maltese terrier, Maltese",
- c154: "Pekinese, Pekingese, Peke",
- c155: "Shih-Tzu",
- c156: "Blenheim spaniel",
- c157: "papillon",
- c158: "toy terrier",
- c159: "Rhodesian ridgeback",
- c160: "Afghan hound, Afghan",
- c161: "basset, basset hound",
- c162: "beagle",
- c163: "bloodhound, sleuthhound",
- c164: "bluetick",
- c165: "black-and-tan coonhound",
- c166: "Walker hound, Walker foxhound",
- c167: "English foxhound",
- c168: "redbone",
- c169: "borzoi, Russian wolfhound",
- c170: "Irish wolfhound",
- c171: "Italian greyhound",
- c172: "whippet",
- c173: "Ibizan hound, Ibizan Podenco",
- c174: "Norwegian elkhound, elkhound",
- c175: "otterhound, otter hound",
- c176: "Saluki, gazelle hound",
- c177: "Scottish deerhound, deerhound",
- c178: "Weimaraner",
- c179: "Staffordshire bullterrier, Staffordshire bull terrier",
- c180: "American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier",
- c181: "Bedlington terrier",
- c182: "Border terrier",
- c183: "Kerry blue terrier",
- c184: "Irish terrier",
- c185: "Norfolk terrier",
- c186: "Norwich terrier",
- c187: "Yorkshire terrier",
- c188: "wire-haired fox terrier",
- c189: "Lakeland terrier",
- c190: "Sealyham terrier, Sealyham",
- c191: "Airedale, Airedale terrier",
- c192: "cairn, cairn terrier",
- c193: "Australian terrier",
- c194: "Dandie Dinmont, Dandie Dinmont terrier",
- c195: "Boston bull, Boston terrier",
- c196: "miniature schnauzer",
- c197: "giant schnauzer",
- c198: "standard schnauzer",
- c199: "Scotch terrier, Scottish terrier, Scottie",
- c200: "Tibetan terrier, chrysanthemum dog",
- c201: "silky terrier, Sydney silky",
- c202: "soft-coated wheaten terrier",
- c203: "West Highland white terrier",
- c204: "Lhasa, Lhasa apso",
- c205: "flat-coated retriever",
- c206: "curly-coated retriever",
- c207: "golden retriever",
- c208: "Labrador retriever",
- c209: "Chesapeake Bay retriever",
- c210: "German short-haired pointer",
- c211: "vizsla, Hungarian pointer",
- c212: "English setter",
- c213: "Irish setter, red setter",
- c214: "Gordon setter",
- c215: "Brittany spaniel",
- c216: "clumber, clumber spaniel",
- c217: "English springer, English springer spaniel",
- c218: "Welsh springer spaniel",
- c219: "cocker spaniel, English cocker spaniel, cocker",
- c220: "Sussex spaniel",
- c221: "Irish water spaniel",
- c222: "kuvasz",
- c223: "schipperke",
- c224: "groenendael",
- c225: "malinois",
- c226: "briard",
- c227: "kelpie",
- c228: "komondor",
- c229: "Old English sheepdog, bobtail",
- c230: "Shetland sheepdog, Shetland sheep dog, Shetland",
- c231: "collie",
- c232: "Border collie",
- c233: "Bouvier des Flandres, Bouviers des Flandres",
- c234: "Rottweiler",
- c235: "German shepherd, German shepherd dog, German police dog, alsatian",
- c236: "Doberman, Doberman pinscher",
- c237: "miniature pinscher",
- c238: "Greater Swiss Mountain dog",
- c239: "Bernese mountain dog",
- c240: "Appenzeller",
- c241: "EntleBucher",
- c242: "boxer",
- c243: "bull mastiff",
- c244: "Tibetan mastiff",
- c245: "French bulldog",
- c246: "Great Dane",
- c247: "Saint Bernard, St Bernard",
- c248: "Eskimo dog, husky",
- c249: "malamute, malemute, Alaskan malamute",
- c250: "Siberian husky",
- c251: "dalmatian, coach dog, carriage dog",
- c252: "affenpinscher, monkey pinscher, monkey dog",
- c253: "basenji",
- c254: "pug, pug-dog",
- c255: "Leonberg",
- c256: "Newfoundland, Newfoundland dog",
- c257: "Great Pyrenees",
- c258: "Samoyed, Samoyede",
- c259: "Pomeranian",
- c260: "chow, chow chow",
- c261: "keeshond",
- c262: "Brabancon griffon",
- c263: "Pembroke, Pembroke Welsh corgi",
- c264: "Cardigan, Cardigan Welsh corgi",
- c265: "toy poodle",
- c266: "miniature poodle",
- c267: "standard poodle",
- c268: "Mexican hairless",
- c269: "timber wolf, grey wolf, gray wolf, Canis lupus",
- c270: "white wolf, Arctic wolf, Canis lupus tundrarum",
- c271: "red wolf, maned wolf, Canis rufus, Canis niger",
- c272: "coyote, prairie wolf, brush wolf, Canis latrans",
- c273: "dingo, warrigal, warragal, Canis dingo",
- c274: "dhole, Cuon alpinus",
- c275: "African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus",
- c276: "hyena, hyaena",
- c277: "red fox, Vulpes vulpes",
- c278: "kit fox, Vulpes macrotis",
- c279: "Arctic fox, white fox, Alopex lagopus",
- c280: "grey fox, gray fox, Urocyon cinereoargenteus",
- c281: "tabby, tabby cat",
- c282: "tiger cat",
- c283: "Persian cat",
- c284: "Siamese cat, Siamese",
- c285: "Egyptian cat",
- c286: "cougar, puma, catamount, mountain lion, painter, panther, Felis concolor",
- c287: "lynx, catamount",
- c288: "leopard, Panthera pardus",
- c289: "snow leopard, ounce, Panthera uncia",
- c290: "jaguar, panther, Panthera onca, Felis onca",
- c291: "lion, king of beasts, Panthera leo",
- c292: "tiger, Panthera tigris",
- c293: "cheetah, chetah, Acinonyx jubatus",
- c294: "brown bear, bruin, Ursus arctos",
- c295: "American black bear, black bear, Ursus americanus, Euarctos americanus",
- c296: "ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus",
- c297: "sloth bear, Melursus ursinus, Ursus ursinus",
- c298: "mongoose",
- c299: "meerkat, mierkat",
- c300: "tiger beetle",
- c301: "ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle",
- c302: "ground beetle, carabid beetle",
- c303: "long-horned beetle, longicorn, longicorn beetle",
- c304: "leaf beetle, chrysomelid",
- c305: "dung beetle",
- c306: "rhinoceros beetle",
- c307: "weevil",
- c308: "fly",
- c309: "bee",
- c310: "ant, emmet, pismire",
- c311: "grasshopper, hopper",
- c312: "cricket",
- c313: "walking stick, walkingstick, stick insect",
- c314: "cockroach, roach",
- c315: "mantis, mantid",
- c316: "cicada, cicala",
- c317: "leafhopper",
- c318: "lacewing, lacewing fly",
- c319: "dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk",
- c320: "damselfly",
- c321: "admiral",
- c322: "ringlet, ringlet butterfly",
- c323: "monarch, monarch butterfly, milkweed butterfly, Danaus plexippus",
- c324: "cabbage butterfly",
- c325: "sulphur butterfly, sulfur butterfly",
- c326: "lycaenid, lycaenid butterfly",
- c327: "starfish, sea star",
- c328: "sea urchin",
- c329: "sea cucumber, holothurian",
- c330: "wood rabbit, cottontail, cottontail rabbit",
- c331: "hare",
- c332: "Angora, Angora rabbit",
- c333: "hamster",
- c334: "porcupine, hedgehog",
- c335: "fox squirrel, eastern fox squirrel, Sciurus niger",
- c336: "marmot",
- c337: "beaver",
- c338: "guinea pig, Cavia cobaya",
- c339: "sorrel",
- c340: "zebra",
- c341: "hog, pig, grunter, squealer, Sus scrofa",
- c342: "wild boar, boar, Sus scrofa",
- c343: "warthog",
- c344: "hippopotamus, hippo, river horse, Hippopotamus amphibius",
- c345: "ox",
- c346: "water buffalo, water ox, Asiatic buffalo, Bubalus bubalis",
- c347: "bison",
- c348: "ram, tup",
- c349: "bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis",
- c350: "ibex, Capra ibex",
- c351: "hartebeest",
- c352: "impala, Aepyceros melampus",
- c353: "gazelle",
- c354: "Arabian camel, dromedary, Camelus dromedarius",
- c355: "llama",
- c356: "weasel",
- c357: "mink",
- c358: "polecat, fitch, foulmart, foumart, Mustela putorius",
- c359: "black-footed ferret, ferret, Mustela nigripes",
- c360: "otter",
- c361: "skunk, polecat, wood pussy",
- c362: "badger",
- c363: "armadillo",
- c364: "three-toed sloth, ai, Bradypus tridactylus",
- c365: "orangutan, orang, orangutang, Pongo pygmaeus",
- c366: "gorilla, Gorilla gorilla",
- c367: "chimpanzee, chimp, Pan troglodytes",
- c368: "gibbon, Hylobates lar",
- c369: "siamang, Hylobates syndactylus, Symphalangus syndactylus",
- c370: "guenon, guenon monkey",
- c371: "patas, hussar monkey, Erythrocebus patas",
- c372: "baboon",
- c373: "macaque",
- c374: "langur",
- c375: "colobus, colobus monkey",
- c376: "proboscis monkey, Nasalis larvatus",
- c377: "marmoset",
- c378: "capuchin, ringtail, Cebus capucinus",
- c379: "howler monkey, howler",
- c380: "titi, titi monkey",
- c381: "spider monkey, Ateles geoffroyi",
- c382: "squirrel monkey, Saimiri sciureus",
- c383: "Madagascar cat, ring-tailed lemur, Lemur catta",
- c384: "indri, indris, Indri indri, Indri brevicaudatus",
- c385: "Indian elephant, Elephas maximus",
- c386: "African elephant, Loxodonta africana",
- c387: "lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens",
- c388: "giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca",
- c389: "barracouta, snoek",
- c390: "eel",
- c391: "coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch",
- c392: "rock beauty, Holocanthus tricolor",
- c393: "anemone fish",
- c394: "sturgeon",
- c395: "gar, garfish, garpike, billfish, Lepisosteus osseus",
- c396: "lionfish",
- c397: "puffer, pufferfish, blowfish, globefish",
- c398: "abacus",
- c399: "abaya",
- c400: "academic gown, academic robe, judge's robe",
- c401: "accordion, piano accordion, squeeze box",
- c402: "acoustic guitar",
- c403: "aircraft carrier, carrier, flattop, attack aircraft carrier",
- c404: "airliner",
- c405: "airship, dirigible",
- c406: "altar",
- c407: "ambulance",
- c408: "amphibian, amphibious vehicle",
- c409: "analog clock",
- c410: "apiary, bee house",
- c411: "apron",
- c412: "ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin",
- c413: "assault rifle, assault gun",
- c414: "backpack, back pack, knapsack, packsack, rucksack, haversack",
- c415: "bakery, bakeshop, bakehouse",
- c416: "balance beam, beam",
- c417: "balloon",
- c418: "ballpoint, ballpoint pen, ballpen, Biro",
- c419: "Band Aid",
- c420: "banjo",
- c421: "bannister, banister, balustrade, balusters, handrail",
- c422: "barbell",
- c423: "barber chair",
- c424: "barbershop",
- c425: "barn",
- c426: "barometer",
- c427: "barrel, cask",
- c428: "barrow, garden cart, lawn cart, wheelbarrow",
- c429: "baseball",
- c430: "basketball",
- c431: "bassinet",
- c432: "bassoon",
- c433: "bathing cap, swimming cap",
- c434: "bath towel",
- c435: "bathtub, bathing tub, bath, tub",
- c436: "beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon",
- c437: "beacon, lighthouse, beacon light, pharos",
- c438: "beaker",
- c439: "bearskin, busby, shako",
- c440: "beer bottle",
- c441: "beer glass",
- c442: "bell cote, bell cot",
- c443: "bib",
- c444: "bicycle-built-for-two, tandem bicycle, tandem",
- c445: "bikini, two-piece",
- c446: "binder, ring-binder",
- c447: "binoculars, field glasses, opera glasses",
- c448: "birdhouse",
- c449: "boathouse",
- c450: "bobsled, bobsleigh, bob",
- c451: "bolo tie, bolo, bola tie, bola",
- c452: "bonnet, poke bonnet",
- c453: "bookcase",
- c454: "bookshop, bookstore, bookstall",
- c455: "bottlecap",
- c456: "bow",
- c457: "bow tie, bow-tie, bowtie",
- c458: "brass, memorial tablet, plaque",
- c459: "brassiere, bra, bandeau",
- c460: "breakwater, groin, groyne, mole, bulwark, seawall, jetty",
- c461: "breastplate, aegis, egis",
- c462: "broom",
- c463: "bucket, pail",
- c464: "buckle",
- c465: "bulletproof vest",
- c466: "bullet train, bullet",
- c467: "butcher shop, meat market",
- c468: "cab, hack, taxi, taxicab",
- c469: "caldron, cauldron",
- c470: "candle, taper, wax light",
- c471: "cannon",
- c472: "canoe",
- c473: "can opener, tin opener",
- c474: "cardigan",
- c475: "car mirror",
- c476: "carousel, carrousel, merry-go-round, roundabout, whirligig",
- c477: "carpenter's kit, tool kit",
- c478: "carton",
- c479: "car wheel",
- c480: "cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM",
- c481: "cassette",
- c482: "cassette player",
- c483: "castle",
- c484: "catamaran",
- c485: "CD player",
- c486: "cello, violoncello",
- c487: "cellular telephone, cellular phone, cellphone, cell, mobile phone",
- c488: "chain",
- c489: "chainlink fence",
- c490: "chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour",
- c491: "chain saw, chainsaw",
- c492: "chest",
- c493: "chiffonier, commode",
- c494: "chime, bell, gong",
- c495: "china cabinet, china closet",
- c496: "Christmas stocking",
- c497: "church, church building",
- c498: "cinema, movie theater, movie theatre, movie house, picture palace",
- c499: "cleaver, meat cleaver, chopper",
- c500: "cliff dwelling",
- c501: "cloak",
- c502: "clog, geta, patten, sabot",
- c503: "cocktail shaker",
- c504: "coffee mug",
- c505: "coffeepot",
- c506: "coil, spiral, volute, whorl, helix",
- c507: "combination lock",
- c508: "computer keyboard, keypad",
- c509: "confectionery, confectionary, candy store",
- c510: "container ship, containership, container vessel",
- c511: "convertible",
- c512: "corkscrew, bottle screw",
- c513: "cornet, horn, trumpet, trump",
- c514: "cowboy boot",
- c515: "cowboy hat, ten-gallon hat",
- c516: "cradle",
- c517: "crane",
- c518: "crash helmet",
- c519: "crate",
- c520: "crib, cot",
- c521: "Crock Pot",
- c522: "croquet ball",
- c523: "crutch",
- c524: "cuirass",
- c525: "dam, dike, dyke",
- c526: "desk",
- c527: "desktop computer",
- c528: "dial telephone, dial phone",
- c529: "diaper, nappy, napkin",
- c530: "digital clock",
- c531: "digital watch",
- c532: "dining table, board",
- c533: "dishrag, dishcloth",
- c534: "dishwasher, dish washer, dishwashing machine",
- c535: "disk brake, disc brake",
- c536: "dock, dockage, docking facility",
- c537: "dogsled, dog sled, dog sleigh",
- c538: "dome",
- c539: "doormat, welcome mat",
- c540: "drilling platform, offshore rig",
- c541: "drum, membranophone, tympan",
- c542: "drumstick",
- c543: "dumbbell",
- c544: "Dutch oven",
- c545: "electric fan, blower",
- c546: "electric guitar",
- c547: "electric locomotive",
- c548: "entertainment center",
- c549: "envelope",
- c550: "espresso maker",
- c551: "face powder",
- c552: "feather boa, boa",
- c553: "file, file cabinet, filing cabinet",
- c554: "fireboat",
- c555: "fire engine, fire truck",
- c556: "fire screen, fireguard",
- c557: "flagpole, flagstaff",
- c558: "flute, transverse flute",
- c559: "folding chair",
- c560: "football helmet",
- c561: "forklift",
- c562: "fountain",
- c563: "fountain pen",
- c564: "four-poster",
- c565: "freight car",
- c566: "French horn, horn",
- c567: "frying pan, frypan, skillet",
- c568: "fur coat",
- c569: "garbage truck, dustcart",
- c570: "gasmask, respirator, gas helmet",
- c571: "gas pump, gasoline pump, petrol pump, island dispenser",
- c572: "goblet",
- c573: "go-kart",
- c574: "golf ball",
- c575: "golfcart, golf cart",
- c576: "gondola",
- c577: "gong, tam-tam",
- c578: "gown",
- c579: "grand piano, grand",
- c580: "greenhouse, nursery, glasshouse",
- c581: "grille, radiator grille",
- c582: "grocery store, grocery, food market, market",
- c583: "guillotine",
- c584: "hair slide",
- c585: "hair spray",
- c586: "half track",
- c587: "hammer",
- c588: "hamper",
- c589: "hand blower, blow dryer, blow drier, hair dryer, hair drier",
- c590: "hand-held computer, hand-held microcomputer",
- c591: "handkerchief, hankie, hanky, hankey",
- c592: "hard disc, hard disk, fixed disk",
- c593: "harmonica, mouth organ, harp, mouth harp",
- c594: "harp",
- c595: "harvester, reaper",
- c596: "hatchet",
- c597: "holster",
- c598: "home theater, home theatre",
- c599: "honeycomb",
- c600: "hook, claw",
- c601: "hoopskirt, crinoline",
- c602: "horizontal bar, high bar",
- c603: "horse cart, horse-cart",
- c604: "hourglass",
- c605: "iPod",
- c606: "iron, smoothing iron",
- c607: "jack-o'-lantern",
- c608: "jean, blue jean, denim",
- c609: "jeep, landrover",
- c610: "jersey, T-shirt, tee shirt",
- c611: "jigsaw puzzle",
- c612: "jinrikisha, ricksha, rickshaw",
- c613: "joystick",
- c614: "kimono",
- c615: "knee pad",
- c616: "knot",
- c617: "lab coat, laboratory coat",
- c618: "ladle",
- c619: "lampshade, lamp shade",
- c620: "laptop, laptop computer",
- c621: "lawn mower, mower",
- c622: "lens cap, lens cover",
- c623: "letter opener, paper knife, paperknife",
- c624: "library",
- c625: "lifeboat",
- c626: "lighter, light, igniter, ignitor",
- c627: "limousine, limo",
- c628: "liner, ocean liner",
- c629: "lipstick, lip rouge",
- c630: "Loafer",
- c631: "lotion",
- c632: "loudspeaker, speaker, speaker unit, loudspeaker system, speaker system",
- c633: "loupe, jeweler's loupe",
- c634: "lumbermill, sawmill",
- c635: "magnetic compass",
- c636: "mailbag, postbag",
- c637: "mailbox, letter box",
- c638: "maillot",
- c639: "maillot, tank suit",
- c640: "manhole cover",
- c641: "maraca",
- c642: "marimba, xylophone",
- c643: "mask",
- c644: "matchstick",
- c645: "maypole",
- c646: "maze, labyrinth",
- c647: "measuring cup",
- c648: "medicine chest, medicine cabinet",
- c649: "megalith, megalithic structure",
- c650: "microphone, mike",
- c651: "microwave, microwave oven",
- c652: "military uniform",
- c653: "milk can",
- c654: "minibus",
- c655: "miniskirt, mini",
- c656: "minivan",
- c657: "missile",
- c658: "mitten",
- c659: "mixing bowl",
- c660: "mobile home, manufactured home",
- c661: "Model T",
- c662: "modem",
- c663: "monastery",
- c664: "monitor",
- c665: "moped",
- c666: "mortar",
- c667: "mortarboard",
- c668: "mosque",
- c669: "mosquito net",
- c670: "motor scooter, scooter",
- c671: "mountain bike, all-terrain bike, off-roader",
- c672: "mountain tent",
- c673: "mouse, computer mouse",
- c674: "mousetrap",
- c675: "moving van",
- c676: "muzzle",
- c677: "nail",
- c678: "neck brace",
- c679: "necklace",
- c680: "nipple",
- c681: "notebook, notebook computer",
- c682: "obelisk",
- c683: "oboe, hautboy, hautbois",
- c684: "ocarina, sweet potato",
- c685: "odometer, hodometer, mileometer, milometer",
- c686: "oil filter",
- c687: "organ, pipe organ",
- c688: "oscilloscope, scope, cathode-ray oscilloscope, CRO",
- c689: "overskirt",
- c690: "oxcart",
- c691: "oxygen mask",
- c692: "packet",
- c693: "paddle, boat paddle",
- c694: "paddlewheel, paddle wheel",
- c695: "padlock",
- c696: "paintbrush",
- c697: "pajama, pyjama, pj's, jammies",
- c698: "palace",
- c699: "panpipe, pandean pipe, syrinx",
- c700: "paper towel",
- c701: "parachute, chute",
- c702: "parallel bars, bars",
- c703: "park bench",
- c704: "parking meter",
- c705: "passenger car, coach, carriage",
- c706: "patio, terrace",
- c707: "pay-phone, pay-station",
- c708: "pedestal, plinth, footstall",
- c709: "pencil box, pencil case",
- c710: "pencil sharpener",
- c711: "perfume, essence",
- c712: "Petri dish",
- c713: "photocopier",
- c714: "pick, plectrum, plectron",
- c715: "pickelhaube",
- c716: "picket fence, paling",
- c717: "pickup, pickup truck",
- c718: "pier",
- c719: "piggy bank, penny bank",
- c720: "pill bottle",
- c721: "pillow",
- c722: "ping-pong ball",
- c723: "pinwheel",
- c724: "pirate, pirate ship",
- c725: "pitcher, ewer",
- c726: "plane, carpenter's plane, woodworking plane",
- c727: "planetarium",
- c728: "plastic bag",
- c729: "plate rack",
- c730: "plow, plough",
- c731: "plunger, plumber's helper",
- c732: "Polaroid camera, Polaroid Land camera",
- c733: "pole",
- c734: "police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria",
- c735: "poncho",
- c736: "pool table, billiard table, snooker table",
- c737: "pop bottle, soda bottle",
- c738: "pot, flowerpot",
- c739: "potter's wheel",
- c740: "power drill",
- c741: "prayer rug, prayer mat",
- c742: "printer",
- c743: "prison, prison house",
- c744: "projectile, missile",
- c745: "projector",
- c746: "puck, hockey puck",
- c747: "punching bag, punch bag, punching ball, punchball",
- c748: "purse",
- c749: "quill, quill pen",
- c750: "quilt, comforter, comfort, puff",
- c751: "racer, race car, racing car",
- c752: "racket, racquet",
- c753: "radiator",
- c754: "radio, wireless",
- c755: "radio telescope, radio reflector",
- c756: "rain barrel",
- c757: "recreational vehicle, RV, R.V.",
- c758: "reel",
- c759: "reflex camera",
- c760: "refrigerator, icebox",
- c761: "remote control, remote",
- c762: "restaurant, eating house, eating place, eatery",
- c763: "revolver, six-gun, six-shooter",
- c764: "rifle",
- c765: "rocking chair, rocker",
- c766: "rotisserie",
- c767: "rubber eraser, rubber, pencil eraser",
- c768: "rugby ball",
- c769: "rule, ruler",
- c770: "running shoe",
- c771: "safe",
- c772: "safety pin",
- c773: "saltshaker, salt shaker",
- c774: "sandal",
- c775: "sarong",
- c776: "sax, saxophone",
- c777: "scabbard",
- c778: "scale, weighing machine",
- c779: "school bus",
- c780: "schooner",
- c781: "scoreboard",
- c782: "screen, CRT screen",
- c783: "screw",
- c784: "screwdriver",
- c785: "seat belt, seatbelt",
- c786: "sewing machine",
- c787: "shield, buckler",
- c788: "shoe shop, shoe-shop, shoe store",
- c789: "shoji",
- c790: "shopping basket",
- c791: "shopping cart",
- c792: "shovel",
- c793: "shower cap",
- c794: "shower curtain",
- c795: "ski",
- c796: "ski mask",
- c797: "sleeping bag",
- c798: "slide rule, slipstick",
- c799: "sliding door",
- c800: "slot, one-armed bandit",
- c801: "snorkel",
- c802: "snowmobile",
- c803: "snowplow, snowplough",
- c804: "soap dispenser",
- c805: "soccer ball",
- c806: "sock",
- c807: "solar dish, solar collector, solar furnace",
- c808: "sombrero",
- c809: "soup bowl",
- c810: "space bar",
- c811: "space heater",
- c812: "space shuttle",
- c813: "spatula",
- c814: "speedboat",
- c815: "spider web, spider's web",
- c816: "spindle",
- c817: "sports car, sport car",
- c818: "spotlight, spot",
- c819: "stage",
- c820: "steam locomotive",
- c821: "steel arch bridge",
- c822: "steel drum",
- c823: "stethoscope",
- c824: "stole",
- c825: "stone wall",
- c826: "stopwatch, stop watch",
- c827: "stove",
- c828: "strainer",
- c829: "streetcar, tram, tramcar, trolley, trolley car",
- c830: "stretcher",
- c831: "studio couch, day bed",
- c832: "stupa, tope",
- c833: "submarine, pigboat, sub, U-boat",
- c834: "suit, suit of clothes",
- c835: "sundial",
- c836: "sunglass",
- c837: "sunglasses, dark glasses, shades",
- c838: "sunscreen, sunblock, sun blocker",
- c839: "suspension bridge",
- c840: "swab, swob, mop",
- c841: "sweatshirt",
- c842: "swimming trunks, bathing trunks",
- c843: "swing",
- c844: "switch, electric switch, electrical switch",
- c845: "syringe",
- c846: "table lamp",
- c847: "tank, army tank, armored combat vehicle, armoured combat vehicle",
- c848: "tape player",
- c849: "teapot",
- c850: "teddy, teddy bear",
- c851: "television, television system",
- c852: "tennis ball",
- c853: "thatch, thatched roof",
- c854: "theater curtain, theatre curtain",
- c855: "thimble",
- c856: "thresher, thrasher, threshing machine",
- c857: "throne",
- c858: "tile roof",
- c859: "toaster",
- c860: "tobacco shop, tobacconist shop, tobacconist",
- c861: "toilet seat",
- c862: "torch",
- c863: "totem pole",
- c864: "tow truck, tow car, wrecker",
- c865: "toyshop",
- c866: "tractor",
- c867: "trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi",
- c868: "tray",
- c869: "trench coat",
- c870: "tricycle, trike, velocipede",
- c871: "trimaran",
- c872: "tripod",
- c873: "triumphal arch",
- c874: "trolleybus, trolley coach, trackless trolley",
- c875: "trombone",
- c876: "tub, vat",
- c877: "turnstile",
- c878: "typewriter keyboard",
- c879: "umbrella",
- c880: "unicycle, monocycle",
- c881: "upright, upright piano",
- c882: "vacuum, vacuum cleaner",
- c883: "vase",
- c884: "vault",
- c885: "velvet",
- c886: "vending machine",
- c887: "vestment",
- c888: "viaduct",
- c889: "violin, fiddle",
- c890: "volleyball",
- c891: "waffle iron",
- c892: "wall clock",
- c893: "wallet, billfold, notecase, pocketbook",
- c894: "wardrobe, closet, press",
- c895: "warplane, military plane",
- c896: "washbasin, handbasin, washbowl, lavabo, wash-hand basin",
- c897: "washer, automatic washer, washing machine",
- c898: "water bottle",
- c899: "water jug",
- c900: "water tower",
- c901: "whiskey jug",
- c902: "whistle",
- c903: "wig",
- c904: "window screen",
- c905: "window shade",
- c906: "Windsor tie",
- c907: "wine bottle",
- c908: "wing",
- c909: "wok",
- c910: "wooden spoon",
- c911: "wool, woolen, woollen",
- c912: "worm fence, snake fence, snake-rail fence, Virginia fence",
- c913: "wreck",
- c914: "yawl",
- c915: "yurt",
- c916: "web site, website, internet site, site",
- c917: "comic book",
- c918: "crossword puzzle, crossword",
- c919: "street sign",
- c920: "traffic light, traffic signal, stoplight",
- c921: "book jacket, dust cover, dust jacket, dust wrapper",
- c922: "menu",
- c923: "plate",
- c924: "guacamole",
- c925: "consomme",
- c926: "hot pot, hotpot",
- c927: "trifle",
- c928: "ice cream, icecream",
- c929: "ice lolly, lolly, lollipop, popsicle",
- c930: "French loaf",
- c931: "bagel, beigel",
- c932: "pretzel",
- c933: "cheeseburger",
- c934: "hotdog, hot dog, red hot",
- c935: "mashed potato",
- c936: "head cabbage",
- c937: "broccoli",
- c938: "cauliflower",
- c939: "zucchini, courgette",
- c940: "spaghetti squash",
- c941: "acorn squash",
- c942: "butternut squash",
- c943: "cucumber, cuke",
- c944: "artichoke, globe artichoke",
- c945: "bell pepper",
- c946: "cardoon",
- c947: "mushroom",
- c948: "Granny Smith",
- c949: "strawberry",
- c950: "orange",
- c951: "lemon",
- c952: "fig",
- c953: "pineapple, ananas",
- c954: "banana",
- c955: "jackfruit, jak, jack",
- c956: "custard apple",
- c957: "pomegranate",
- c958: "hay",
- c959: "carbonara",
- c960: "chocolate sauce, chocolate syrup",
- c961: "dough",
- c962: "meat loaf, meatloaf",
- c963: "pizza, pizza pie",
- c964: "potpie",
- c965: "burrito",
- c966: "red wine",
- c967: "espresso",
- c968: "cup",
- c969: "eggnog",
- c970: "alp",
- c971: "bubble",
- c972: "cliff, drop, drop-off",
- c973: "coral reef",
- c974: "geyser",
- c975: "lakeside, lakeshore",
- c976: "promontory, headland, head, foreland",
- c977: "sandbar, sand bar",
- c978: "seashore, coast, seacoast, sea-coast",
- c979: "valley, vale",
- c980: "volcano",
- c981: "ballplayer, baseball player",
- c982: "groom, bridegroom",
- c983: "scuba diver",
- c984: "rapeseed",
- c985: "daisy",
- c986: "yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum",
- c987: "corn",
- c988: "acorn",
- c989: "hip, rose hip, rosehip",
- c990: "buckeye, horse chestnut, conker",
- c991: "coral fungus",
- c992: "agaric",
- c993: "gyromitra",
- c994: "stinkhorn, carrion fungus",
- c995: "earthstar",
- c996: "hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa",
- c997: "bolete",
- c998: "ear, spike, capitulum",
- c999: "toilet tissue, toilet paper, bathroom tissue",
-};
-
-export class Classifier {
-
- // 图像显示尺寸结构体 { width: Number, height: Number }
- displaySize;
-
- // net inference session
- session;
-
- // is ready
- ready;
-
- // the predicted class
- mPredClass = "None";
-
- speedTime = 0.0;
-
- modelInput = null;
-
- constructor(displaySize) {
- this.displaySize = {
- width: displaySize.width,
- height: displaySize.height,
- };
-
- this.modelInput = new Float32Array(modelWidth * modelHeight * modelChannel);
-
- this.ready = false;
- }
-
- load() {
- return new Promise((resolve, reject) => {
-
- const modelPath = `${wx.env.USER_DATA_PATH}/mobilenetv2-12.onnx`;
-
- // 判断之前是否已经下载过onnx模型
- wx.getFileSystemManager().access({
- path: modelPath,
- success: (res) =>
- {
- console.log("file already exist at: " + modelPath)
- this.createInferenceSession(modelPath).then(() =>
- {
- resolve();
- })
- },
- fail: (res) => {
- console.error(res)
-
- wx.cloud.init();
- console.log("begin download model");
-
- const cloudPath = 'cloud://containertest-0gmw3ulnd8d9bc7b.636f-containertest-0gmw3ulnd8d9bc7b-1258211818/mobilenetv2-12.onnx'
- this.downloadFile(cloudPath, function(r) {
- console.log(`下载进度:${r.progress}%,已下载${r.totalBytesWritten}B,共${r.totalBytesExpectedToWrite}B`)
- }).then(result => {
-
- wx.getFileSystemManager().saveFile({
- tempFilePath:result.tempFilePath,
- filePath: modelPath,
- success: (res) => { // 注册回调函数
- console.log(res)
- // const modelPath = res.savedFilePath +'/mobilenetv2-12.onnx'
-
- const modelPath = res.savedFilePath;
- console.log("save onnx model at path: " + modelPath)
-
- this.createInferenceSession(modelPath).then(() => {
- resolve();
- })
- },
- fail(res) {
- console.error(res)
- return
- }
- })
- });
- }
- })
- })
- }
-
- createInferenceSession(modelPath) {
- return new Promise((resolve, reject) => {
- this.session = wx.createInferenceSession({
- model: modelPath,
- /* 0: Lowest precision e.g., LS16 + A16 + Winograd A16 + approx. math
- 1: Lower precision e.g., LS16 + A16 + Winograd off + approx. math
- 2: Modest precision e.g., LS16 + A32 + Winograd A32 + approx. math
- 3: Higher precision e.g., LS32 + A32 + Winograd A32 + approx. math
- 4: Highest precision e.g., LS32 + A32 + Winograd A32 + precise math
-
- Higher precision always require longer time to run session
- */
- precisionLevel : 4,
- allowNPU : false, // wheather use NPU for inference, only useful for IOS
- allowQuantize: false, // wheather generate quantize model
- });
-
- // 监听error事件
- this.session.onError((error) => {
- console.error(error);
- reject(error);
- });
- this.session.onLoad(() => {
- this.ready = true;
- resolve();
- });
- })
- }
-
- downloadFile(fileID, onCall = () => {}) {
- return new Promise((resolve, reject) => {
- const task = wx.cloud.downloadFile({
- fileID,
- success: res => resolve(res),
- fail: e => {
- const info = e.toString()
- if (info.indexOf('abort') != -1) {
- reject(new Error('【文件下载失败】中断下载'))
- } else {
- reject(new Error('【文件下载失败】网络或其他错误'))
- }
- }
- })
- task.onProgressUpdate((res) => {
- if (onCall(res) == false) {
- task.abort()
- }
- })
- })
- }
-
- isReady() {
- return this.ready;
- }
-
- predClass() {
- return this.mPredClass;
- }
-
- // input is rgba uint8 data
- preProcess(frame, dstInput) {
-
- return new Promise((resolve, reject) =>
- {
- const origData = new Uint8Array(frame.data);
-
- const hRatio = frame.height / modelHeight;
-
- const wRatio = frame.width / modelWidth;
-
- // resize data to model input size, uint8 data to float32 data,
- // and transpose from nhwc to nchw
-
- const origHStride = frame.width * 4;
- const origWStride = 4;
-
- const mean = [0.485, 0.456, 0.406]
-
- const reverse_div = [4.367, 4.464, 4.444] // reverse of std = [0.229, 0.224, 0.225]
- const ratio = 1 / 255.0
-
- const normalized_div = [ratio * reverse_div[0], ratio * reverse_div[1], ratio * reverse_div[2]];
-
- const normalized_mean = [mean[0] * reverse_div[0], mean[1] * reverse_div[1], mean[2] * reverse_div[2]];
-
- var idx = 0;
- for (var c = 0; c < modelChannel; ++c)
- {
- for (var h = 0; h < modelHeight; ++h)
- {
- const origH = Math.round(h * hRatio);
-
- const origHOffset = origH * origHStride;
-
- for (var w = 0; w < modelWidth; ++w)
- {
- const origW = Math.round(w * wRatio);
-
- const origIndex = origHOffset + origW * origWStride + c;
-
- //var val = ((origData[origIndex] * ratio) - mean[c]) * reverse_div[c];
-
- var val = origData[origIndex] * (normalized_div[c]) - normalized_mean[c];
- dstInput[idx] = val;
-
- idx++;
- }
- }
- }
-
- resolve();
- });
-
- }
- // run inference and get the output
- async detect(frame)
- {
- return new Promise((resolve, reject) =>
- {
- this.preProcess(frame, this.modelInput).then(() => {
- const xinput = {
- shape: [1, 3, 224, 224], // Input data shape in NCHW
- data: this.modelInput.buffer,
- type: 'float32', // Input data type
- };
-
- inferenceStart = new Date().getTime()
-
- this.session.run({
- // Here string "input" Should be the same with the input name in onnx file
- "input": xinput,
- })
- .then((res) => {
- inferenceEnd = new Date().getTime();
-
- this.speedTime = inferenceEnd - inferenceStart
-
- // Here use res.outputname.data, outputname
- // Should be the same with the output name in onnx file
- let num = new Float32Array(res.output.data)
-
- var maxVar = num[0];
-
- var index = 0;
-
- for (var i = 1; i < num.length; ++i)
- {
- if (maxVar < num[i])
- {
- maxVar = num[i]
- index = i
- }
- }
-
- this.getClass(index);
-
- resolve();
- }).catch(error => alert(error.message));
- })
-
- });
- }
-
- getClass(index)
- {
- const cIndex=`c${index}`
- this.mPredClass = classNames[cIndex];
- }
-
- getTime()
- {
- return this.speedTime;
- }
- dispose() {
- this.session.destroy();
- }
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet/index.js b/miniprogram/packageAPI/pages/ai/mobilenet/index.js
deleted file mode 100644
index e06c7ff3..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet/index.js
+++ /dev/null
@@ -1,211 +0,0 @@
-// pages/mobilenet/index.ts
-
-import { Classifier } from './classify'
-
-import { FpsHelper } from '../../../../util/fps_helper'
-
-const { appWidth, appHeight, benchmarkLevel } = getApp().globalData
-
-Page({
- classifier: null,
- ctx: null,
- fpsHelper: null,
-
- predicting: false,
-
- // For Speed Test
- constBuffer: null,
-
- /**
- * 页面的初始数据
- */
- data: {
- predClass: 'None',
- classifier: null,
- enableSpeedTest: false,
- avgTime: 110.0,
- minTime: 110.0
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad() {
- if (this.data.enableSpeedTest) {
- this.constBuffer = new Float32Array(3 * 224 * 224)
- }
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- this.ctx = wx.createCanvasContext('ssd1')
- const context = wx.createCameraContext(this)
- this.initClassifier()
- this.fpsHelper = new FpsHelper()
-
- const listener = context.onCameraFrame(frame => {
- const fps = this.fpsHelper.getAverageFps()
- console.log(`fps=${fps}`)
-
- if (this.classifier && this.classifier.isReady() && !this.predicting) {
- this.executeClassify(frame)
- }
- })
- listener.start()
- this.fpsHelper.reset()
- },
-
- /**
- * 初始化 SSD models
- */
- initClassifier() {
- wx.showLoading({ title: '模型正在加载...' })
- this.classifier = new Classifier({ width: appWidth, height: appHeight })
- this.classifier.load().then(() => {
- wx.hideLoading()
- }).catch(err => {
- console.log('模型加载报错:', err)
- })
- },
-
- /**
- * 构建模型
- */
- async executeClassify(frame) {
- this.predicting = true
-
- if (this.classifier && this.classifier.isReady()) {
- this.fpsHelper.updateFPS()
-
- this.setData({
- predClass: this.classifier.predClass(),
- enableSpeedTest: this.data.enableSpeedTest
- })
-
- await this.classifier.detect(frame).then(() => {
- this.setData({
- predClass: this.classifier.predClass()
- })
- }).catch((err) => {
- console.log(err)
- })
-
- if (this.data.enableSpeedTest) {
- await this.inferSpeedTest()
- }
- }
-
- this.predicting = false
- },
-
- async inferSpeedTest() {
- console.log('runInferenceSession speed test start run===============================')
-
- const xinput = {
- shape: [1, 3, 224, 224],
- data: this.constBuffer.buffer,
- type: 'float32',
- }
-
- this.data.classifier = this.classifier
-
- // warm up
- for (let index = 0; index < 20; index++) {
- await this.inferOnce(xinput, this.data)
- }
-
- for (let l = 0; l < 5; ++l) {
- const beMs = new Date().getTime()
-
- for (let index = 0; index < 100; index++) {
- await this.inferOnce(xinput, this.data)
- }
-
- const afMs = new Date().getTime()
-
- const avgTime = (afMs - beMs) / 100.0
-
- let overall = 0.0
- let minTime = 1000000.0
-
- for (let index = 0; index < 100; index++) {
- const beMsTmp = new Date().getTime()
- await this.inferOnce(xinput, this.data)
- const afMsTmp = new Date().getTime()
- const tmpTime = (afMsTmp - beMsTmp)
- if (minTime > tmpTime) {
- minTime = tmpTime
- }
- overall += (afMsTmp - beMsTmp)
- }
-
- console.log('Inference min time: ', minTime)
- console.log('Inference avg time: ', avgTime)
-
- this.setData({
- predClass: this.classifier.predClass(),
- minTime,
- avgTime,
- })
- }
- },
-
- inferOnce(xinput, data) {
- return new Promise(function (resolve, reject) {
- data.classifier.session.run({
- input: xinput,
- }).then(async function (res) {
- resolve()
- })
- })
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- if (this.classifier && this.classifier.isReady()) {
- this.classifier.dispose()
- }
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- return {
- title: '微信小程序 × MobileNet',
- path: 'packageAPI/pages/ai/mobilenet/index',
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet/index.json b/miniprogram/packageAPI/pages/ai/mobilenet/index.json
deleted file mode 100644
index 6cdc72a9..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet/index.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "disableScroll": true,
- "usingComponents": {}
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet/index.less b/miniprogram/packageAPI/pages/ai/mobilenet/index.less
deleted file mode 100644
index d37313ce..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet/index.less
+++ /dev/null
@@ -1 +0,0 @@
-/* packageAPI/pages/ai/mobilenet/index.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet/index.wxml b/miniprogram/packageAPI/pages/ai/mobilenet/index.wxml
deleted file mode 100644
index 27074ce9..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet/index.wxml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
- 分类结果: {{predClass}}
-
- 平均耗时(ms): {{avgTime}}
- 最小耗时(ms): {{minTime}}
-
-
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet/index.wxss b/miniprogram/packageAPI/pages/ai/mobilenet/index.wxss
deleted file mode 100644
index 8a7a70fd..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet/index.wxss
+++ /dev/null
@@ -1,17 +0,0 @@
-/* packageAPI/pages/ai/mobilenet/index.wxss */
-/* pages/mobilenet/index.wxss */
-.camera {
- width: 100%;
- height: 70vh;
-}
-
-.canvas {
- width: 100%;
- height: 100vh;
-}
-
-.textstyle {
- color: #e0a165;
- font-size: 28rpx;
- line-height: 1.6;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet_int8/classify.js b/miniprogram/packageAPI/pages/ai/mobilenet_int8/classify.js
deleted file mode 100644
index 9e810156..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet_int8/classify.js
+++ /dev/null
@@ -1,1268 +0,0 @@
-
-const modelWidth = 224.0;
-const modelHeight = 224.0;
-const modelChannel = 3;
-
-var inferenceStart;
-var inferenceEnd;
-
-const classNames = {
- c0: "tench, Tinca tinca",
- c1: "goldfish, Carassius auratus",
- c2: "great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias",
- c3: "tiger shark, Galeocerdo cuvieri",
- c4: "hammerhead, hammerhead shark",
- c5: "electric ray, crampfish, numbfish, torpedo",
- c6: "stingray",
- c7: "cock",
- c8: "hen",
- c9: "ostrich, Struthio camelus",
- c10: "brambling, Fringilla montifringilla",
- c11: "goldfinch, Carduelis carduelis",
- c12: "house finch, linnet, Carpodacus mexicanus",
- c13: "junco, snowbird",
- c14: "indigo bunting, indigo finch, indigo bird, Passerina cyanea",
- c15: "robin, American robin, Turdus migratorius",
- c16: "bulbul",
- c17: "jay",
- c18: "magpie",
- c19: "chickadee",
- c20: "water ouzel, dipper",
- c21: "kite",
- c22: "bald eagle, American eagle, Haliaeetus leucocephalus",
- c23: "vulture",
- c24: "great grey owl, great gray owl, Strix nebulosa",
- c25: "European fire salamander, Salamandra salamandra",
- c26: "common newt, Triturus vulgaris",
- c27: "eft",
- c28: "spotted salamander, Ambystoma maculatum",
- c29: "axolotl, mud puppy, Ambystoma mexicanum",
- c30: "bullfrog, Rana catesbeiana",
- c31: "tree frog, tree-frog",
- c32: "tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui",
- c33: "loggerhead, loggerhead turtle, Caretta caretta",
- c34: "leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea",
- c35: "mud turtle",
- c36: "terrapin",
- c37: "box turtle, box tortoise",
- c38: "banded gecko",
- c39: "common iguana, iguana, Iguana iguana",
- c40: "American chameleon, anole, Anolis carolinensis",
- c41: "whiptail, whiptail lizard",
- c42: "agama",
- c43: "frilled lizard, Chlamydosaurus kingi",
- c44: "alligator lizard",
- c45: "Gila monster, Heloderma suspectum",
- c46: "green lizard, Lacerta viridis",
- c47: "African chameleon, Chamaeleo chamaeleon",
- c48: "Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis",
- c49: "African crocodile, Nile crocodile, Crocodylus niloticus",
- c50: "American alligator, Alligator mississipiensis",
- c51: "triceratops",
- c52: "thunder snake, worm snake, Carphophis amoenus",
- c53: "ringneck snake, ring-necked snake, ring snake",
- c54: "hognose snake, puff adder, sand viper",
- c55: "green snake, grass snake",
- c56: "king snake, kingsnake",
- c57: "garter snake, grass snake",
- c58: "water snake",
- c59: "vine snake",
- c60: "night snake, Hypsiglena torquata",
- c61: "boa constrictor, Constrictor constrictor",
- c62: "rock python, rock snake, Python sebae",
- c63: "Indian cobra, Naja naja",
- c64: "green mamba",
- c65: "sea snake",
- c66: "horned viper, cerastes, sand viper, horned asp, Cerastes cornutus",
- c67: "diamondback, diamondback rattlesnake, Crotalus adamanteus",
- c68: "sidewinder, horned rattlesnake, Crotalus cerastes",
- c69: "trilobite",
- c70: "harvestman, daddy longlegs, Phalangium opilio",
- c71: "scorpion",
- c72: "black and gold garden spider, Argiope aurantia",
- c73: "barn spider, Araneus cavaticus",
- c74: "garden spider, Aranea diademata",
- c75: "black widow, Latrodectus mactans",
- c76: "tarantula",
- c77: "wolf spider, hunting spider",
- c78: "tick",
- c79: "centipede",
- c80: "black grouse",
- c81: "ptarmigan",
- c82: "ruffed grouse, partridge, Bonasa umbellus",
- c83: "prairie chicken, prairie grouse, prairie fowl",
- c84: "peacock",
- c85: "quail",
- c86: "partridge",
- c87: "African grey, African gray, Psittacus erithacus",
- c88: "macaw",
- c89: "sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita",
- c90: "lorikeet",
- c91: "coucal",
- c92: "bee eater",
- c93: "hornbill",
- c94: "hummingbird",
- c95: "jacamar",
- c96: "toucan",
- c97: "drake",
- c98: "red-breasted merganser, Mergus serrator",
- c99: "goose",
- c100: "black swan, Cygnus atratus",
- c101: "tusker",
- c102: "echidna, spiny anteater, anteater",
- c103: "platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus",
- c104: "wallaby, brush kangaroo",
- c105: "koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus",
- c106: "wombat",
- c107: "jellyfish",
- c108: "sea anemone, anemone",
- c109: "brain coral",
- c110: "flatworm, platyhelminth",
- c111: "nematode, nematode worm, roundworm",
- c112: "conch",
- c113: "snail",
- c114: "slug",
- c115: "sea slug, nudibranch",
- c116: "chiton, coat-of-mail shell, sea cradle, polyplacophore",
- c117: "chambered nautilus, pearly nautilus, nautilus",
- c118: "Dungeness crab, Cancer magister",
- c119: "rock crab, Cancer irroratus",
- c120: "fiddler crab",
- c121: "king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica",
- c122: "American lobster, Northern lobster, Maine lobster, Homarus americanus",
- c123: "spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish",
- c124: "crayfish, crawfish, crawdad, crawdaddy",
- c125: "hermit crab",
- c126: "isopod",
- c127: "white stork, Ciconia ciconia",
- c128: "black stork, Ciconia nigra",
- c129: "spoonbill",
- c130: "flamingo",
- c131: "little blue heron, Egretta caerulea",
- c132: "American egret, great white heron, Egretta albus",
- c133: "bittern",
- c134: "crane",
- c135: "limpkin, Aramus pictus",
- c136: "European gallinule, Porphyrio porphyrio",
- c137: "American coot, marsh hen, mud hen, water hen, Fulica americana",
- c138: "bustard",
- c139: "ruddy turnstone, Arenaria interpres",
- c140: "red-backed sandpiper, dunlin, Erolia alpina",
- c141: "redshank, Tringa totanus",
- c142: "dowitcher",
- c143: "oystercatcher, oyster catcher",
- c144: "pelican",
- c145: "king penguin, Aptenodytes patagonica",
- c146: "albatross, mollymawk",
- c147: "grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus",
- c148: "killer whale, killer, orca, grampus, sea wolf, Orcinus orca",
- c149: "dugong, Dugong dugon",
- c150: "sea lion",
- c151: "Chihuahua",
- c152: "Japanese spaniel",
- c153: "Maltese dog, Maltese terrier, Maltese",
- c154: "Pekinese, Pekingese, Peke",
- c155: "Shih-Tzu",
- c156: "Blenheim spaniel",
- c157: "papillon",
- c158: "toy terrier",
- c159: "Rhodesian ridgeback",
- c160: "Afghan hound, Afghan",
- c161: "basset, basset hound",
- c162: "beagle",
- c163: "bloodhound, sleuthhound",
- c164: "bluetick",
- c165: "black-and-tan coonhound",
- c166: "Walker hound, Walker foxhound",
- c167: "English foxhound",
- c168: "redbone",
- c169: "borzoi, Russian wolfhound",
- c170: "Irish wolfhound",
- c171: "Italian greyhound",
- c172: "whippet",
- c173: "Ibizan hound, Ibizan Podenco",
- c174: "Norwegian elkhound, elkhound",
- c175: "otterhound, otter hound",
- c176: "Saluki, gazelle hound",
- c177: "Scottish deerhound, deerhound",
- c178: "Weimaraner",
- c179: "Staffordshire bullterrier, Staffordshire bull terrier",
- c180: "American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier",
- c181: "Bedlington terrier",
- c182: "Border terrier",
- c183: "Kerry blue terrier",
- c184: "Irish terrier",
- c185: "Norfolk terrier",
- c186: "Norwich terrier",
- c187: "Yorkshire terrier",
- c188: "wire-haired fox terrier",
- c189: "Lakeland terrier",
- c190: "Sealyham terrier, Sealyham",
- c191: "Airedale, Airedale terrier",
- c192: "cairn, cairn terrier",
- c193: "Australian terrier",
- c194: "Dandie Dinmont, Dandie Dinmont terrier",
- c195: "Boston bull, Boston terrier",
- c196: "miniature schnauzer",
- c197: "giant schnauzer",
- c198: "standard schnauzer",
- c199: "Scotch terrier, Scottish terrier, Scottie",
- c200: "Tibetan terrier, chrysanthemum dog",
- c201: "silky terrier, Sydney silky",
- c202: "soft-coated wheaten terrier",
- c203: "West Highland white terrier",
- c204: "Lhasa, Lhasa apso",
- c205: "flat-coated retriever",
- c206: "curly-coated retriever",
- c207: "golden retriever",
- c208: "Labrador retriever",
- c209: "Chesapeake Bay retriever",
- c210: "German short-haired pointer",
- c211: "vizsla, Hungarian pointer",
- c212: "English setter",
- c213: "Irish setter, red setter",
- c214: "Gordon setter",
- c215: "Brittany spaniel",
- c216: "clumber, clumber spaniel",
- c217: "English springer, English springer spaniel",
- c218: "Welsh springer spaniel",
- c219: "cocker spaniel, English cocker spaniel, cocker",
- c220: "Sussex spaniel",
- c221: "Irish water spaniel",
- c222: "kuvasz",
- c223: "schipperke",
- c224: "groenendael",
- c225: "malinois",
- c226: "briard",
- c227: "kelpie",
- c228: "komondor",
- c229: "Old English sheepdog, bobtail",
- c230: "Shetland sheepdog, Shetland sheep dog, Shetland",
- c231: "collie",
- c232: "Border collie",
- c233: "Bouvier des Flandres, Bouviers des Flandres",
- c234: "Rottweiler",
- c235: "German shepherd, German shepherd dog, German police dog, alsatian",
- c236: "Doberman, Doberman pinscher",
- c237: "miniature pinscher",
- c238: "Greater Swiss Mountain dog",
- c239: "Bernese mountain dog",
- c240: "Appenzeller",
- c241: "EntleBucher",
- c242: "boxer",
- c243: "bull mastiff",
- c244: "Tibetan mastiff",
- c245: "French bulldog",
- c246: "Great Dane",
- c247: "Saint Bernard, St Bernard",
- c248: "Eskimo dog, husky",
- c249: "malamute, malemute, Alaskan malamute",
- c250: "Siberian husky",
- c251: "dalmatian, coach dog, carriage dog",
- c252: "affenpinscher, monkey pinscher, monkey dog",
- c253: "basenji",
- c254: "pug, pug-dog",
- c255: "Leonberg",
- c256: "Newfoundland, Newfoundland dog",
- c257: "Great Pyrenees",
- c258: "Samoyed, Samoyede",
- c259: "Pomeranian",
- c260: "chow, chow chow",
- c261: "keeshond",
- c262: "Brabancon griffon",
- c263: "Pembroke, Pembroke Welsh corgi",
- c264: "Cardigan, Cardigan Welsh corgi",
- c265: "toy poodle",
- c266: "miniature poodle",
- c267: "standard poodle",
- c268: "Mexican hairless",
- c269: "timber wolf, grey wolf, gray wolf, Canis lupus",
- c270: "white wolf, Arctic wolf, Canis lupus tundrarum",
- c271: "red wolf, maned wolf, Canis rufus, Canis niger",
- c272: "coyote, prairie wolf, brush wolf, Canis latrans",
- c273: "dingo, warrigal, warragal, Canis dingo",
- c274: "dhole, Cuon alpinus",
- c275: "African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus",
- c276: "hyena, hyaena",
- c277: "red fox, Vulpes vulpes",
- c278: "kit fox, Vulpes macrotis",
- c279: "Arctic fox, white fox, Alopex lagopus",
- c280: "grey fox, gray fox, Urocyon cinereoargenteus",
- c281: "tabby, tabby cat",
- c282: "tiger cat",
- c283: "Persian cat",
- c284: "Siamese cat, Siamese",
- c285: "Egyptian cat",
- c286: "cougar, puma, catamount, mountain lion, painter, panther, Felis concolor",
- c287: "lynx, catamount",
- c288: "leopard, Panthera pardus",
- c289: "snow leopard, ounce, Panthera uncia",
- c290: "jaguar, panther, Panthera onca, Felis onca",
- c291: "lion, king of beasts, Panthera leo",
- c292: "tiger, Panthera tigris",
- c293: "cheetah, chetah, Acinonyx jubatus",
- c294: "brown bear, bruin, Ursus arctos",
- c295: "American black bear, black bear, Ursus americanus, Euarctos americanus",
- c296: "ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus",
- c297: "sloth bear, Melursus ursinus, Ursus ursinus",
- c298: "mongoose",
- c299: "meerkat, mierkat",
- c300: "tiger beetle",
- c301: "ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle",
- c302: "ground beetle, carabid beetle",
- c303: "long-horned beetle, longicorn, longicorn beetle",
- c304: "leaf beetle, chrysomelid",
- c305: "dung beetle",
- c306: "rhinoceros beetle",
- c307: "weevil",
- c308: "fly",
- c309: "bee",
- c310: "ant, emmet, pismire",
- c311: "grasshopper, hopper",
- c312: "cricket",
- c313: "walking stick, walkingstick, stick insect",
- c314: "cockroach, roach",
- c315: "mantis, mantid",
- c316: "cicada, cicala",
- c317: "leafhopper",
- c318: "lacewing, lacewing fly",
- c319: "dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk",
- c320: "damselfly",
- c321: "admiral",
- c322: "ringlet, ringlet butterfly",
- c323: "monarch, monarch butterfly, milkweed butterfly, Danaus plexippus",
- c324: "cabbage butterfly",
- c325: "sulphur butterfly, sulfur butterfly",
- c326: "lycaenid, lycaenid butterfly",
- c327: "starfish, sea star",
- c328: "sea urchin",
- c329: "sea cucumber, holothurian",
- c330: "wood rabbit, cottontail, cottontail rabbit",
- c331: "hare",
- c332: "Angora, Angora rabbit",
- c333: "hamster",
- c334: "porcupine, hedgehog",
- c335: "fox squirrel, eastern fox squirrel, Sciurus niger",
- c336: "marmot",
- c337: "beaver",
- c338: "guinea pig, Cavia cobaya",
- c339: "sorrel",
- c340: "zebra",
- c341: "hog, pig, grunter, squealer, Sus scrofa",
- c342: "wild boar, boar, Sus scrofa",
- c343: "warthog",
- c344: "hippopotamus, hippo, river horse, Hippopotamus amphibius",
- c345: "ox",
- c346: "water buffalo, water ox, Asiatic buffalo, Bubalus bubalis",
- c347: "bison",
- c348: "ram, tup",
- c349: "bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis",
- c350: "ibex, Capra ibex",
- c351: "hartebeest",
- c352: "impala, Aepyceros melampus",
- c353: "gazelle",
- c354: "Arabian camel, dromedary, Camelus dromedarius",
- c355: "llama",
- c356: "weasel",
- c357: "mink",
- c358: "polecat, fitch, foulmart, foumart, Mustela putorius",
- c359: "black-footed ferret, ferret, Mustela nigripes",
- c360: "otter",
- c361: "skunk, polecat, wood pussy",
- c362: "badger",
- c363: "armadillo",
- c364: "three-toed sloth, ai, Bradypus tridactylus",
- c365: "orangutan, orang, orangutang, Pongo pygmaeus",
- c366: "gorilla, Gorilla gorilla",
- c367: "chimpanzee, chimp, Pan troglodytes",
- c368: "gibbon, Hylobates lar",
- c369: "siamang, Hylobates syndactylus, Symphalangus syndactylus",
- c370: "guenon, guenon monkey",
- c371: "patas, hussar monkey, Erythrocebus patas",
- c372: "baboon",
- c373: "macaque",
- c374: "langur",
- c375: "colobus, colobus monkey",
- c376: "proboscis monkey, Nasalis larvatus",
- c377: "marmoset",
- c378: "capuchin, ringtail, Cebus capucinus",
- c379: "howler monkey, howler",
- c380: "titi, titi monkey",
- c381: "spider monkey, Ateles geoffroyi",
- c382: "squirrel monkey, Saimiri sciureus",
- c383: "Madagascar cat, ring-tailed lemur, Lemur catta",
- c384: "indri, indris, Indri indri, Indri brevicaudatus",
- c385: "Indian elephant, Elephas maximus",
- c386: "African elephant, Loxodonta africana",
- c387: "lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens",
- c388: "giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca",
- c389: "barracouta, snoek",
- c390: "eel",
- c391: "coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch",
- c392: "rock beauty, Holocanthus tricolor",
- c393: "anemone fish",
- c394: "sturgeon",
- c395: "gar, garfish, garpike, billfish, Lepisosteus osseus",
- c396: "lionfish",
- c397: "puffer, pufferfish, blowfish, globefish",
- c398: "abacus",
- c399: "abaya",
- c400: "academic gown, academic robe, judge's robe",
- c401: "accordion, piano accordion, squeeze box",
- c402: "acoustic guitar",
- c403: "aircraft carrier, carrier, flattop, attack aircraft carrier",
- c404: "airliner",
- c405: "airship, dirigible",
- c406: "altar",
- c407: "ambulance",
- c408: "amphibian, amphibious vehicle",
- c409: "analog clock",
- c410: "apiary, bee house",
- c411: "apron",
- c412: "ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin",
- c413: "assault rifle, assault gun",
- c414: "backpack, back pack, knapsack, packsack, rucksack, haversack",
- c415: "bakery, bakeshop, bakehouse",
- c416: "balance beam, beam",
- c417: "balloon",
- c418: "ballpoint, ballpoint pen, ballpen, Biro",
- c419: "Band Aid",
- c420: "banjo",
- c421: "bannister, banister, balustrade, balusters, handrail",
- c422: "barbell",
- c423: "barber chair",
- c424: "barbershop",
- c425: "barn",
- c426: "barometer",
- c427: "barrel, cask",
- c428: "barrow, garden cart, lawn cart, wheelbarrow",
- c429: "baseball",
- c430: "basketball",
- c431: "bassinet",
- c432: "bassoon",
- c433: "bathing cap, swimming cap",
- c434: "bath towel",
- c435: "bathtub, bathing tub, bath, tub",
- c436: "beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon",
- c437: "beacon, lighthouse, beacon light, pharos",
- c438: "beaker",
- c439: "bearskin, busby, shako",
- c440: "beer bottle",
- c441: "beer glass",
- c442: "bell cote, bell cot",
- c443: "bib",
- c444: "bicycle-built-for-two, tandem bicycle, tandem",
- c445: "bikini, two-piece",
- c446: "binder, ring-binder",
- c447: "binoculars, field glasses, opera glasses",
- c448: "birdhouse",
- c449: "boathouse",
- c450: "bobsled, bobsleigh, bob",
- c451: "bolo tie, bolo, bola tie, bola",
- c452: "bonnet, poke bonnet",
- c453: "bookcase",
- c454: "bookshop, bookstore, bookstall",
- c455: "bottlecap",
- c456: "bow",
- c457: "bow tie, bow-tie, bowtie",
- c458: "brass, memorial tablet, plaque",
- c459: "brassiere, bra, bandeau",
- c460: "breakwater, groin, groyne, mole, bulwark, seawall, jetty",
- c461: "breastplate, aegis, egis",
- c462: "broom",
- c463: "bucket, pail",
- c464: "buckle",
- c465: "bulletproof vest",
- c466: "bullet train, bullet",
- c467: "butcher shop, meat market",
- c468: "cab, hack, taxi, taxicab",
- c469: "caldron, cauldron",
- c470: "candle, taper, wax light",
- c471: "cannon",
- c472: "canoe",
- c473: "can opener, tin opener",
- c474: "cardigan",
- c475: "car mirror",
- c476: "carousel, carrousel, merry-go-round, roundabout, whirligig",
- c477: "carpenter's kit, tool kit",
- c478: "carton",
- c479: "car wheel",
- c480: "cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM",
- c481: "cassette",
- c482: "cassette player",
- c483: "castle",
- c484: "catamaran",
- c485: "CD player",
- c486: "cello, violoncello",
- c487: "cellular telephone, cellular phone, cellphone, cell, mobile phone",
- c488: "chain",
- c489: "chainlink fence",
- c490: "chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour",
- c491: "chain saw, chainsaw",
- c492: "chest",
- c493: "chiffonier, commode",
- c494: "chime, bell, gong",
- c495: "china cabinet, china closet",
- c496: "Christmas stocking",
- c497: "church, church building",
- c498: "cinema, movie theater, movie theatre, movie house, picture palace",
- c499: "cleaver, meat cleaver, chopper",
- c500: "cliff dwelling",
- c501: "cloak",
- c502: "clog, geta, patten, sabot",
- c503: "cocktail shaker",
- c504: "coffee mug",
- c505: "coffeepot",
- c506: "coil, spiral, volute, whorl, helix",
- c507: "combination lock",
- c508: "computer keyboard, keypad",
- c509: "confectionery, confectionary, candy store",
- c510: "container ship, containership, container vessel",
- c511: "convertible",
- c512: "corkscrew, bottle screw",
- c513: "cornet, horn, trumpet, trump",
- c514: "cowboy boot",
- c515: "cowboy hat, ten-gallon hat",
- c516: "cradle",
- c517: "crane",
- c518: "crash helmet",
- c519: "crate",
- c520: "crib, cot",
- c521: "Crock Pot",
- c522: "croquet ball",
- c523: "crutch",
- c524: "cuirass",
- c525: "dam, dike, dyke",
- c526: "desk",
- c527: "desktop computer",
- c528: "dial telephone, dial phone",
- c529: "diaper, nappy, napkin",
- c530: "digital clock",
- c531: "digital watch",
- c532: "dining table, board",
- c533: "dishrag, dishcloth",
- c534: "dishwasher, dish washer, dishwashing machine",
- c535: "disk brake, disc brake",
- c536: "dock, dockage, docking facility",
- c537: "dogsled, dog sled, dog sleigh",
- c538: "dome",
- c539: "doormat, welcome mat",
- c540: "drilling platform, offshore rig",
- c541: "drum, membranophone, tympan",
- c542: "drumstick",
- c543: "dumbbell",
- c544: "Dutch oven",
- c545: "electric fan, blower",
- c546: "electric guitar",
- c547: "electric locomotive",
- c548: "entertainment center",
- c549: "envelope",
- c550: "espresso maker",
- c551: "face powder",
- c552: "feather boa, boa",
- c553: "file, file cabinet, filing cabinet",
- c554: "fireboat",
- c555: "fire engine, fire truck",
- c556: "fire screen, fireguard",
- c557: "flagpole, flagstaff",
- c558: "flute, transverse flute",
- c559: "folding chair",
- c560: "football helmet",
- c561: "forklift",
- c562: "fountain",
- c563: "fountain pen",
- c564: "four-poster",
- c565: "freight car",
- c566: "French horn, horn",
- c567: "frying pan, frypan, skillet",
- c568: "fur coat",
- c569: "garbage truck, dustcart",
- c570: "gasmask, respirator, gas helmet",
- c571: "gas pump, gasoline pump, petrol pump, island dispenser",
- c572: "goblet",
- c573: "go-kart",
- c574: "golf ball",
- c575: "golfcart, golf cart",
- c576: "gondola",
- c577: "gong, tam-tam",
- c578: "gown",
- c579: "grand piano, grand",
- c580: "greenhouse, nursery, glasshouse",
- c581: "grille, radiator grille",
- c582: "grocery store, grocery, food market, market",
- c583: "guillotine",
- c584: "hair slide",
- c585: "hair spray",
- c586: "half track",
- c587: "hammer",
- c588: "hamper",
- c589: "hand blower, blow dryer, blow drier, hair dryer, hair drier",
- c590: "hand-held computer, hand-held microcomputer",
- c591: "handkerchief, hankie, hanky, hankey",
- c592: "hard disc, hard disk, fixed disk",
- c593: "harmonica, mouth organ, harp, mouth harp",
- c594: "harp",
- c595: "harvester, reaper",
- c596: "hatchet",
- c597: "holster",
- c598: "home theater, home theatre",
- c599: "honeycomb",
- c600: "hook, claw",
- c601: "hoopskirt, crinoline",
- c602: "horizontal bar, high bar",
- c603: "horse cart, horse-cart",
- c604: "hourglass",
- c605: "iPod",
- c606: "iron, smoothing iron",
- c607: "jack-o'-lantern",
- c608: "jean, blue jean, denim",
- c609: "jeep, landrover",
- c610: "jersey, T-shirt, tee shirt",
- c611: "jigsaw puzzle",
- c612: "jinrikisha, ricksha, rickshaw",
- c613: "joystick",
- c614: "kimono",
- c615: "knee pad",
- c616: "knot",
- c617: "lab coat, laboratory coat",
- c618: "ladle",
- c619: "lampshade, lamp shade",
- c620: "laptop, laptop computer",
- c621: "lawn mower, mower",
- c622: "lens cap, lens cover",
- c623: "letter opener, paper knife, paperknife",
- c624: "library",
- c625: "lifeboat",
- c626: "lighter, light, igniter, ignitor",
- c627: "limousine, limo",
- c628: "liner, ocean liner",
- c629: "lipstick, lip rouge",
- c630: "Loafer",
- c631: "lotion",
- c632: "loudspeaker, speaker, speaker unit, loudspeaker system, speaker system",
- c633: "loupe, jeweler's loupe",
- c634: "lumbermill, sawmill",
- c635: "magnetic compass",
- c636: "mailbag, postbag",
- c637: "mailbox, letter box",
- c638: "maillot",
- c639: "maillot, tank suit",
- c640: "manhole cover",
- c641: "maraca",
- c642: "marimba, xylophone",
- c643: "mask",
- c644: "matchstick",
- c645: "maypole",
- c646: "maze, labyrinth",
- c647: "measuring cup",
- c648: "medicine chest, medicine cabinet",
- c649: "megalith, megalithic structure",
- c650: "microphone, mike",
- c651: "microwave, microwave oven",
- c652: "military uniform",
- c653: "milk can",
- c654: "minibus",
- c655: "miniskirt, mini",
- c656: "minivan",
- c657: "missile",
- c658: "mitten",
- c659: "mixing bowl",
- c660: "mobile home, manufactured home",
- c661: "Model T",
- c662: "modem",
- c663: "monastery",
- c664: "monitor",
- c665: "moped",
- c666: "mortar",
- c667: "mortarboard",
- c668: "mosque",
- c669: "mosquito net",
- c670: "motor scooter, scooter",
- c671: "mountain bike, all-terrain bike, off-roader",
- c672: "mountain tent",
- c673: "mouse, computer mouse",
- c674: "mousetrap",
- c675: "moving van",
- c676: "muzzle",
- c677: "nail",
- c678: "neck brace",
- c679: "necklace",
- c680: "nipple",
- c681: "notebook, notebook computer",
- c682: "obelisk",
- c683: "oboe, hautboy, hautbois",
- c684: "ocarina, sweet potato",
- c685: "odometer, hodometer, mileometer, milometer",
- c686: "oil filter",
- c687: "organ, pipe organ",
- c688: "oscilloscope, scope, cathode-ray oscilloscope, CRO",
- c689: "overskirt",
- c690: "oxcart",
- c691: "oxygen mask",
- c692: "packet",
- c693: "paddle, boat paddle",
- c694: "paddlewheel, paddle wheel",
- c695: "padlock",
- c696: "paintbrush",
- c697: "pajama, pyjama, pj's, jammies",
- c698: "palace",
- c699: "panpipe, pandean pipe, syrinx",
- c700: "paper towel",
- c701: "parachute, chute",
- c702: "parallel bars, bars",
- c703: "park bench",
- c704: "parking meter",
- c705: "passenger car, coach, carriage",
- c706: "patio, terrace",
- c707: "pay-phone, pay-station",
- c708: "pedestal, plinth, footstall",
- c709: "pencil box, pencil case",
- c710: "pencil sharpener",
- c711: "perfume, essence",
- c712: "Petri dish",
- c713: "photocopier",
- c714: "pick, plectrum, plectron",
- c715: "pickelhaube",
- c716: "picket fence, paling",
- c717: "pickup, pickup truck",
- c718: "pier",
- c719: "piggy bank, penny bank",
- c720: "pill bottle",
- c721: "pillow",
- c722: "ping-pong ball",
- c723: "pinwheel",
- c724: "pirate, pirate ship",
- c725: "pitcher, ewer",
- c726: "plane, carpenter's plane, woodworking plane",
- c727: "planetarium",
- c728: "plastic bag",
- c729: "plate rack",
- c730: "plow, plough",
- c731: "plunger, plumber's helper",
- c732: "Polaroid camera, Polaroid Land camera",
- c733: "pole",
- c734: "police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria",
- c735: "poncho",
- c736: "pool table, billiard table, snooker table",
- c737: "pop bottle, soda bottle",
- c738: "pot, flowerpot",
- c739: "potter's wheel",
- c740: "power drill",
- c741: "prayer rug, prayer mat",
- c742: "printer",
- c743: "prison, prison house",
- c744: "projectile, missile",
- c745: "projector",
- c746: "puck, hockey puck",
- c747: "punching bag, punch bag, punching ball, punchball",
- c748: "purse",
- c749: "quill, quill pen",
- c750: "quilt, comforter, comfort, puff",
- c751: "racer, race car, racing car",
- c752: "racket, racquet",
- c753: "radiator",
- c754: "radio, wireless",
- c755: "radio telescope, radio reflector",
- c756: "rain barrel",
- c757: "recreational vehicle, RV, R.V.",
- c758: "reel",
- c759: "reflex camera",
- c760: "refrigerator, icebox",
- c761: "remote control, remote",
- c762: "restaurant, eating house, eating place, eatery",
- c763: "revolver, six-gun, six-shooter",
- c764: "rifle",
- c765: "rocking chair, rocker",
- c766: "rotisserie",
- c767: "rubber eraser, rubber, pencil eraser",
- c768: "rugby ball",
- c769: "rule, ruler",
- c770: "running shoe",
- c771: "safe",
- c772: "safety pin",
- c773: "saltshaker, salt shaker",
- c774: "sandal",
- c775: "sarong",
- c776: "sax, saxophone",
- c777: "scabbard",
- c778: "scale, weighing machine",
- c779: "school bus",
- c780: "schooner",
- c781: "scoreboard",
- c782: "screen, CRT screen",
- c783: "screw",
- c784: "screwdriver",
- c785: "seat belt, seatbelt",
- c786: "sewing machine",
- c787: "shield, buckler",
- c788: "shoe shop, shoe-shop, shoe store",
- c789: "shoji",
- c790: "shopping basket",
- c791: "shopping cart",
- c792: "shovel",
- c793: "shower cap",
- c794: "shower curtain",
- c795: "ski",
- c796: "ski mask",
- c797: "sleeping bag",
- c798: "slide rule, slipstick",
- c799: "sliding door",
- c800: "slot, one-armed bandit",
- c801: "snorkel",
- c802: "snowmobile",
- c803: "snowplow, snowplough",
- c804: "soap dispenser",
- c805: "soccer ball",
- c806: "sock",
- c807: "solar dish, solar collector, solar furnace",
- c808: "sombrero",
- c809: "soup bowl",
- c810: "space bar",
- c811: "space heater",
- c812: "space shuttle",
- c813: "spatula",
- c814: "speedboat",
- c815: "spider web, spider's web",
- c816: "spindle",
- c817: "sports car, sport car",
- c818: "spotlight, spot",
- c819: "stage",
- c820: "steam locomotive",
- c821: "steel arch bridge",
- c822: "steel drum",
- c823: "stethoscope",
- c824: "stole",
- c825: "stone wall",
- c826: "stopwatch, stop watch",
- c827: "stove",
- c828: "strainer",
- c829: "streetcar, tram, tramcar, trolley, trolley car",
- c830: "stretcher",
- c831: "studio couch, day bed",
- c832: "stupa, tope",
- c833: "submarine, pigboat, sub, U-boat",
- c834: "suit, suit of clothes",
- c835: "sundial",
- c836: "sunglass",
- c837: "sunglasses, dark glasses, shades",
- c838: "sunscreen, sunblock, sun blocker",
- c839: "suspension bridge",
- c840: "swab, swob, mop",
- c841: "sweatshirt",
- c842: "swimming trunks, bathing trunks",
- c843: "swing",
- c844: "switch, electric switch, electrical switch",
- c845: "syringe",
- c846: "table lamp",
- c847: "tank, army tank, armored combat vehicle, armoured combat vehicle",
- c848: "tape player",
- c849: "teapot",
- c850: "teddy, teddy bear",
- c851: "television, television system",
- c852: "tennis ball",
- c853: "thatch, thatched roof",
- c854: "theater curtain, theatre curtain",
- c855: "thimble",
- c856: "thresher, thrasher, threshing machine",
- c857: "throne",
- c858: "tile roof",
- c859: "toaster",
- c860: "tobacco shop, tobacconist shop, tobacconist",
- c861: "toilet seat",
- c862: "torch",
- c863: "totem pole",
- c864: "tow truck, tow car, wrecker",
- c865: "toyshop",
- c866: "tractor",
- c867: "trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi",
- c868: "tray",
- c869: "trench coat",
- c870: "tricycle, trike, velocipede",
- c871: "trimaran",
- c872: "tripod",
- c873: "triumphal arch",
- c874: "trolleybus, trolley coach, trackless trolley",
- c875: "trombone",
- c876: "tub, vat",
- c877: "turnstile",
- c878: "typewriter keyboard",
- c879: "umbrella",
- c880: "unicycle, monocycle",
- c881: "upright, upright piano",
- c882: "vacuum, vacuum cleaner",
- c883: "vase",
- c884: "vault",
- c885: "velvet",
- c886: "vending machine",
- c887: "vestment",
- c888: "viaduct",
- c889: "violin, fiddle",
- c890: "volleyball",
- c891: "waffle iron",
- c892: "wall clock",
- c893: "wallet, billfold, notecase, pocketbook",
- c894: "wardrobe, closet, press",
- c895: "warplane, military plane",
- c896: "washbasin, handbasin, washbowl, lavabo, wash-hand basin",
- c897: "washer, automatic washer, washing machine",
- c898: "water bottle",
- c899: "water jug",
- c900: "water tower",
- c901: "whiskey jug",
- c902: "whistle",
- c903: "wig",
- c904: "window screen",
- c905: "window shade",
- c906: "Windsor tie",
- c907: "wine bottle",
- c908: "wing",
- c909: "wok",
- c910: "wooden spoon",
- c911: "wool, woolen, woollen",
- c912: "worm fence, snake fence, snake-rail fence, Virginia fence",
- c913: "wreck",
- c914: "yawl",
- c915: "yurt",
- c916: "web site, website, internet site, site",
- c917: "comic book",
- c918: "crossword puzzle, crossword",
- c919: "street sign",
- c920: "traffic light, traffic signal, stoplight",
- c921: "book jacket, dust cover, dust jacket, dust wrapper",
- c922: "menu",
- c923: "plate",
- c924: "guacamole",
- c925: "consomme",
- c926: "hot pot, hotpot",
- c927: "trifle",
- c928: "ice cream, icecream",
- c929: "ice lolly, lolly, lollipop, popsicle",
- c930: "French loaf",
- c931: "bagel, beigel",
- c932: "pretzel",
- c933: "cheeseburger",
- c934: "hotdog, hot dog, red hot",
- c935: "mashed potato",
- c936: "head cabbage",
- c937: "broccoli",
- c938: "cauliflower",
- c939: "zucchini, courgette",
- c940: "spaghetti squash",
- c941: "acorn squash",
- c942: "butternut squash",
- c943: "cucumber, cuke",
- c944: "artichoke, globe artichoke",
- c945: "bell pepper",
- c946: "cardoon",
- c947: "mushroom",
- c948: "Granny Smith",
- c949: "strawberry",
- c950: "orange",
- c951: "lemon",
- c952: "fig",
- c953: "pineapple, ananas",
- c954: "banana",
- c955: "jackfruit, jak, jack",
- c956: "custard apple",
- c957: "pomegranate",
- c958: "hay",
- c959: "carbonara",
- c960: "chocolate sauce, chocolate syrup",
- c961: "dough",
- c962: "meat loaf, meatloaf",
- c963: "pizza, pizza pie",
- c964: "potpie",
- c965: "burrito",
- c966: "red wine",
- c967: "espresso",
- c968: "cup",
- c969: "eggnog",
- c970: "alp",
- c971: "bubble",
- c972: "cliff, drop, drop-off",
- c973: "coral reef",
- c974: "geyser",
- c975: "lakeside, lakeshore",
- c976: "promontory, headland, head, foreland",
- c977: "sandbar, sand bar",
- c978: "seashore, coast, seacoast, sea-coast",
- c979: "valley, vale",
- c980: "volcano",
- c981: "ballplayer, baseball player",
- c982: "groom, bridegroom",
- c983: "scuba diver",
- c984: "rapeseed",
- c985: "daisy",
- c986: "yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum",
- c987: "corn",
- c988: "acorn",
- c989: "hip, rose hip, rosehip",
- c990: "buckeye, horse chestnut, conker",
- c991: "coral fungus",
- c992: "agaric",
- c993: "gyromitra",
- c994: "stinkhorn, carrion fungus",
- c995: "earthstar",
- c996: "hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa",
- c997: "bolete",
- c998: "ear, spike, capitulum",
- c999: "toilet tissue, toilet paper, bathroom tissue",
-};
-
-export class Classifier {
-
- // 图像显示尺寸结构体 { width: Number, height: Number }
- displaySize;
-
- // net inference session
- session;
-
- // is ready
- ready;
-
- // the predicted class
- mPredClass = "None";
-
- speedTime = 0.0;
-
- modelInput = null;
-
- constructor(displaySize) {
- this.displaySize = {
- width: displaySize.width,
- height: displaySize.height,
- };
-
- this.modelInput = new Float32Array(modelWidth * modelHeight * modelChannel);
-
- this.ready = false;
- }
-
- load() {
- return new Promise((resolve, reject) => {
-
- const modelPath = `${wx.env.USER_DATA_PATH}/mobilenetv2_qat.onnx`;
-
- // 判断之前是否已经下载过onnx模型
- wx.getFileSystemManager().access({
- path: modelPath,
- success: (res) =>
- {
- console.log("file already exist at: " + modelPath)
- this.createInferenceSession(modelPath).then(() =>
- {
- resolve();
- })
- },
- fail: (res) => {
- console.error(res)
-
- wx.cloud.init();
- console.log("begin download model");
-
- const cloudPath = 'cloud://containertest-0gmw3ulnd8d9bc7b.636f-containertest-0gmw3ulnd8d9bc7b-1258211818/mobilenetv2_qat.onnx'
- this.downloadFile(cloudPath, function(r) {
- console.log(`下载进度:${r.progress}%,已下载${r.totalBytesWritten}B,共${r.totalBytesExpectedToWrite}B`)
- }).then(result => {
-
- wx.getFileSystemManager().saveFile({
- tempFilePath:result.tempFilePath,
- filePath: modelPath,
- success: (res) => { // 注册回调函数
- console.log(res)
-
- const modelPath = res.savedFilePath;
- console.log("save onnx model at path: " + modelPath)
-
- this.createInferenceSession(modelPath).then(() => {
- resolve();
- })
- },
- fail(res) {
- console.error(res)
- return
- }
- })
- });
- }
- })
- })
- }
-
- createInferenceSession(modelPath) {
- return new Promise((resolve, reject) => {
- this.session = wx.createInferenceSession({
- model: modelPath,
- /* 0: Lowest precision e.g., LS16 + A16 + Winograd A16 + approx. math
- 1: Lower precision e.g., LS16 + A16 + Winograd off + approx. math
- 2: Modest precision e.g., LS16 + A32 + Winograd A32 + approx. math
- 3: Higher precision e.g., LS32 + A32 + Winograd A32 + approx. math
- 4: Highest precision e.g., LS32 + A32 + Winograd A32 + precise math
-
- Higher precision always require longer time to run session
- */
- precisionLevel : 4,
- allowNPU : false, // wheather use NPU for inference, only useful for IOS
- allowQuantize: true, // wheather generate quantize model
- });
-
- // 监听error事件
- this.session.onError((error) => {
- console.error(error);
- reject(error);
- });
- this.session.onLoad(() => {
- this.ready = true;
- resolve();
- });
- })
- }
-
- downloadFile(fileID, onCall = () => {}) {
- return new Promise((resolve, reject) => {
- const task = wx.cloud.downloadFile({
- fileID,
- success: res => resolve(res),
- fail: e => {
- const info = e.toString()
- if (info.indexOf('abort') != -1) {
- reject(new Error('【文件下载失败】中断下载'))
- } else {
- reject(new Error('【文件下载失败】网络或其他错误'))
- }
- }
- })
- task.onProgressUpdate((res) => {
- if (onCall(res) == false) {
- task.abort()
- }
- })
- })
- }
-
- isReady() {
- return this.ready;
- }
-
- predClass() {
- return this.mPredClass;
- }
-
- // input is rgba uint8 data
- preProcess(frame, dstInput) {
-
- return new Promise((resolve, reject) =>
- {
- const origData = new Uint8Array(frame.data);
-
- const hRatio = frame.height / modelHeight;
-
- const wRatio = frame.width / modelWidth;
-
- // resize data to model input size, uint8 data to float32 data,
- // and transpose from nhwc to nchw
-
- const origHStride = frame.width * 4;
- const origWStride = 4;
-
- const mean = [0.485, 0.456, 0.406]
-
- const reverse_div = [4.367, 4.464, 4.444] // reverse of std = [0.229, 0.224, 0.225]
- const ratio = 1 / 255.0
-
- const normalized_div = [ratio * reverse_div[0], ratio * reverse_div[1], ratio * reverse_div[2]];
-
- const normalized_mean = [mean[0] * reverse_div[0], mean[1] * reverse_div[1], mean[2] * reverse_div[2]];
-
- var idx = 0;
- for (var c = 0; c < modelChannel; ++c)
- {
- for (var h = 0; h < modelHeight; ++h)
- {
- const origH = Math.round(h * hRatio);
-
- const origHOffset = origH * origHStride;
-
- for (var w = 0; w < modelWidth; ++w)
- {
- const origW = Math.round(w * wRatio);
-
- const origIndex = origHOffset + origW * origWStride + c;
-
- //var val = ((origData[origIndex] * ratio) - mean[c]) * reverse_div[c];
-
- var val = origData[origIndex] * (normalized_div[c]) - normalized_mean[c];
- dstInput[idx] = val;
-
- idx++;
- }
- }
- }
-
- resolve();
- });
-
- }
- // run inference and get the output
- async detect(frame)
- {
- return new Promise((resolve, reject) =>
- {
- this.preProcess(frame, this.modelInput).then(() => {
- const xinput = {
- shape: [1, 3, 224, 224], // Input data shape in NCHW
- data: this.modelInput.buffer,
- type: 'float32', // Input data type
- };
-
- inferenceStart = new Date().getTime()
-
- this.session.run({
- // Here string "input" Should be the same with the input name in onnx file
- "onnx::QuantizeLinear_0": xinput,
- })
- .then((res) => {
- inferenceEnd = new Date().getTime();
-
- this.speedTime = inferenceEnd - inferenceStart
-
- // Here use res.outputname.data, outputname
- // Should be the same with the output name in onnx file
- let num = new Float32Array(res["1962"].data)
-
- var maxVar = num[0];
-
- var index = 0;
-
- for (var i = 1; i < num.length; ++i)
- {
- if (maxVar < num[i])
- {
- maxVar = num[i]
- index = i
- }
- }
-
- this.getClass(index);
-
- resolve();
- }).catch(error => console.log("runing error!: ", error.message));
- })
-
- });
- }
-
- getClass(index)
- {
- const cIndex=`c${index}`
- this.mPredClass = classNames[cIndex];
- }
-
- getTime()
- {
- return this.speedTime;
- }
- dispose() {
- this.session.destroy();
- }
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.js b/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.js
deleted file mode 100644
index 4fcf22a2..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.js
+++ /dev/null
@@ -1,211 +0,0 @@
-// pages/mobilenet/index.ts
-
-import { Classifier } from './classify'
-
-import { FpsHelper } from '../../../../util/fps_helper'
-
-const { appWidth, appHeight, benchmarkLevel } = getApp().globalData
-
-Page({
- classifier: null,
- ctx: null,
- fpsHelper: null,
-
- predicting: false,
-
- // For Speed Test
- constBuffer: null,
-
- /**
- * 页面的初始数据
- */
- data: {
- predClass: 'None',
- classifier: null,
- enableSpeedTest: false,
- avgTime: 110.0,
- minTime: 110.0
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad() {
- if (this.data.enableSpeedTest) {
- this.constBuffer = new Float32Array(3 * 224 * 224)
- }
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- this.ctx = wx.createCanvasContext('ssd')
- const context = wx.createCameraContext(this)
- this.initClassifier()
- this.fpsHelper = new FpsHelper()
-
- const listener = context.onCameraFrame(frame => {
- const fps = this.fpsHelper.getAverageFps()
- console.log(`fps=${fps}`)
-
- if (this.classifier && this.classifier.isReady() && !this.predicting) {
- this.executeClassify(frame)
- }
- })
- listener.start()
- this.fpsHelper.reset()
- },
-
- /**
- * 初始化 SSD models
- */
- initClassifier() {
- wx.showLoading({ title: '模型正在加载...' })
- this.classifier = new Classifier({ width: appWidth, height: appHeight })
- this.classifier.load().then(() => {
- wx.hideLoading()
- }).catch(err => {
- console.log('模型加载报错:', err)
- })
- },
-
- /**
- * 构建模型
- */
- async executeClassify(frame) {
- this.predicting = true
-
- if (this.classifier && this.classifier.isReady()) {
- this.fpsHelper.updateFPS()
-
- this.setData({
- predClass: this.classifier.predClass(),
- enableSpeedTest: this.data.enableSpeedTest
- })
-
- await this.classifier.detect(frame).then(() => {
- this.setData({
- predClass: this.classifier.predClass()
- })
- }).catch((err) => {
- console.log(err)
- })
-
- if (this.data.enableSpeedTest) {
- await this.inferSpeedTest()
- }
- }
-
- this.predicting = false
- },
-
- async inferSpeedTest() {
- console.log('runInferenceSession speed test start run===============================')
-
- const xinput = {
- shape: [1, 3, 224, 224],
- data: this.constBuffer.buffer,
- type: 'float32',
- }
-
- this.data.classifier = this.classifier
-
- // warm up
- for (let index = 0; index < 20; index++) {
- await this.inferOnce(xinput, this.data)
- }
-
- for (let l = 0; l < 5; ++l) {
- const beMs = new Date().getTime()
-
- for (let index = 0; index < 100; index++) {
- await this.inferOnce(xinput, this.data)
- }
-
- const afMs = new Date().getTime()
-
- const avgTime = (afMs - beMs) / 100.0
-
- let overall = 0.0
- let minTime = 1000000.0
-
- for (let index = 0; index < 100; index++) {
- const beMsTmp = new Date().getTime()
- await this.inferOnce(xinput, this.data)
- const afMsTmp = new Date().getTime()
- const tmpTime = (afMsTmp - beMsTmp)
- if (minTime > tmpTime) {
- minTime = tmpTime
- }
- overall += (afMsTmp - beMsTmp)
- }
-
- console.log('Inference min time: ', minTime)
- console.log('Inference avg time: ', avgTime)
-
- this.setData({
- predClass: this.classifier.predClass(),
- minTime,
- avgTime,
- })
- }
- },
-
- inferOnce(xinput, data) {
- return new Promise(function (resolve, reject) {
- data.classifier.session.run({
- 'onnx::QuantizeLinear_0': xinput,
- }).then(async function (res) {
- resolve()
- })
- })
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- if (this.classifier && this.classifier.isReady()) {
- this.classifier.dispose()
- }
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- return {
- title: '微信小程序 × MobileNetInt8',
- path: 'packageAPI/pages/ai/mobilenet_int8/index',
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.json b/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.json
deleted file mode 100644
index 6cdc72a9..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "disableScroll": true,
- "usingComponents": {}
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.less b/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.less
deleted file mode 100644
index d37313ce..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.less
+++ /dev/null
@@ -1 +0,0 @@
-/* packageAPI/pages/ai/mobilenet/index.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.wxml b/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.wxml
deleted file mode 100644
index 87c92573..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.wxml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
- 分类结果: {{predClass}}
-
- 平均耗时(ms): {{avgTime}}
- 最小耗时(ms): {{minTime}}
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.wxss b/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.wxss
deleted file mode 100644
index ffdb74fd..00000000
--- a/miniprogram/packageAPI/pages/ai/mobilenet_int8/index.wxss
+++ /dev/null
@@ -1,17 +0,0 @@
-/* packageAPI/pages/ai/mobilenet_int8/index.wxss */
-/* pages/mobilenet_int8/index.wxss */
-.camera {
- width: 100%;
- height: 70vh;
-}
-
-.canvas {
- width: 100%;
- height: 100vh;
-}
-
-.textstyle {
- color: #e0a165;
- font-size: 28rpx;
- line-height: 1.6;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ai/style-trans/index.js b/miniprogram/packageAPI/pages/ai/style-trans/index.js
deleted file mode 100644
index f896ec13..00000000
--- a/miniprogram/packageAPI/pages/ai/style-trans/index.js
+++ /dev/null
@@ -1,278 +0,0 @@
-// pages/stype-trans/index.js.ts
-Page({
- session: null,
-
- canvasCtx: null, // on screen canvas
- /**
- * 页面的初始数据
- */
- data: {
- src: '',
- imageWidth: 224,
- imageHeight: 224,
- imageChannel: 3,
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad() {
-
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
-
- },
-
- takePhoto() {
- const camera = wx.createCameraContext()
- camera.takePhoto({
- quality: 'normal',
- success: (res) => {
- this.setData({
- src: res.tempImagePath
- })
-
- const canvas = wx.createOffscreenCanvas({ type: '2d', width: this.data.imageWidth, height: this.data.imageHeight })
-
- const ctx = canvas.getContext('2d')
-
- const image = canvas.createImage()
-
- // wait for image upload
- new Promise(resolve => {
- image.onload = resolve
- image.src = this.data.src
- }).then(() => {
- // init the inferenceSession
- this.InitSession().then(() => {
- // create input
- ctx.clearRect(0, 0, this.data.imageWidth, this.data.imageHeight)
- ctx.drawImage(image, 0, 0, this.data.imageWidth, this.data.imageHeight)
-
- // get the imgdata
- const imgData = ctx.getImageData(0, 0, this.data.imageWidth, this.data.imageHeight)
-
- // use the image data
- this.detect(imgData)
- })
- })
- }
- })
- },
-
- InitSession() {
- return new Promise((resolve, reject) => {
- const modelPath = `${wx.env.USER_DATA_PATH}/mosaic-8.onnx`
-
- // 判断之前是否已经下载过onnx模型
- wx.getFileSystemManager().access({
- path: modelPath,
- success: (res) => {
- console.log('file already exist at: ' + modelPath)
- this.createInferenceSession(modelPath).then(() => {
- resolve()
- })
- },
- fail: (res) => {
- console.error(res)
-
- wx.cloud.init()
- console.log('begin download model')
-
- const cloudPath = 'cloud://containertest-0gmw3ulnd8d9bc7b.636f-containertest-0gmw3ulnd8d9bc7b-1258211818/mosaic-8.onnx'
-
- this.downloadFile(cloudPath, function (r) {
- console.log(`下载进度:${r.progress}%,已下载${r.totalBytesWritten}B,共${r.totalBytesExpectedToWrite}B`)
- }).then(result => {
- wx.getFileSystemManager().saveFile({
- tempFilePath: result.tempFilePath,
- filePath: modelPath,
- success: (res) => { // 注册回调函数
- console.log(res)
-
- const modelPath = res.savedFilePath
- console.log('save onnx model at path: ' + modelPath)
-
- this.createInferenceSession(modelPath).then(() => {
- resolve()
- })
- },
- fail(res) {
- console.error(res)
- }
- })
- })
- }
- })
- })
- },
-
- createInferenceSession(modelPath) {
- return new Promise((resolve, reject) => {
- this.session = wx.createInferenceSession({
- model: modelPath,
- /* 0: Lowest precision e.g., LS16 + A16 + Winograd A16 + approx. math
- 1: Lower precision e.g., LS16 + A16 + Winograd off + approx. math
- 2: Modest precision e.g., LS16 + A32 + Winograd A32 + approx. math
- 3: Higher precision e.g., LS32 + A32 + Winograd A32 + approx. math
- 4: Highest precision e.g., LS32 + A32 + Winograd A32 + precise math
-
- Higher precision always require longer time to run session
- */
- precisionLevel: 4,
- allowNPU: false, // wheather use NPU for inference, only useful for IOS
- allowQuantize: false, // wheather generate quantize model
- })
-
- // 监听error事件
- this.session.onError((error) => {
- console.error(error)
- reject(error)
- })
- this.session.onLoad(() => {
- resolve()
- })
- })
- },
-
- downloadFile(fileID, onCall = () => {}) {
- return new Promise((resolve, reject) => {
- const task = wx.cloud.downloadFile({
- fileID,
- success: res => resolve(res),
- fail: e => {
- const info = e.toString()
- if (info.indexOf('abort') != -1) {
- reject(new Error('【文件下载失败】中断下载'))
- } else {
- reject(new Error('【文件下载失败】网络或其他错误'))
- }
- }
- })
- task.onProgressUpdate((res) => {
- if (onCall(res) == false) {
- task.abort()
- }
- })
- })
- },
-
- detect(imgData) {
- return new Promise((resolve, reject) => {
- const uint8Data = new Uint8Array(imgData.data)
-
- const floatData = new Float32Array(this.data.imageChannel * this.data.imageHeight * this.data.imageWidth)
-
- // nhwc uint8 data to nchw float32 data, and ignore the alpha channel
- const modelChannel = this.data.imageChannel
-
- const imageWH = this.data.imageHeight * this.data.imageWidth
-
- let idx = 0
- for (let c = 0; c < modelChannel; ++c) {
- for (let wh = 0; wh < imageWH; ++wh) {
- const inputIdx = wh * 4 + c
- floatData[idx] = uint8Data[inputIdx]
- idx++
- }
- }
-
- const xinput = {
- shape: [1, 3, 224, 224], // Input data shape in NCHW
- data: floatData.buffer,
- type: 'float32', // Input data type
- }
-
- this.session.run({
- // Here string "input1" Should be the same with the input name in onnx file
- input1: xinput,
- }).then((res) => {
- // Here use res.outputname.data, outputname
- // Should be the same with the output name in onnx file
- const output = new Float32Array(res.output1.data)
-
- const hwSize = imgData.height * imgData.width
-
- const finalout = new Uint8ClampedArray(4 * hwSize)
-
- // fill the alpha channel
- finalout.fill(255)
-
- // convert from nchw to nhwc
- idx = 0
- for (let c = 0; c < modelChannel; ++c) {
- for (let hw = 0; hw < hwSize; ++hw) {
- const dstIdx = hw * 4 + c
- finalout[dstIdx] = Math.max(0, Math.min(Math.round(output[idx]), 255))
- idx++
- }
- }
-
- this.canvasCtx = wx.createCanvasContext('trans')
-
- wx.canvasPutImageData({
- canvasId: 'trans',
- data: finalout,
- height: 224,
- width: 224,
- x: 0,
- y: 0,
- }).then((res) => {
- console.log(res)
- })
- })
-
- resolve()
- })
- },
-
- error(e) {
- console.log(e.detail)
- }
-})
diff --git a/miniprogram/packageAPI/pages/ai/style-trans/index.json b/miniprogram/packageAPI/pages/ai/style-trans/index.json
deleted file mode 100644
index a1556cc8..00000000
--- a/miniprogram/packageAPI/pages/ai/style-trans/index.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "disableScroll": true
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ai/style-trans/index.less b/miniprogram/packageAPI/pages/ai/style-trans/index.less
deleted file mode 100644
index 5351ba58..00000000
--- a/miniprogram/packageAPI/pages/ai/style-trans/index.less
+++ /dev/null
@@ -1 +0,0 @@
-/* packageAPI/pages/ai/style-trans/index.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ai/style-trans/index.wxml b/miniprogram/packageAPI/pages/ai/style-trans/index.wxml
deleted file mode 100644
index 736300e3..00000000
--- a/miniprogram/packageAPI/pages/ai/style-trans/index.wxml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- packageAPI/pages/ai/style-trans/index.wxml
-
-
-
-
-
-
-
-
- 预览
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/ai/style-trans/index.wxss b/miniprogram/packageAPI/pages/ai/style-trans/index.wxss
deleted file mode 100644
index 17525d62..00000000
--- a/miniprogram/packageAPI/pages/ai/style-trans/index.wxss
+++ /dev/null
@@ -1,17 +0,0 @@
-/* packageAPI/pages/ai/style-trans/index.wxss */
-.camera {
- width: 100%;
- height: 80vh;
-}
-
-.offcanvas {
- width: 224px;
- height: 224px;
- position: relative;
- margin-left: 25%;
-}
-
-.btn-area {
- margin-top: 0;
-}
-
diff --git a/miniprogram/packageAPI/pages/api/choose-address/choose-address.js b/miniprogram/packageAPI/pages/api/choose-address/choose-address.js
deleted file mode 100644
index 8234545f..00000000
--- a/miniprogram/packageAPI/pages/api/choose-address/choose-address.js
+++ /dev/null
@@ -1,41 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '收货地址',
- path: 'packageAPI/pages/api/choose-address/choose-address'
- }
- },
-
- data: {
- theme: 'light',
- addressInfo: null
- },
- chooseAddress() {
- wx.chooseAddress({
- success: (res) => {
- this.setData({
- addressInfo: res
- })
- },
- fail(err) {
- console.log(err)
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/api/choose-address/choose-address.json b/miniprogram/packageAPI/pages/api/choose-address/choose-address.json
deleted file mode 100644
index 3d04036e..00000000
--- a/miniprogram/packageAPI/pages/api/choose-address/choose-address.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "收货地址",
- "renderer": "webview"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/choose-address/choose-address.wxml b/miniprogram/packageAPI/pages/api/choose-address/choose-address.wxml
deleted file mode 100644
index 30d9ddf3..00000000
--- a/miniprogram/packageAPI/pages/api/choose-address/choose-address.wxml
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/api/choose-address/choose-address.wxss b/miniprogram/packageAPI/pages/api/choose-address/choose-address.wxss
deleted file mode 100644
index 0e4dd82e..00000000
--- a/miniprogram/packageAPI/pages/api/choose-address/choose-address.wxss
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-form {
- margin-top: 15px;
-}
-
-.weui-cell__bd {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- padding: 10px 0;
- min-height: 30px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.js b/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.js
deleted file mode 100644
index 5878845a..00000000
--- a/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.js
+++ /dev/null
@@ -1,53 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '获取发票抬头',
- path: 'packageAPI/pages/api/choose-invoice-title/choose-invoice-title'
- }
- },
-
- data: {
- theme: 'light',
- type: '',
- title: '',
- taxNumber: '',
- companyAddress: '',
- telephone: '',
- bankName: '',
- bankAccount: '',
- },
- chooseInvoiceTitle() {
- wx.chooseInvoiceTitle({
- success: (res) => {
- this.setData({
- type: res.type,
- title: res.title,
- taxNumber: res.taxNumber,
- companyAddress: res.companyAddress,
- telephone: res.telephone,
- bankName: res.bankName,
- bankAccount: res.bankAccount
- })
- },
- fail: (err) => {
- console.error(err)
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.json b/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.json
deleted file mode 100644
index f0390003..00000000
--- a/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "获取发票抬头",
- "renderer": "webview"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.wxml b/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.wxml
deleted file mode 100644
index 1a23ee8f..00000000
--- a/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.wxml
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.wxss b/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.wxss
deleted file mode 100644
index 2e79d510..00000000
--- a/miniprogram/packageAPI/pages/api/choose-invoice-title/choose-invoice-title.wxss
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-form {
- margin-top: 15px;
-}
-
-.weui-cell__bd {
- display: flex;
- justify-content: flex-start;
- padding: 10px 0;
- min-height: 30px;
- align-items: center;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/custom-message/custom-message.js b/miniprogram/packageAPI/pages/api/custom-message/custom-message.js
deleted file mode 100644
index b5361819..00000000
--- a/miniprogram/packageAPI/pages/api/custom-message/custom-message.js
+++ /dev/null
@@ -1,28 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '客服消息',
- path: 'packageAPI/pages/api/custom-message/custom-message'
- }
- },
- handleContact(e) {
- console.log(e.detail.path)
- console.log(e.detail.query)
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/api/custom-message/custom-message.json b/miniprogram/packageAPI/pages/api/custom-message/custom-message.json
deleted file mode 100644
index dad64f13..00000000
--- a/miniprogram/packageAPI/pages/api/custom-message/custom-message.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "客服消息",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageAPI/pages/api/custom-message/custom-message.wxml b/miniprogram/packageAPI/pages/api/custom-message/custom-message.wxml
deleted file mode 100644
index 172f6ca3..00000000
--- a/miniprogram/packageAPI/pages/api/custom-message/custom-message.wxml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/api/custom-message/custom-message.wxss b/miniprogram/packageAPI/pages/api/custom-message/custom-message.wxss
deleted file mode 100644
index a399c319..00000000
--- a/miniprogram/packageAPI/pages/api/custom-message/custom-message.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* page/API/pages/custom-message/custom-message.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.js b/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.js
deleted file mode 100644
index aade5ce3..00000000
--- a/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.js
+++ /dev/null
@@ -1,62 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '获取用户信息',
- path: 'packageAPI/pages/api/get-user-info/get-user-info'
- }
- },
-
- data: {
- theme: 'light',
- hasUserInfo: false,
- canIUseGetUserProfile: false
- },
- getUserInfo(info) {
- console.log('getUserInfo')
- const userInfo = info.detail.userInfo
- this.setData({
- userInfo,
- hasUserInfo: true
- })
- },
- handleGetUserProfile(e) {
- console.log('getUserProfile')
- wx.getUserProfile({
- desc: '用于演示 wx.getUserProfile', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
- success: (res) => {
- console.log('wx.getUserProfile: ', res.userInfo)
- this.setData({
- userInfo: res.userInfo,
- hasUserInfo: true
- })
- }
- })
- },
- clear() {
- this.setData({
- hasUserInfo: false,
- userInfo: {}
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- if (wx.getUserProfile) {
- this.setData({
- canIUseGetUserProfile: true
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.json b/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.json
deleted file mode 100644
index c4f72f02..00000000
--- a/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "获取用户信息",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.wxml b/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.wxml
deleted file mode 100644
index 008c4eae..00000000
--- a/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.wxml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
- 用户信息
-
- 未获取
- 点击绿色按钮可获取用户头像及昵称
-
-
-
- {{userInfo.nickName}}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.wxss b/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.wxss
deleted file mode 100644
index 4506b375..00000000
--- a/miniprogram/packageAPI/pages/api/get-user-info/get-user-info.wxss
+++ /dev/null
@@ -1,13 +0,0 @@
-.page-body-info {
- padding-bottom: 0;
- height: 230px;
-}
-.userinfo-avatar {
- border-radius: 114px;
- width: 114px;
- height: 114px;
-}
-.userinfo-nickname {
- margin-top: 10px;
- font-size: 19px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/jump/jump.js b/miniprogram/packageAPI/pages/api/jump/jump.js
deleted file mode 100644
index 3da1fbde..00000000
--- a/miniprogram/packageAPI/pages/api/jump/jump.js
+++ /dev/null
@@ -1,74 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '跳转',
- path: 'packageAPI/pages/api/jump/jump'
- }
- },
-
- data: {
- theme: 'light',
- setting: {}
- },
- // 打开半屏小程序
- openhalfscreenminiprogram() {
- wx.openEmbeddedMiniProgram({
- appId: 'wxfdcee92a299bcaf1', // 腾讯公益
- extraData: {
- foo: 'bar'
- },
- // envVersion: 'develop',
- success(res) {
- // 打开成功
- }
- })
- },
- // 打开另一个小程序
- openanotherminiprogram() {
- wx.navigateToMiniProgram({
- appId: 'wxfdcee92a299bcaf1', // 腾讯公益
- // extraData: {
- // foo: 'bar'
- // },
- // envVersion: 'develop',
- success(res) {
- // 打开成功
- }
- })
- },
- // 退出当前小程序
- exitminiprogram() {
- wx.exitMiniProgram({
- success() {
- wx.showToast({
- title: '退出成功',
- icon: 'none',
- duration: 2000
- })
- },
- fail() {
- wx.showToast({
- title: '退出失败',
- icon: 'none',
- duration: 2000
- })
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/api/jump/jump.json b/miniprogram/packageAPI/pages/api/jump/jump.json
deleted file mode 100644
index 9197c29d..00000000
--- a/miniprogram/packageAPI/pages/api/jump/jump.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "跳转",
- "renderer": "webview"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/jump/jump.wxml b/miniprogram/packageAPI/pages/api/jump/jump.wxml
deleted file mode 100644
index ea65f72a..00000000
--- a/miniprogram/packageAPI/pages/api/jump/jump.wxml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/jump/jump.wxss b/miniprogram/packageAPI/pages/api/jump/jump.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/api/login/login.js b/miniprogram/packageAPI/pages/api/login/login.js
deleted file mode 100644
index 16c2b4a8..00000000
--- a/miniprogram/packageAPI/pages/api/login/login.js
+++ /dev/null
@@ -1,41 +0,0 @@
-const app = getApp()
-Page({
- onShareAppMessage() {
- return {
- title: '微信登录',
- path: 'packageAPI/pages/api/login/login'
- }
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- this.setData({
- hasLogin: app.globalData.hasLogin
- })
- },
- data: { theme: 'light' },
- login() {
- const that = this
- wx.login({
- success() {
- app.globalData.hasLogin = true
- that.setData({
- hasLogin: true
- })
- }
- })
- }
-})
diff --git a/miniprogram/packageAPI/pages/api/login/login.json b/miniprogram/packageAPI/pages/api/login/login.json
deleted file mode 100644
index 6f946e57..00000000
--- a/miniprogram/packageAPI/pages/api/login/login.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "微信登录",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageAPI/pages/api/login/login.wxml b/miniprogram/packageAPI/pages/api/login/login.wxml
deleted file mode 100644
index 732cdc46..00000000
--- a/miniprogram/packageAPI/pages/api/login/login.wxml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
- 已登录
- 每个微信号中仅需登录 1 次,后续每次进入页面即可根据微信 id 自动拉取用户信息
-
-
- 每个微信号中仅需登录一次
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/api/login/login.wxss b/miniprogram/packageAPI/pages/api/login/login.wxss
deleted file mode 100644
index bbdd3a7f..00000000
--- a/miniprogram/packageAPI/pages/api/login/login.wxss
+++ /dev/null
@@ -1,26 +0,0 @@
-/* @import '../../common.wxss'; */
-
-.page-section {
- margin-top: 100px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- width: 100%;
- padding: 0 25px;
- box-sizing: border-box;
-}
-.page-body-title {
- font-size: 30px;
- line-height: 100px;
-}
-.page-body-text {
- color: #bbb;
- font-size: 14px;
- line-height: 20px;
- margin: 0 0 50px 0;
- text-align: center;
-}
-.page-body-button {
- width: 100%;
-}
diff --git a/miniprogram/packageAPI/pages/api/request-payment/request-payment.js b/miniprogram/packageAPI/pages/api/request-payment/request-payment.js
deleted file mode 100644
index 5620a80d..00000000
--- a/miniprogram/packageAPI/pages/api/request-payment/request-payment.js
+++ /dev/null
@@ -1,85 +0,0 @@
-const app = getApp()
-
-Page({
- onShareAppMessage() {
- return {
- title: '发起支付',
- path: 'packageAPI/pages/api/request-payment/request-payment'
- }
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
-
- 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: {
- theme: 'light',
- 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) {
- self.setData({
- loading: false
- })
- console.error('支付失败:', err)
- }
- })
- },
- 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/packageAPI/pages/api/request-payment/request-payment.json b/miniprogram/packageAPI/pages/api/request-payment/request-payment.json
deleted file mode 100644
index 7a9e1b6f..00000000
--- a/miniprogram/packageAPI/pages/api/request-payment/request-payment.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "发起支付",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageAPI/pages/api/request-payment/request-payment.wxml b/miniprogram/packageAPI/pages/api/request-payment/request-payment.wxml
deleted file mode 100644
index 8dc8c6ef..00000000
--- a/miniprogram/packageAPI/pages/api/request-payment/request-payment.wxml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
- 支付金额
- 0.01
- 实际接口应用中可自定义金额
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/api/request-payment/request-payment.wxss b/miniprogram/packageAPI/pages/api/request-payment/request-payment.wxss
deleted file mode 100644
index bdfbd28b..00000000
--- a/miniprogram/packageAPI/pages/api/request-payment/request-payment.wxss
+++ /dev/null
@@ -1,26 +0,0 @@
-.page-section{
- width: auto;
- margin: 15px;
- padding: 62px 15px;
- background-color: var(--weui-BG-2);
- text-align: center;
- font-size: 14px;
-}
-.desc{
- color: var(--weui-FG-1);
-}
-.price{
- margin-top: 15px;
- margin-bottom: 13px;
- position: relative;
- display: inline-block;
- font-size: 39px;
- line-height: 1;
-}
-.price:before{
- content: "¥";
- position: absolute;
- font-size: 20px;
- top: 4px;
- left: -20px;
-}
diff --git a/miniprogram/packageAPI/pages/api/setting/setting.js b/miniprogram/packageAPI/pages/api/setting/setting.js
deleted file mode 100644
index fa17cefa..00000000
--- a/miniprogram/packageAPI/pages/api/setting/setting.js
+++ /dev/null
@@ -1,38 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '设置',
- path: 'packageAPI/pages/api/setting/setting'
- }
- },
-
- data: {
- theme: 'light',
- setting: {}
- },
-
- getSetting() {
- wx.getSetting({
- success: (res) => {
- console.log(res)
- this.setData({ setting: res.authSetting })
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/api/setting/setting.json b/miniprogram/packageAPI/pages/api/setting/setting.json
deleted file mode 100644
index a4ab2775..00000000
--- a/miniprogram/packageAPI/pages/api/setting/setting.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "设置",
- "renderer": "webview"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/setting/setting.wxml b/miniprogram/packageAPI/pages/api/setting/setting.wxml
deleted file mode 100644
index 275f764c..00000000
--- a/miniprogram/packageAPI/pages/api/setting/setting.wxml
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/api/setting/setting.wxss b/miniprogram/packageAPI/pages/api/setting/setting.wxss
deleted file mode 100644
index 93221219..00000000
--- a/miniprogram/packageAPI/pages/api/setting/setting.wxss
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-form {
- margin-top: 15px;
-}
-
-.weui-cell__bd {
- display: flex;
- justify-content: center;
- padding: 10px 0;
- min-height: 30px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/share-button/share-button.js b/miniprogram/packageAPI/pages/api/share-button/share-button.js
deleted file mode 100644
index 66b69160..00000000
--- a/miniprogram/packageAPI/pages/api/share-button/share-button.js
+++ /dev/null
@@ -1,33 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '转发按钮',
- path: 'packageAPI/pages/api/share-button/share-button'
- }
- },
- handleTapShareButton() {
- if (!((typeof wx.canIUse === 'function') && wx.canIUse('button.open-type.share'))) {
- wx.showModal({
- title: '当前版本不支持转发按钮',
- content: '请升级至最新版本微信客户端',
- showCancel: false
- })
- }
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/api/share-button/share-button.json b/miniprogram/packageAPI/pages/api/share-button/share-button.json
deleted file mode 100644
index d2f33322..00000000
--- a/miniprogram/packageAPI/pages/api/share-button/share-button.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "转发按钮",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageAPI/pages/api/share-button/share-button.wxml b/miniprogram/packageAPI/pages/api/share-button/share-button.wxml
deleted file mode 100644
index f89e176e..00000000
--- a/miniprogram/packageAPI/pages/api/share-button/share-button.wxml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
- 轻触下方图标即可转发
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/api/share-button/share-button.wxss b/miniprogram/packageAPI/pages/api/share-button/share-button.wxss
deleted file mode 100644
index 21842510..00000000
--- a/miniprogram/packageAPI/pages/api/share-button/share-button.wxss
+++ /dev/null
@@ -1,3 +0,0 @@
-.button-share {
- display: none;
-}
diff --git a/miniprogram/packageAPI/pages/api/share/share.js b/miniprogram/packageAPI/pages/api/share/share.js
deleted file mode 100644
index 6d50d1d6..00000000
--- a/miniprogram/packageAPI/pages/api/share/share.js
+++ /dev/null
@@ -1,31 +0,0 @@
-Page({
- data: {
- theme: 'light',
- sharedata: {
- theme: 'light',
- title: '自定义转发标题',
- desc: '自定义转发描述',
- path: 'packageAPI/pages/api/share/share'
- }
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
-
- onShareAppMessage() {
- return this.data.shareData
- }
-})
diff --git a/miniprogram/packageAPI/pages/api/share/share.json b/miniprogram/packageAPI/pages/api/share/share.json
deleted file mode 100644
index f22df9c6..00000000
--- a/miniprogram/packageAPI/pages/api/share/share.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "转发",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageAPI/pages/api/share/share.wxml b/miniprogram/packageAPI/pages/api/share/share.wxml
deleted file mode 100644
index 53f090c5..00000000
--- a/miniprogram/packageAPI/pages/api/share/share.wxml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
- 发送内容(以下字段可自由适配)
-
-
-
- 标题
-
-
-
-
-
-
-
- 描述
-
-
-
-
-
-
-
- 跳转页面
-
-
-
-
-
-
- 点击右上角菜单转发给好友
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/api/share/share.wxss b/miniprogram/packageAPI/pages/api/share/share.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/api/soter-authentication/soter-authentication.js b/miniprogram/packageAPI/pages/api/soter-authentication/soter-authentication.js
deleted file mode 100644
index 5ab8d8be..00000000
--- a/miniprogram/packageAPI/pages/api/soter-authentication/soter-authentication.js
+++ /dev/null
@@ -1,94 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '生物认证',
- path: 'packageAPI/pages/api/soter-authentication/soter-authentication'
- }
- },
-
- startAuth(e) {
- console.log(e)
- const AUTH_MODE = e.currentTarget.dataset.mode
- console.log(AUTH_MODE)
- const startSoterAuthentication = () => {
- wx.startSoterAuthentication({
- requestAuthModes: [AUTH_MODE],
- challenge: 'test',
- authContent: '小程序示例',
- success: () => {
- wx.showToast({
- title: '认证成功'
- })
- },
- fail: (err) => {
- console.error(err)
- wx.showModal({
- title: '失败',
- content: '认证失败',
- showCancel: false
- })
- }
- })
- }
-
- const checkIsEnrolled = () => {
- wx.checkIsSoterEnrolledInDevice({
- checkAuthMode: AUTH_MODE,
- success: (res) => {
- console.log(res)
- if (parseInt(res.isEnrolled, 10) <= 0) {
- wx.showModal({
- title: '错误',
- content: `您暂未录入${AUTH_MODE === 'facial' ? '人脸' : '指纹'}信息,请录入后重试`,
- showCancel: false
- })
- return
- }
- startSoterAuthentication()
- },
- fail: (err) => {
- console.error(err)
- }
- })
- }
-
- const notSupported = () => {
- wx.showModal({
- title: '错误',
- content: `您的设备不支持${AUTH_MODE === 'facial' ? '人脸' : '指纹'}识别`,
- showCancel: false
- })
- }
-
- wx.checkIsSupportSoterAuthentication({
- success: (res) => {
- console.log(res)
- if (!res || res.supportMode.length === 0 || res.supportMode.indexOf(AUTH_MODE) < 0) {
- notSupported()
- return
- }
- checkIsEnrolled()
- },
- fail: (err) => {
- console.error(err)
- notSupported()
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/api/soter-authentication/soter-authentication.json b/miniprogram/packageAPI/pages/api/soter-authentication/soter-authentication.json
deleted file mode 100644
index d6498cc2..00000000
--- a/miniprogram/packageAPI/pages/api/soter-authentication/soter-authentication.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "生物认证",
- "renderer": "webview"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/soter-authentication/soter-authentication.wxml b/miniprogram/packageAPI/pages/api/soter-authentication/soter-authentication.wxml
deleted file mode 100644
index 96e4e92e..00000000
--- a/miniprogram/packageAPI/pages/api/soter-authentication/soter-authentication.wxml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/api/soter-authentication/soter-authentication.wxss b/miniprogram/packageAPI/pages/api/soter-authentication/soter-authentication.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.js b/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.js
deleted file mode 100644
index 2e10e175..00000000
--- a/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.js
+++ /dev/null
@@ -1,122 +0,0 @@
-Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- theme: 'light',
-
- },
-
- // 请求订阅
- 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: {
- theme: 'light',
- 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() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- return {
- title: '订阅消息',
- path: 'packageAPI/pages/api/subscribe-message/subscribe-message'
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.json b/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.json
deleted file mode 100644
index 8835af06..00000000
--- a/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "usingComponents": {}
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.wxml b/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.wxml
deleted file mode 100644
index f873cdba..00000000
--- a/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.wxml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
- 点击提交,调用示例订阅消息
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.wxss b/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.wxss
deleted file mode 100644
index 075fbd80..00000000
--- a/miniprogram/packageAPI/pages/api/subscribe-message/subscribe-message.wxss
+++ /dev/null
@@ -1,24 +0,0 @@
-.page-section {
- margin-top: 100px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- width: 100%;
- padding: 0 25px;
- box-sizing: border-box;
-}
-.page-body-title {
- font-size: 30px;
- line-height: 100px;
-}
-.page-body-text {
- color: var(--weui-FG-1);
- font-size: 14px;
- line-height: 20px;
- margin: 0 0 50px 0;
- text-align: center;
-}
-.page-body-button {
- width: 100%;
-}
diff --git a/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.js b/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.js
deleted file mode 100644
index 632d3f4c..00000000
--- a/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.js
+++ /dev/null
@@ -1,370 +0,0 @@
-import arBehavior from '../behavior/behavior-ar'
-import threeBehavior from '../behavior/behavior-three'
-
-// VK 投影矩阵参数定义
-const NEAR = 0.01
-const FAR = 1000
-
-Component({
- behaviors: [arBehavior, threeBehavior],
- data: {
- theme: 'light',
- widthScale: 1, // canvas宽度缩放值
- heightScale: 0.6, // canvas高度缩放值
- markerImgList: [], // 使用的 marker 列表
- chooseImgList: [], // 使用的 图片 列表
- hintBoxList: [], // 显示提示盒子列表
- },
- markerIndex: 0, // 使用的 marker 索引
- hintInfo: undefined, // 提示框信息
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
-
- methods: {
- // 对应案例的初始化逻辑,由统一的 behavior 触发
- init() {
- // 初始化 Three.js,用于模型相关的渲染
- this.initTHREE()
-
- // 初始化 GL,基于 Three.js 的 Context,用于相机YUV渲染
- this.initYUV()
-
- // 初始化VK
- // start完毕后,进行更新渲染循环
- this.initVK()
-
- this.markerIndex = 0
-
- // 添加 识别包围盒子
- this.add3DBox()
- },
- initVK() {
- // VKSession 配置
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 3
- },
- marker: true,
- },
- version: 'v1',
- gl: this.gl
- })
-
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- // VKSession EVENT resize
- session.on('resize', () => {
- this.calcCanvasSize()
- })
-
- // VKSession EVENT addAnchors
- session.on('addAnchors', anchors => {
- // console.log("addAnchor", anchors);
-
- this.left.visible = true
- this.right.visible = true
- this.top.visible = true
- this.bottom.visible = true
- })
-
- // VKSession EVENT updateAnchors
- session.on('updateAnchors', anchors => {
- // marker 模式下,目前仅有一个识别目标,可以直接取
- const anchor = anchors[0]
- const markerId = anchor.id
- const size = anchor.size
- this.hintInfo = {
- markerId,
- size
- }
- })
-
- // VKSession removeAnchors
- // 识别目标丢失时,会触发一次
- session.on('removeAnchors', anchors => {
- this.left.visible = false
- this.right.visible = false
- this.top.visible = false
- this.bottom.visible = false
-
- if (this.data.hintBoxList && this.data.hintBoxList.length > 0) {
- // 清理信息
- this.hintInfo = undefined
- // 存在列表的情况,去除remove
- this.setData({
- hintBoxList: []
- })
- }
- })
-
- console.log('ready to initloop')
- // start 初始化完毕后,进行更新渲染循环
- this.initLoop()
- })
- },
- loop() {
- // console.log('loop')
-
- // 获取 VKFrame
- const frame = this.session.getVKFrame(this.canvas.width, this.canvas.height)
-
- // 成功获取 VKFrame 才进行
- if (!frame) { return }
-
- // 更新相机 YUV 数据
- this.renderYUV(frame)
-
- // 获取 VKCamera
- const VKCamera = frame.camera
-
- // 相机
- if (VKCamera) {
- // 接管 ThreeJs 相机矩阵更新,Marker模式下,主要由视图和投影矩阵改变渲染效果
- this.camera.matrixAutoUpdate = false
-
- // 视图矩阵
- this.camera.matrixWorldInverse.fromArray(VKCamera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- // 投影矩阵
- const projectionMatrix = VKCamera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- // 绘制而为提示框的逻辑
- if (this.hintInfo) {
- // 存在提示信息,则更新
- const THREE = this.THREE
-
- // 原点偏移矩阵,VK情况下,marker 点对应就是 0 0 0,世界矩阵可以认为是一个单位矩阵
- // marker 右侧点可以理解是 0.5 0 0
- const center = new THREE.Vector3()
- const right = new THREE.Vector3(0.5, 0, 0)
-
- // 获取设备空间坐标
- const devicePos = center.clone().project(this.camera)
-
- // 转换坐标系,从 (-1, 1) 转到 (0, 100),同时移到左上角 0 0,右下角 1 1
- const screenPos = new THREE.Vector3(0, 0, 0)
- screenPos.x = devicePos.x * 50 + 50
- screenPos.y = 50 - devicePos.y * 50
-
- // 获取右侧点信息
- const deviceRightPos = right.clone().project(this.camera)
- const screenRightPos = new THREE.Vector3(0, 0, 0)
- screenRightPos.x = deviceRightPos.x * 50 + 50
-
- const markerHalfWidth = screenRightPos.x - screenPos.x
-
- this.setData({
- hintBoxList: [
- {
- markerId: this.hintInfo.markerId,
- left: screenPos.x - markerHalfWidth,
- top: screenPos.y - markerHalfWidth,
- width: markerHalfWidth * this.data.domWidth * 2 / 100,
- height: markerHalfWidth * this.data.domWidth * 2 / 100,
- }
- ]
- })
- }
-
- this.renderer.autoClearColor = false
- this.renderer.state.setCullFace(this.THREE.CullFaceBack)
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- add3DBox() {
- // 添加marker需要的 三维包围框
-
- const THREE = this.THREE
- const scene = this.scene
-
- const material = new THREE.MeshPhysicalMaterial({
- metalness: 0.0,
- roughness: 0.1,
- color: 0x64f573,
- })
- const geometry = new THREE.BoxGeometry(1, 1, 1)
-
- const borderSize = 0.1
-
- const left = new THREE.Mesh(geometry, material)
- left.position.set(-0.5, 0, 0)
- left.rotation.set(-Math.PI / 2, 0, 0)
- left.scale.set(borderSize, 1.1, borderSize)
- scene.add(left)
- left.visible = false
- this.left = left
-
- const right = new THREE.Mesh(geometry, material)
- right.position.set(0.5, 0, 0)
- right.rotation.set(-Math.PI / 2, 0, 0)
- right.scale.set(borderSize, 1.1, borderSize)
- scene.add(right)
- right.visible = false
- this.right = right
-
- const top = new THREE.Mesh(geometry, material)
- top.position.set(0, 0, 0.5)
- top.rotation.set(0, 0, 0)
- top.scale.set(1.1, borderSize, borderSize)
- scene.add(top)
- top.visible = false
- this.top = top
-
- const bottom = new THREE.Mesh(geometry, material)
- bottom.position.set(0, 0, -0.5)
- bottom.rotation.set(0, 0, 0)
- bottom.scale.set(1.1, borderSize, borderSize)
- scene.add(bottom)
- bottom.visible = false
- this.bottom = bottom
-
- console.log('add3DBox is finish')
- },
- chooseMedia() {
- // marker图片上传逻辑
- wx.chooseMedia({
- count: 9,
- mediaType: ['image'],
- sizeType: ['original'],
- success: res => {
- console.log('chooseMedia res', res)
-
- const chooseImgListRes = []
- for (let i = 0; i < res.tempFiles.length; i++) {
- const imgUrl = res.tempFiles[i].tempFilePath
- chooseImgListRes.push(imgUrl)
- }
-
- console.log('set chooseImgList', chooseImgListRes)
- this.setData({
- chooseImgList: chooseImgListRes,
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- async addMarker() {
- console.log('addMarker')
- const fs = wx.getFileSystemManager()
-
- const markerImgListRes = this.data.markerImgList.concat([])
- const preMarkerIndex = this.markerIndex
-
- console.log('pre markerImgList', preMarkerIndex, markerImgListRes)
-
- // 检查与添加 marker 函数
- const chooseImgCount = this.data.chooseImgList.length
- let handledCount = 0
- const checkMarkerAdded = () => {
- if (handledCount === chooseImgCount) {
- this.markerIndex = markerImgListRes.length
-
- console.log('markerImgList set', markerImgListRes, this.markerIndex)
- this.setData({
- chooseImgList: [],
- markerImgList: markerImgListRes
- })
- }
- }
-
- // 准备进行choose的图片保存到fs
- for (let i = 0; i < chooseImgCount; i++) {
- const chooseImgUrl = this.data.chooseImgList[i]
- const fileEnd = chooseImgUrl.split('.').slice(-1)[0]
- const fileIndex = preMarkerIndex + i
- // 算法侧目前只认 map png jpg jpeg 后缀文件
- const filePath = `${wx.env.USER_DATA_PATH}/marker-ar-${fileIndex}.${fileEnd}`
-
- const saveAndAddMarker = () => {
- console.log('saveFileSync start', filePath, chooseImgUrl)
- // 存入文件系统,并添加到marker
- fs.saveFile({
- filePath,
- tempFilePath: chooseImgUrl,
- success: () => {
- console.log('[addMarker] --> ', filePath)
- const markerId = this.session.addMarker(filePath)
- markerImgListRes.push({
- markerId,
- filePath
- })
- handledCount++
- checkMarkerAdded()
- },
- fail: res => {
- console.error(res)
- console.log('文件保存失败', filePath)
- handledCount++
- checkMarkerAdded()
- }
- })
- }
-
- console.log('uploadFile Path', filePath)
- // 确定文件,存在即删除
- fs.stat({
- path: filePath,
- success: (res) => {
- if (res.stats.isFile()) {
- fs.unlinkSync(filePath)
- console.log('fs unlinkSync', filePath)
- }
- saveAndAddMarker()
- },
- fail: (res) => {
- console.error(res)
- console.log('fs中不存在,直接写入', filePath)
-
- saveAndAddMarker()
- }
- })
- }
- },
- removeMarker() {
- if (this.data.markerImgList) {
- for (let i = 0; i < this.data.markerImgList.length; i++) {
- const markerImg = this.data.markerImgList[i]
- this.session.removeMarker(markerImg.markerId)
- }
- this.markerIndex = 0
- this.setData({
- markerImgList: [],
- })
- }
- },
- getAllMarker() {
- console.log(this.session.getAllMarker())
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.json b/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.json
deleted file mode 100644
index 9c3851e8..00000000
--- a/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "2DMarkerAR"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.wxml b/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.wxml
deleted file mode 100644
index 0476197e..00000000
--- a/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.wxml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
- 识别id: {{hintBox.markerId}}
-
-
-
- 提示:选择用于识别的图片, 点击添加为marker, 然后手机摄像头对准下方所选图片
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 上传图片后点击左侧按钮
将图片添加到 Marker 识别列表
-
-
-
-
-
-
-
-
-
-
-
-
- 点击左侧按钮上传图片(允许上传1-9张)
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.wxss b/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.wxss
deleted file mode 100644
index 24b0c41b..00000000
--- a/miniprogram/packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.wxss
+++ /dev/null
@@ -1,144 +0,0 @@
-.canvas-wrap {
- position: relative;
- width: 100%;
- background-color: #000;
-}
-
-.canvas-wrap #canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.hint-box {
- position: absolute;
- left: 0%;
- top: 0%;
- width: 0;
- height: 0;
-}
-.hint-id {
- position: absolute;
- left: -6rpx;
- right: -6rpx;
- bottom: 100%;
- color: #fff;
- font-size: 20rpx;
- line-height: 40rpx;
- text-align: center;
- text-overflow: ellipsis;
- background-color: #07c160;
- border-radius: 8rpx;
-
-}
-
-.wrap-fix {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.hint-words {
- position: absolute;
- left: 20rpx;
- top: 20rpx;
- right: 20rpx;
- padding: 10rpx 20rpx;
- line-height: 40rpx;
- text-align: center;
- border-radius: 6rpx;
- background-color: rgba(0, 0, 0, .3);
- font-size: 26rpx;
- color: #fff;
-}
-
-.wrap-left {
- position: absolute;
- left: 0;
- top: 0;
- bottom: 30rpx;
- width: 160rpx;
-}
-
-button.btn-left {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- padding: 12rpx;
- font-size: 30rpx;
- line-height: 1.2;
-}
-
-.wrap-right {
- position: absolute;
- left: 180rpx;
- right: 20rpx;
- top: 0;
- bottom: 30rpx;
- display: flex;
-}
-
-.img-list {
- display: flex;
- overflow: auto;
-}
-
-.img-list image {
- height: 100%;
-}
-
-.hint-empty {
- position: relative;
- flex: 1;
- border: 4rpx dotted rgba(0, 0, 0, .3);
- border-radius: 6rpx;
-}
-
-.hint-empty p {
- position: absolute;
- left: 20rpx;
- right: 20rpx;
- top: 50%;
- transform: translate(0, -50%);
- text-align: center;
- font-size: 26rpx;
- color: rgba(0, 0, 0, .3);
-}
-
-.wrap-choose {
- position: absolute;
- left: 20rpx;
- right: 20rpx;
- bottom: 0;
- height: 15%;
-}
-
-.wrap-marker {
- position: absolute;
- left: 20rpx;
- right: 20rpx;
- bottom: 15%;
- height: 15%;
-}
-
-.wrap-option {
- position: absolute;
- left: 20rpx;
- right: 0;
- bottom: 30%;
- height: 10%;
- display: flex;
-}
-
-.wrap-option button {
- flex: 1;
- margin: 20rpx 20rpx 20rpx 0;
- font-size: 30rpx;
- line-height: 1.2;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.js
deleted file mode 100644
index e38bbf35..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.js
+++ /dev/null
@@ -1,527 +0,0 @@
-import arBehavior from '../behavior/behavior-ar'
-import xrFrameBehavior from '../behavior/behavior-xrframe'
-
-// protobuf 相关逻辑
-const protobuf = require('./protobuf/protobuf.js')
-const json = require('./proto/arModelProto.js')
-
-const root = protobuf.Root.fromJSON(json)
-const message = root.lookupType('ARModelData')
-
-let gltfIndex = 0
-
-// VK 投影矩阵参数定义
-const NEAR = 0.01
-const FAR = 1000
-
-// 针对 vk 生成模型的矫正
-const modelScale = 0.16
-
-Component({
- behaviors: [arBehavior, xrFrameBehavior],
- data: {
- theme: 'light',
- widthScale: 1, // canvas宽度缩放值
- heightScale: 0.6, // canvas高度缩放值
- hintBoxList: [], // 显示提示盒子列表
- usingMarkerId: false, // 使用中的markerId
- haveMap: false, // 存在map
- haveGLTF: false, // 存在gltf
- },
- markerIndex: 0, // 使用的 marker 索引
- hintInfo: undefined, // 提示框信息
- selectCosid: 0, // 选中的cosid
- selectResp: undefined, // 选中的回调信息
- parsedMapUrl: undefined, // 使用中的mapUrl
- parsedGlbUrl: undefined, // 使用中的glbUrl
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- // 对应案例的初始化逻辑,由统一的 behavior 触发
- init() {
- this.markerIndex = 0
-
- // 初始化VK
- // start完毕后,进行更新渲染循环
- this.initVK()
- },
- initVK() {
- // VKSession 配置
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 3
- },
- marker: true,
- },
- version: 'v1',
- gl: this.gl
- })
-
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- // VKSession EVENT resize
- session.on('resize', () => {
- this.calcCanvasSize()
- })
-
- // VKSession EVENT addAnchors
- session.on('addAnchors', anchors => {
- console.log('addAnchor', anchors)
- })
-
- // VKSession EVENT updateAnchors
- session.on('updateAnchors', anchors => {
- // marker 模式下,目前仅有一个识别目标,可以直接取
- const anchor = anchors[0]
- const markerId = anchor.id
- const size = anchor.size
- this.hintInfo = {
- markerId,
- size
- }
-
- console.log('update a')
- if (!this.modelShow) {
- if (this.modelTrs) {
- this.modelTrs.scale.x = modelScale
- this.modelTrs.scale.y = modelScale
- this.modelTrs.scale.z = modelScale
- }
-
- this.xAxis.visible = true
- this.yAxis.visible = true
- this.zAxis.visible = true
-
- this.modelShow = true
- }
- })
-
- // VKSession removeAnchors
- // 识别目标丢失时,会触发一次
- session.on('removeAnchors', anchors => {
- console.log('remove a')
-
- if (this.modelShow) {
- if (this.modelTrs) {
- this.modelTrs.scale.x = 0
- this.modelTrs.scale.y = 0
- this.modelTrs.scale.z = 0
- }
-
- this.xAxis.visible = false
- this.yAxis.visible = false
- this.zAxis.visible = false
-
- this.modelShow = false
- }
- })
-
- console.log('ready to initloop')
- // start 初始化完毕后,进行更新渲染循环
- this.initLoop()
- })
- },
- // 针对 xr-frame 的初始化逻辑
- async initXRFrame() {
- const xrFrameSystem = wx.getXrFrameSystem()
- const scene = this.xrScene
- const { rootShadow } = scene
-
- // 初始化YUV相机配置
- this.initXRYUVCamera()
-
- // 添加marker 提示用的 三个轴
- const geometryCube = scene.assets.getAsset('geometry', 'cube')
- const effectCube = scene.assets.getAsset('effect', 'standard')
- const axisScale = 1.0
- const lineScale = 0.05
-
- const elX = scene.createElement(xrFrameSystem.XRNode, {
- position: `${axisScale / 2} 0 0`,
- scale: `${axisScale} ${lineScale} ${lineScale}`,
- })
- const elXTrs = elX.getComponent(xrFrameSystem.Transform)
- const matX = scene.createMaterial(effectCube)
- matX.setVector('u_baseColorFactor', xrFrameSystem.Vector4.createFromNumber(1, 0.2, 0.2, 1.0))
- const meshX = elX.addComponent(xrFrameSystem.Mesh, {
- geometry: geometryCube,
- material: matX,
- })
- this.xAxis = elXTrs
- rootShadow.addChild(elX)
- this.xAxis.visible = false
-
- const elY = scene.createElement(xrFrameSystem.XRNode, {
- position: `0 ${axisScale / 2} 0`,
- scale: `${lineScale} ${axisScale} ${lineScale}`,
- })
- const elYTrs = elY.getComponent(xrFrameSystem.Transform)
- const matY = scene.createMaterial(effectCube)
- matY.setVector('u_baseColorFactor', xrFrameSystem.Vector4.createFromNumber(0.2, 1, 0.2, 1.0))
- const meshY = elY.addComponent(xrFrameSystem.Mesh, {
- geometry: geometryCube,
- material: matY,
- })
- this.yAxis = elYTrs
- rootShadow.addChild(elY)
- this.yAxis.visible = false
-
- const elZ = scene.createElement(xrFrameSystem.XRNode, {
- position: `0 0 ${axisScale / 2}`,
- scale: `${lineScale} ${lineScale} ${axisScale}`,
- })
- const elZTrs = elZ.getComponent(xrFrameSystem.Transform)
- const matZ = scene.createMaterial(effectCube)
- matZ.setVector('u_baseColorFactor', xrFrameSystem.Vector4.createFromNumber(0.2, 0.2, 1, 1.0))
- const meshZ = elZ.addComponent(xrFrameSystem.Mesh, {
- geometry: geometryCube,
- material: matZ,
- })
- this.zAxis = elZTrs
- rootShadow.addChild(elZ)
- this.zAxis.visible = false
- console.log('add3DAxis is finish')
- },
- loop() {
- // 获取 VKFrame
- const frame = this.session.getVKFrame(this.data.domWidth, this.data.domHeight)
-
- // 成功获取 VKFrame 才进行
- if (!frame) { return }
-
- // 更新相机 YUV 数据
- this.updataXRYUV(frame)
-
- // 获取 VKCamera
- const VKCamera = frame.camera
-
- // 更新 xrFrame 相机矩阵
- this.updataXRCameraMatrix(VKCamera, NEAR, FAR)
- },
- async parseAddMarker() {
- // 目前未选中cosid 跳过
- if (!this.selectCosid) {
- console.log('目前未选中cosid,请选中后重试')
- return
- }
- // 存在marker的情况下,无法继续添加marker
- if (this.data.usingMarkerId) {
- console.log('已添加 marker,请删除后重试')
- return
- }
- if (this.parseAddMarkerLoading) {
- console.log('加载中,请稍后重试')
- return
- }
-
- const resp = this.selectResp
- console.log('开始添加 marker')
- console.log('获取的模型的cosID为', this.selectCosid)
- console.log(this.selectResp)
- const filePath = wx.env.USER_DATA_PATH + '/temp'
- console.log('请求地址')
- console.log(resp.result.respBody.url)
-
- // 简单的加载锁
- this.parseAddMarkerLoading = true
- // 开始下载文件
- wx.downloadFile({
- filePath,
- url: resp.result.respBody.url,
- success: (res) => {
- console.log('下载回调', res)
- const fs = wx.getFileSystemManager()
- fs.readFile({
- filePath: res.filePath,
- position: 0,
- success: async (res) => {
- console.log('读文件回调,结果返回为', res)
- wx.hideLoading()
-
- // 开始解析具体信息 protobuf
- try {
- console.log('开始解析回调')
- var data = message.decode(res.data)
- console.log('反序列化完成')
- console.log(data)
- } catch (e) {
- wx.hideLoading()
- console.log('模型数据解析有误')
- console.log(e)
- if (e instanceof protobuf.util.ProtocolError) {
- // missing required field
- console.log('missing required field')
- } else {
- // wire format is invalid
- console.log('wire format is invalid')
- }
- throw e
- }
-
- let mapSuccess = true
- let gltfSuccess = true
-
- // map文件
- if (data.meshModel && data.meshModel.byteLength !== 0) {
- // map文件成功
- this.setData({
- haveMap: true,
- })
-
- // 解析完毕,进行 buffer 具体处理
- // map文件
- const byteOffset = data.meshModel.byteOffset
- const byteLength = data.meshModel.byteLength
- const mapContent = data.meshModel.buffer.slice(byteOffset, byteOffset + byteLength)
- console.log('byteOffset:', byteOffset)
- console.log('byteLength:', byteLength)
-
- // 写入文件后的地址
- const mapUrl = this.saveLocalFile(mapContent, 'model.map')
- console.log('map文件的本地路径', mapUrl)
- this.parsedMapUrl = mapUrl
-
- // 添加marker
- const markerId = this.session.addMarker(mapUrl)
- console.log('add Marker', markerId, mapUrl)
- this.setData({
- usingMarkerId: markerId
- })
- } else {
- mapSuccess = false
- }
-
- // glb文件
- if (data.meshBlob && data.meshBlob.byteLength !== 0) {
- // 简单过滤下无模型情况
- const glbByteOffset = data.meshBlob.byteOffset
- const glbByteLength = data.meshBlob.byteLength
- const glbContent = data.meshBlob.buffer.slice(glbByteOffset, glbByteOffset + glbByteLength)
- console.log('glbContent', glbContent)
- const glbUrl = this.saveLocalFile(glbContent, 'result.glb')
- console.log('glb文件的本地路径', glbUrl)
- this.parsedGlbUrl = glbUrl
-
- // @optional
- // 后续为添加渲染产物模型的逻辑
- // xrFrame 加载模型相关
-
- // 加载生成模型
- const xrFrameSystem = wx.getXrFrameSystem()
- const scene = this.xrScene
-
- // gltf索引更新
- gltfIndex++
-
- const resultModel = await scene.assets.loadAsset({
- type: 'gltf',
- assetId: `gltf-result-${gltfIndex}`,
- src: `${wx.env.USER_DATA_PATH}/result.glb`,
- })
- console.log('resultModel', resultModel.value)
- const el = scene.createElement(xrFrameSystem.XRGLTF, {
- model: `gltf-result-${gltfIndex}`,
- position: `0 -${modelScale} -${modelScale}`,
- rotation: '90 0 0',
- scale: '0 0 0', // 默认先不显示
- })
- this.model = el
- this.modelTrs = el.getComponent(xrFrameSystem.Transform)
- this.modelShow = false
- this.xrScene.rootShadow.addChild(el)
-
- // Three 场景相关
- // const THREE = this.THREE;
- // // 控制容器节点
- // this.modelWrap = new THREE.Object3D();
- // this.scene.add( this.modelWrap );
-
- // // 加载模模型
- // const loader = this.loader = new THREE.GLTFLoader()
- // loader.parse( glbContent, './', ( gltf ) =>{
- // console.log('gltf loaded', gltf.scene);
-
- // // 设置模型索引以及缩放比
- // this.model = gltf.scene;
- // this.model.position.set(0, 0, 0);
- // // 默认缩放设置到0.1
- // this.model.scale.set(0.1, 0.1, 0.1);
- // this.model.visible = false;
-
- // console.log('gltf set', this.model);
-
- // // 模型加载到场上
- // this.modelWrap.add(this.model);
- // });
- } else {
- gltfSuccess = false
- }
-
- // 更新产物状态
- this.setData({
- haveMap: mapSuccess,
- haveGLTF: gltfSuccess
- })
-
- if (!mapSuccess || !gltfSuccess) {
- // 文件生成失败提示
- const mapWord = !mapSuccess ? 'map文件' : ''
- const gltfWord = !gltfSuccess ? 'glTF文件' : ''
-
- wx.showToast({
- title: `${mapWord} ${gltfWord} 生成失败`,
- icon: 'none',
- duration: 2000
- })
- }
-
- this.parseAddMarkerLoading = false
- },
- fail(res) {
- wx.hideLoading()
- wx.showToast({
- title: res.errMsg,
- icon: 'none',
- duration: 2000
- })
-
- this.parseAddMarkerLoading = false
- }
- })
- },
- fail(res) {
- wx.hideLoading()
- wx.showToast({
- title: res.errMsg,
- icon: 'none',
- duration: 2000
- })
- console.error(res)
- this.parseAddMarkerLoading = false
- }
- })
- },
- saveLocalFile(bufferContent, name) {
- const url = `${wx.env.USER_DATA_PATH}/${name}`
-
- const fs = wx.getFileSystemManager()
- try {
- const res = fs.writeFileSync(
- url,
- bufferContent,
- 'utf8'
- )
- console.log(res)
- } catch (e) {
- console.error(e)
- }
-
- return url
- },
- removeMarker() {
- // 清理所有 marker
- this.session.removeMarker(this.data.usingMarkerId)
- this.setData({
- usingMarkerId: null
- })
- // 释放xrframe资源
- if (this.model) {
- const scene = this.xrScene
- scene.assets.releaseAsset('gltf', `gltf-result-${gltfIndex}`)
- scene.rootShadow.removeChild(this.model)
- this.model = undefined
- }
- },
- getAllMarker() {
- console.log(this.session.getAllMarker())
- },
- changeSelect(e) {
- console.log('触发选择更改')
- console.log(e.detail)
-
- this.selectCosid = e.detail.cosid
- this.selectResp = e.detail.modelResp
- },
- saveMap() {
- if (!this.parsedMapUrl) {
- console.log('不存在使用中的map地址')
- return
- }
- wx.shareFileMessage({
- filePath: this.parsedMapUrl,
- })
- },
- saveGlTF() {
- if (!this.parsedGlbUrl) {
- console.log('不存在使用中的glb地址')
- return
- }
-
- wx.shareFileMessage({
- filePath: this.parsedGlbUrl,
- })
- },
- useDefaultMarker() {
- // 简单的加载锁
- if (this.parseAddMarkerLoading) {
- console.log('加载中,请稍后重试')
- return
- }
- this.parseAddMarkerLoading = true
-
- // 开始下载文件
- const filePath = wx.env.USER_DATA_PATH + '/default.map'
- wx.downloadFile({
- filePath,
- url: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/default.map',
- success: (res) => {
- console.log('下载回调', res)
- // 添加marker
- const markerId = this.session.addMarker(res.filePath)
- console.log('add Default Marker', markerId)
- this.modelShow = false
- this.setData({
- usingMarkerId: markerId
- })
-
- this.parseAddMarkerLoading = false
- },
- fail(res) {
- wx.hideLoading()
- wx.showToast({
- title: res.errMsg,
- icon: 'none',
- duration: 2000
- })
- console.error(res)
- this.parseAddMarkerLoading = false
- }
- })
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.json b/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.json
deleted file mode 100644
index f7c0fc09..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "usingComponents": {
- "ar-model-component": "./Components/arModelComponent",
- "xr-frame-canvas": "../components/xr-frame/index"
- },
- "enablePullDownRefresh": true,
- "renderer": "webview",
-"navigationBarTitleText": "3D Marker"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.wxml b/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.wxml
deleted file mode 100644
index d52ec3cb..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.wxml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
- 识别id: {{hintBox.markerId}}
-
-
-
- 提示:点击 `添加按钮`,提交绕目标一圈的视频;点选列表中已完成的模型;点击 `解析添加marker` 进行实际文件解析;将手机对准识别目标进行marker识别;解析后,可下载marker识别用产物map、渲染用产物 glTF。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.wxss b/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.wxss
deleted file mode 100644
index 9329a78c..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.wxss
+++ /dev/null
@@ -1,83 +0,0 @@
-.canvas-wrap {
- position: relative;
- width: 100%;
- background-color: #000;
-}
-
-.canvas-wrap canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.hint-box {
- position: absolute;
- left: 0%;
- top: 0%;
- width: 0;
- height: 0;
-}
-.hint-id {
- position: absolute;
- left: -6rpx;
- right: -6rpx;
- bottom: 100%;
- color: #fff;
- font-size: 20rpx;
- line-height: 40rpx;
- text-align: center;
- text-overflow: ellipsis;
- background-color: #07c160;
- border-radius: 8rpx;
-}
-
-
-.wrap-fix {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.hint-words {
- position: absolute;
- left: 20rpx;
- top: 20rpx;
- right: 20rpx;
- padding: 10rpx 20rpx;
- line-height: 40rpx;
- text-align: center;
- border-radius: 6rpx;
- background-color: rgba(0, 0, 0, .3);
- font-size: 26rpx;
- color: #fff;
-}
-
-.wrap-option {
- margin-left: 20rpx;
- height: 160rpx;
- display: flex;
-}
-
-.wrap-option.small {
- height: 100rpx;
-}
-
-.wrap-option.small button {
- margin: 20rpx 20rpx 0rpx 0;
-}
-
-.wrap-option button {
- flex: 1;
- margin: 20rpx 20rpx 20rpx 0;
- padding: 4rpx;
- font-size: 28rpx;
- line-height: 1.2;
-}
-
-.model-wrap {
- position: relative;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.js
deleted file mode 100644
index 25e4e29d..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.js
+++ /dev/null
@@ -1,476 +0,0 @@
-Component({
- behaviors: ['wx://component-export'],
- export() {
- return { getARModelList: this.getARModelList.bind(this) }
- },
- data: {
- chooseMapFile: null,
- envId: 'test-f0b102',
- modelName: 'arDemo',
- // 模型数据
- // @ modelStatus 模型状态
- // @ cosid
- // @ uploadTime 上传时间
- // @ errMsg 错误信息
- models: [],
- },
- modelRespMap: {},
- lifetimes: {
- ready() {
- if (!wx.cloud) {
- console.error('请使用 2.2.3 或以上的基础库以使用云能力')
- } else {
- wx.cloud.init({
- traceUser: true,
- })
- console.log('初始化云函数成功')
- }
-
- // 缓存resp map
- this.modelRespMap = {}
-
- const keyNumber = (new Date()).getTime() * 10 + Math.floor(Math.random() * 10)
- this.setData({
- modelName: 'arDemo' + keyNumber
- })
-
- console.log('当前上传模型名称为 ' + 'arDemo' + keyNumber)
-
- // 获取已有数据
- this.getARModelList()
- }
- },
-
- methods: {
- // 上传视频逻辑
- uploadARModel() {
- const callback = this.generateARModel.bind(this)
- const cloudUpload = this.cloudUploadARModel.bind(this)
- const timeNow = Date.now() / 1000 | 0
- const modelInfos = wx.getStorageSync('modelsInfo')
- console.log('modelInfos的值为:')
- console.log(modelInfos)
- if (modelInfos && modelInfos.length != 0) {
- if (timeNow - modelInfos[0].timeStamp < 100) {
- wx.showToast({
- title: '每15分钟允许上传一次视频',
- icon: 'none',
- duration: 2000
- })
- return
- }
- }
- // 上传视频
- wx.chooseMedia({
- count: 1,
- mediaType: ['video'],
- sourceType: ['camera', 'album'],
- sizeType: ['original'], // 关闭压缩
- maxDuration: 60,
- camera: 'back',
- success: (res) => {
- console.log('录制成功,结果为')
- console.log(res)
- const tempFileInfo = res.tempFiles[0]
- // 保证视频时长在 10-30秒 之间
- if (tempFileInfo.duration >= 10 && tempFileInfo.duration <= 30) {
- const rate = tempFileInfo.width / tempFileInfo.height
-
- let min = tempFileInfo.width
- let max = tempFileInfo.height
- if (rate > 1) {
- min = tempFileInfo.height
- max = tempFileInfo.width
- }
- // 保证长边在 720 以上
- if (max > 720) {
- // 不接受比例在 3:1 以上的视频
- if (rate < 1 / 3 || rate > 3) {
- wx.showModal({
- content: '长宽比尽量为16:9或4:3,不接受比例大于3:1的视频',
- confirmText: '继续上传',
- cancelText: '取消上传',
- success: (button) => {
- if (button.confirm) {
- cloudUpload(res, callback)
- } else if (button.cancel) {
- }
- }
- })
- } else {
- cloudUpload(res, callback)
- }
- } else {
- wx.showModal({
- content: '建议长边在720以上',
- confirmText: '继续上传',
- cancelText: '取消上传',
- success: (button) => {
- if (button.confirm) {
- cloudUpload(res, callback)
- } else if (button.cancel) {
- }
- }
- })
- }
- } else {
- wx.showToast({
- title: '请录制10~30秒内的视频',
- icon: 'none',
- duration: 2000
- })
- }
- }
- })
- },
- // 生成具体模型
- generateARModel(url) {
- console.log('当前地址为:', url)
- wx.showLoading({
- title: '生成模型中……',
- })
-
- const reqData = {
- type: 'GenerateARModel',
- name: this.data.modelName,
- url,
- algoType: 2,
- getMesh: true,
- getTexture: true
- }
-
- console.log('调用参数为:', reqData)
-
- wx.cloud.callFunction({
- name: 'ARDemo',
- config: {
- env: this.data.envId
- },
- data: reqData
- }).then((resp) => {
- console.log('生成模型成功')
- console.log(resp)
- wx.showToast({
- title: '生成模型成功',
- icon: 'none',
- duration: 2000
- })
-
- wx.hideLoading()
-
- let modelInfos = wx.getStorageSync('modelsInfo')
- if (modelInfos == undefined || modelInfos.length == 0) {
- modelInfos = []
- }
- console.log('原有的缓存列表', modelInfos)
-
- const returnCosid = resp.result.respBody.cosid
-
- // 5分钟内上传相同文件,会返回相同的cosid,需要过滤掉
- let matched = false
- for (let j = modelInfos.length - 1; j >= 0; j--) {
- if (modelInfos[j].cosid === returnCosid) {
- matched = true
- break
- }
- }
- if (!matched) {
- console.log('缓存对cosid进行push')
- console.log('当前生成模型的cosid为:', returnCosid)
-
- console.log()
- modelInfos.push({
- cosid: resp.result.respBody.cosid,
- uploadTime: this.convertToTime(Date.parse(new Date()) / 1000),
- timeStamp: Date.now() / 1000 | 0,
- modelStatus: 0,
- restTime: 0,
- statusMsg: '准备中'
- })
- }
-
- modelInfos.sort(function (a, b) {
- if (a.uploadTime > b.uploadTime) {
- return -1
- } else if (a.uploadTime < b.uploadTime) {
- return 1
- }
- return 0
- })
-
- wx.setStorage({
- key: 'modelsInfo',
- data: modelInfos,
- success() {
- console.log('存储cosID集合为:', modelInfos)
- }
- })
-
- this.setData({
- models: modelInfos
- })
- }).catch((e) => {
- console.log(e)
- wx.showToast({
- title: e.errMsg,
- icon: 'none',
- duration: 2000
- })
- this.setData({
- showUploadTip: true
- })
- wx.hideLoading()
- })
- },
- // 获取现有模型列表
- getARModelList() {
- // 获取本地缓存
- const modelInfos = wx.getStorageSync('modelsInfo')
- if (modelInfos == undefined || modelInfos.length == 0) {
- // 无缓存,跳过
- return
- }
-
- const countModelInfo = modelInfos.length
- let countLoaded = 0
-
- const modelInfosNew = []
-
- // 统一的获取处理回调
- const handleLoadModelInfo = () => {
- if (countLoaded === countModelInfo) {
- // 加载完毕
- console.log('基于本地缓存请求列表结束', modelInfosNew)
-
- // 新列表,基于创建时间排序
- modelInfosNew.sort(function (a, b) {
- if (a.uploadTime > b.uploadTime) {
- return -1
- } else if (a.uploadTime < b.uploadTime) {
- return 1
- }
- return 0
- })
-
- // 写入缓存
- wx.setStorage({
- key: 'modelsInfo',
- data: modelInfosNew,
- success() {
- console.log('存储cosID集合为:', modelInfosNew)
- wx.hideLoading()
- }
- })
-
- // 更新显示列表
- this.setData({
- models: modelInfosNew,
- })
- }
- }
-
- // 基于缓存列表请求
- for (let i = 0; i < countModelInfo; i++) {
- const modelInfo = modelInfos[i]
- const cosid = modelInfo.cosid
- wx.cloud.callFunction({
- name: 'ARDemo',
- config: {
- env: this.data.envId
- },
- data: {
- type: 'GetARModel',
- cosid,
- modelType: 3,
- needData: 0,
- useIntranet: 0,
- expireTime: 1200
- }
- }).then(resp => {
- countLoaded++
-
- const modelStatus = resp.result.respBody.status
-
- console.log('获取的模型的cosID为', cosid)
- console.log(resp)
- console.log('status', modelStatus)
-
- // 根据返回信息,更新模型信息
- const modelInfoNew = {
- cosid,
- uploadTime: modelInfo.uploadTime,
- timeStamp: modelInfo.timeStamp,
- modelStatus, // 0 生成中 1 生成成功 2 过期 3 生成失败
- restTime: 0,
- statusMsg: '准备中',
- }
- // 回调写入缓存map,方便读取
- this.modelRespMap[cosid] = resp
-
- // 根据状态设置描述
- if (modelStatus === 1) {
- // 生成成功
- modelInfoNew.statusMsg = '已完成'
- // 运算过期时间
- const expireTime = resp.result.respBody.expireTime
- const nowTime = Date.now() / 1000 | 0
- const restTime = Math.floor((expireTime - nowTime) / 60 / 60 / 24)
- modelInfoNew.restTime = restTime
- } else if (modelStatus === 2) {
- // 资源过期
- modelInfoNew.statusMsg = '资源过期'
- } else if (modelStatus === 3) {
- // 生成失败
- const errMsg = resp.result.respBody.errMsg
- console.log('errMsg', errMsg)
-
- modelInfoNew.statusMsg = '生成失败'
- if (errMsg) {
- modelInfoNew.errMsg = errMsg
- }
- }
-
- modelInfosNew.push(modelInfoNew)
-
- handleLoadModelInfo()
- }).catch((e) => {
- countLoaded++
-
- console.log(e)
- })
- }
- },
- cloudUploadARModel(res, callback) {
- wx.showLoading({
- title: '文件上传中……',
- })
-
- const second = (new Date()).getSeconds()
-
- // 组成规则 第一位随机数(1 / 2)第二位是秒的个位
- const id = Math.ceil(Math.random() * 2) * 10 + second % 10
-
- wx.cloud.uploadFile({
- cloudPath: `3dmarker/arVideo${id}.mp4`,
- filePath: res.tempFiles[0].tempFilePath, // 文件路径
- config: {
- env: this.data.envId
- },
- timeout: 60000,
- success(res) {
- wx.hideLoading()
- const data = res.data
- console.log('上传文件success:', res)
- wx.showToast({
- title: '上传文件成功',
- icon: 'none',
- duration: 2000
- })
- wx.cloud.getTempFileURL({
- fileList: [res.fileID],
- success: res => {
- callback(res.fileList[0].tempFileURL)
- console.log('生成模型中……')
- },
- fail: err => {
- console.log('发生错误:', err)
- wx.showToast({
- title: err.errMsg,
- icon: 'none',
- duration: 2000
- })
- }
- })
- },
- fail: err => {
- wx.hideLoading()
- console.log('上传文件error:', err)
- wx.showToast({
- title: err.errMsg,
- icon: 'none',
- duration: 2000
- })
- }
- })
- },
- // 工具函数 转换时间戳
- convertToTime(timestamp) {
- const now = new Date(timestamp * 1000)
- const y = now.getFullYear()
- const m = now.getMonth() + 1
- const d = now.getDate()
- const x = y + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d) + ' \n' + now.toTimeString().substr(0, 8)
- return x
- },
- // 选择模型
- chooseARModel(event) {
- // 被选中cosid
- const selectCosid = event.currentTarget.dataset.cosid
- // 已选中cosid
- const targetCosId = this.data.targetCosId
-
- // 不同的情况下,更新选中目标
- if (selectCosid !== targetCosId) {
- const modelResp = this.modelRespMap[selectCosid]
-
- const modelStatus = modelResp.result.respBody.status
- // 成功才允许点击
- if (modelStatus === 1) {
- this.setData({
- targetCosId: selectCosid
- })
-
- // 选择的时候,通知上层
- this.triggerEvent('selectEvent', {
- cosid: selectCosid,
- modelResp,
- })
- }
- }
- },
- // 删除模型本地缓存
- deleteARModel(event) {
- // 被选中cosid
- const selectCosid = event.currentTarget.dataset.cosid
-
- wx.showModal({
- content: `是否删除当前缓存模型(删除后不可恢复),模型id ${selectCosid}`,
- confirmText: '确定删除',
- cancelText: '取消',
- success: (res) => {
- if (res.confirm) {
- console.log('确定删除')
- // 获取本地缓存
- const modelInfos = wx.getStorageSync('modelsInfo')
- if (modelInfos == undefined || modelInfos.length == 0) {
- // 无缓存,跳过
- return
- }
-
- // 新列表,过滤掉删除的cosid
- const modelInfosNew = modelInfos.filter(
- (modelInfo) => modelInfo.cosid !== selectCosid
- )
-
- // 写入缓存
- wx.setStorage({
- key: 'modelsInfo',
- data: modelInfosNew,
- success() {
- console.log('存储cosID集合为:', modelInfosNew)
- wx.hideLoading()
- }
- })
-
- // 更新显示列表
- this.setData({
- models: modelInfosNew,
- })
- } else if (res.cancel) {
- console.log('取消')
- }
- }
- })
- },
- }
-})
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.json b/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.json
deleted file mode 100644
index 62389a94..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "component": true,
- "usingComponents": {}
- }
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.wxml b/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.wxml
deleted file mode 100644
index 8ae563b5..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.wxml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
- {{modelItem.statusMsg}}
- {{modelItem.uploadTime}}
- {{modelItem.cosid !== undefined ? modelItem.cosid : '不存在cosid'}}
- 剩余 {{modelItem.restTime}} 天过期
- {{modelItem.errMsg}}
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.wxss b/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.wxss
deleted file mode 100644
index 7fd6648d..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/Components/arModelComponent.wxss
+++ /dev/null
@@ -1,213 +0,0 @@
-.wrap-choose {
- margin-left: 20rpx;
-}
-
-.wrap-left {
- position: absolute;
- left: 40rpx;
- top: 30rpx;
- width: 200rpx;
- height: 268rpx;
-}
-
-button.btn-left {
- position: absolute;
- left: 0;
- top: 0%;
- width: 100%;
- height: 100%;
- padding: 12rpx;
- border-radius: 20rpx;
-}
-button.btn-left .info-wrap {
- position: absolute;
- left: 0;
- right: 0;
- bottom: 20rpx;
- text-align: center;
-}
-.info-wrap p {
- display: block;
- color: #fff;
- font-size: 16rpx;
- text-align: center;
- line-height: 24rpx;
- white-space: nowrap;
-}
-.info-wrap p:first-child {
- font-size: 36rpx;
- line-height: 60rpx;
-}
-
-button.btn-left .cross-v {
- position: absolute;
- left: 50%;
- top: 26%;
- width: 10rpx;
- height: 80rpx;
- transform: translate(-50%, -50%);
- background-color: rgba(255, 255, 255, 1);
- border-radius: 6rpx;
-}
-
-button.btn-left .cross-h {
- position: absolute;
- left: 50%;
- top: 26%;
- width: 80rpx;
- height: 10rpx;
- transform: translate(-50%, -50%);
- background-color: rgba(255, 255, 255, 1);
- border-radius: 6rpx;
-}
-.wrap-right {
- text-align: left;
- padding: 10rpx;
- padding-right: 0;
- margin-right: 20rpx;
- min-height: 280rpx;
- border-radius: 20rpx;
- border: 4rpx dotted rgba(0, 0, 0, .3);
-}
-
-.model-item {
- position: relative;
- display: inline-block;
- margin: 10rpx 10rpx 0 10rpx;
- width: 206rpx;
- height: 280rpx;
- border-radius: 20rpx;
-}
-.model-item:first-child {
- margin-left: 230rpx;
-}
-
-.model-info {
- position: absolute;
- left: 0rpx;
- top: 0rpx;
- width: 100%;
- height: 100%;
- border-radius: 20rpx;
- box-sizing: border-box;
- background-color: #a0a0a0;
-}
-
-.model-info.loading {
- background-color: #a0a0a0;
- border: 8rpx #a0a0a0 solid;
-}
-.model-info.done {
- background-color: #2B3467;
- border: 8rpx #2B3467 solid;
-}
-.model-info.expired {
- background-color: #ed6c10;
- border: 8rpx #ed6c10 solid;
-}
-.model-info.error {
- background-color: #f73a3a;
- border: 8rpx #f73a3a solid;
-}
-.model-info.choosed {
- border-color: #07c160;
-}
-
-.model-info .status {
- position: absolute;
- left: 20rpx;
- right: 20rpx;
- bottom: 20rpx;
- height: 50rpx;
- border-radius: 10rpx;
- line-height: 50rpx;
- font-size: 22rpx;
- text-align: center;
- background-color: #fff;
-}
-
-.model-info .cosid {
- position: absolute;
- left: 20rpx;
- right: 20rpx;
- bottom: 140rpx;
- height: 40rpx;
- line-height: 20rpx;
- font-size: 16rpx;
- text-align: center;
- color: #fff;
- word-break: break-all;
-}
-
-.model-info.done .cosid {
- color: #d0d0d0;
-}
-
-.model-info .timeStamp {
- position: absolute;
- left: 10rpx;
- right: 10rpx;
- top: 15rpx;
- color: #fff;
- font-size: 26rpx;
- text-align: center;
- line-height: 34rpx;
-}
-
-.model-info .restTime {
- position: absolute;
- left: 10rpx;
- right: 10rpx;
- bottom: 76rpx;
- color: #fff;
- font-size: 22rpx;
- text-align: center;
- line-height: 38rpx;
-}
-
-.model-info .errMsg {
- position: absolute;
- left: 10rpx;
- right: 10rpx;
- bottom: 76rpx;
- color: #fff;
- font-size: 16rpx;
- text-align: center;
- line-height: 26rpx;
- background-color: #000;
- padding: 6rpx;
- border-radius: 6rpx;
-}
-
-.model-info .buttonDelete {
- position: absolute;
- right: -20rpx;
- top: -16rpx;
- width: 40rpx;
- height: 40rpx;
- background-color: #FF6969;
- border: 2rpx solid #fff;
- border-radius: 12rpx;
-}
-
-.buttonDelete .linel {
- position: absolute;
- left: 50%;
- top: 50%;
- width: 8%;
- height: 70%;
- background-color: #fff;
- border-radius: 2rpx;
- transform: translate(-50%, -50%) rotate(45deg);
-}
-
-.buttonDelete .liner {
- position: absolute;
- left: 50%;
- top: 50%;
- width: 8%;
- height: 70%;
- background-color: #fff;
- border-radius: 2rpx;
- transform: translate(-50%, -50%) rotate(-45deg);
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/proto/arModelProto.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/proto/arModelProto.js
deleted file mode 100644
index 081ac742..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/proto/arModelProto.js
+++ /dev/null
@@ -1,28 +0,0 @@
-module.exports = {
- nested: {
- ARModelData: {
- fields: {
- meshModel: {
- type: 'bytes',
- id: 1
- },
- textureModel: {
- type: 'bytes',
- id: 2
- },
- preview: {
- type: 'bytes',
- id: 3
- },
- meshBlob: {
- type: 'bytes',
- id: 4
- },
- textureBlob: {
- type: 'bytes',
- id: 5
- }
- }
- }
- }
-}
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/proto/arModelProto.proto b/miniprogram/packageAPI/pages/ar/3dmarker-ar/proto/arModelProto.proto
deleted file mode 100644
index dd88ff41..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/proto/arModelProto.proto
+++ /dev/null
@@ -1,8 +0,0 @@
-message ARModelData
-{
- optional bytes mesh_model = 1; // 文本(点面信息)
- optional bytes texture_model = 2; // 图像png
- optional bytes preview = 3;
- optional bytes mesh_blob = 4; // obj二进制, getmesh = true时返回
- optional bytes texture_blob = 5; // 纹理二进制, gettexture = true时返回
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/protobuf.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/protobuf.js
deleted file mode 100644
index 54c943d2..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/protobuf.js
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/13.
- */
-
-
-
-(function (protobufFactory){
- //if (typeof define === 'function')//这里会不会定义重复呢?怎么去掉呢
- // define('protobuf', protobufFactory);
- //else
- module.exports = protobufFactory();
-})(function(){
- var protobuf = {};
-//app.globalData.protobuf = protobuf;
-
- /**
- * Build type, one of `"full"`, `"light"` or `"minimal"`.
- * @name build
- * @type {string}
- * @const
- */
- protobuf.build = "minimal";
-
-// Serialization
- protobuf.Writer = require("./src/writer");
- protobuf.encoder = require("./src/encoder");
- protobuf.Reader = require("./src/reader");
-
-// Utility
- protobuf.util = require("./src/util");
- protobuf.rpc = require("./src/rpc/service");
- protobuf.roots = require("./src/roots");
- protobuf.verifier = require("./src/verifier");
-
- protobuf.tokenize = require("./src/tokenize");
- protobuf.parse = require("./src/parse");
- protobuf.common = require("./src/common");
-
- protobuf.ReflectionObject = require("./src/object");
- protobuf.Namespace = require("./src/namespace");
- protobuf.Root = require("./src/root");
- protobuf.Enum = require("./src/enum");
- protobuf.Type = require("./src/type");
- protobuf.Field = require("./src/field");
- protobuf.OneOf = require("./src/oneof");
- protobuf.MapField = require("./src/mapField");
- protobuf.Service = require("./src/service");
- protobuf.Method = require("./src/method");
- protobuf.converter = require("./src/converter");
- protobuf.decoder = require("./src/decoder");
-
-// Runtime
- protobuf.Message = require("./src/message");
- protobuf.wrappers = require("./src/wrappers");
-
-// Utility
- protobuf.types = require("./src/types");
- protobuf.util = require("./src/util");
-
- protobuf.configure = configure;
-
-
- function load(filename, root, callback) {
- if (typeof root === "function") {
- callback = root;
- root = new protobuf.Root();
- } else if (!root)
- root = new protobuf.Root();
- return root.load(filename, callback);
- }
-
- protobuf.load = load;
-
- function loadSync(filename, root) {
- if (!root)
- root = new protobuf.Root();
- return root.loadSync(filename);
- }
-
- protobuf.loadSync = loadSync;
-
-
-//新增weichat支持的解析pbConfig接口
- function parseFromPbString(pbString, root, callback){
- if (typeof root === "function") {
- callback = root;
- root = new protobuf.Root();
- } else if (!root)
- root = new protobuf.Root();
- return root.parseFromPbString(pbString, callback);
- }
-
- protobuf.parseFromPbString = parseFromPbString;
-
- /**
- * Reconfigures the library according to the environment.
- * @returns {undefined}
- */
- function configure() {
-
- protobuf.converter._configure();
- protobuf.decoder._configure();
- protobuf.encoder._configure();
- protobuf.Field._configure();
- protobuf.MapField._configure();
- protobuf.Message._configure();
- protobuf.Namespace._configure();
- protobuf.Method._configure();
- protobuf.ReflectionObject._configure();
- protobuf.OneOf._configure();
- protobuf.parse._configure();
- protobuf.Reader._configure();
- protobuf.Root._configure();
- protobuf.Service._configure();
- protobuf.verifier._configure();
- protobuf.Type._configure();
- protobuf.types._configure();
- protobuf.wrappers._configure();
- protobuf.Writer._configure();
- }
- configure();
-
- if(arguments&&arguments.length){
- for (var i = 0 ;i < arguments.length; i++){
- var argument = arguments[i];
- if(argument.hasOwnProperty("exports")){
- argument.exports = protobuf;
- return;
- }
- }
- }
- return protobuf;
-});
-
-
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/EventEmitter.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/EventEmitter.js
deleted file mode 100644
index f766fd07..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/EventEmitter.js
+++ /dev/null
@@ -1,76 +0,0 @@
-"use strict";
-module.exports = EventEmitter;
-
-/**
- * Constructs a new event emitter instance.
- * @classdesc A minimal event emitter.
- * @memberof util
- * @constructor
- */
-function EventEmitter() {
-
- /**
- * Registered listeners.
- * @type {Object.}
- * @private
- */
- this._listeners = {};
-}
-
-/**
- * Registers an event listener.
- * @param {string} evt Event name
- * @param {function} fn Listener
- * @param {*} [ctx] Listener context
- * @returns {util.EventEmitter} `this`
- */
-EventEmitter.prototype.on = function on(evt, fn, ctx) {
- (this._listeners[evt] || (this._listeners[evt] = [])).push({
- fn : fn,
- ctx : ctx || this
- });
- return this;
-};
-
-/**
- * Removes an event listener or any matching listeners if arguments are omitted.
- * @param {string} [evt] Event name. Removes all listeners if omitted.
- * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.
- * @returns {util.EventEmitter} `this`
- */
-EventEmitter.prototype.off = function off(evt, fn) {
- if (evt === undefined)
- this._listeners = {};
- else {
- if (fn === undefined)
- this._listeners[evt] = [];
- else {
- var listeners = this._listeners[evt];
- for (var i = 0; i < listeners.length;)
- if (listeners[i].fn === fn)
- listeners.splice(i, 1);
- else
- ++i;
- }
- }
- return this;
-};
-
-/**
- * Emits an event by calling its listeners with the specified arguments.
- * @param {string} evt Event name
- * @param {...*} args Arguments
- * @returns {util.EventEmitter} `this`
- */
-EventEmitter.prototype.emit = function emit(evt) {
- var listeners = this._listeners[evt];
- if (listeners) {
- var args = [],
- i = 1;
- for (; i < arguments.length;)
- args.push(arguments[i++]);
- for (i = 0; i < listeners.length;)
- listeners[i].fn.apply(listeners[i++].ctx, args);
- }
- return this;
-};
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/asPromise.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/asPromise.js
deleted file mode 100644
index d6f642cb..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/asPromise.js
+++ /dev/null
@@ -1,52 +0,0 @@
-"use strict";
-module.exports = asPromise;
-
-/**
- * Callback as used by {@link util.asPromise}.
- * @typedef asPromiseCallback
- * @type {function}
- * @param {Error|null} error Error, if any
- * @param {...*} params Additional arguments
- * @returns {undefined}
- */
-
-/**
- * Returns a promise from a node-style callback function.
- * @memberof util
- * @param {asPromiseCallback} fn Function to call
- * @param {*} ctx Function context
- * @param {...*} params Function arguments
- * @returns {Promise<*>} Promisified function
- */
-function asPromise(fn, ctx/*, varargs */) {
- var params = new Array(arguments.length - 1),
- offset = 0,
- index = 2,
- pending = true;
- while (index < arguments.length)
- params[offset++] = arguments[index++];
- return new Promise(function executor(resolve, reject) {
- params[offset] = function callback(err/*, varargs */) {
- if (pending) {
- pending = false;
- if (err)
- reject(err);
- else {
- var params = new Array(arguments.length - 1),
- offset = 0;
- while (offset < params.length)
- params[offset++] = arguments[offset];
- resolve.apply(null, params);
- }
- }
- };
- try {
- fn.apply(ctx || null, params);
- } catch (err) {
- if (pending) {
- pending = false;
- reject(err);
- }
- }
- });
-}
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/base64.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/base64.js
deleted file mode 100644
index dd2855bd..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/base64.js
+++ /dev/null
@@ -1,139 +0,0 @@
-"use strict";
-
-/**
- * A minimal base64 implementation for number arrays.
- * @memberof util
- * @namespace
- */
-var base64 = module.exports;
-
-/**
- * Calculates the byte length of a base64 encoded string.
- * @param {string} string Base64 encoded string
- * @returns {number} Byte length
- */
-base64.length = function length(string) {
- var p = string.length;
- if (!p)
- return 0;
- var n = 0;
- while (--p % 4 > 1 && string.charAt(p) === "=")
- ++n;
- return Math.ceil(string.length * 3) / 4 - n;
-};
-
-// Base64 encoding table
-var b64 = new Array(64);
-
-// Base64 decoding table
-var s64 = new Array(123);
-
-// 65..90, 97..122, 48..57, 43, 47
-for (var i = 0; i < 64;)
- s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;
-
-/**
- * Encodes a buffer to a base64 encoded string.
- * @param {Uint8Array} buffer Source buffer
- * @param {number} start Source start
- * @param {number} end Source end
- * @returns {string} Base64 encoded string
- */
-base64.encode = function encode(buffer, start, end) {
- var parts = null,
- chunk = [];
- var i = 0, // output index
- j = 0, // goto index
- t; // temporary
- while (start < end) {
- var b = buffer[start++];
- switch (j) {
- case 0:
- chunk[i++] = b64[b >> 2];
- t = (b & 3) << 4;
- j = 1;
- break;
- case 1:
- chunk[i++] = b64[t | b >> 4];
- t = (b & 15) << 2;
- j = 2;
- break;
- case 2:
- chunk[i++] = b64[t | b >> 6];
- chunk[i++] = b64[b & 63];
- j = 0;
- break;
- }
- if (i > 8191) {
- (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
- i = 0;
- }
- }
- if (j) {
- chunk[i++] = b64[t];
- chunk[i++] = 61;
- if (j === 1)
- chunk[i++] = 61;
- }
- if (parts) {
- if (i)
- parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
- return parts.join("");
- }
- return String.fromCharCode.apply(String, chunk.slice(0, i));
-};
-
-var invalidEncoding = "invalid encoding";
-
-/**
- * Decodes a base64 encoded string to a buffer.
- * @param {string} string Source string
- * @param {Uint8Array} buffer Destination buffer
- * @param {number} offset Destination offset
- * @returns {number} Number of bytes written
- * @throws {Error} If encoding is invalid
- */
-base64.decode = function decode(string, buffer, offset) {
- var start = offset;
- var j = 0, // goto index
- t; // temporary
- for (var i = 0; i < string.length;) {
- var c = string.charCodeAt(i++);
- if (c === 61 && j > 1)
- break;
- if ((c = s64[c]) === undefined)
- throw Error(invalidEncoding);
- switch (j) {
- case 0:
- t = c;
- j = 1;
- break;
- case 1:
- buffer[offset++] = t << 2 | (c & 48) >> 4;
- t = c;
- j = 2;
- break;
- case 2:
- buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;
- t = c;
- j = 3;
- break;
- case 3:
- buffer[offset++] = (t & 3) << 6 | c;
- j = 0;
- break;
- }
- }
- if (j === 1)
- throw Error(invalidEncoding);
- return offset - start;
-};
-
-/**
- * Tests if the specified string appears to be base64 encoded.
- * @param {string} string String to test
- * @returns {boolean} `true` if probably base64 encoded, otherwise false
- */
-base64.test = function test(string) {
- return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);
-};
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/common.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/common.js
deleted file mode 100644
index fbf4e959..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/common.js
+++ /dev/null
@@ -1,398 +0,0 @@
-module.exports = common;
-
-var commonRe = /\/|\./;
-
-/**
- * Provides common type definitions.
- * Can also be used to provide additional google types or your own custom types.
- * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name
- * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition
- * @returns {undefined}
- * @property {INamespace} google/protobuf/any.proto Any
- * @property {INamespace} google/protobuf/duration.proto Duration
- * @property {INamespace} google/protobuf/empty.proto Empty
- * @property {INamespace} google/protobuf/field_mask.proto FieldMask
- * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue
- * @property {INamespace} google/protobuf/timestamp.proto Timestamp
- * @property {INamespace} google/protobuf/wrappers.proto Wrappers
- * @example
- * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)
- * protobuf.common("descriptor", descriptorJson);
- *
- * // manually provides a custom definition (uses my.foo namespace)
- * protobuf.common("my/foo/bar.proto", myFooBarJson);
- */
-function common(name, json) {
- if (!commonRe.test(name)) {
- name = "google/protobuf/" + name + ".proto";
- json = { nested: { google: { nested: { protobuf: { nested: json } } } } };
- }
- common[name] = json;
-}
-
-// Not provided because of limited use (feel free to discuss or to provide yourself):
-//
-// google/protobuf/descriptor.proto
-// google/protobuf/source_context.proto
-// google/protobuf/type.proto
-//
-// Stripped and pre-parsed versions of these non-bundled files are instead available as part of
-// the repository or package within the google/protobuf directory.
-
-common("any", {
-
- /**
- * Properties of a google.protobuf.Any message.
- * @interface IAny
- * @type {Object}
- * @property {string} [typeUrl]
- * @property {Uint8Array} [bytes]
- * @memberof common
- */
- Any: {
- fields: {
- type_url: {
- type: "string",
- id: 1
- },
- value: {
- type: "bytes",
- id: 2
- }
- }
- }
-});
-
-var timeType;
-
-common("duration", {
-
- /**
- * Properties of a google.protobuf.Duration message.
- * @interface IDuration
- * @type {Object}
- * @property {number|Long} [seconds]
- * @property {number} [nanos]
- * @memberof common
- */
- Duration: timeType = {
- fields: {
- seconds: {
- type: "int64",
- id: 1
- },
- nanos: {
- type: "int32",
- id: 2
- }
- }
- }
-});
-
-common("timestamp", {
-
- /**
- * Properties of a google.protobuf.Timestamp message.
- * @interface ITimestamp
- * @type {Object}
- * @property {number|Long} [seconds]
- * @property {number} [nanos]
- * @memberof common
- */
- Timestamp: timeType
-});
-
-common("empty", {
-
- /**
- * Properties of a google.protobuf.Empty message.
- * @interface IEmpty
- * @memberof common
- */
- Empty: {
- fields: {}
- }
-});
-
-common("struct", {
-
- /**
- * Properties of a google.protobuf.Struct message.
- * @interface IStruct
- * @type {Object}
- * @property {Object.} [fields]
- * @memberof common
- */
- Struct: {
- fields: {
- fields: {
- keyType: "string",
- type: "Value",
- id: 1
- }
- }
- },
-
- /**
- * Properties of a google.protobuf.Value message.
- * @interface IValue
- * @type {Object}
- * @property {string} [kind]
- * @property {0} [nullValue]
- * @property {number} [numberValue]
- * @property {string} [stringValue]
- * @property {boolean} [boolValue]
- * @property {IStruct} [structValue]
- * @property {IListValue} [listValue]
- * @memberof common
- */
- Value: {
- oneofs: {
- kind: {
- oneof: [
- "nullValue",
- "numberValue",
- "stringValue",
- "boolValue",
- "structValue",
- "listValue"
- ]
- }
- },
- fields: {
- nullValue: {
- type: "NullValue",
- id: 1
- },
- numberValue: {
- type: "double",
- id: 2
- },
- stringValue: {
- type: "string",
- id: 3
- },
- boolValue: {
- type: "bool",
- id: 4
- },
- structValue: {
- type: "Struct",
- id: 5
- },
- listValue: {
- type: "ListValue",
- id: 6
- }
- }
- },
-
- NullValue: {
- values: {
- NULL_VALUE: 0
- }
- },
-
- /**
- * Properties of a google.protobuf.ListValue message.
- * @interface IListValue
- * @type {Object}
- * @property {Array.} [values]
- * @memberof common
- */
- ListValue: {
- fields: {
- values: {
- rule: "repeated",
- type: "Value",
- id: 1
- }
- }
- }
-});
-
-common("wrappers", {
-
- /**
- * Properties of a google.protobuf.DoubleValue message.
- * @interface IDoubleValue
- * @type {Object}
- * @property {number} [value]
- * @memberof common
- */
- DoubleValue: {
- fields: {
- value: {
- type: "double",
- id: 1
- }
- }
- },
-
- /**
- * Properties of a google.protobuf.FloatValue message.
- * @interface IFloatValue
- * @type {Object}
- * @property {number} [value]
- * @memberof common
- */
- FloatValue: {
- fields: {
- value: {
- type: "float",
- id: 1
- }
- }
- },
-
- /**
- * Properties of a google.protobuf.Int64Value message.
- * @interface IInt64Value
- * @type {Object}
- * @property {number|Long} [value]
- * @memberof common
- */
- Int64Value: {
- fields: {
- value: {
- type: "int64",
- id: 1
- }
- }
- },
-
- /**
- * Properties of a google.protobuf.UInt64Value message.
- * @interface IUInt64Value
- * @type {Object}
- * @property {number|Long} [value]
- * @memberof common
- */
- UInt64Value: {
- fields: {
- value: {
- type: "uint64",
- id: 1
- }
- }
- },
-
- /**
- * Properties of a google.protobuf.Int32Value message.
- * @interface IInt32Value
- * @type {Object}
- * @property {number} [value]
- * @memberof common
- */
- Int32Value: {
- fields: {
- value: {
- type: "int32",
- id: 1
- }
- }
- },
-
- /**
- * Properties of a google.protobuf.UInt32Value message.
- * @interface IUInt32Value
- * @type {Object}
- * @property {number} [value]
- * @memberof common
- */
- UInt32Value: {
- fields: {
- value: {
- type: "uint32",
- id: 1
- }
- }
- },
-
- /**
- * Properties of a google.protobuf.BoolValue message.
- * @interface IBoolValue
- * @type {Object}
- * @property {boolean} [value]
- * @memberof common
- */
- BoolValue: {
- fields: {
- value: {
- type: "bool",
- id: 1
- }
- }
- },
-
- /**
- * Properties of a google.protobuf.StringValue message.
- * @interface IStringValue
- * @type {Object}
- * @property {string} [value]
- * @memberof common
- */
- StringValue: {
- fields: {
- value: {
- type: "string",
- id: 1
- }
- }
- },
-
- /**
- * Properties of a google.protobuf.BytesValue message.
- * @interface IBytesValue
- * @type {Object}
- * @property {Uint8Array} [value]
- * @memberof common
- */
- BytesValue: {
- fields: {
- value: {
- type: "bytes",
- id: 1
- }
- }
- }
-});
-
-common("field_mask", {
-
- /**
- * Properties of a google.protobuf.FieldMask message.
- * @interface IDoubleValue
- * @type {Object}
- * @property {number} [value]
- * @memberof common
- */
- FieldMask: {
- fields: {
- paths: {
- rule: "repeated",
- type: "string",
- id: 1
- }
- }
- }
-});
-
-/**
- * Gets the root definition of the specified common proto file.
- *
- * Bundled definitions are:
- * - google/protobuf/any.proto
- * - google/protobuf/duration.proto
- * - google/protobuf/empty.proto
- * - google/protobuf/field_mask.proto
- * - google/protobuf/struct.proto
- * - google/protobuf/timestamp.proto
- * - google/protobuf/wrappers.proto
- *
- * @param {string} file Proto file name
- * @returns {INamespace|null} Root definition or `null` if not defined
- */
-common.get = function get(file) {
- return common[file] || null;
-};
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/converter.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/converter.js
deleted file mode 100644
index 67e1f601..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/converter.js
+++ /dev/null
@@ -1,330 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/14.
- * 写这个,有点难;有错误请指出 ,微信中不能Function.Apply 和evl,所以去掉其中所有的gen()
- */
-var converter = module.exports;
-
-var Enum,
- util;
-
-
-converter._configure = function () {
- Enum = require('./enum');
- util = require('./util');
-};
-
-function valuePartial_fromObject(field, fieldIndex, propName, options){
- var m = options['m'];
- var d = options['d'];
- var _types = options['types'];
- var ksi = options['ksi'];
- var ksiFlag = typeof ksi != 'undefined';
- if(field.resolvedType){
- if(field.resolvedType instanceof Enum){
- var prop = ksiFlag ? d[propName][ksi] : d[propName];
- var values = field.resolvedType.values,
- keys = Object.keys(values);
- for (var i = 0; i < keys.length; i++){
- if(field.repeated && values[keys[i]] === field.typeDefault){
- continue;
- }
- if(keys[i] == prop || values[keys[i]] == prop){
- ksiFlag ?
- m[propName][ksi] = values[keys[i]] :
- m[propName] = values[keys[i]];
- break
- }
- }
- }else {
- if(typeof (ksiFlag ? d[propName][ksi] : d[propName]) !== 'object')
- throw TypeError(field.fullName + ": object expected");
- ksiFlag ?
- m[propName][ksi] = _types[fieldIndex].fromObject(d[propName][ksi]):
- m[propName] = _types[fieldIndex].fromObject(d[propName]);
- }
- } else {
- var isUnsigned = false;
- switch (field.type){
- case "double":
- case "float":
- ksiFlag ?
- m[propName][ksi] = Number(d[propName][ksi]) :
- m[propName] = Number(d[propName]);
- break;
- case "uint32":
- case "fixed32":
- ksiFlag ?
- m[propName][ksi] = d[propName][ksi] >>> 0:
- m[propName] = d[propName] >>> 0;
- break;
- case "int32":
- case "sint32":
- case "sfixed32":
- ksiFlag ?
- m[propName][ksi] = d[propName][ksi] | 0 :
- m[propName] = d[propName] |0;
- break;
- case "uint64":
- isUnsigned = true;
- // eslint-disable-line no-fallthrough
- case "int64":
- case "sint64":
- case "fixed64":
- case "sfixed64":
- if(util.Long)
- ksiFlag ?
- m[propName][ksi] = util.Long.fromValue(d[propName][ksi]).unsigned = isUnsigned :
- m[propName] = util.Long.fromValue(d[propName]).unsigned = isUnsigned;
- else if(typeof (ksiFlag ? d[propName][ksi] : d[propName]) === 'string')
- ksiFlag ?
- m[propName][ksi] =parseInt(d[propName][ksi], 10) :
- m[propName] =parseInt(d[propName], 10);
- else if(typeof (ksiFlag ? d[propName][ksi] : d[propName]) === 'number')
- ksiFlag ?
- m[propName][ksi] = d[propName][ksi] :
- m[propName] = d[propName];
- else if(typeof (ksiFlag ? d[propName][ksi] : d[propName]) === 'object')
- ksiFlag ?
- m[propName][ksi] = new util.LongBits(d[propName][ksi].low >>> 0, d[propName][ksi].high >>> 0).toNumber(isUnsigned) :
- m[propName] = new util.LongBits(d[propName].low >>> 0, d[propName].high >>> 0).toNumber(isUnsigned);
- break;
- case "bytes":
- if(typeof (ksiFlag ? d[propName][ksi] : d[propName]) ==="string")
- ksiFlag ?
- util.base64.decode(d[propName][ksi],m[propName][ksi]=util.newBuffer(util.base64.length(d[propName][ksi])),0) :
- util.base64.decode(d[propName],m[propName]=util.newBuffer(util.base64.length(d[propName])),0);
- else if((ksiFlag ? d[propName][ksi] : d[propName]).length)
- ksiFlag?
- m[propName][ksi]=d[propName][ksi] :
- m[propName]=d[propName];
- break;
- case "string":
- ksiFlag?
- m[propName][ksi]=String(d[propName][ksi]) :
- m[propName]=String(d[propName]);
- break;
- case "bool":
- ksiFlag?
- m[propName][ksi]=Boolean(d[propName][ksi]):
- m[propName]=Boolean(d[propName]);
- break;
- }
- }
-}
-
-/*
-* @param {Type} mtype Message type
-* @returns {Function} Function instance
-*/
-converter.fromObject = function fromObject(mtype){
- var fields = mtype.fieldsArray;
- return function (options){
- return function (d){
- if(d instanceof this.ctor)
- return d;
- if(!fields.length)
- return new this.ctor;
-
- var m = new this.ctor;
- for (var i = 0; i < fields.length; ++i){
- var field = fields[i].resolve();
- var propName = field.name;
- var _i;
- if(field.map){
- if(d[propName]){
- if(typeof d[propName] !== 'object')
- throw TypeError(field.fullName + ": object expected");
- m[propName] = {};
- }
- var ks = Object.keys(d[propName]);
- for ( _i = 0; _i>> 0, m[propName][ksi].high >>> 0).toNumber(isUnsigned) : m[propName][ksi]):
- (d[propName] =
- o.longs === String ?
- util.Long.prototype.toString.call(m[propName]) :
- o.longs === Number ? new util.LongBits(m[propName].low >>> 0, m[propName].high >>> 0).toNumber(isUnsigned) : m[propName]);
- break;
- case "bytes":
- ksiFlag?
- (d[propName][ksi] =
- o.bytes === String ?
- util.base64.encode(m[propName][ksi], 0, m[propName][ksi].length) :
- o.bytes === Array ? Array.prototype.slice.call(m[propName][ksi]) : m[propName][ksi]):
- (d[propName] =
- o.bytes === String ?
- util.base64.encode(m[propName], 0, m[propName].length) :
- o.bytes === Array ? Array.prototype.slice.call(m[propName]) : m[propName]);
- break;
- default:
- ksiFlag ? d[propName][ksi] = m[propName][ksi] : d[propName] = m[propName];
- break;
- }
- }
-}
-
-
-converter.toObject = function toObject(mtype){
- var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);
- return function (options){
- if(!fields.length)
- return function (){
- return {};
- };
- return function (m, o){
- o = o || {};
- var d = {};
- var repeatedFields = [],
- mapFields = [],
- normalFields = [],
- field,
- propName,
- i = 0;
- for (; i < fields.length; ++i)
- if (!fields[i].partOf)
- ( fields[i].resolve().repeated ? repeatedFields
- : fields[i].map ? mapFields
- : normalFields).push(fields[i]);
-
- if (repeatedFields.length) {
- if(o.arrays || o.defaults ){
- for (i = 0; i < repeatedFields.length; ++i)
- d[repeatedFields[i].name] = [];
- }
- }
-
- if (mapFields.length) {
- if(o.objects || o.defaults){
- for (i = 0; i < mapFields.length; ++i)
- d[mapFields[i].name] = {};
- }
- }
-
- if(normalFields.length){
- if(o.defaults){
- for (i = 0; i < normalFields.length; ++i){
- field = normalFields[i],
- propName = field.name;
- if(field.resolvedType instanceof Enum)
- d[propName] = o.enums = String ? field.resolvedType.valuesById[field.typeDefault] : field.typeDefault;
- else if(field.long){
- if(util.Long){
- var n = new util.Long(field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned);
- d[propName] = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber():n;
- }else {
- d[propName] = o.longs === String ? field.typeDefault.toString() : field.typeDefault.toNumber();
- }
- }else if(field.bytes){
- d[propName] = o.bytes === String ? String.fromCharCode.apply(String, field.typeDefault) : Array.prototype.slice.call(field.typeDefault).join('*..*').split("*..*");
- }else {
- d[propName] =field.typeDefault;
- }
-
- }
- }
- }
- var hasKs2 = false;
- for (i = 0; i < fields.length; ++i){
- field = fields[i];
- propName = field.name;
- var index = mtype._fieldsArray.indexOf(field);
- var ks2;
- var j;
- if(field.map){
- if (!hasKs2){
- hasKs2 = true;
- }
- if (m[propName]&&(ks2 = Object.keys(m[propName]).length)){
- d[propName] = {};
- for (j = 0; j < ks2.length; ++j){
- valuePartial_toObject(field, index, propName, util.merge(util.copy(options), {m:m,d:d,ksi :ks2[j],o:o}));
- }
- }
- }else if(field.repeated){
- if(m[propName]&&m[propName].length){
- d[propName] = [];
- for (j = 0; j < m[propName].length; ++j){
- valuePartial_toObject(field, index, propName, util.merge(util.copy(options), {m:m,d:d,ksi:j,o:o}))
- }
- }
- }else {
- if(m[propName]!=null&& (m.hasOwnProperty(propName)/*|| field.partOf*/)){
- valuePartial_toObject(field, index, propName, util.merge(util.copy(options), {m:m,d:d,o:o}))
- }
- if(field.partOf) {
- if (o.oneofs)
- d[field.partOf.name] = propName;
- }
- }
- }
- return d;
- }
- }
-
-
-};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/decoder.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/decoder.js
deleted file mode 100644
index 7443b409..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/decoder.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/13.
- */
-
-var Enum,
- types,
- util;
-
-
-function missing(field) {
- return "missing required '" + field.name + "'";
-}
-
-function decoder(mtype){
- return function (options){
- var Reader = options.Reader;
- var _types = options.types;
- var _util = options.util;
- return function (r, l){
- if(!(r instanceof Reader))
- r = Reader.create(r);
- var c = l === undefined ? r.len : r.pos + l,
- m = new this.ctor;
- var k;
- while (r.pos < c){
- var t = r.uint32();
- if (mtype.group){
- if((t&7) === 4)
- break;
- }
- var fieldId = t>>>3;
- var i = 0;
- var find = false;
- for (; i < mtype.fieldsArray.length; ++i){
- var field = mtype._fieldsArray[i].resolve(),
- name = field.name,
- type = field.resolvedType instanceof Enum ? "int32" : field.type;
- //ref = m[field.name];
- if (fieldId != field.id) continue;
- find = true;
- if (field.map){
- r.skip().pos++;
- if(m[name] === _util.emptyObject)
- m[name] = {};
- k = r[field.keyType]();
- r.pos++;
- if(types.long[field.keyType] != undefined){
- if(types.basic[type] == undefined){
- m[name][typeof k ==='object' ? _util.longToHash(k):k] = _types[i].decode(r, r.uint32());
- }else {
- m[name][typeof k ==='object' ? _util.longToHash(k):k] = r[type]();
- }
- }else {
- if(types.basic[type] == undefined){
- m[name] = _types[i].decode(r, r.uint32());
- }else {
- m[name] = r[type]();
- }
- }
- }else if(field.repeated){
- if(!(m[name] && m[name].length)){
- m[name] = [];
- }
-
- if(types.packed[type] != undefined && (t&7) === 2){
- var c2 = r.uint32()+ r.pos;
- while (r.pos < c2)
- m[name].push(r[type]())
- }else {
- if(types.basic[type] == undefined){
- field.resolvedType.group ?
- m[name].push(_types[i].decode(r)) :
- m[name].push(_types[i].decode(r, r.uint32()))
-
- }else {
- m[name].push(r[type]());
- }
- }
- }else if (types.basic[type] == undefined){
- if(field.resolvedType.group){
- m[name] = _types[i].decode(r);
- }else {
- m[name] = _types[i].decode(r, r.uint32());
- }
- }else {
- //console.log("m",JSON.stringify(m),"type",type,"field",field);
- m[name] = r[type]();
- }
- break;
- }
-
- if(!find){
- console.log("t",t);
- r.skipType(t&7)
- }
-
- }
-
- for (i = 0; i < mtype._fieldsArray.length; ++ i){
- var rfield = mtype._fieldsArray[i];
- if(rfield.required){
- if(!m.hasOwnProperty(rfield.name)){
- throw util.ProtocolError(missing(rfield),{instance:m})
- }
- }
- }
- //mtype.fieldsArray.filter(function(field) { return field.map; }).length
- return m;
- }
- }
-}
-
-module.exports = decoder;
-decoder._configure = function (){
- Enum = require("./enum");
- types = require("./types");
- util = require("./util");
-};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/encoder.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/encoder.js
deleted file mode 100644
index c238a45d..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/encoder.js
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/13.
- * 改写原来的googleProtocolBuffer的encode,请不要告我侵犯版权;/(ㄒoㄒ)/~~
- */
-var Enum;
-var types;
-
-
-//得到一个编码过程
-function encoder(mtype){
- return function (options){
- var Writer = options.Writer;
- var _types = options.types;
- var util = options.util;
- return function (message, writer) {
- writer = writer || Writer.create();
- var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);
- for (var i = 0; i < fields.length; i++) {
- var field = fields[i];
- var index = mtype._fieldsArray.indexOf(field);
-
- var type = field.resolvedType instanceof Enum ? 'uint32' : field.type;
- var wireType = types.basic[type];
- var ref = message[field.name];
- //此处增加枚举型替换,有可能外界传入的枚举是string,转换成number
- if(field.resolvedType instanceof Enum && typeof ref === 'string'){
- ref = _types[index]['values'][ref];
- }
-
- //正式进行序列化
- if (field.map) {//有待验证
- if(ref != null && message.hasOwnProperty(field.name)){
- for (var ks =Object.keys(ref), l = 0; l < ks.length; ++l){
- writer.uint32((field.id << 3 | 2) >>> 0).fork().uint32(8 | types.mapKey[field.keyType])[field.keyType](ks[l]);
- if(wireType === undefined ){
- _types[index].encode(ref[ks[l]], writer.uint32(18).fork()).ldelim().ldelim();
- }else {
- writer.uint32(16 | wireType)[type](ref[ks[l]]).ldelim();
- }
- }
- }
- } else if (field.repeated) {
- if (ref && ref.length) {
- if (field.packed && types.packed[type] !== undefined) {//如果数据可以被packed的话
- writer.uint32((field.id << 3 | 2) >>> 0).fork();
- for (var j = 0; j < ref.length; j++) {
- writer[type](ref[j])
- }
- writer.ldelim();
- } else {//数据不能packed的话
- for (var k = 0; k < ref.length; k++) {
- if (wireType === undefined) {//如果是一个自定义的数据类型
- if(field.resolvedType.group){
- _types[index].encode(ref[k],writer.uint32((field.id << 3 | 3) >>> 0)).uint32((field.id << 3 | 4) >>> 0);
- }else {
- _types[index].encode(ref[k],writer.uint32((field.id << 3 | 2) >>> 0).fork()).ldelim();
- }
- } else {//如果是string 或者 bytes
- writer.uint32((field.id << 3 | wireType) >>> 0)[type](ref[k]);
- }
- }
- }
- }
- } else {
- if(!field.optional || (ref != null && (message.hasOwnProperty(field.name) /*|| field.partOf*/))){
- if(!field.optional && (ref == null || !message.hasOwnProperty(field.name))){
- console.warn('注意啦!!!很大概率会报错 类型:',message.$type ? message.$type.name : "不晓得",'没有设置对应的属性:',field.name,'检查是不是proto文件属性设置为了required');
- }
- if(wireType === undefined){
- if(field.resolvedType.group){
- _types[index].encode(ref,writer.uint32((field.id << 3 | 3) >>> 0)).uint32((field.id << 3 | 4) >>> 0);
- }else {
- _types[index].encode(ref,writer.uint32((field.id << 3 | 2) >>> 0).fork()).ldelim();
- }
- }else {
- writer.uint32((field.id << 3 | wireType) >>> 0)[type](ref);
- }
- }
- }
- }
- return writer;
- }
- };
-}
-
-module.exports = encoder;
-
-encoder._configure = function (){
- Enum = require("./enum");
- types = require("./types");
-};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/enum.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/enum.js
deleted file mode 100644
index f9c4ceb8..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/enum.js
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/12.
- */
-
-module.exports = Enum;
-
-var ReflectionObject = require("./object");
-
-((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum";
-var Namespace = require("./namespace");
-
-function Enum(name, values, options, comment, comments) {
- ReflectionObject.call(this, name, options);
-
- if (values && typeof values !== "object")
- throw TypeError("values must be an object");
-
- /**
- * Enum values by id.
- * @type {Object.}
- */
- this.valuesById = {};
-
- /**
- * Enum values by name.
- * @type {Object.}
- */
- this.values = Object.create(this.valuesById); // toJSON, marker
-
- /**
- * Enum comment text.
- * @type {string|null}
- */
- this.comment = comment;
-
- /**
- * Value comment texts, if any.
- * @type {Object.}
- */
- this.comments = comments || {};
-
- /**
- * Reserved ranges, if any.
- * @type {Array.}
- */
- this.reserved = undefined; // toJSON
-
- // Note that values inherit valuesById on their prototype which makes them a TypeScript-
- // compatible enum. This is used by pbts to write actual enum definitions that work for
- // static and reflection code alike instead of emitting generic object definitions.
-
- if (values)
- for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)
- if (typeof values[keys[i]] === "number") // use forward entries only
- this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];
-}
-
-/**
- * Enum descriptor.
- * @interface IEnum
- * @property {Object.} values Enum values
- * @property {Object.} [options] Enum options
- */
-
-/**
- * Constructs an enum from an enum descriptor.
- * @param {string} name Enum name
- * @param {IEnum} json Enum descriptor
- * @returns {Enum} Created enum
- * @throws {TypeError} If arguments are invalid
- */
-Enum.fromJSON = function fromJSON(name, json) {
- var enm = new Enum(name, json.values, json.options, json.comment, json.comments);
- enm.reserved = json.reserved;
- return enm;
-};
-
-/**
- * Converts this enum to an enum descriptor.
- * @param {IToJSONOptions} [toJSONOptions] JSON conversion options
- * @returns {IEnum} Enum descriptor
- */
-Enum.prototype.toJSON = function toJSON(toJSONOptions) {
- var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
- return util.toObject([
- "options" , this.options,
- "values" , this.values,
- "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined,
- "comment" , keepComments ? this.comment : undefined,
- "comments" , keepComments ? this.comments : undefined
- ]);
-};
-
-/**
- * Adds a value to this enum.
- * @param {string} name Value name
- * @param {number} id Value id
- * @param {string} [comment] Comment, if any
- * @returns {Enum} `this`
- * @throws {TypeError} If arguments are invalid
- * @throws {Error} If there is already a value with this name or id
- */
-Enum.prototype.add = function add(name, id, comment) {
- // utilized by the parser but not by .fromJSON
-
- if (!util.isString(name))
- throw TypeError("name must be a string");
-
- if (!util.isInteger(id))
- throw TypeError("id must be an integer");
-
- if (this.values[name] !== undefined)
- throw Error("duplicate name '" + name + "' in " + this);
-
- if (this.isReservedId(id))
- throw Error("id " + id + " is reserved in " + this);
-
- if (this.isReservedName(name))
- throw Error("name '" + name + "' is reserved in " + this);
-
- if (this.valuesById[id] !== undefined) {
- if (!(this.options && this.options.allow_alias))
- throw Error("duplicate id " + id + " in " + this);
- this.values[name] = id;
- } else
- this.valuesById[this.values[name] = id] = name;
-
- this.comments[name] = comment || null;
- return this;
-};
-
-/**
- * Removes a value from this enum
- * @param {string} name Value name
- * @returns {Enum} `this`
- * @throws {TypeError} If arguments are invalid
- * @throws {Error} If `name` is not a name of this enum
- */
-Enum.prototype.remove = function remove(name) {
-
- if (!util.isString(name))
- throw TypeError("name must be a string");
-
- var val = this.values[name];
- if (val == null)
- throw Error("name '" + name + "' does not exist in " + this);
-
- delete this.valuesById[val];
- delete this.values[name];
- delete this.comments[name];
-
- return this;
-};
-
-/**
- * Tests if the specified id is reserved.
- * @param {number} id Id to test
- * @returns {boolean} `true` if reserved, otherwise `false`
- */
-Enum.prototype.isReservedId = function isReservedId(id) {
- return Namespace.isReservedId(this.reserved, id);
-};
-
-/**
- * Tests if the specified name is reserved.
- * @param {string} name Name to test
- * @returns {boolean} `true` if reserved, otherwise `false`
- */
-Enum.prototype.isReservedName = function isReservedName(name) {
- return Namespace.isReservedName(this.reserved, name);
-};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/field.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/field.js
deleted file mode 100644
index 8de03d6a..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/field.js
+++ /dev/null
@@ -1,377 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/12.
- */
-
-module.exports = Field;
-
-// extends ReflectionObject
-var ReflectionObject = require("./object");
-((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field";
-
-var Enum,
- types,
- util;
-
-var Type; // cyclic
-
-var ruleRe = /^required|optional|repeated$/;
-
-/**
- * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.
- * @name Field
- * @classdesc Reflected message field.
- * @extends FieldBase
- * @constructor
- * @param {string} name Unique name within its namespace
- * @param {number} id Unique id within its namespace
- * @param {string} type Value type
- * @param {string|Object.} [rule="optional"] Field rule
- * @param {string|Object.} [extend] Extended type if different from parent
- * @param {Object.} [options] Declared options
- */
-
-/**
- * Constructs a field from a field descriptor.
- * @param {string} name Field name
- * @param {IField} json Field descriptor
- * @returns {Field} Created field
- * @throws {TypeError} If arguments are invalid
- */
-Field.fromJSON = function fromJSON(name, json) {
- return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);
-};
-
-/**
- * Not an actual constructor. Use {@link Field} instead.
- * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.
- * @exports FieldBase
- * @extends ReflectionObject
- * @constructor
- * @param {string} name Unique name within its namespace
- * @param {number} id Unique id within its namespace
- * @param {string} type Value type
- * @param {string|Object.} [rule="optional"] Field rule
- * @param {string|Object.} [extend] Extended type if different from parent
- * @param {Object.} [options] Declared options
- * @param {string} [comment] Comment associated with this field
- */
-function Field(name, id, type, rule, extend, options, comment) {
-
- if (util.isObject(rule)) {
- comment = extend;
- options = rule;
- rule = extend = undefined;
- } else if (util.isObject(extend)) {
- comment = options;
- options = extend;
- extend = undefined;
- }
-
- ReflectionObject.call(this, name, options);
-
- if (!util.isInteger(id) || id < 0)
- throw TypeError("id must be a non-negative integer");
-
- if (!util.isString(type))
- throw TypeError("type must be a string");
-
- if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))
- throw TypeError("rule must be a string rule");
-
- if (extend !== undefined && !util.isString(extend))
- throw TypeError("extend must be a string");
-
- /**
- * Field rule, if any.
- * @type {string|undefined}
- */
- this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON
-
- /**
- * Field type.
- * @type {string}
- */
- this.type = type; // toJSON
-
- /**
- * Unique field id.
- * @type {number}
- */
- this.id = id; // toJSON, marker
-
- /**
- * Extended type if different from parent.
- * @type {string|undefined}
- */
- this.extend = extend || undefined; // toJSON
-
- /**
- * Whether this field is required.
- * @type {boolean}
- */
- this.required = rule === "required";
-
- /**
- * Whether this field is optional.
- * @type {boolean}
- */
- this.optional = !this.required;
-
- /**
- * Whether this field is repeated.
- * @type {boolean}
- */
- this.repeated = rule === "repeated";
-
- /**
- * Whether this field is a map or not.
- * @type {boolean}
- */
- this.map = false;
-
- /**
- * Message this field belongs to.
- * @type {Type|null}
- */
- this.message = null;
-
- /**
- * OneOf this field belongs to, if any,
- * @type {OneOf|null}
- */
- this.partOf = null;
-
- /**
- * The field type's default value.
- * @type {*}
- */
- this.typeDefault = null;
-
- /**
- * The field's default value on prototypes.
- * @type {*}
- */
- this.defaultValue = null;
-
- /**
- * Whether this field's value should be treated as a long.
- * @type {boolean}
- */
- this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;
-
- /**
- * Whether this field's value is a buffer.
- * @type {boolean}
- */
- this.bytes = type === "bytes";
-
- /**
- * Resolved type if not a basic type.
- * @type {Type|Enum|null}
- */
- this.resolvedType = null;
-
- /**
- * Sister-field within the extended type if a declaring extension field.
- * @type {Field|null}
- */
- this.extensionField = null;
-
- /**
- * Sister-field within the declaring namespace if an extended field.
- * @type {Field|null}
- */
- this.declaringField = null;
-
- /**
- * Internally remembers whether this field is packed.
- * @type {boolean|null}
- * @private
- */
- this._packed = null;
-
- /**
- * Comment for this field.
- * @type {string|null}
- */
- this.comment = comment;
-}
-
-/**
- * Determines whether this field is packed. Only relevant when repeated and working with proto2.
- * @name Field#packed
- * @type {boolean}
- * @readonly
- */
-Object.defineProperty(Field.prototype, "packed", {
- get: function() {
- // defaults to packed=true if not explicity set to false
- if (this._packed === null)
- this._packed = this.getOption("packed") !== false;
- return this._packed;
- }
-});
-
-/**
- * @override
- */
-Field.prototype.setOption = function setOption(name, value, ifNotSet) {
- if (name === "packed") // clear cached before setting
- this._packed = null;
- return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);
-};
-
-/**
- * Field descriptor.
- * @interface IField
- * @property {string} [rule="optional"] Field rule
- * @property {string} type Field type
- * @property {number} id Field id
- * @property {Object.} [options] Field options
- */
-
-/**
- * Extension field descriptor.
- * @interface IExtensionField
- * @extends IField
- * @property {string} extend Extended type
- */
-
-/**
- * Converts this field to a field descriptor.
- * @param {IToJSONOptions} [toJSONOptions] JSON conversion options
- * @returns {IField} Field descriptor
- */
-Field.prototype.toJSON = function toJSON(toJSONOptions) {
- var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
- return util.toObject([
- "rule" , this.rule !== "optional" && this.rule || undefined,
- "type" , this.type,
- "id" , this.id,
- "extend" , this.extend,
- "options" , this.options,
- "comment" , keepComments ? this.comment : undefined
- ]);
-};
-
-/**
- * Resolves this field's type references.
- * @returns {Field} `this`
- * @throws {Error} If any reference cannot be resolved
- */
-Field.prototype.resolve = function resolve() {
-
- if (this.resolved)
- return this;
-
- if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it
- this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);
- if (this.resolvedType instanceof Type)
- this.typeDefault = null;
- else // instanceof Enum
- this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined
- }
-
- // use explicitly set default value if present
- if (this.options && this.options["default"] != null) {
- this.typeDefault = this.options["default"];
- if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string")
- this.typeDefault = this.resolvedType.values[this.typeDefault];
- }
-
- // remove unnecessary options
- if (this.options) {
- if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))
- delete this.options.packed;
- if (!Object.keys(this.options).length)
- this.options = undefined;
- }
-
- // convert to internal data type if necesssary
- if (this.long) {
- this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u");
-
- /* istanbul ignore else */
- if (Object.freeze)
- Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)
-
- } else if (this.bytes && typeof this.typeDefault === "string") {
- var buf;
- //if (util.base64.test(this.typeDefault))
- // util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);
- //else
- util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);
- this.typeDefault = buf;
- }
-
- // take special care of maps and repeated fields
- if (this.map)
- this.defaultValue = util.emptyObject;
- else if (this.repeated)
- this.defaultValue = util.emptyArray;
- else
- this.defaultValue = this.typeDefault;
-
- // ensure proper value on prototype
- if (this.parent instanceof Type) {
- this.parent.ctor.prototype[this.name] = this.defaultValue;
- }
- return ReflectionObject.prototype.resolve.call(this);
-};
-
-/**
- * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).
- * @typedef FieldDecorator
- * @type {function}
- * @param {Object} prototype Target prototype
- * @param {string} fieldName Field name
- * @returns {undefined}
- */
-
-/**
- * Field decorator (TypeScript).
- * @name Field.d
- * @function
- * @param {number} fieldId Field id
- * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type
- * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule
- * @param {T} [defaultValue] Default value
- * @returns {FieldDecorator} Decorator function
- * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]
- */
-Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {
-
- // submessage: decorate the submessage and use its name as the type
- if (typeof fieldType === "function")
- fieldType = util.decorateType(fieldType).name;
-
- // enum reference: create a reflected copy of the enum and keep reuseing it
- else if (fieldType && typeof fieldType === "object")
- fieldType = util.decorateEnum(fieldType).name;
-
- return function fieldDecorator(prototype, fieldName) {
- util.decorateType(prototype.constructor)
- .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue }));
- };
-};
-
-/**
- * Field decorator (TypeScript).
- * @name Field.d
- * @function
- * @param {number} fieldId Field id
- * @param {Constructor|string} fieldType Field type
- * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule
- * @returns {FieldDecorator} Decorator function
- * @template T extends Message
- * @variation 2
- */
-// like Field.d but without a default value
-
-Field._configure = function configure() {
- Type = require('./type');
-
- Enum = require("./enum");
- types = require("./types");
- util = require("./util");
-};
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/float.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/float.js
deleted file mode 100644
index 3eabfe0e..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/float.js
+++ /dev/null
@@ -1,333 +0,0 @@
-module.exports = factory(factory);
-
-/**
- * Reads / writes floats / doubles from / to buffers.
- * @name util.float
- * @namespace
- */
-
-/**
- * Writes a 32 bit float to a buffer using little endian byte order.
- * @name util.float.writeFloatLE
- * @function
- * @param {number} val Value to write
- * @param {Uint8Array} buf Target buffer
- * @param {number} pos Target buffer offset
- * @returns {undefined}
- */
-
-/**
- * Writes a 32 bit float to a buffer using big endian byte order.
- * @name util.float.writeFloatBE
- * @function
- * @param {number} val Value to write
- * @param {Uint8Array} buf Target buffer
- * @param {number} pos Target buffer offset
- * @returns {undefined}
- */
-
-/**
- * Reads a 32 bit float from a buffer using little endian byte order.
- * @name util.float.readFloatLE
- * @function
- * @param {Uint8Array} buf Source buffer
- * @param {number} pos Source buffer offset
- * @returns {number} Value read
- */
-
-/**
- * Reads a 32 bit float from a buffer using big endian byte order.
- * @name util.float.readFloatBE
- * @function
- * @param {Uint8Array} buf Source buffer
- * @param {number} pos Source buffer offset
- * @returns {number} Value read
- */
-
-/**
- * Writes a 64 bit double to a buffer using little endian byte order.
- * @name util.float.writeDoubleLE
- * @function
- * @param {number} val Value to write
- * @param {Uint8Array} buf Target buffer
- * @param {number} pos Target buffer offset
- * @returns {undefined}
- */
-
-/**
- * Writes a 64 bit double to a buffer using big endian byte order.
- * @name util.float.writeDoubleBE
- * @function
- * @param {number} val Value to write
- * @param {Uint8Array} buf Target buffer
- * @param {number} pos Target buffer offset
- * @returns {undefined}
- */
-
-/**
- * Reads a 64 bit double from a buffer using little endian byte order.
- * @name util.float.readDoubleLE
- * @function
- * @param {Uint8Array} buf Source buffer
- * @param {number} pos Source buffer offset
- * @returns {number} Value read
- */
-
-/**
- * Reads a 64 bit double from a buffer using big endian byte order.
- * @name util.float.readDoubleBE
- * @function
- * @param {Uint8Array} buf Source buffer
- * @param {number} pos Source buffer offset
- * @returns {number} Value read
- */
-
-// Factory function for the purpose of node-based testing in modified global environments
-function factory(exports) {
-
- // float: typed array
- if (typeof Float32Array !== "undefined") (function() {
-
- var f32 = new Float32Array([ -0 ]),
- f8b = new Uint8Array(f32.buffer),
- le = f8b[3] === 128;
-
- function writeFloat_f32_cpy(val, buf, pos) {
- f32[0] = val;
- buf[pos ] = f8b[0];
- buf[pos + 1] = f8b[1];
- buf[pos + 2] = f8b[2];
- buf[pos + 3] = f8b[3];
- }
-
- function writeFloat_f32_rev(val, buf, pos) {
- f32[0] = val;
- buf[pos ] = f8b[3];
- buf[pos + 1] = f8b[2];
- buf[pos + 2] = f8b[1];
- buf[pos + 3] = f8b[0];
- }
-
- /* istanbul ignore next */
- exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;
- /* istanbul ignore next */
- exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;
-
- function readFloat_f32_cpy(buf, pos) {
- f8b[0] = buf[pos ];
- f8b[1] = buf[pos + 1];
- f8b[2] = buf[pos + 2];
- f8b[3] = buf[pos + 3];
- return f32[0];
- }
-
- function readFloat_f32_rev(buf, pos) {
- f8b[3] = buf[pos ];
- f8b[2] = buf[pos + 1];
- f8b[1] = buf[pos + 2];
- f8b[0] = buf[pos + 3];
- return f32[0];
- }
-
- /* istanbul ignore next */
- exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;
- /* istanbul ignore next */
- exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;
-
- // float: ieee754
- })(); else (function() {
-
- function writeFloat_ieee754(writeUint, val, buf, pos) {
- var sign = val < 0 ? 1 : 0;
- if (sign)
- val = -val;
- if (val === 0)
- writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);
- else if (isNaN(val))
- writeUint(2143289344, buf, pos);
- else if (val > 3.4028234663852886e+38) // +-Infinity
- writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);
- else if (val < 1.1754943508222875e-38) // denormal
- writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);
- else {
- var exponent = Math.floor(Math.log(val) / Math.LN2),
- mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;
- writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);
- }
- }
-
- exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);
- exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);
-
- function readFloat_ieee754(readUint, buf, pos) {
- var uint = readUint(buf, pos),
- sign = (uint >> 31) * 2 + 1,
- exponent = uint >>> 23 & 255,
- mantissa = uint & 8388607;
- return exponent === 255
- ? mantissa
- ? NaN
- : sign * Infinity
- : exponent === 0 // denormal
- ? sign * 1.401298464324817e-45 * mantissa
- : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);
- }
-
- exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);
- exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);
-
- })();
-
- // double: typed array
- if (typeof Float64Array !== "undefined") (function() {
-
- var f64 = new Float64Array([-0]),
- f8b = new Uint8Array(f64.buffer),
- le = f8b[7] === 128;
-
- function writeDouble_f64_cpy(val, buf, pos) {
- f64[0] = val;
- buf[pos ] = f8b[0];
- buf[pos + 1] = f8b[1];
- buf[pos + 2] = f8b[2];
- buf[pos + 3] = f8b[3];
- buf[pos + 4] = f8b[4];
- buf[pos + 5] = f8b[5];
- buf[pos + 6] = f8b[6];
- buf[pos + 7] = f8b[7];
- }
-
- function writeDouble_f64_rev(val, buf, pos) {
- f64[0] = val;
- buf[pos ] = f8b[7];
- buf[pos + 1] = f8b[6];
- buf[pos + 2] = f8b[5];
- buf[pos + 3] = f8b[4];
- buf[pos + 4] = f8b[3];
- buf[pos + 5] = f8b[2];
- buf[pos + 6] = f8b[1];
- buf[pos + 7] = f8b[0];
- }
-
- /* istanbul ignore next */
- exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;
- /* istanbul ignore next */
- exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;
-
- function readDouble_f64_cpy(buf, pos) {
- f8b[0] = buf[pos ];
- f8b[1] = buf[pos + 1];
- f8b[2] = buf[pos + 2];
- f8b[3] = buf[pos + 3];
- f8b[4] = buf[pos + 4];
- f8b[5] = buf[pos + 5];
- f8b[6] = buf[pos + 6];
- f8b[7] = buf[pos + 7];
- return f64[0];
- }
-
- function readDouble_f64_rev(buf, pos) {
- f8b[7] = buf[pos ];
- f8b[6] = buf[pos + 1];
- f8b[5] = buf[pos + 2];
- f8b[4] = buf[pos + 3];
- f8b[3] = buf[pos + 4];
- f8b[2] = buf[pos + 5];
- f8b[1] = buf[pos + 6];
- f8b[0] = buf[pos + 7];
- return f64[0];
- }
-
- /* istanbul ignore next */
- exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;
- /* istanbul ignore next */
- exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;
-
- // double: ieee754
- })(); else (function() {
-
- function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {
- var sign = val < 0 ? 1 : 0;
- if (sign)
- val = -val;
- if (val === 0) {
- writeUint(0, buf, pos + off0);
- writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);
- } else if (isNaN(val)) {
- writeUint(0, buf, pos + off0);
- writeUint(2146959360, buf, pos + off1);
- } else if (val > 1.7976931348623157e+308) { // +-Infinity
- writeUint(0, buf, pos + off0);
- writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);
- } else {
- var mantissa;
- if (val < 2.2250738585072014e-308) { // denormal
- mantissa = val / 5e-324;
- writeUint(mantissa >>> 0, buf, pos + off0);
- writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);
- } else {
- var exponent = Math.floor(Math.log(val) / Math.LN2);
- if (exponent === 1024)
- exponent = 1023;
- mantissa = val * Math.pow(2, -exponent);
- writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);
- writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);
- }
- }
- }
-
- exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);
- exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);
-
- function readDouble_ieee754(readUint, off0, off1, buf, pos) {
- var lo = readUint(buf, pos + off0),
- hi = readUint(buf, pos + off1);
- var sign = (hi >> 31) * 2 + 1,
- exponent = hi >>> 20 & 2047,
- mantissa = 4294967296 * (hi & 1048575) + lo;
- return exponent === 2047
- ? mantissa
- ? NaN
- : sign * Infinity
- : exponent === 0 // denormal
- ? sign * 5e-324 * mantissa
- : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);
- }
-
- exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);
- exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);
-
- })();
-
- return exports;
-}
-
-// uint helpers
-
-function writeUintLE(val, buf, pos) {
- buf[pos ] = val & 255;
- buf[pos + 1] = val >>> 8 & 255;
- buf[pos + 2] = val >>> 16 & 255;
- buf[pos + 3] = val >>> 24;
-}
-
-function writeUintBE(val, buf, pos) {
- buf[pos ] = val >>> 24;
- buf[pos + 1] = val >>> 16 & 255;
- buf[pos + 2] = val >>> 8 & 255;
- buf[pos + 3] = val & 255;
-}
-
-function readUintLE(buf, pos) {
- return (buf[pos ]
- | buf[pos + 1] << 8
- | buf[pos + 2] << 16
- | buf[pos + 3] << 24) >>> 0;
-}
-
-function readUintBE(buf, pos) {
- return (buf[pos ] << 24
- | buf[pos + 1] << 16
- | buf[pos + 2] << 8
- | buf[pos + 3]) >>> 0;
-}
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/inquire.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/inquire.js
deleted file mode 100644
index 22425ec4..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/inquire.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/14.
- */
-module.exports = inquire;
-
-/**
- * Requires a module only if available.
- * @memberof util
- * @param {string} moduleName Module to require
- * @returns {?Object} Required module if available and not empty, otherwise `null`
- */
-const app = getApp();
-app.globalData.pbModuleMap = app.globalData.pbModuleMap || {};
-function inquire(moduleName) {
- var moduleMap = app.globalData.pbModuleMap;
- var arr = moduleName.split('/');
- var name = arr[arr.length -1];
- if(typeof moduleMap[name] != 'undefined')
- {
- return moduleMap[name];
- }
-
- try {
- var mod = require(moduleName);
- if (mod) {
- moduleMap[name] = mod;
- return mod;
- }
- else {
- console.log('没有加载到该模块')
- }
- } catch (e) {} // eslint-disable-line no-empty
- return null;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/long.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/long.js
deleted file mode 100644
index 7a769e2f..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/long.js
+++ /dev/null
@@ -1,1323 +0,0 @@
-module.exports = Long;
-
-/**
- * wasm optimizations, to do native i64 multiplication and divide
- */
-var wasm = null;
-
-try {
- wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([
- 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11
- ])), {}).exports;
-} catch (e) {
- // no wasm support :(
-}
-
-/**
- * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.
- * See the from* functions below for more convenient ways of constructing Longs.
- * @exports Long
- * @class A Long class for representing a 64 bit two's-complement integer value.
- * @param {number} low The low (signed) 32 bits of the long
- * @param {number} high The high (signed) 32 bits of the long
- * @param {boolean=} unsigned Whether unsigned or not, defaults to signed
- * @constructor
- */
-function Long(low, high, unsigned) {
-
- /**
- * The low 32 bits as a signed value.
- * @type {number}
- */
- this.low = low | 0;
-
- /**
- * The high 32 bits as a signed value.
- * @type {number}
- */
- this.high = high | 0;
-
- /**
- * Whether unsigned or not.
- * @type {boolean}
- */
- this.unsigned = !!unsigned;
-}
-
-// The internal representation of a long is the two given signed, 32-bit values.
-// We use 32-bit pieces because these are the size of integers on which
-// Javascript performs bit-operations. For operations like addition and
-// multiplication, we split each number into 16 bit pieces, which can easily be
-// multiplied within Javascript's floating-point representation without overflow
-// or change in sign.
-//
-// In the algorithms below, we frequently reduce the negative case to the
-// positive case by negating the input(s) and then post-processing the result.
-// Note that we must ALWAYS check specially whether those values are MIN_VALUE
-// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
-// a positive number, it overflows back into a negative). Not handling this
-// case would often result in infinite recursion.
-//
-// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*
-// methods on which they depend.
-
-/**
- * An indicator used to reliably determine if an object is a Long or not.
- * @type {boolean}
- * @const
- * @private
- */
-Long.prototype.__isLong__;
-
-Object.defineProperty(Long.prototype, "__isLong__", { value: true });
-
-/**
- * @function
- * @param {*} obj Object
- * @returns {boolean}
- * @inner
- */
-function isLong(obj) {
- return (obj && obj["__isLong__"]) === true;
-}
-
-/**
- * Tests if the specified object is a Long.
- * @function
- * @param {*} obj Object
- * @returns {boolean}
- */
-Long.isLong = isLong;
-
-/**
- * A cache of the Long representations of small integer values.
- * @type {!Object}
- * @inner
- */
-var INT_CACHE = {};
-
-/**
- * A cache of the Long representations of small unsigned integer values.
- * @type {!Object}
- * @inner
- */
-var UINT_CACHE = {};
-
-/**
- * @param {number} value
- * @param {boolean=} unsigned
- * @returns {!Long}
- * @inner
- */
-function fromInt(value, unsigned) {
- var obj, cachedObj, cache;
- if (unsigned) {
- value >>>= 0;
- if (cache = (0 <= value && value < 256)) {
- cachedObj = UINT_CACHE[value];
- if (cachedObj)
- return cachedObj;
- }
- obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);
- if (cache)
- UINT_CACHE[value] = obj;
- return obj;
- } else {
- value |= 0;
- if (cache = (-128 <= value && value < 128)) {
- cachedObj = INT_CACHE[value];
- if (cachedObj)
- return cachedObj;
- }
- obj = fromBits(value, value < 0 ? -1 : 0, false);
- if (cache)
- INT_CACHE[value] = obj;
- return obj;
- }
-}
-
-/**
- * Returns a Long representing the given 32 bit integer value.
- * @function
- * @param {number} value The 32 bit integer in question
- * @param {boolean=} unsigned Whether unsigned or not, defaults to signed
- * @returns {!Long} The corresponding Long value
- */
-Long.fromInt = fromInt;
-
-/**
- * @param {number} value
- * @param {boolean=} unsigned
- * @returns {!Long}
- * @inner
- */
-function fromNumber(value, unsigned) {
- if (isNaN(value))
- return unsigned ? UZERO : ZERO;
- if (unsigned) {
- if (value < 0)
- return UZERO;
- if (value >= TWO_PWR_64_DBL)
- return MAX_UNSIGNED_VALUE;
- } else {
- if (value <= -TWO_PWR_63_DBL)
- return MIN_VALUE;
- if (value + 1 >= TWO_PWR_63_DBL)
- return MAX_VALUE;
- }
- if (value < 0)
- return fromNumber(-value, unsigned).neg();
- return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);
-}
-
-/**
- * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
- * @function
- * @param {number} value The number in question
- * @param {boolean=} unsigned Whether unsigned or not, defaults to signed
- * @returns {!Long} The corresponding Long value
- */
-Long.fromNumber = fromNumber;
-
-/**
- * @param {number} lowBits
- * @param {number} highBits
- * @param {boolean=} unsigned
- * @returns {!Long}
- * @inner
- */
-function fromBits(lowBits, highBits, unsigned) {
- return new Long(lowBits, highBits, unsigned);
-}
-
-/**
- * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is
- * assumed to use 32 bits.
- * @function
- * @param {number} lowBits The low 32 bits
- * @param {number} highBits The high 32 bits
- * @param {boolean=} unsigned Whether unsigned or not, defaults to signed
- * @returns {!Long} The corresponding Long value
- */
-Long.fromBits = fromBits;
-
-/**
- * @function
- * @param {number} base
- * @param {number} exponent
- * @returns {number}
- * @inner
- */
-var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)
-
-/**
- * @param {string} str
- * @param {(boolean|number)=} unsigned
- * @param {number=} radix
- * @returns {!Long}
- * @inner
- */
-function fromString(str, unsigned, radix) {
- if (str.length === 0)
- throw Error('empty string');
- if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity")
- return ZERO;
- if (typeof unsigned === 'number') {
- // For goog.math.long compatibility
- radix = unsigned,
- unsigned = false;
- } else {
- unsigned = !! unsigned;
- }
- radix = radix || 10;
- if (radix < 2 || 36 < radix)
- throw RangeError('radix');
-
- var p;
- if ((p = str.indexOf('-')) > 0)
- throw Error('interior hyphen');
- else if (p === 0) {
- return fromString(str.substring(1), unsigned, radix).neg();
- }
-
- // Do several (8) digits each time through the loop, so as to
- // minimize the calls to the very expensive emulated div.
- var radixToPower = fromNumber(pow_dbl(radix, 8));
-
- var result = ZERO;
- for (var i = 0; i < str.length; i += 8) {
- var size = Math.min(8, str.length - i),
- value = parseInt(str.substring(i, i + size), radix);
- if (size < 8) {
- var power = fromNumber(pow_dbl(radix, size));
- result = result.mul(power).add(fromNumber(value));
- } else {
- result = result.mul(radixToPower);
- result = result.add(fromNumber(value));
- }
- }
- result.unsigned = unsigned;
- return result;
-}
-
-/**
- * Returns a Long representation of the given string, written using the specified radix.
- * @function
- * @param {string} str The textual representation of the Long
- * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed
- * @param {number=} radix The radix in which the text is written (2-36), defaults to 10
- * @returns {!Long} The corresponding Long value
- */
-Long.fromString = fromString;
-
-/**
- * @function
- * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val
- * @param {boolean=} unsigned
- * @returns {!Long}
- * @inner
- */
-function fromValue(val, unsigned) {
- if (typeof val === 'number')
- return fromNumber(val, unsigned);
- if (typeof val === 'string')
- return fromString(val, unsigned);
- // Throws for non-objects, converts non-instanceof Long:
- return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);
-}
-
-/**
- * Converts the specified value to a Long using the appropriate from* function for its type.
- * @function
- * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value
- * @param {boolean=} unsigned Whether unsigned or not, defaults to signed
- * @returns {!Long}
- */
-Long.fromValue = fromValue;
-
-// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be
-// no runtime penalty for these.
-
-/**
- * @type {number}
- * @const
- * @inner
- */
-var TWO_PWR_16_DBL = 1 << 16;
-
-/**
- * @type {number}
- * @const
- * @inner
- */
-var TWO_PWR_24_DBL = 1 << 24;
-
-/**
- * @type {number}
- * @const
- * @inner
- */
-var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;
-
-/**
- * @type {number}
- * @const
- * @inner
- */
-var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;
-
-/**
- * @type {number}
- * @const
- * @inner
- */
-var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;
-
-/**
- * @type {!Long}
- * @const
- * @inner
- */
-var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);
-
-/**
- * @type {!Long}
- * @inner
- */
-var ZERO = fromInt(0);
-
-/**
- * Signed zero.
- * @type {!Long}
- */
-Long.ZERO = ZERO;
-
-/**
- * @type {!Long}
- * @inner
- */
-var UZERO = fromInt(0, true);
-
-/**
- * Unsigned zero.
- * @type {!Long}
- */
-Long.UZERO = UZERO;
-
-/**
- * @type {!Long}
- * @inner
- */
-var ONE = fromInt(1);
-
-/**
- * Signed one.
- * @type {!Long}
- */
-Long.ONE = ONE;
-
-/**
- * @type {!Long}
- * @inner
- */
-var UONE = fromInt(1, true);
-
-/**
- * Unsigned one.
- * @type {!Long}
- */
-Long.UONE = UONE;
-
-/**
- * @type {!Long}
- * @inner
- */
-var NEG_ONE = fromInt(-1);
-
-/**
- * Signed negative one.
- * @type {!Long}
- */
-Long.NEG_ONE = NEG_ONE;
-
-/**
- * @type {!Long}
- * @inner
- */
-var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);
-
-/**
- * Maximum signed value.
- * @type {!Long}
- */
-Long.MAX_VALUE = MAX_VALUE;
-
-/**
- * @type {!Long}
- * @inner
- */
-var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);
-
-/**
- * Maximum unsigned value.
- * @type {!Long}
- */
-Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;
-
-/**
- * @type {!Long}
- * @inner
- */
-var MIN_VALUE = fromBits(0, 0x80000000|0, false);
-
-/**
- * Minimum signed value.
- * @type {!Long}
- */
-Long.MIN_VALUE = MIN_VALUE;
-
-/**
- * @alias Long.prototype
- * @inner
- */
-var LongPrototype = Long.prototype;
-
-/**
- * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.
- * @returns {number}
- */
-LongPrototype.toInt = function toInt() {
- return this.unsigned ? this.low >>> 0 : this.low;
-};
-
-/**
- * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).
- * @returns {number}
- */
-LongPrototype.toNumber = function toNumber() {
- if (this.unsigned)
- return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);
- return this.high * TWO_PWR_32_DBL + (this.low >>> 0);
-};
-
-/**
- * Converts the Long to a string written in the specified radix.
- * @param {number=} radix Radix (2-36), defaults to 10
- * @returns {string}
- * @override
- * @throws {RangeError} If `radix` is out of range
- */
-LongPrototype.toString = function toString(radix) {
- radix = radix || 10;
- if (radix < 2 || 36 < radix)
- throw RangeError('radix');
- if (this.isZero())
- return '0';
- if (this.isNegative()) { // Unsigned Longs are never negative
- if (this.eq(MIN_VALUE)) {
- // We need to change the Long value before it can be negated, so we remove
- // the bottom-most digit in this base and then recurse to do the rest.
- var radixLong = fromNumber(radix),
- div = this.div(radixLong),
- rem1 = div.mul(radixLong).sub(this);
- return div.toString(radix) + rem1.toInt().toString(radix);
- } else
- return '-' + this.neg().toString(radix);
- }
-
- // Do several (6) digits each time through the loop, so as to
- // minimize the calls to the very expensive emulated div.
- var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),
- rem = this;
- var result = '';
- while (true) {
- var remDiv = rem.div(radixToPower),
- intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,
- digits = intval.toString(radix);
- rem = remDiv;
- if (rem.isZero())
- return digits + result;
- else {
- while (digits.length < 6)
- digits = '0' + digits;
- result = '' + digits + result;
- }
- }
-};
-
-/**
- * Gets the high 32 bits as a signed integer.
- * @returns {number} Signed high bits
- */
-LongPrototype.getHighBits = function getHighBits() {
- return this.high;
-};
-
-/**
- * Gets the high 32 bits as an unsigned integer.
- * @returns {number} Unsigned high bits
- */
-LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {
- return this.high >>> 0;
-};
-
-/**
- * Gets the low 32 bits as a signed integer.
- * @returns {number} Signed low bits
- */
-LongPrototype.getLowBits = function getLowBits() {
- return this.low;
-};
-
-/**
- * Gets the low 32 bits as an unsigned integer.
- * @returns {number} Unsigned low bits
- */
-LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {
- return this.low >>> 0;
-};
-
-/**
- * Gets the number of bits needed to represent the absolute value of this Long.
- * @returns {number}
- */
-LongPrototype.getNumBitsAbs = function getNumBitsAbs() {
- if (this.isNegative()) // Unsigned Longs are never negative
- return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();
- var val = this.high != 0 ? this.high : this.low;
- for (var bit = 31; bit > 0; bit--)
- if ((val & (1 << bit)) != 0)
- break;
- return this.high != 0 ? bit + 33 : bit + 1;
-};
-
-/**
- * Tests if this Long's value equals zero.
- * @returns {boolean}
- */
-LongPrototype.isZero = function isZero() {
- return this.high === 0 && this.low === 0;
-};
-
-/**
- * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.
- * @returns {boolean}
- */
-LongPrototype.eqz = LongPrototype.isZero;
-
-/**
- * Tests if this Long's value is negative.
- * @returns {boolean}
- */
-LongPrototype.isNegative = function isNegative() {
- return !this.unsigned && this.high < 0;
-};
-
-/**
- * Tests if this Long's value is positive.
- * @returns {boolean}
- */
-LongPrototype.isPositive = function isPositive() {
- return this.unsigned || this.high >= 0;
-};
-
-/**
- * Tests if this Long's value is odd.
- * @returns {boolean}
- */
-LongPrototype.isOdd = function isOdd() {
- return (this.low & 1) === 1;
-};
-
-/**
- * Tests if this Long's value is even.
- * @returns {boolean}
- */
-LongPrototype.isEven = function isEven() {
- return (this.low & 1) === 0;
-};
-
-/**
- * Tests if this Long's value equals the specified's.
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.equals = function equals(other) {
- if (!isLong(other))
- other = fromValue(other);
- if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)
- return false;
- return this.high === other.high && this.low === other.low;
-};
-
-/**
- * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.
- * @function
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.eq = LongPrototype.equals;
-
-/**
- * Tests if this Long's value differs from the specified's.
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.notEquals = function notEquals(other) {
- return !this.eq(/* validates */ other);
-};
-
-/**
- * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.
- * @function
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.neq = LongPrototype.notEquals;
-
-/**
- * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.
- * @function
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.ne = LongPrototype.notEquals;
-
-/**
- * Tests if this Long's value is less than the specified's.
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.lessThan = function lessThan(other) {
- return this.comp(/* validates */ other) < 0;
-};
-
-/**
- * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.
- * @function
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.lt = LongPrototype.lessThan;
-
-/**
- * Tests if this Long's value is less than or equal the specified's.
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {
- return this.comp(/* validates */ other) <= 0;
-};
-
-/**
- * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.
- * @function
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.lte = LongPrototype.lessThanOrEqual;
-
-/**
- * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.
- * @function
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.le = LongPrototype.lessThanOrEqual;
-
-/**
- * Tests if this Long's value is greater than the specified's.
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.greaterThan = function greaterThan(other) {
- return this.comp(/* validates */ other) > 0;
-};
-
-/**
- * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.
- * @function
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.gt = LongPrototype.greaterThan;
-
-/**
- * Tests if this Long's value is greater than or equal the specified's.
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {
- return this.comp(/* validates */ other) >= 0;
-};
-
-/**
- * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.
- * @function
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.gte = LongPrototype.greaterThanOrEqual;
-
-/**
- * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.
- * @function
- * @param {!Long|number|string} other Other value
- * @returns {boolean}
- */
-LongPrototype.ge = LongPrototype.greaterThanOrEqual;
-
-/**
- * Compares this Long's value with the specified's.
- * @param {!Long|number|string} other Other value
- * @returns {number} 0 if they are the same, 1 if the this is greater and -1
- * if the given one is greater
- */
-LongPrototype.compare = function compare(other) {
- if (!isLong(other))
- other = fromValue(other);
- if (this.eq(other))
- return 0;
- var thisNeg = this.isNegative(),
- otherNeg = other.isNegative();
- if (thisNeg && !otherNeg)
- return -1;
- if (!thisNeg && otherNeg)
- return 1;
- // At this point the sign bits are the same
- if (!this.unsigned)
- return this.sub(other).isNegative() ? -1 : 1;
- // Both are positive if at least one is unsigned
- return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;
-};
-
-/**
- * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.
- * @function
- * @param {!Long|number|string} other Other value
- * @returns {number} 0 if they are the same, 1 if the this is greater and -1
- * if the given one is greater
- */
-LongPrototype.comp = LongPrototype.compare;
-
-/**
- * Negates this Long's value.
- * @returns {!Long} Negated Long
- */
-LongPrototype.negate = function negate() {
- if (!this.unsigned && this.eq(MIN_VALUE))
- return MIN_VALUE;
- return this.not().add(ONE);
-};
-
-/**
- * Negates this Long's value. This is an alias of {@link Long#negate}.
- * @function
- * @returns {!Long} Negated Long
- */
-LongPrototype.neg = LongPrototype.negate;
-
-/**
- * Returns the sum of this and the specified Long.
- * @param {!Long|number|string} addend Addend
- * @returns {!Long} Sum
- */
-LongPrototype.add = function add(addend) {
- if (!isLong(addend))
- addend = fromValue(addend);
-
- // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
-
- var a48 = this.high >>> 16;
- var a32 = this.high & 0xFFFF;
- var a16 = this.low >>> 16;
- var a00 = this.low & 0xFFFF;
-
- var b48 = addend.high >>> 16;
- var b32 = addend.high & 0xFFFF;
- var b16 = addend.low >>> 16;
- var b00 = addend.low & 0xFFFF;
-
- var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
- c00 += a00 + b00;
- c16 += c00 >>> 16;
- c00 &= 0xFFFF;
- c16 += a16 + b16;
- c32 += c16 >>> 16;
- c16 &= 0xFFFF;
- c32 += a32 + b32;
- c48 += c32 >>> 16;
- c32 &= 0xFFFF;
- c48 += a48 + b48;
- c48 &= 0xFFFF;
- return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
-};
-
-/**
- * Returns the difference of this and the specified Long.
- * @param {!Long|number|string} subtrahend Subtrahend
- * @returns {!Long} Difference
- */
-LongPrototype.subtract = function subtract(subtrahend) {
- if (!isLong(subtrahend))
- subtrahend = fromValue(subtrahend);
- return this.add(subtrahend.neg());
-};
-
-/**
- * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.
- * @function
- * @param {!Long|number|string} subtrahend Subtrahend
- * @returns {!Long} Difference
- */
-LongPrototype.sub = LongPrototype.subtract;
-
-/**
- * Returns the product of this and the specified Long.
- * @param {!Long|number|string} multiplier Multiplier
- * @returns {!Long} Product
- */
-LongPrototype.multiply = function multiply(multiplier) {
- if (this.isZero())
- return ZERO;
- if (!isLong(multiplier))
- multiplier = fromValue(multiplier);
-
- // use wasm support if present
- if (wasm) {
- var low = wasm.mul(this.low,
- this.high,
- multiplier.low,
- multiplier.high);
- return fromBits(low, wasm.get_high(), this.unsigned);
- }
-
- if (multiplier.isZero())
- return ZERO;
- if (this.eq(MIN_VALUE))
- return multiplier.isOdd() ? MIN_VALUE : ZERO;
- if (multiplier.eq(MIN_VALUE))
- return this.isOdd() ? MIN_VALUE : ZERO;
-
- if (this.isNegative()) {
- if (multiplier.isNegative())
- return this.neg().mul(multiplier.neg());
- else
- return this.neg().mul(multiplier).neg();
- } else if (multiplier.isNegative())
- return this.mul(multiplier.neg()).neg();
-
- // If both longs are small, use float multiplication
- if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))
- return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);
-
- // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.
- // We can skip products that would overflow.
-
- var a48 = this.high >>> 16;
- var a32 = this.high & 0xFFFF;
- var a16 = this.low >>> 16;
- var a00 = this.low & 0xFFFF;
-
- var b48 = multiplier.high >>> 16;
- var b32 = multiplier.high & 0xFFFF;
- var b16 = multiplier.low >>> 16;
- var b00 = multiplier.low & 0xFFFF;
-
- var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
- c00 += a00 * b00;
- c16 += c00 >>> 16;
- c00 &= 0xFFFF;
- c16 += a16 * b00;
- c32 += c16 >>> 16;
- c16 &= 0xFFFF;
- c16 += a00 * b16;
- c32 += c16 >>> 16;
- c16 &= 0xFFFF;
- c32 += a32 * b00;
- c48 += c32 >>> 16;
- c32 &= 0xFFFF;
- c32 += a16 * b16;
- c48 += c32 >>> 16;
- c32 &= 0xFFFF;
- c32 += a00 * b32;
- c48 += c32 >>> 16;
- c32 &= 0xFFFF;
- c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
- c48 &= 0xFFFF;
- return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
-};
-
-/**
- * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.
- * @function
- * @param {!Long|number|string} multiplier Multiplier
- * @returns {!Long} Product
- */
-LongPrototype.mul = LongPrototype.multiply;
-
-/**
- * Returns this Long divided by the specified. The result is signed if this Long is signed or
- * unsigned if this Long is unsigned.
- * @param {!Long|number|string} divisor Divisor
- * @returns {!Long} Quotient
- */
-LongPrototype.divide = function divide(divisor) {
- if (!isLong(divisor))
- divisor = fromValue(divisor);
- if (divisor.isZero())
- throw Error('division by zero');
-
- // use wasm support if present
- if (wasm) {
- // guard against signed division overflow: the largest
- // negative number / -1 would be 1 larger than the largest
- // positive number, due to two's complement.
- if (!this.unsigned &&
- this.high === -0x80000000 &&
- divisor.low === -1 && divisor.high === -1) {
- // be consistent with non-wasm code path
- return this;
- }
- var low = (this.unsigned ? wasm.div_u : wasm.div_s)(
- this.low,
- this.high,
- divisor.low,
- divisor.high
- );
- return fromBits(low, wasm.get_high(), this.unsigned);
- }
-
- if (this.isZero())
- return this.unsigned ? UZERO : ZERO;
- var approx, rem, res;
- if (!this.unsigned) {
- // This section is only relevant for signed longs and is derived from the
- // closure library as a whole.
- if (this.eq(MIN_VALUE)) {
- if (divisor.eq(ONE) || divisor.eq(NEG_ONE))
- return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
- else if (divisor.eq(MIN_VALUE))
- return ONE;
- else {
- // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
- var halfThis = this.shr(1);
- approx = halfThis.div(divisor).shl(1);
- if (approx.eq(ZERO)) {
- return divisor.isNegative() ? ONE : NEG_ONE;
- } else {
- rem = this.sub(divisor.mul(approx));
- res = approx.add(rem.div(divisor));
- return res;
- }
- }
- } else if (divisor.eq(MIN_VALUE))
- return this.unsigned ? UZERO : ZERO;
- if (this.isNegative()) {
- if (divisor.isNegative())
- return this.neg().div(divisor.neg());
- return this.neg().div(divisor).neg();
- } else if (divisor.isNegative())
- return this.div(divisor.neg()).neg();
- res = ZERO;
- } else {
- // The algorithm below has not been made for unsigned longs. It's therefore
- // required to take special care of the MSB prior to running it.
- if (!divisor.unsigned)
- divisor = divisor.toUnsigned();
- if (divisor.gt(this))
- return UZERO;
- if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true
- return UONE;
- res = UZERO;
- }
-
- // Repeat the following until the remainder is less than other: find a
- // floating-point that approximates remainder / other *from below*, add this
- // into the result, and subtract it from the remainder. It is critical that
- // the approximate value is less than or equal to the real value so that the
- // remainder never becomes negative.
- rem = this;
- while (rem.gte(divisor)) {
- // Approximate the result of division. This may be a little greater or
- // smaller than the actual value.
- approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));
-
- // We will tweak the approximate result by changing it in the 48-th digit or
- // the smallest non-fractional digit, whichever is larger.
- var log2 = Math.ceil(Math.log(approx) / Math.LN2),
- delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),
-
- // Decrease the approximation until it is smaller than the remainder. Note
- // that if it is too large, the product overflows and is negative.
- approxRes = fromNumber(approx),
- approxRem = approxRes.mul(divisor);
- while (approxRem.isNegative() || approxRem.gt(rem)) {
- approx -= delta;
- approxRes = fromNumber(approx, this.unsigned);
- approxRem = approxRes.mul(divisor);
- }
-
- // We know the answer can't be zero... and actually, zero would cause
- // infinite recursion since we would make no progress.
- if (approxRes.isZero())
- approxRes = ONE;
-
- res = res.add(approxRes);
- rem = rem.sub(approxRem);
- }
- return res;
-};
-
-/**
- * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.
- * @function
- * @param {!Long|number|string} divisor Divisor
- * @returns {!Long} Quotient
- */
-LongPrototype.div = LongPrototype.divide;
-
-/**
- * Returns this Long modulo the specified.
- * @param {!Long|number|string} divisor Divisor
- * @returns {!Long} Remainder
- */
-LongPrototype.modulo = function modulo(divisor) {
- if (!isLong(divisor))
- divisor = fromValue(divisor);
-
- // use wasm support if present
- if (wasm) {
- var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(
- this.low,
- this.high,
- divisor.low,
- divisor.high
- );
- return fromBits(low, wasm.get_high(), this.unsigned);
- }
-
- return this.sub(this.div(divisor).mul(divisor));
-};
-
-/**
- * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.
- * @function
- * @param {!Long|number|string} divisor Divisor
- * @returns {!Long} Remainder
- */
-LongPrototype.mod = LongPrototype.modulo;
-
-/**
- * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.
- * @function
- * @param {!Long|number|string} divisor Divisor
- * @returns {!Long} Remainder
- */
-LongPrototype.rem = LongPrototype.modulo;
-
-/**
- * Returns the bitwise NOT of this Long.
- * @returns {!Long}
- */
-LongPrototype.not = function not() {
- return fromBits(~this.low, ~this.high, this.unsigned);
-};
-
-/**
- * Returns the bitwise AND of this Long and the specified.
- * @param {!Long|number|string} other Other Long
- * @returns {!Long}
- */
-LongPrototype.and = function and(other) {
- if (!isLong(other))
- other = fromValue(other);
- return fromBits(this.low & other.low, this.high & other.high, this.unsigned);
-};
-
-/**
- * Returns the bitwise OR of this Long and the specified.
- * @param {!Long|number|string} other Other Long
- * @returns {!Long}
- */
-LongPrototype.or = function or(other) {
- if (!isLong(other))
- other = fromValue(other);
- return fromBits(this.low | other.low, this.high | other.high, this.unsigned);
-};
-
-/**
- * Returns the bitwise XOR of this Long and the given one.
- * @param {!Long|number|string} other Other Long
- * @returns {!Long}
- */
-LongPrototype.xor = function xor(other) {
- if (!isLong(other))
- other = fromValue(other);
- return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);
-};
-
-/**
- * Returns this Long with bits shifted to the left by the given amount.
- * @param {number|!Long} numBits Number of bits
- * @returns {!Long} Shifted Long
- */
-LongPrototype.shiftLeft = function shiftLeft(numBits) {
- if (isLong(numBits))
- numBits = numBits.toInt();
- if ((numBits &= 63) === 0)
- return this;
- else if (numBits < 32)
- return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);
- else
- return fromBits(0, this.low << (numBits - 32), this.unsigned);
-};
-
-/**
- * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.
- * @function
- * @param {number|!Long} numBits Number of bits
- * @returns {!Long} Shifted Long
- */
-LongPrototype.shl = LongPrototype.shiftLeft;
-
-/**
- * Returns this Long with bits arithmetically shifted to the right by the given amount.
- * @param {number|!Long} numBits Number of bits
- * @returns {!Long} Shifted Long
- */
-LongPrototype.shiftRight = function shiftRight(numBits) {
- if (isLong(numBits))
- numBits = numBits.toInt();
- if ((numBits &= 63) === 0)
- return this;
- else if (numBits < 32)
- return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);
- else
- return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);
-};
-
-/**
- * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.
- * @function
- * @param {number|!Long} numBits Number of bits
- * @returns {!Long} Shifted Long
- */
-LongPrototype.shr = LongPrototype.shiftRight;
-
-/**
- * Returns this Long with bits logically shifted to the right by the given amount.
- * @param {number|!Long} numBits Number of bits
- * @returns {!Long} Shifted Long
- */
-LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {
- if (isLong(numBits))
- numBits = numBits.toInt();
- numBits &= 63;
- if (numBits === 0)
- return this;
- else {
- var high = this.high;
- if (numBits < 32) {
- var low = this.low;
- return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);
- } else if (numBits === 32)
- return fromBits(high, 0, this.unsigned);
- else
- return fromBits(high >>> (numBits - 32), 0, this.unsigned);
- }
-};
-
-/**
- * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.
- * @function
- * @param {number|!Long} numBits Number of bits
- * @returns {!Long} Shifted Long
- */
-LongPrototype.shru = LongPrototype.shiftRightUnsigned;
-
-/**
- * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.
- * @function
- * @param {number|!Long} numBits Number of bits
- * @returns {!Long} Shifted Long
- */
-LongPrototype.shr_u = LongPrototype.shiftRightUnsigned;
-
-/**
- * Converts this Long to signed.
- * @returns {!Long} Signed long
- */
-LongPrototype.toSigned = function toSigned() {
- if (!this.unsigned)
- return this;
- return fromBits(this.low, this.high, false);
-};
-
-/**
- * Converts this Long to unsigned.
- * @returns {!Long} Unsigned long
- */
-LongPrototype.toUnsigned = function toUnsigned() {
- if (this.unsigned)
- return this;
- return fromBits(this.low, this.high, true);
-};
-
-/**
- * Converts this Long to its byte representation.
- * @param {boolean=} le Whether little or big endian, defaults to big endian
- * @returns {!Array.} Byte representation
- */
-LongPrototype.toBytes = function toBytes(le) {
- return le ? this.toBytesLE() : this.toBytesBE();
-};
-
-/**
- * Converts this Long to its little endian byte representation.
- * @returns {!Array.} Little endian byte representation
- */
-LongPrototype.toBytesLE = function toBytesLE() {
- var hi = this.high,
- lo = this.low;
- return [
- lo & 0xff,
- lo >>> 8 & 0xff,
- lo >>> 16 & 0xff,
- lo >>> 24 ,
- hi & 0xff,
- hi >>> 8 & 0xff,
- hi >>> 16 & 0xff,
- hi >>> 24
- ];
-};
-
-/**
- * Converts this Long to its big endian byte representation.
- * @returns {!Array.} Big endian byte representation
- */
-LongPrototype.toBytesBE = function toBytesBE() {
- var hi = this.high,
- lo = this.low;
- return [
- hi >>> 24 ,
- hi >>> 16 & 0xff,
- hi >>> 8 & 0xff,
- hi & 0xff,
- lo >>> 24 ,
- lo >>> 16 & 0xff,
- lo >>> 8 & 0xff,
- lo & 0xff
- ];
-};
-
-/**
- * Creates a Long from its byte representation.
- * @param {!Array.} bytes Byte representation
- * @param {boolean=} unsigned Whether unsigned or not, defaults to signed
- * @param {boolean=} le Whether little or big endian, defaults to big endian
- * @returns {Long} The corresponding Long value
- */
-Long.fromBytes = function fromBytes(bytes, unsigned, le) {
- return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);
-};
-
-/**
- * Creates a Long from its little endian byte representation.
- * @param {!Array.} bytes Little endian byte representation
- * @param {boolean=} unsigned Whether unsigned or not, defaults to signed
- * @returns {Long} The corresponding Long value
- */
-Long.fromBytesLE = function fromBytesLE(bytes, unsigned) {
- return new Long(
- bytes[0] |
- bytes[1] << 8 |
- bytes[2] << 16 |
- bytes[3] << 24,
- bytes[4] |
- bytes[5] << 8 |
- bytes[6] << 16 |
- bytes[7] << 24,
- unsigned
- );
-};
-
-/**
- * Creates a Long from its big endian byte representation.
- * @param {!Array.} bytes Big endian byte representation
- * @param {boolean=} unsigned Whether unsigned or not, defaults to signed
- * @returns {Long} The corresponding Long value
- */
-Long.fromBytesBE = function fromBytesBE(bytes, unsigned) {
- return new Long(
- bytes[4] << 24 |
- bytes[5] << 16 |
- bytes[6] << 8 |
- bytes[7],
- bytes[0] << 24 |
- bytes[1] << 16 |
- bytes[2] << 8 |
- bytes[3],
- unsigned
- );
-};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/longBits.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/longBits.js
deleted file mode 100644
index ae87a234..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/longBits.js
+++ /dev/null
@@ -1,122 +0,0 @@
-module.exports = LongBits;
-
-function LongBits(lo, hi) {
- this.lo = lo >>> 0;
- this.hi = hi >>> 0;
-}
-
-var zero = LongBits.zero = new LongBits(0, 0);
-
-zero.toNumber = function() { return 0; };
-zero.zzEncode = zero.zzDecode = function() { return this; };
-zero.length = function() { return 1; };
-
-
-var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0";
-
-LongBits.fromNumber = function fromNumber(value) {
- if (value === 0)
- return zero;
- var sign = value < 0;//如果sign为 1 ,表示为负数
- if (sign)
- value = -value;
- var lo = value >>> 0,//取出底32位
- hi = (value - lo) / 4294967296 >>> 0; //取出高32位
- if (sign) { //负数
- hi = ~hi >>> 0; //求取高32位的反码
- lo = ~lo >>> 0; //求取低32位的反码
- if (++lo > 4294967295) { //低32位大于Math.pow(2,31)-1
- lo = 0;
- if (++hi > 4294967295) //高32位大于Math.pow(2,31)-1
- hi = 0;
- }
- }
- return new LongBits(lo, hi);
-};
-
-
-LongBits.from = function from(value) {
- if (typeof value === "number")
- return LongBits.fromNumber(value);
- if (typeof value === "string" || value instanceof String) {
- return LongBits.fromNumber(parseInt(value, 10));
- }
- return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;
-};
-
-LongBits.prototype.toNumber = function toNumber(unsigned) {
- if (!unsigned && this.hi >>> 31) {
- var lo = ~this.lo + 1 >>> 0,
- hi = ~this.hi >>> 0;
- if (!lo)
- hi = hi + 1 >>> 0;
- return -(lo + hi * 4294967296);
- }
- return this.lo + this.hi * 4294967296;
-};
-LongBits.prototype.toLong = function toLong(unsigned) {
- //return util.Long
- // ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))
- // /* istanbul ignore next */
- // : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };
- return { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };
-};
-
-var charCodeAt = String.prototype.charCodeAt;
-
-LongBits.fromHash = function fromHash(hash) {
- if (hash === zeroHash)
- return zero;
- return new LongBits(
- ( charCodeAt.call(hash, 0)
- | charCodeAt.call(hash, 1) << 8
- | charCodeAt.call(hash, 2) << 16
- | charCodeAt.call(hash, 3) << 24) >>> 0
- ,
- ( charCodeAt.call(hash, 4)
- | charCodeAt.call(hash, 5) << 8
- | charCodeAt.call(hash, 6) << 16
- | charCodeAt.call(hash, 7) << 24) >>> 0
- );
-};
-
-LongBits.prototype.toHash = function toHash() {
- return String.fromCharCode(
- this.lo & 255,
- this.lo >>> 8 & 255,
- this.lo >>> 16 & 255,
- this.lo >>> 24 ,
- this.hi & 255,
- this.hi >>> 8 & 255,
- this.hi >>> 16 & 255,
- this.hi >>> 24
- );
-};
-
-LongBits.prototype.zzEncode = function zzEncode() {
- var mask = this.hi >> 31;
- this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;
- this.lo = ( this.lo << 1 ^ mask) >>> 0;
- return this;
-};
-
-LongBits.prototype.zzDecode = function zzDecode() {
- var mask = -(this.lo & 1);
- this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;
- this.hi = ( this.hi >>> 1 ^ mask) >>> 0;
- return this;
-};
-LongBits.prototype.length = function length() {
- var part0 = this.lo,
- part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,
- part2 = this.hi >>> 24;
- return part2 === 0
- ? part1 === 0
- ? part0 < 16384
- ? part0 < 128 ? 1 : 2
- : part0 < 2097152 ? 3 : 4
- : part1 < 16384
- ? part1 < 128 ? 5 : 6
- : part1 < 2097152 ? 7 : 8
- : part2 < 128 ? 9 : 10;
-};
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/mapField.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/mapField.js
deleted file mode 100644
index 4ca5cbe1..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/mapField.js
+++ /dev/null
@@ -1,130 +0,0 @@
-module.exports = MapField;
-
-// extends Field
-var Field = require("./field");
-((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField";
-
-var types,
- util;
-
-/**
- * Constructs a new map field instance.
- * @classdesc Reflected map field.
- * @extends FieldBase
- * @constructor
- * @param {string} name Unique name within its namespace
- * @param {number} id Unique id within its namespace
- * @param {string} keyType Key type
- * @param {string} type Value type
- * @param {Object.} [options] Declared options
- * @param {string} [comment] Comment associated with this field
- */
-function MapField(name, id, keyType, type, options, comment) {
- Field.call(this, name, id, type, undefined, undefined, options, comment);
-
- /* istanbul ignore if */
- if (!util.isString(keyType))
- throw TypeError("keyType must be a string");
-
- /**
- * Key type.
- * @type {string}
- */
- this.keyType = keyType; // toJSON, marker
-
- /**
- * Resolved key type if not a basic type.
- * @type {ReflectionObject|null}
- */
- this.resolvedKeyType = null;
-
- // Overrides Field#map
- this.map = true;
-}
-
-/**
- * Map field descriptor.
- * @interface IMapField
- * @extends {IField}
- * @property {string} keyType Key type
- */
-
-/**
- * Extension map field descriptor.
- * @interface IExtensionMapField
- * @extends IMapField
- * @property {string} extend Extended type
- */
-
-/**
- * Constructs a map field from a map field descriptor.
- * @param {string} name Field name
- * @param {IMapField} json Map field descriptor
- * @returns {MapField} Created map field
- * @throws {TypeError} If arguments are invalid
- */
-MapField.fromJSON = function fromJSON(name, json) {
- return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);
-};
-
-/**
- * Converts this map field to a map field descriptor.
- * @param {IToJSONOptions} [toJSONOptions] JSON conversion options
- * @returns {IMapField} Map field descriptor
- */
-MapField.prototype.toJSON = function toJSON(toJSONOptions) {
- var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
- return util.toObject([
- "keyType" , this.keyType,
- "type" , this.type,
- "id" , this.id,
- "extend" , this.extend,
- "options" , this.options,
- "comment" , keepComments ? this.comment : undefined
- ]);
-};
-
-/**
- * @override
- */
-MapField.prototype.resolve = function resolve() {
- if (this.resolved)
- return this;
-
- // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes"
- if (types.mapKey[this.keyType] === undefined)
- throw Error("invalid key type: " + this.keyType);
-
- return Field.prototype.resolve.call(this);
-};
-
-/**
- * Map field decorator (TypeScript).
- * @name MapField.d
- * @function
- * @param {number} fieldId Field id
- * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type
- * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type
- * @returns {FieldDecorator} Decorator function
- * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }
- */
-MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {
-
- // submessage value: decorate the submessage and use its name as the type
- if (typeof fieldValueType === "function")
- fieldValueType = util.decorateType(fieldValueType).name;
-
- // enum reference value: create a reflected copy of the enum and keep reuseing it
- else if (fieldValueType && typeof fieldValueType === "object")
- fieldValueType = util.decorateEnum(fieldValueType).name;
-
- return function mapFieldDecorator(prototype, fieldName) {
- util.decorateType(prototype.constructor)
- .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));
- };
-};
-
-MapField._configure = function(){
- types = require("./types");
- util = require("./util");
-};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/message.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/message.js
deleted file mode 100644
index 7bc9fceb..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/message.js
+++ /dev/null
@@ -1,160 +0,0 @@
-"use strict";
-module.exports = Message;
-
-var util;
-
-/**
- * Constructs a new message instance.
- * @classdesc Abstract runtime message.
- * @constructor
- * @param {Properties} [properties] Properties to set
- * @template T extends object
- */
-function Message(properties) {
- // not used internally
- if (properties)
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
- this[keys[i]] = properties[keys[i]];
-}
-
-/**
- * Reference to the reflected type.
- * @name Message.$type
- * @type {Type}
- * @readonly
- */
-
-/**
- * Reference to the reflected type.
- * @name Message#$type
- * @type {Type}
- * @readonly
- */
-
-/*eslint-disable valid-jsdoc*/
-
-/**
- * Creates a new message of this type using the specified properties.
- * @param {Object.} [properties] Properties to set
- * @returns {Message} Message instance
- * @template T extends Message
- * @this Constructor
- */
-Message.create = function create(properties) {
- return this.$type.create(properties);
-};
-
-/**
- * Encodes a message of this type.
- * @param {T|Object.} message Message to encode
- * @param {Writer} [writer] Writer to use
- * @returns {Writer} Writer
- * @template T extends Message
- * @this Constructor
- */
-Message.encode = function encode(message, writer) {
- if(!arguments.length){
- return this.$type.encode(this);
- }else if (arguments.length == 1){
- return this.$type.encode(arguments[0]);
- }else{
- return this.$type.encode(arguments[0], arguments[1]);
- }
- //return this.$type.encode(message, writer);
-};
-
-/**
- * Encodes a message of this type preceeded by its length as a varint.
- * @param {T|Object.} message Message to encode
- * @param {Writer} [writer] Writer to use
- * @returns {Writer} Writer
- * @template T extends Message
- * @this Constructor
- */
-Message.encodeDelimited = function encodeDelimited(message, writer) {
- return this.$type.encodeDelimited(message, writer);
-};
-
-/**
- * Decodes a message of this type.
- * @name Message.decode
- * @function
- * @param {Reader|Uint8Array} reader Reader or buffer to decode
- * @returns {T} Decoded message
- * @template T extends Message
- * @this Constructor
- */
-Message.decode = function decode(reader) {
- return this.$type.decode(reader);
-};
-
-/**
- * Decodes a message of this type preceeded by its length as a varint.
- * @name Message.decodeDelimited
- * @function
- * @param {Reader|Uint8Array} reader Reader or buffer to decode
- * @returns {T} Decoded message
- * @template T extends Message
- * @this Constructor
- */
-Message.decodeDelimited = function decodeDelimited(reader) {
- return this.$type.decodeDelimited(reader);
-};
-
-/**
- * Verifies a message of this type.
- * @name Message.verify
- * @function
- * @param {Object.} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
-Message.verify = function verify(message) {
- return this.$type.verify(message);
-};
-
-/**
- * Creates a new message of this type from a plain object. Also converts values to their respective internal types.
- * @param {Object.} object Plain object
- * @returns {T} Message instance
- * @template T extends Message
- * @this Constructor
- */
-Message.fromObject = function fromObject(object) {
- return this.$type.fromObject(object);
-};
-
-/**
- * Creates a plain object from a message of this type. Also converts values to other types if specified.
- * @param {T} message Message instance
- * @param {IConversionOptions} [options] Conversion options
- * @returns {Object.} Plain object
- * @template T extends Message
- * @this Constructor
- */
-Message.toObject = function toObject(message, options) {
- message = message || this;
- return this.$type.toObject(message, options);
-};
-
-/**
- * Converts this message to JSON.
- * @returns {Object.} JSON object
- */
-Message.prototype.toJSON = function toJSON() {
- return this.$type.toObject(this, util.toJSONOptions);
-};
-
-
-
-Message.set = function(key,value){
- Message[key] = value;
-};
-
-Message.get = function (key){
- return Message[key];
-};
-/*eslint-enable valid-jsdoc*/
-
-Message._configure = function(){
- util = require("./util");
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/method.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/method.js
deleted file mode 100644
index 3e82f5f2..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/method.js
+++ /dev/null
@@ -1,155 +0,0 @@
-"use strict";
-module.exports = Method;
-
-// extends ReflectionObject
-var ReflectionObject = require("./object");
-((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method";
-
-var util;
-
-/**
- * Constructs a new service method instance.
- * @classdesc Reflected service method.
- * @extends ReflectionObject
- * @constructor
- * @param {string} name Method name
- * @param {string|undefined} type Method type, usually `"rpc"`
- * @param {string} requestType Request message type
- * @param {string} responseType Response message type
- * @param {boolean|Object.} [requestStream] Whether the request is streamed
- * @param {boolean|Object.} [responseStream] Whether the response is streamed
- * @param {Object.} [options] Declared options
- * @param {string} [comment] The comment for this method
- */
-function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {
-
- /* istanbul ignore next */
- if (util.isObject(requestStream)) {
- options = requestStream;
- requestStream = responseStream = undefined;
- } else if (util.isObject(responseStream)) {
- options = responseStream;
- responseStream = undefined;
- }
-
- /* istanbul ignore if */
- if (!(type === undefined || util.isString(type)))
- throw TypeError("type must be a string");
-
- /* istanbul ignore if */
- if (!util.isString(requestType))
- throw TypeError("requestType must be a string");
-
- /* istanbul ignore if */
- if (!util.isString(responseType))
- throw TypeError("responseType must be a string");
-
- ReflectionObject.call(this, name, options);
-
- /**
- * Method type.
- * @type {string}
- */
- this.type = type || "rpc"; // toJSON
-
- /**
- * Request type.
- * @type {string}
- */
- this.requestType = requestType; // toJSON, marker
-
- /**
- * Whether requests are streamed or not.
- * @type {boolean|undefined}
- */
- this.requestStream = requestStream ? true : undefined; // toJSON
-
- /**
- * Response type.
- * @type {string}
- */
- this.responseType = responseType; // toJSON
-
- /**
- * Whether responses are streamed or not.
- * @type {boolean|undefined}
- */
- this.responseStream = responseStream ? true : undefined; // toJSON
-
- /**
- * Resolved request type.
- * @type {Type|null}
- */
- this.resolvedRequestType = null;
-
- /**
- * Resolved response type.
- * @type {Type|null}
- */
- this.resolvedResponseType = null;
-
- /**
- * Comment for this method
- * @type {string|null}
- */
- this.comment = comment;
-}
-
-/**
- * Method descriptor.
- * @interface IMethod
- * @property {string} [type="rpc"] Method type
- * @property {string} requestType Request type
- * @property {string} responseType Response type
- * @property {boolean} [requestStream=false] Whether requests are streamed
- * @property {boolean} [responseStream=false] Whether responses are streamed
- * @property {Object.} [options] Method options
- */
-
-/**
- * Constructs a method from a method descriptor.
- * @param {string} name Method name
- * @param {IMethod} json Method descriptor
- * @returns {Method} Created method
- * @throws {TypeError} If arguments are invalid
- */
-Method.fromJSON = function fromJSON(name, json) {
- return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);
-};
-
-/**
- * Converts this method to a method descriptor.
- * @param {IToJSONOptions} [toJSONOptions] JSON conversion options
- * @returns {IMethod} Method descriptor
- */
-Method.prototype.toJSON = function toJSON(toJSONOptions) {
- var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
- return util.toObject([
- "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined,
- "requestType" , this.requestType,
- "requestStream" , this.requestStream,
- "responseType" , this.responseType,
- "responseStream" , this.responseStream,
- "options" , this.options,
- "comment" , keepComments ? this.comment : undefined
- ]);
-};
-
-/**
- * @override
- */
-Method.prototype.resolve = function resolve() {
-
- /* istanbul ignore if */
- if (this.resolved)
- return this;
-
- this.resolvedRequestType = this.parent.lookupType(this.requestType);
- this.resolvedResponseType = this.parent.lookupType(this.responseType);
-
- return ReflectionObject.prototype.resolve.call(this);
-};
-
-Method._configure = function (){
- util = require("./util");
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/namespace.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/namespace.js
deleted file mode 100644
index dddcf0e1..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/namespace.js
+++ /dev/null
@@ -1,435 +0,0 @@
-
-module.exports = Namespace;
-
-// extends ReflectionObject
-var ReflectionObject = require("./object");
-((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace";
-
-var Enum,
- Field,
- util;
-
-var Type; // cyclic
-var Service;
-
-/**
- * Constructs a new namespace instance.
- * @name Namespace
- * @classdesc Reflected namespace.
- * @extends NamespaceBase
- * @constructor
- * @param {string} name Namespace name
- * @param {Object.} [options] Declared options
- */
-
-/**
- * Constructs a namespace from JSON.
- * @memberof Namespace
- * @function
- * @param {string} name Namespace name
- * @param {Object.} json JSON object
- * @returns {Namespace} Created namespace
- * @throws {TypeError} If arguments are invalid
- */
-Namespace.fromJSON = function fromJSON(name, json) {
- return new Namespace(name, json.options).addJSON(json.nested);
-};
-
-/**
- * Converts an array of reflection objects to JSON.
- * @memberof Namespace
- * @param {ReflectionObject[]} array Object array
- * @param {IToJSONOptions} [toJSONOptions] JSON conversion options
- * @returns {Object.|undefined} JSON object or `undefined` when array is empty
- */
-function arrayToJSON(array, toJSONOptions) {
- if (!(array && array.length))
- return undefined;
- var obj = {};
- for (var i = 0; i < array.length; ++i)
- obj[array[i].name] = array[i].toJSON(toJSONOptions);
- return obj;
-}
-
-Namespace.arrayToJSON = arrayToJSON;
-
-/**
- * Tests if the specified id is reserved.
- * @param {Array.|undefined} reserved Array of reserved ranges and names
- * @param {number} id Id to test
- * @returns {boolean} `true` if reserved, otherwise `false`
- */
-Namespace.isReservedId = function isReservedId(reserved, id) {
- if (reserved)
- for (var i = 0; i < reserved.length; ++i)
- if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] >= id)
- return true;
- return false;
-};
-
-/**
- * Tests if the specified name is reserved.
- * @param {Array.|undefined} reserved Array of reserved ranges and names
- * @param {string} name Name to test
- * @returns {boolean} `true` if reserved, otherwise `false`
- */
-Namespace.isReservedName = function isReservedName(reserved, name) {
- if (reserved)
- for (var i = 0; i < reserved.length; ++i)
- if (reserved[i] === name)
- return true;
- return false;
-};
-
-/**
- * Not an actual constructor. Use {@link Namespace} instead.
- * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.
- * @exports NamespaceBase
- * @extends ReflectionObject
- * @abstract
- * @constructor
- * @param {string} name Namespace name
- * @param {Object.} [options] Declared options
- * @see {@link Namespace}
- */
-function Namespace(name, options) {
- ReflectionObject.call(this, name, options);
-
- /**
- * Nested objects by name.
- * @type {Object.|undefined}
- */
- this.nested = undefined; // toJSON
-
- /**
- * Cached nested objects as an array.
- * @type {ReflectionObject[]|null}
- * @private
- */
- this._nestedArray = null;
-}
-
-function clearCache(namespace) {
- namespace._nestedArray = null;
- return namespace;
-}
-
-/**
- * Nested objects of this namespace as an array for iteration.
- * @name NamespaceBase#nestedArray
- * @type {ReflectionObject[]}
- * @readonly
- */
-Object.defineProperty(Namespace.prototype, "nestedArray", {
- get: function() {
- return this._nestedArray || (this._nestedArray = util.toArray(this.nested));
- }
-});
-
-/**
- * Namespace descriptor.
- * @interface INamespace
- * @property {Object.} [options] Namespace options
- * @property {Object.} [nested] Nested object descriptors
- */
-
-/**
- * Any extension field descriptor.
- * @typedef AnyExtensionField
- * @type {IExtensionField|IExtensionMapField}
- */
-
-/**
- * Any nested object descriptor.
- * @typedef AnyNestedObject
- * @type {IEnum|IType|IService|AnyExtensionField|INamespace}
- */
-// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)
-
-/**
- * Converts this namespace to a namespace descriptor.
- * @param {IToJSONOptions} [toJSONOptions] JSON conversion options
- * @returns {INamespace} Namespace descriptor
- */
-Namespace.prototype.toJSON = function toJSON(toJSONOptions) {
- return util.toObject([
- "options" , this.options,
- "nested" , arrayToJSON(this.nestedArray, toJSONOptions)
- ]);
-};
-
-/**
- * Adds nested objects to this namespace from nested object descriptors.
- * @param {Object.} nestedJson Any nested object descriptors
- * @returns {Namespace} `this`
- */
-Namespace.prototype.addJSON = function addJSON(nestedJson) {
- var ns = this;
- /* istanbul ignore else */
- if (nestedJson) {
- for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {
- nested = nestedJson[names[i]];
- ns.add( // most to least likely
- ( nested.fields !== undefined
- ? Type.fromJSON
- : nested.values !== undefined
- ? Enum.fromJSON
- : nested.methods !== undefined
- ? Service.fromJSON
- : nested.id !== undefined
- ? Field.fromJSON
- : Namespace.fromJSON )(names[i], nested)
- );
- }
- }
- return this;
-};
-
-/**
- * Gets the nested object of the specified name.
- * @param {string} name Nested object name
- * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist
- */
-Namespace.prototype.get = function get(name) {
- return this.nested && this.nested[name]
- || null;
-};
-
-/**
- * Gets the values of the nested {@link Enum|enum} of the specified name.
- * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.
- * @param {string} name Nested enum name
- * @returns {Object.} Enum values
- * @throws {Error} If there is no such enum
- */
-Namespace.prototype.getEnum = function getEnum(name) {
- if (this.nested && this.nested[name] instanceof Enum)
- return this.nested[name].values;
- throw Error("no such enum: " + name);
-};
-
-/**
- * Adds a nested object to this namespace.
- * @param {ReflectionObject} object Nested object to add
- * @returns {Namespace} `this`
- * @throws {TypeError} If arguments are invalid
- * @throws {Error} If there is already a nested object with this name
- */
-Namespace.prototype.add = function add(object) {
-
- if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))
- throw TypeError("object must be a valid nested object");
-
- if (!this.nested)
- this.nested = {};
- else {
- var prev = this.get(object.name);
- if (prev) {
- if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {
- // replace plain namespace but keep existing nested elements and options
- var nested = prev.nestedArray;
- for (var i = 0; i < nested.length; ++i)
- object.add(nested[i]);
- this.remove(prev);
- if (!this.nested)
- this.nested = {};
- object.setOptions(prev.options, true);
-
- } else
- throw Error("duplicate name '" + object.name + "' in " + this);
- }
- }
- this.nested[object.name] = object;
- object.onAdd(this);
- return clearCache(this);
-};
-
-/**
- * Removes a nested object from this namespace.
- * @param {ReflectionObject} object Nested object to remove
- * @returns {Namespace} `this`
- * @throws {TypeError} If arguments are invalid
- * @throws {Error} If `object` is not a member of this namespace
- */
-Namespace.prototype.remove = function remove(object) {
-
- if (!(object instanceof ReflectionObject))
- throw TypeError("object must be a ReflectionObject");
- if (object.parent !== this)
- throw Error(object + " is not a member of " + this);
-
- delete this.nested[object.name];
- if (!Object.keys(this.nested).length)
- this.nested = undefined;
-
- object.onRemove(this);
- return clearCache(this);
-};
-
-/**
- * Defines additial namespaces within this one if not yet existing.
- * @param {string|string[]} path Path to create
- * @param {*} [json] Nested types to create from JSON
- * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty
- */
-Namespace.prototype.define = function define(path, json) {
-
- if (util.isString(path))
- path = path.split(".");
- else if (!Array.isArray(path))
- throw TypeError("illegal path");
- if (path && path.length && path[0] === "")
- throw Error("path must be relative");
-
- var ptr = this;
- while (path.length > 0) {
- var part = path.shift();
- if (ptr.nested && ptr.nested[part]) {
- ptr = ptr.nested[part];
- if (!(ptr instanceof Namespace))
- throw Error("path conflicts with non-namespace objects");
- } else
- ptr.add(ptr = new Namespace(part));
- }
- if (json)
- ptr.addJSON(json);
- return ptr;
-};
-
-/**
- * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.
- * @returns {Namespace} `this`
- */
-Namespace.prototype.resolveAll = function resolveAll() {
- var nested = this.nestedArray, i = 0;
- while (i < nested.length)
- if (nested[i] instanceof Namespace)
- nested[i++].resolveAll();
- else
- nested[i++].resolve();
- return this.resolve();
-};
-
-/**
- * Recursively looks up the reflection object matching the specified path in the scope of this namespace.
- * @param {string|string[]} path Path to look up
- * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.
- * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked
- * @returns {ReflectionObject|null} Looked up object or `null` if none could be found
- */
-Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {
-
- /* istanbul ignore next */
- if (typeof filterTypes === "boolean") {
- parentAlreadyChecked = filterTypes;
- filterTypes = undefined;
- } else if (filterTypes && !Array.isArray(filterTypes))
- filterTypes = [ filterTypes ];
-
- if (util.isString(path) && path.length) {
- if (path === ".")
- return this.root;
- path = path.split(".");
- } else if (!path.length)
- return this;
-
- // Start at root if path is absolute
- if (path[0] === "")
- return this.root.lookup(path.slice(1), filterTypes);
-
- // Test if the first part matches any nested object, and if so, traverse if path contains more
- var found = this.get(path[0]);
- if (found) {
- if (path.length === 1) {
- if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)
- return found;
- } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))
- return found;
-
- // Otherwise try each nested namespace
- } else
- for (var i = 0; i < this.nestedArray.length; ++i)
- if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))
- return found;
-
- // If there hasn't been a match, try again at the parent
- if (this.parent === null || parentAlreadyChecked)
- return null;
- return this.parent.lookup(path, filterTypes);
-};
-
-/**
- * Looks up the reflection object at the specified path, relative to this namespace.
- * @name NamespaceBase#lookup
- * @function
- * @param {string|string[]} path Path to look up
- * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked
- * @returns {ReflectionObject|null} Looked up object or `null` if none could be found
- * @variation 2
- */
-// lookup(path: string, [parentAlreadyChecked: boolean])
-
-/**
- * Looks up the {@link Type|type} at the specified path, relative to this namespace.
- * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.
- * @param {string|string[]} path Path to look up
- * @returns {Type} Looked up type
- * @throws {Error} If `path` does not point to a type
- */
-Namespace.prototype.lookupType = function lookupType(path) {
- var found = this.lookup(path, [ Type ]);
- if (!found)
- throw Error("no such type: " + path);
- return found;
-};
-
-/**
- * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.
- * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.
- * @param {string|string[]} path Path to look up
- * @returns {Enum} Looked up enum
- * @throws {Error} If `path` does not point to an enum
- */
-Namespace.prototype.lookupEnum = function lookupEnum(path) {
- var found = this.lookup(path, [ Enum ]);
- if (!found)
- throw Error("no such Enum '" + path + "' in " + this);
- return found;
-};
-
-/**
- * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.
- * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.
- * @param {string|string[]} path Path to look up
- * @returns {Type} Looked up type or enum
- * @throws {Error} If `path` does not point to a type or enum
- */
-Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {
- var found = this.lookup(path, [ Type, Enum ]);
- if (!found)
- throw Error("no such Type or Enum '" + path + "' in " + this);
- return found;
-};
-
-/**
- * Looks up the {@link Service|service} at the specified path, relative to this namespace.
- * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.
- * @param {string|string[]} path Path to look up
- * @returns {Service} Looked up service
- * @throws {Error} If `path` does not point to a service
- */
-Namespace.prototype.lookupService = function lookupService(path) {
- var found = this.lookup(path, [ Service ]);
- if (!found)
- throw Error("no such Service '" + path + "' in " + this);
- return found;
-};
-
-Namespace._configure = function() {
- Enum = require("./enum");
- Field = require("./field");
- util = require("./util");
-
- Type = require("./type"); // cyclic
- Service = require("./service");
-};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/object.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/object.js
deleted file mode 100644
index 0b7dfc49..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/object.js
+++ /dev/null
@@ -1,199 +0,0 @@
-"use strict";
-module.exports = ReflectionObject;
-
-ReflectionObject.className = "ReflectionObject";
-var util;
-
-var Root; // cyclic
-
-/**
- * Constructs a new reflection object instance.
- * @classdesc Base class of all reflection objects.
- * @constructor
- * @param {string} name Object name
- * @param {Object.} [options] Declared options
- * @abstract
- */
-function ReflectionObject(name, options) {
-
- if (!util.isString(name))
- throw TypeError("name must be a string");
-
- if (options && !util.isObject(options))
- throw TypeError("options must be an object");
-
- /**
- * Options.
- * @type {Object.|undefined}
- */
- this.options = options; // toJSON
-
- /**
- * Unique name within its namespace.
- * @type {string}
- */
- this.name = name;
-
- /**
- * Parent namespace.
- * @type {Namespace|null}
- */
- this.parent = null;
-
- /**
- * Whether already resolved or not.
- * @type {boolean}
- */
- this.resolved = false;
-
- /**
- * Comment text, if any.
- * @type {string|null}
- */
- this.comment = null;
-
- /**
- * Defining file name.
- * @type {string|null}
- */
- this.filename = null;
-}
-
-Object.defineProperties(ReflectionObject.prototype, {
-
- /**
- * Reference to the root namespace.
- * @name ReflectionObject#root
- * @type {Root}
- * @readonly
- */
- root: {
- get: function() {
- var ptr = this;
- while (ptr.parent !== null)
- ptr = ptr.parent;
- return ptr;
- }
- },
-
- /**
- * Full name including leading dot.
- * @name ReflectionObject#fullName
- * @type {string}
- * @readonly
- */
- fullName: {
- get: function() {
- var path = [ this.name ],
- ptr = this.parent;
- while (ptr) {
- path.unshift(ptr.name);
- ptr = ptr.parent;
- }
- return path.join(".");
- }
- }
-});
-
-/**
- * Converts this reflection object to its descriptor representation.
- * @returns {Object.} Descriptor
- * @abstract
- */
-ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {
- throw Error(); // not implemented, shouldn't happen
-};
-
-/**
- * Called when this object is added to a parent.
- * @param {ReflectionObject} parent Parent added to
- * @returns {undefined}
- */
-ReflectionObject.prototype.onAdd = function onAdd(parent) {
- if (this.parent && this.parent !== parent)
- this.parent.remove(this);
- this.parent = parent;
- this.resolved = false;
- var root = parent.root;
- if (root instanceof Root)
- root._handleAdd(this);
-};
-
-/**
- * Called when this object is removed from a parent.
- * @param {ReflectionObject} parent Parent removed from
- * @returns {undefined}
- */
-ReflectionObject.prototype.onRemove = function onRemove(parent) {
- var root = parent.root;
- if (root instanceof Root)
- root._handleRemove(this);
- this.parent = null;
- this.resolved = false;
-};
-
-/**
- * Resolves this objects type references.
- * @returns {ReflectionObject} `this`
- */
-ReflectionObject.prototype.resolve = function resolve() {
- if (this.resolved)
- return this;
- if (this.root instanceof Root)
- this.resolved = true; // only if part of a root
- return this;
-};
-
-/**
- * Gets an option value.
- * @param {string} name Option name
- * @returns {*} Option value or `undefined` if not set
- */
-ReflectionObject.prototype.getOption = function getOption(name) {
- if (this.options)
- return this.options[name];
- return undefined;
-};
-
-/**
- * Sets an option.
- * @param {string} name Option name
- * @param {*} value Option value
- * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set
- * @returns {ReflectionObject} `this`
- */
-ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {
- if (!ifNotSet || !this.options || this.options[name] === undefined)
- (this.options || (this.options = {}))[name] = value;
- return this;
-};
-
-/**
- * Sets multiple options.
- * @param {Object.} options Options to set
- * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set
- * @returns {ReflectionObject} `this`
- */
-ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {
- if (options)
- for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)
- this.setOption(keys[i], options[keys[i]], ifNotSet);
- return this;
-};
-
-/**
- * Converts this instance to its string representation.
- * @returns {string} Class name[, space, full name]
- */
-ReflectionObject.prototype.toString = function toString() {
- var className = this.constructor.className,
- fullName = this.fullName;
- if (fullName.length)
- return className + " " + fullName;
- return className;
-};
-
-ReflectionObject._configure = function(Root_) {
- Root = require('./root');
- util = require('./util');
-};
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/oneof.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/oneof.js
deleted file mode 100644
index c5605c31..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/oneof.js
+++ /dev/null
@@ -1,207 +0,0 @@
-module.exports = OneOf;
-
-// extends ReflectionObject
-var ReflectionObject = require("./object");
-((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf";
-
-var Field;
-var util;
-
-/**
- * Constructs a new oneof instance.
- * @classdesc Reflected oneof.
- * @extends ReflectionObject
- * @constructor
- * @param {string} name Oneof name
- * @param {string[]|Object.} [fieldNames] Field names
- * @param {Object.} [options] Declared options
- * @param {string} [comment] Comment associated with this field
- */
-function OneOf(name, fieldNames, options, comment) {
- if (!Array.isArray(fieldNames)) {
- options = fieldNames;
- fieldNames = undefined;
- }
- ReflectionObject.call(this, name, options);
-
- /* istanbul ignore if */
- if (!(fieldNames === undefined || Array.isArray(fieldNames)))
- throw TypeError("fieldNames must be an Array");
-
- /**
- * Field names that belong to this oneof.
- * @type {string[]}
- */
- this.oneof = fieldNames || []; // toJSON, marker
-
- /**
- * Fields that belong to this oneof as an array for iteration.
- * @type {Field[]}
- * @readonly
- */
- this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent
-
- /**
- * Comment for this field.
- * @type {string|null}
- */
- this.comment = comment;
-}
-
-/**
- * Oneof descriptor.
- * @interface IOneOf
- * @property {Array.} oneof Oneof field names
- * @property {Object.} [options] Oneof options
- */
-
-/**
- * Constructs a oneof from a oneof descriptor.
- * @param {string} name Oneof name
- * @param {IOneOf} json Oneof descriptor
- * @returns {OneOf} Created oneof
- * @throws {TypeError} If arguments are invalid
- */
-OneOf.fromJSON = function fromJSON(name, json) {
- return new OneOf(name, json.oneof, json.options, json.comment);
-};
-
-/**
- * Converts this oneof to a oneof descriptor.
- * @param {IToJSONOptions} [toJSONOptions] JSON conversion options
- * @returns {IOneOf} Oneof descriptor
- */
-OneOf.prototype.toJSON = function toJSON(toJSONOptions) {
- var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
- return util.toObject([
- "options" , this.options,
- "oneof" , this.oneof,
- "comment" , keepComments ? this.comment : undefined
- ]);
-};
-
-/**
- * Adds the fields of the specified oneof to the parent if not already done so.
- * @param {OneOf} oneof The oneof
- * @returns {undefined}
- * @inner
- * @ignore
- */
-function addFieldsToParent(oneof) {
- if (oneof.parent)
- for (var i = 0; i < oneof.fieldsArray.length; ++i)
- if (!oneof.fieldsArray[i].parent)
- oneof.parent.add(oneof.fieldsArray[i]);
-}
-
-/**
- * Adds a field to this oneof and removes it from its current parent, if any.
- * @param {Field} field Field to add
- * @returns {OneOf} `this`
- */
-OneOf.prototype.add = function add(field) {
-
- /* istanbul ignore if */
- if (!(field instanceof Field))
- throw TypeError("field must be a Field");
-
- if (field.parent && field.parent !== this.parent)
- field.parent.remove(field);
- this.oneof.push(field.name);
- this.fieldsArray.push(field);
- field.partOf = this; // field.parent remains null
- addFieldsToParent(this);
- return this;
-};
-
-/**
- * Removes a field from this oneof and puts it back to the oneof's parent.
- * @param {Field} field Field to remove
- * @returns {OneOf} `this`
- */
-OneOf.prototype.remove = function remove(field) {
-
- /* istanbul ignore if */
- if (!(field instanceof Field))
- throw TypeError("field must be a Field");
-
- var index = this.fieldsArray.indexOf(field);
-
- /* istanbul ignore if */
- if (index < 0)
- throw Error(field + " is not a member of " + this);
-
- this.fieldsArray.splice(index, 1);
- index = this.oneof.indexOf(field.name);
-
- /* istanbul ignore else */
- if (index > -1) // theoretical
- this.oneof.splice(index, 1);
-
- field.partOf = null;
- return this;
-};
-
-/**
- * @override
- */
-OneOf.prototype.onAdd = function onAdd(parent) {
- ReflectionObject.prototype.onAdd.call(this, parent);
- var self = this;
- // Collect present fields
- for (var i = 0; i < this.oneof.length; ++i) {
- var field = parent.get(this.oneof[i]);
- if (field && !field.partOf) {
- field.partOf = self;
- self.fieldsArray.push(field);
- }
- }
- // Add not yet present fields
- addFieldsToParent(this);
-};
-
-/**
- * @override
- */
-OneOf.prototype.onRemove = function onRemove(parent) {
- for (var i = 0, field; i < this.fieldsArray.length; ++i)
- if ((field = this.fieldsArray[i]).parent)
- field.parent.remove(field);
- ReflectionObject.prototype.onRemove.call(this, parent);
-};
-
-/**
- * Decorator function as returned by {@link OneOf.d} (TypeScript).
- * @typedef OneOfDecorator
- * @type {function}
- * @param {Object} prototype Target prototype
- * @param {string} oneofName OneOf name
- * @returns {undefined}
- */
-
-/**
- * OneOf decorator (TypeScript).
- * @function
- * @param {...string} fieldNames Field names
- * @returns {OneOfDecorator} Decorator function
- * @template T extends string
- */
-OneOf.d = function decorateOneOf() {
- var fieldNames = new Array(arguments.length),
- index = 0;
- while (index < arguments.length)
- fieldNames[index] = arguments[index++];
- return function oneOfDecorator(prototype, oneofName) {
- util.decorateType(prototype.constructor)
- .add(new OneOf(oneofName, fieldNames));
- Object.defineProperty(prototype, oneofName, {
- get: util.oneOfGetter(fieldNames),
- set: util.oneOfSetter(fieldNames)
- });
- };
-};
-
-OneOf._configure = function (){
- Field = require('./field');
- util = require('./util');
-};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/parse.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/parse.js
deleted file mode 100644
index d7f43894..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/parse.js
+++ /dev/null
@@ -1,770 +0,0 @@
-"use strict";
-module.exports = parse;
-
-parse.filename = null;
-parse.defaults = { keepCase: false };
-
-var tokenize,
- Root,
- Type,
- Field,
- MapField,
- OneOf,
- Enum,
- Service,
- Method,
- types,
- util;
-
-var base10Re = /^[1-9][0-9]*$/,
- base10NegRe = /^-?[1-9][0-9]*$/,
- base16Re = /^0[x][0-9a-fA-F]+$/,
- base16NegRe = /^-?0[x][0-9a-fA-F]+$/,
- base8Re = /^0[0-7]+$/,
- base8NegRe = /^-?0[0-7]+$/,
- numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,
- nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,
- typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
- fqTypeRefRe = /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/;
-
-/**
- * Result object returned from {@link parse}.
- * @interface IParserResult
- * @property {string|undefined} package Package name, if declared
- * @property {string[]|undefined} imports Imports, if any
- * @property {string[]|undefined} weakImports Weak imports, if any
- * @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`)
- * @property {Root} root Populated root instance
- */
-
-/**
- * Options modifying the behavior of {@link parse}.
- * @interface IParseOptions
- * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case
- * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments.
- */
-
-/**
- * Options modifying the behavior of JSON serialization.
- * @interface IToJSONOptions
- * @property {boolean} [keepComments=false] Serializes comments.
- */
-
-/**
- * Parses the given .proto source and returns an object with the parsed contents.
- * @param {string} source Source contents
- * @param {Root} root Root to populate
- * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.
- * @returns {IParserResult} Parser result
- * @property {string} filename=null Currently processing file name for error reporting, if known
- * @property {IParseOptions} defaults Default {@link IParseOptions}
- */
-function parse(source, root, options) {
- /* eslint-disable callback-return */
- if (!(root instanceof Root)) {
- options = root;
- root = new Root();
- }
- if (!options)
- options = parse.defaults;
-
- var tn = tokenize(source, options.alternateCommentMode || false),
- next = tn.next,
- push = tn.push,
- peek = tn.peek,
- skip = tn.skip,
- cmnt = tn.cmnt;
-
- var head = true,
- pkg,
- imports,
- weakImports,
- syntax,
- isProto3 = false;
-
- var ptr = root;
-
- var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;
-
- /* istanbul ignore next */
- function illegal(token, name, insideTryCatch) {
- var filename = parse.filename;
- if (!insideTryCatch)
- parse.filename = null;
- return Error("illegal " + (name || "token") + " '" + token + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")");
- }
-
- function readString() {
- var values = [],
- token;
- do {
- /* istanbul ignore if */
- if ((token = next()) !== "\"" && token !== "'")
- throw illegal(token);
-
- values.push(next());
- skip(token);
- token = peek();
- } while (token === "\"" || token === "'");
- return values.join("");
- }
-
- function readValue(acceptTypeRef) {
- var token = next();
- switch (token) {
- case "'":
- case "\"":
- push(token);
- return readString();
- case "true": case "TRUE":
- return true;
- case "false": case "FALSE":
- return false;
- }
- try {
- return parseNumber(token, /* insideTryCatch */ true);
- } catch (e) {
-
- /* istanbul ignore else */
- if (acceptTypeRef && typeRefRe.test(token))
- return token;
-
- /* istanbul ignore next */
- throw illegal(token, "value");
- }
- }
-
- function readRanges(target, acceptStrings) {
- var token, start;
- do {
- if (acceptStrings && ((token = peek()) === "\"" || token === "'"))
- target.push(readString());
- else
- target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]);
- } while (skip(",", true));
- skip(";");
- }
-
- function parseNumber(token, insideTryCatch) {
- var sign = 1;
- if (token.charAt(0) === "-") {
- sign = -1;
- token = token.substring(1);
- }
- switch (token) {
- case "inf": case "INF": case "Inf":
- return sign * Infinity;
- case "nan": case "NAN": case "Nan": case "NaN":
- return NaN;
- case "0":
- return 0;
- }
- if (base10Re.test(token))
- return sign * parseInt(token, 10);
- if (base16Re.test(token))
- return sign * parseInt(token, 16);
- if (base8Re.test(token))
- return sign * parseInt(token, 8);
-
- /* istanbul ignore else */
- if (numberRe.test(token))
- return sign * parseFloat(token);
-
- /* istanbul ignore next */
- throw illegal(token, "number", insideTryCatch);
- }
-
- function parseId(token, acceptNegative) {
- switch (token) {
- case "max": case "MAX": case "Max":
- return 536870911;
- case "0":
- return 0;
- }
-
- /* istanbul ignore if */
- if (!acceptNegative && token.charAt(0) === "-")
- throw illegal(token, "id");
-
- if (base10NegRe.test(token))
- return parseInt(token, 10);
- if (base16NegRe.test(token))
- return parseInt(token, 16);
-
- /* istanbul ignore else */
- if (base8NegRe.test(token))
- return parseInt(token, 8);
-
- /* istanbul ignore next */
- throw illegal(token, "id");
- }
-
- function parsePackage() {
-
- /* istanbul ignore if */
- if (pkg !== undefined)
- throw illegal("package");
-
- pkg = next();
-
- /* istanbul ignore if */
- if (!typeRefRe.test(pkg))
- throw illegal(pkg, "name");
-
- ptr = ptr.define(pkg);
- skip(";");
- }
-
- function parseImport() {
- var token = peek();
- var whichImports;
- switch (token) {
- case "weak":
- whichImports = weakImports || (weakImports = []);
- next();
- break;
- case "public":
- next();
- // eslint-disable-line no-fallthrough
- default:
- whichImports = imports || (imports = []);
- break;
- }
- token = readString();
- skip(";");
- whichImports.push(token);
- }
-
- function parseSyntax() {
- skip("=");
- syntax = readString();
- isProto3 = syntax === "proto3";
-
- /* istanbul ignore if */
- if (!isProto3 && syntax !== "proto2")
- throw illegal(syntax, "syntax");
-
- skip(";");
- }
-
- function parseCommon(parent, token) {
- switch (token) {
-
- case "option":
- parseOption(parent, token);
- skip(";");
- return true;
-
- case "message":
- parseType(parent, token);
- return true;
-
- case "enum":
- parseEnum(parent, token);
- return true;
-
- case "service":
- parseService(parent, token);
- return true;
-
- case "extend":
- parseExtension(parent, token);
- return true;
- }
- return false;
- }
-
- function ifBlock(obj, fnIf, fnElse) {
- var trailingLine = tn.line;
- if (obj) {
- obj.comment = cmnt(); // try block-type comment
- obj.filename = parse.filename;
- }
- if (skip("{", true)) {
- var token;
- while ((token = next()) !== "}")
- fnIf(token);
- skip(";", true);
- } else {
- if (fnElse)
- fnElse();
- skip(";");
- if (obj && typeof obj.comment !== "string")
- obj.comment = cmnt(trailingLine); // try line-type comment if no block
- }
- }
-
- function parseType(parent, token) {
-
- /* istanbul ignore if */
- if (!nameRe.test(token = next()))
- throw illegal(token, "type name");
-
- var type = new Type(token);
- ifBlock(type, function parseType_block(token) {
- if (parseCommon(type, token))
- return;
-
- switch (token) {
-
- case "map":
- parseMapField(type, token);
- break;
-
- case "required":
- case "optional":
- case "repeated":
- parseField(type, token);
- break;
-
- case "oneof":
- parseOneOf(type, token);
- break;
-
- case "extensions":
- readRanges(type.extensions || (type.extensions = []));
- break;
-
- case "reserved":
- readRanges(type.reserved || (type.reserved = []), true);
- break;
-
- default:
- /* istanbul ignore if */
- if (!isProto3 || !typeRefRe.test(token))
- throw illegal(token);
-
- push(token);
- parseField(type, "optional");
- break;
- }
- });
- parent.add(type);
- }
-
- function parseField(parent, rule, extend) {
- var type = next();
- if (type === "group") {
- parseGroup(parent, rule);
- return;
- }
-
- /* istanbul ignore if */
- if (!typeRefRe.test(type))
- throw illegal(type, "type");
-
- var name = next();
-
- /* istanbul ignore if */
- if (!nameRe.test(name))
- throw illegal(name, "name");
-
- name = applyCase(name);
- skip("=");
-
- var field = new Field(name, parseId(next()), type, rule, extend);
- ifBlock(field, function parseField_block(token) {
-
- /* istanbul ignore else */
- if (token === "option") {
- parseOption(field, token);
- skip(";");
- } else
- throw illegal(token);
-
- }, function parseField_line() {
- parseInlineOptions(field);
- });
- parent.add(field);
-
- // JSON defaults to packed=true if not set so we have to set packed=false explicity when
- // parsing proto2 descriptors without the option, where applicable. This must be done for
- // all known packable types and anything that could be an enum (= is not a basic type).
- if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined))
- field.setOption("packed", false, /* ifNotSet */ true);
- }
-
- function parseGroup(parent, rule) {
- var name = next();
-
- /* istanbul ignore if */
- if (!nameRe.test(name))
- throw illegal(name, "name");
-
- var fieldName = util.lcFirst(name);
- if (name === fieldName)
- name = util.ucFirst(name);
- skip("=");
- var id = parseId(next());
- var type = new Type(name);
- type.group = true;
- var field = new Field(fieldName, id, name, rule);
- field.filename = parse.filename;
- ifBlock(type, function parseGroup_block(token) {
- switch (token) {
-
- case "option":
- parseOption(type, token);
- skip(";");
- break;
-
- case "required":
- case "optional":
- case "repeated":
- parseField(type, token);
- break;
-
- /* istanbul ignore next */
- default:
- throw illegal(token); // there are no groups with proto3 semantics
- }
- });
- parent.add(type)
- .add(field);
- }
-
- function parseMapField(parent) {
- skip("<");
- var keyType = next();
-
- /* istanbul ignore if */
- if (types.mapKey[keyType] === undefined)
- throw illegal(keyType, "type");
-
- skip(",");
- var valueType = next();
-
- /* istanbul ignore if */
- if (!typeRefRe.test(valueType))
- throw illegal(valueType, "type");
-
- skip(">");
- var name = next();
-
- /* istanbul ignore if */
- if (!nameRe.test(name))
- throw illegal(name, "name");
-
- skip("=");
- var field = new MapField(applyCase(name), parseId(next()), keyType, valueType);
- ifBlock(field, function parseMapField_block(token) {
-
- /* istanbul ignore else */
- if (token === "option") {
- parseOption(field, token);
- skip(";");
- } else
- throw illegal(token);
-
- }, function parseMapField_line() {
- parseInlineOptions(field);
- });
- parent.add(field);
- }
-
- function parseOneOf(parent, token) {
-
- /* istanbul ignore if */
- if (!nameRe.test(token = next()))
- throw illegal(token, "name");
-
- var oneof = new OneOf(applyCase(token));
- ifBlock(oneof, function parseOneOf_block(token) {
- if (token === "option") {
- parseOption(oneof, token);
- skip(";");
- } else {
- push(token);
- parseField(oneof, "optional");
- }
- });
- parent.add(oneof);
- }
-
- function parseEnum(parent, token) {
-
- /* istanbul ignore if */
- if (!nameRe.test(token = next()))
- throw illegal(token, "name");
-
- var enm = new Enum(token);
- ifBlock(enm, function parseEnum_block(token) {
- switch(token) {
- case "option":
- parseOption(enm, token);
- skip(";");
- break;
-
- case "reserved":
- readRanges(enm.reserved || (enm.reserved = []), true);
- break;
-
- default:
- parseEnumValue(enm, token);
- }
- });
- parent.add(enm);
- }
-
- function parseEnumValue(parent, token) {
-
- /* istanbul ignore if */
- if (!nameRe.test(token))
- throw illegal(token, "name");
-
- skip("=");
- var value = parseId(next(), true),
- dummy = {};
- ifBlock(dummy, function parseEnumValue_block(token) {
-
- /* istanbul ignore else */
- if (token === "option") {
- parseOption(dummy, token); // skip
- skip(";");
- } else
- throw illegal(token);
-
- }, function parseEnumValue_line() {
- parseInlineOptions(dummy); // skip
- });
- parent.add(token, value, dummy.comment);
- }
-
- function parseOption(parent, token) {
- var isCustom = skip("(", true);
-
- /* istanbul ignore if */
- if (!typeRefRe.test(token = next()))
- throw illegal(token, "name");
-
- var name = token;
- if (isCustom) {
- skip(")");
- name = "(" + name + ")";
- token = peek();
- if (fqTypeRefRe.test(token)) {
- name += token;
- next();
- }
- }
- skip("=");
- parseOptionValue(parent, name);
- }
-
- function parseOptionValue(parent, name) {
- if (skip("{", true)) { // { a: "foo" b { c: "bar" } }
- do {
- /* istanbul ignore if */
- if (!nameRe.test(token = next()))
- throw illegal(token, "name");
-
- if (peek() === "{")
- parseOptionValue(parent, name + "." + token);
- else {
- skip(":");
- if (peek() === "{")
- parseOptionValue(parent, name + "." + token);
- else
- setOption(parent, name + "." + token, readValue(true));
- }
- } while (!skip("}", true));
- } else
- setOption(parent, name, readValue(true));
- // Does not enforce a delimiter to be universal
- }
-
- function setOption(parent, name, value) {
- if (parent.setOption)
- parent.setOption(name, value);
- }
-
- function parseInlineOptions(parent) {
- if (skip("[", true)) {
- do {
- parseOption(parent, "option");
- } while (skip(",", true));
- skip("]");
- }
- return parent;
- }
-
- function parseService(parent, token) {
-
- /* istanbul ignore if */
- if (!nameRe.test(token = next()))
- throw illegal(token, "service name");
-
- var service = new Service(token);
- ifBlock(service, function parseService_block(token) {
- if (parseCommon(service, token))
- return;
-
- /* istanbul ignore else */
- if (token === "rpc")
- parseMethod(service, token);
- else
- throw illegal(token);
- });
- parent.add(service);
- }
-
- function parseMethod(parent, token) {
- var type = token;
-
- /* istanbul ignore if */
- if (!nameRe.test(token = next()))
- throw illegal(token, "name");
-
- var name = token,
- requestType, requestStream,
- responseType, responseStream;
-
- skip("(");
- if (skip("stream", true))
- requestStream = true;
-
- /* istanbul ignore if */
- if (!typeRefRe.test(token = next()))
- throw illegal(token);
-
- requestType = token;
- skip(")"); skip("returns"); skip("(");
- if (skip("stream", true))
- responseStream = true;
-
- /* istanbul ignore if */
- if (!typeRefRe.test(token = next()))
- throw illegal(token);
-
- responseType = token;
- skip(")");
-
- var method = new Method(name, type, requestType, responseType, requestStream, responseStream);
- ifBlock(method, function parseMethod_block(token) {
-
- /* istanbul ignore else */
- if (token === "option") {
- parseOption(method, token);
- skip(";");
- } else
- throw illegal(token);
-
- });
- parent.add(method);
- }
-
- function parseExtension(parent, token) {
-
- /* istanbul ignore if */
- if (!typeRefRe.test(token = next()))
- throw illegal(token, "reference");
-
- var reference = token;
- ifBlock(null, function parseExtension_block(token) {
- switch (token) {
-
- case "required":
- case "repeated":
- case "optional":
- parseField(parent, token, reference);
- break;
-
- default:
- /* istanbul ignore if */
- if (!isProto3 || !typeRefRe.test(token))
- throw illegal(token);
- push(token);
- parseField(parent, "optional", reference);
- break;
- }
- });
- }
-
- var token;
- while ((token = next()) !== null) {
- switch (token) {
-
- case "package":
-
- /* istanbul ignore if */
- if (!head)
- throw illegal(token);
-
- parsePackage();
- break;
-
- case "import":
-
- /* istanbul ignore if */
- if (!head)
- throw illegal(token);
-
- parseImport();
- break;
-
- case "syntax":
-
- /* istanbul ignore if */
- if (!head)
- throw illegal(token);
-
- parseSyntax();
- break;
-
- case "option":
-
- /* istanbul ignore if */
- if (!head)
- throw illegal(token);
-
- parseOption(ptr, token);
- skip(";");
- break;
-
- default:
-
- /* istanbul ignore else */
- if (parseCommon(ptr, token)) {
- head = false;
- continue;
- }
-
- /* istanbul ignore next */
- throw illegal(token);
- }
- }
-
- parse.filename = null;
- return {
- "package" : pkg,
- "imports" : imports,
- weakImports : weakImports,
- syntax : syntax,
- root : root
- };
-}
-
-/**
- * Parses the given .proto source and returns an object with the parsed contents.
- * @name parse
- * @function
- * @param {string} source Source contents
- * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.
- * @returns {IParserResult} Parser result
- * @property {string} filename=null Currently processing file name for error reporting, if known
- * @property {IParseOptions} defaults Default {@link IParseOptions}
- * @variation 2
- */
-parse._configure = function (){
- tokenize = require("./tokenize"),
- Root = require("./root"),
- Type = require("./type"),
- Field = require("./field"),
- MapField = require("./mapField"),
- OneOf = require("./oneof"),
- Enum = require("./enum"),
- Service = require("./service"),
- Method = require("./method"),
- types = require("./types"),
- util = require("./util");
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/path.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/path.js
deleted file mode 100644
index 9864a0ea..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/path.js
+++ /dev/null
@@ -1,58 +0,0 @@
-var path = module.exports;
-
-var isAbsolute =
-/**
- * Tests if the specified path is absolute.
- * @param {string} path Path to test
- * @returns {boolean} `true` if path is absolute
- */
- path.isAbsolute = function isAbsolute(path) {
- return /^(?:\/|\w+:)/.test(path);
- };
-
-var normalize =
-/**
- * Normalizes the specified path.
- * @param {string} path Path to normalize
- * @returns {string} Normalized path
- */
- path.normalize = function normalize(path) {
- path = path.replace(/\\/g, "/")
- .replace(/\/{2,}/g, "/");
- var parts = path.split("/"),
- absolute = isAbsolute(path),
- prefix = "";
- if (absolute)
- prefix = parts.shift() + "/";
- for (var i = 0; i < parts.length;) {
- if (parts[i] === "..") {
- if (i > 0 && parts[i - 1] !== "..")
- parts.splice(--i, 2);
- else if (absolute)
- parts.splice(i, 1);
- else
- ++i;
- } else if (parts[i] === ".")
- parts.splice(i, 1);
- else
- ++i;
- }
- return prefix + parts.join("/");
- };
-
-/**
- * Resolves the specified include path against the specified origin path.
- * @param {string} originPath Path to the origin file
- * @param {string} includePath Include path relative to origin path
- * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized
- * @returns {string} Path to the include file
- */
-path.resolve = function resolve(originPath, includePath, alreadyNormalized) {
- if (!alreadyNormalized)
- includePath = normalize(includePath);
- if (isAbsolute(includePath))
- return includePath;
- if (!alreadyNormalized)
- originPath = normalize(originPath);
- return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
-};
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/pool.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/pool.js
deleted file mode 100644
index f9168270..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/pool.js
+++ /dev/null
@@ -1,47 +0,0 @@
-module.exports = pool;
-
-/**
- * An allocator as used by {@link util.pool}.
- * @typedef PoolAllocator
- * @type {function}
- * @param {number} size Buffer size
- * @returns {Uint8Array} Buffer
- */
-
-/**
- * A slicer as used by {@link util.pool}.
- * @typedef PoolSlicer
- * @type {function}
- * @param {number} start Start offset
- * @param {number} end End offset
- * @returns {Uint8Array} Buffer slice
- * @this {Uint8Array}
- */
-
-/**
- * A general purpose buffer pool.
- * @memberof util
- * @function
- * @param {PoolAllocator} alloc Allocator
- * @param {PoolSlicer} slice Slicer
- * @param {number} [size=8192] Slab size
- * @returns {PoolAllocator} Pooled allocator
- */
-function pool(alloc, slice, size) {
- var SIZE = size || 8192;
- var MAX = SIZE >>> 1;
- var slab = null;
- var offset = SIZE;
- return function pool_alloc(size) {
- if (size < 1 || size > MAX)
- return alloc(size);
- if (offset + size > SIZE) {
- slab = alloc(SIZE);
- offset = 0;
- }
- var buf = slice.call(slab, offset, offset += size);
- if (offset & 7) // align to 32 bit
- offset = (offset | 7) + 1;
- return buf;
- };
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/reader.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/reader.js
deleted file mode 100644
index 6dd93b86..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/reader.js
+++ /dev/null
@@ -1,314 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/13.
- */
-
-module.exports = Reader;
-
-var util = require('./util');
-
-var LongBits;
-var utf8;
-
-var BufferReader;
-
-function indexOutOfRange(reader, writeLength) {
- return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len);
-}
-
-
-function Reader(buffer) {
-
- /**
- * Read buffer.
- * @type {Uint8Array}
- */
- this.buf = buffer;
-
- /**
- * Read buffer position.
- * @type {number}
- */
- this.pos = 0;
-
- /**
- * Read buffer length.
- * @type {number}
- */
- this.len = buffer.length;
-}
-
-var create_array = typeof Uint8Array !== "undefined"
- ? function create_typed_array(buffer) {
- if (buffer instanceof Uint8Array || Array.isArray(buffer))
- return new Reader(buffer);
- if (typeof ArrayBuffer !== "undefined" && buffer instanceof ArrayBuffer) //增加ArrayBuffer构建
- return new Reader(new Uint8Array(buffer));
- throw Error("illegal buffer");
-}
- /* istanbul ignore next */
- : function create_array(buffer) {
- if (Array.isArray(buffer))
- return new Reader(buffer);
- throw Error("illegal buffer");
-};
-
-Reader.create = util.Buffer
- ? function create_buffer_setup(buffer) {
- return (Reader.create = function create_buffer(buffer) {
- return util.Buffer.isBuffer(buffer)
- ? new BufferReader(buffer)
- /* istanbul ignore next */
- : create_array(buffer);
- })(buffer);
-}
- /* istanbul ignore next */
- : create_array;
-
-Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;
-
-
-Reader.prototype.uint32 = (function read_uint32_setup() {
- var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)
- return function read_uint32() {
- value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;
- value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;
- value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;
- value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;
- value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;
-
- /* istanbul ignore if */
- if ((this.pos += 5) > this.len) {
- this.pos = this.len;
- throw indexOutOfRange(this, 10);
- }
- return value;
- };
-})();
-
-Reader.prototype.int32 = function read_int32() {
- return this.uint32() | 0;
-};
-
-Reader.prototype.sint32 = function read_sint32() {
- var value = this.uint32();
- return value >>> 1 ^ -(value & 1) | 0;
-};
-
-function readLongVarint() {
- // tends to deopt with local vars for octet etc.
- var bits = new LongBits(0, 0);
- var i = 0;
- if (this.len - this.pos > 4) { // fast route (lo)
- for (; i < 4; ++i) {
- // 1st..4th
- bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;
- if (this.buf[this.pos++] < 128)
- return bits;
- }
- // 5th
- bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;
- bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;
- if (this.buf[this.pos++] < 128)
- return bits;
- i = 0;
- } else {
- for (; i < 3; ++i) {
- /* istanbul ignore if */
- if (this.pos >= this.len)
- throw indexOutOfRange(this);
- // 1st..3th
- bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;
- if (this.buf[this.pos++] < 128)
- return bits;
- }
- // 4th
- bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;
- return bits;
- }
- if (this.len - this.pos > 4) { // fast route (hi)
- for (; i < 5; ++i) {
- // 6th..10th
- bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;
- if (this.buf[this.pos++] < 128)
- return bits;
- }
- } else {
- for (; i < 5; ++i) {
- /* istanbul ignore if */
- if (this.pos >= this.len)
- throw indexOutOfRange(this);
- // 6th..10th
- bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;
- if (this.buf[this.pos++] < 128)
- return bits;
- }
- }
- /* istanbul ignore next */
- throw Error("invalid varint encoding");
-}
-
-Reader.prototype.bool = function read_bool() {
- return this.uint32() !== 0;
-};
-
-
-function readFixed32_end(buf, end) { // note that this uses `end`, not `pos`
- return (buf[end - 4]
- | buf[end - 3] << 8
- | buf[end - 2] << 16
- | buf[end - 1] << 24) >>> 0;
-}
-
-Reader.prototype.fixed32 = function read_fixed32() {
-
- /* istanbul ignore if */
- if (this.pos + 4 > this.len)
- throw indexOutOfRange(this, 4);
-
- return readFixed32_end(this.buf, this.pos += 4);
-};
-
-Reader.prototype.sfixed32 = function read_sfixed32() {
-
- /* istanbul ignore if */
- if (this.pos + 4 > this.len)
- throw indexOutOfRange(this, 4);
-
- return readFixed32_end(this.buf, this.pos += 4) | 0;
-};
-
-/* eslint-disable no-invalid-this */
-
-function readFixed64(/* this: Reader */) {
-
- /* istanbul ignore if */
- if (this.pos + 8 > this.len)
- throw indexOutOfRange(this, 8);
-
- return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));
-}
-
-
-Reader.prototype.float = function read_float() {
-
- /* istanbul ignore if */
- if (this.pos + 4 > this.len)
- throw indexOutOfRange(this, 4);
-
- var value = util.float.readFloatLE(this.buf, this.pos);
- this.pos += 4;
- return value;
-};
-
-Reader.prototype.double = function read_double() {
-
- /* istanbul ignore if */
- if (this.pos + 8 > this.len)
- throw indexOutOfRange(this, 4);
-
- var value = util.float.readDoubleLE(this.buf, this.pos);
- this.pos += 8;
- return value;
-};
-
-Reader.prototype.bytes = function read_bytes() {
- var length = this.uint32(),
- start = this.pos,
- end = this.pos + length;
-
- /* istanbul ignore if */
- if (end > this.len)
- throw indexOutOfRange(this, length);
- this.pos += length;
- if (Array.isArray(this.buf)) // plain array
- return this.buf.slice(start, end);
- return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1
- ? new this.buf.constructor(0)
- : this._slice.call(this.buf, start, end);
-};
-
-Reader.prototype.string = function read_string() {
- var bytes = this.bytes();
- return utf8.read(bytes, 0, bytes.length);
-};
-
-Reader.prototype.skip = function skip(length) {
- if (typeof length === "number") {
- /* istanbul ignore if */
- if (this.pos + length > this.len)
- throw indexOutOfRange(this, length);
- this.pos += length;
- } else {
- do {
- /* istanbul ignore if */
- if (this.pos >= this.len)
- throw indexOutOfRange(this);
- } while (this.buf[this.pos++] & 128);
- }
- return this;
-};
-
-Reader.prototype.skipType = function(wireType) {
- switch (wireType) {
- case 0:
- this.skip();
- break;
- case 1:
- this.skip(8);
- break;
- case 2:
- this.skip(this.uint32());
- break;
- case 3:
- do { // eslint-disable-line no-constant-condition
- if ((wireType = this.uint32() & 7) === 4)
- break;
- this.skipType(wireType);
- } while (true);
- break;
- case 5:
- this.skip(4);
- break;
-
- /* istanbul ignore next */
- default:
- throw Error("invalid wire type " + wireType + " at offset " + this.pos);
- }
- return this;
-};
-
-
-
-//这部分可能用不到
-Reader._configure = function() {
-
- //util = require('./util');
- LongBits = require("./longBits");
- utf8 = require("./utf8");
-
- var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber";
- util.merge(Reader.prototype, {
-
- int64: function read_int64() {
- return readLongVarint.call(this)[fn](false);
- },
-
- uint64: function read_uint64() {
- return readLongVarint.call(this)[fn](true);
- },
-
- sint64: function read_sint64() {
- return readLongVarint.call(this).zzDecode()[fn](false);
- },
-
- fixed64: function read_fixed64() {
- return readFixed64.call(this)[fn](true);
- },
-
- sfixed64: function read_sfixed64() {
- return readFixed64.call(this)[fn](false);
- }
-
- });
-};
-
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/root.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/root.js
deleted file mode 100644
index ecf69d4a..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/root.js
+++ /dev/null
@@ -1,439 +0,0 @@
-module.exports = Root;
-
-// extends Namespace
-var Namespace = require("./namespace");
-((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root";
-
-var Field = require("./field"),
- Enum = require("./enum"),
- OneOf = require("./oneof"),
- util = require("./util");
-
-var Type, // cyclic
- parse, // might be excluded
- common; // "
-
-/**
- * Constructs a new root namespace instance.
- * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.
- * @extends NamespaceBase
- * @constructor
- * @param {Object.} [options] Top level options
- */
-function Root(options) {
- Namespace.call(this, "", options);
-
- /**
- * Deferred extension fields.
- * @type {Field[]}
- */
- this.deferred = [];
-
- /**
- * Resolved file names of loaded files.
- * @type {string[]}
- */
- this.files = [];
-
- /**
- * Resolved name of parsered pbString.
- * @type {string[]}
- */
- this.names = [];
-}
-
-/**
- * Loads a namespace descriptor into a root namespace.
- * @param {INamespace} json Nameespace descriptor
- * @param {Root} [root] Root namespace, defaults to create a new one if omitted
- * @returns {Root} Root namespace
- */
-Root.fromJSON = function fromJSON(json, root) {
- json = typeof json === 'string' ? JSON.parse(json) : json;
- if (!root)
- root = new Root();
- if (json.options)
- root.setOptions(json.options);
- return root.addJSON(json.nested);
-};
-
-/**
- * Resolves the path of an imported file, relative to the importing origin.
- * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.
- * @function
- * @param {string} origin The file name of the importing file
- * @param {string} target The file name being imported
- * @returns {string|null} Resolved path to `target` or `null` to skip the file
- */
-Root.prototype.resolvePath = util.path.resolve;
-
-// A symbol-like function to safely signal synchronous loading
-/* istanbul ignore next */
-function SYNC() {} // eslint-disable-line no-empty-function
-
-function parseFromPbString(pbString, options, callback){
-
- if (typeof options === "function") {
- callback = options;
- options = undefined;
- }
- var self = this;
- if (!callback){
- return util.asPromise(parseFromPbString, self, pbString, options);
- }
-
- var pbObj = null;
- if(typeof pbString === 'string'){
- pbObj = JSON.parse(pbString);
- }else if(typeof pbString === 'object'){
- pbObj = pbString;
- }else {
- //throw Error("pb格式转化失败");
- console.log("pb格式转化失败");
- return undefined;
- }
-
- var name = pbObj['name'];
- var pbJsonStr = pbObj['pbJsonStr'];
-
- function finish(err, root){
- if(!callback)
- return;
- var cb = callback;
- callback = null;
- cb(err, root);
- }
-
- function process(name, source){
- try {
- if (util.isString(source) && source.charAt(0) === "{")
- source = JSON.parse(source);
- if (!util.isString(source))
- self.setOptions(source.options).addJSON(source.nested);
- else {
- parse.filename = name;
- var parsed = parse(source, self, options),
- resolved;
- var i = 0;
- if(parsed.imports){
- for (; i < parsed.imports.length; ++i){
- resolved = parsed.imports[i];
- fetch(resolved);
- }
- }
- if (parsed.weakImports){
- for (i = 0; i < parsed.weakImports.length; ++i)
- resolved = parsed.weakImports[i];
- fetch(resolved, true);
- }
- }
- } catch (err) {
- finish(err);
- }
-
- finish(null, self); // only once anyway
- }
-
- function fetch(name){
- if(self.names.indexOf(name)>-1)
- return;
- self.names.push(name);
- if (name in common){
- process(name, common[name]);
- }
- }
-
- process(name, pbJsonStr);
- return undefined;
-}
-
-Root.prototype.parseFromPbString = parseFromPbString;
-
-/**
- * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.
- * @param {string|string[]} filename Names of one or multiple files to load
- * @param {IParseOptions} options Parse options
- * @param {LoadCallback} callback Callback function
- * @returns {undefined}
- */
-Root.prototype.load = function load(filename, options, callback) {
- if (typeof options === "function") {
- callback = options;
- options = undefined;
- }
- var self = this;
- if (!callback)
- return util.asPromise(load, self, filename, options);
-
- var sync = callback === SYNC; // undocumented
-
- // Finishes loading by calling the callback (exactly once)
- function finish(err, root) {
- /* istanbul ignore if */
- if (!callback)
- return;
- var cb = callback;
- callback = null;
- if (sync)
- throw err;
- cb(err, root);
- }
-
- // Processes a single file
- function process(filename, source) {
- try {
- if (util.isString(source) && source.charAt(0) === "{")
- source = JSON.parse(source);
- if (!util.isString(source))
- self.setOptions(source.options).addJSON(source.nested);
- else {
- parse.filename = filename;
- var parsed = parse(source, self, options),
- resolved,
- i = 0;
- if (parsed.imports)
- for (; i < parsed.imports.length; ++i)
- if (resolved = self.resolvePath(filename, parsed.imports[i]))
- fetch(resolved);
- if (parsed.weakImports)
- for (i = 0; i < parsed.weakImports.length; ++i)
- if (resolved = self.resolvePath(filename, parsed.weakImports[i]))
- fetch(resolved, true);
- }
- } catch (err) {
- finish(err);
- }
- if (!sync && !queued)
- finish(null, self); // only once anyway
- }
-
- // Fetches a single file
- function fetch(filename, weak) {
-
- // Strip path if this file references a bundled definition
- var idx = filename.lastIndexOf("google/protobuf/");
- if (idx > -1) {
- var altname = filename.substring(idx);
- if (altname in common)
- filename = altname;
- }
-
- // Skip if already loaded / attempted
- if (self.files.indexOf(filename) > -1)
- return;
- self.files.push(filename);
-
- // Shortcut bundled definitions
- if (filename in common) {
- if (sync)
- process(filename, common[filename]);
- else {
- ++queued;
- setTimeout(function() {
- --queued;
- process(filename, common[filename]);
- });
- }
- return;
- }
-
- // Otherwise fetch from disk or network
- if (sync) {
- var source;
- try {
- source = util.fs.readFileSync(filename).toString("utf8");
- } catch (err) {
- if (!weak)
- finish(err);
- return;
- }
- process(filename, source);
- } else {
- ++queued;
- util.fetch(filename, function(err, source) {
- --queued;
- /* istanbul ignore if */
- if (!callback)
- return; // terminated meanwhile
- if (err) {
- /* istanbul ignore else */
- if (!weak)
- finish(err);
- else if (!queued) // can't be covered reliably
- finish(null, self);
- return;
- }
- process(filename, source);
- });
- }
- }
- var queued = 0;
-
- // Assembling the root namespace doesn't require working type
- // references anymore, so we can load everything in parallel
- if (util.isString(filename))
- filename = [ filename ];
- for (var i = 0, resolved; i < filename.length; ++i)
- if (resolved = self.resolvePath("", filename[i]))
- fetch(resolved);
-
- if (sync)
- return self;
- if (!queued)
- finish(null, self);
- return undefined;
-};
-// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined
-
-/**
- * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.
- * @function Root#load
- * @param {string|string[]} filename Names of one or multiple files to load
- * @param {LoadCallback} callback Callback function
- * @returns {undefined}
- * @variation 2
- */
-// function load(filename:string, callback:LoadCallback):undefined
-
-/**
- * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.
- * @function Root#load
- * @param {string|string[]} filename Names of one or multiple files to load
- * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.
- * @returns {Promise} Promise
- * @variation 3
- */
-// function load(filename:string, [options:IParseOptions]):Promise
-
-/**
- * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).
- * @function Root#loadSync
- * @param {string|string[]} filename Names of one or multiple files to load
- * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.
- * @returns {Root} Root namespace
- * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid
- */
-Root.prototype.loadSync = function loadSync(filename, options) {
- if (!util.isNode)
- throw Error("not supported");
- return this.load(filename, options, SYNC);
-};
-
-/**
- * @override
- */
-Root.prototype.resolveAll = function resolveAll() {
- if (this.deferred.length)
- throw Error("unresolvable extensions: " + this.deferred.map(function(field) {
- return "'extend " + field.extend + "' in " + field.parent.fullName;
- }).join(", "));
- return Namespace.prototype.resolveAll.call(this);
-};
-
-// only uppercased (and thus conflict-free) children are exposed, see below
-var exposeRe = /^[A-Z]/;
-
-/**
- * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.
- * @param {Root} root Root instance
- * @param {Field} field Declaring extension field witin the declaring type
- * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise
- * @inner
- * @ignore
- */
-function tryHandleExtension(root, field) {
- var extendedType = field.parent.lookup(field.extend);
- if (extendedType) {
- var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);
- sisterField.declaringField = field;
- field.extensionField = sisterField;
- extendedType.add(sisterField);
- return true;
- }
- return false;
-}
-
-/**
- * Called when any object is added to this root or its sub-namespaces.
- * @param {ReflectionObject} object Object added
- * @returns {undefined}
- * @private
- */
-Root.prototype._handleAdd = function _handleAdd(object) {
- if (object instanceof Field) {
-
- if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)
- if (!tryHandleExtension(this, object))
- this.deferred.push(object);
-
- } else if (object instanceof Enum) {
-
- if (exposeRe.test(object.name))
- object.parent[object.name] = object.values; // expose enum values as property of its parent
-
- } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {
-
- if (object instanceof Type) // Try to handle any deferred extensions
- for (var i = 0; i < this.deferred.length;)
- if (tryHandleExtension(this, this.deferred[i]))
- this.deferred.splice(i, 1);
- else
- ++i;
- for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace
- this._handleAdd(object._nestedArray[j]);
- if (exposeRe.test(object.name))
- object.parent[object.name] = object; // expose namespace as property of its parent
- }
-
- // The above also adds uppercased (and thus conflict-free) nested types, services and enums as
- // properties of namespaces just like static code does. This allows using a .d.ts generated for
- // a static module with reflection-based solutions where the condition is met.
-};
-
-/**
- * Called when any object is removed from this root or its sub-namespaces.
- * @param {ReflectionObject} object Object removed
- * @returns {undefined}
- * @private
- */
-Root.prototype._handleRemove = function _handleRemove(object) {
- if (object instanceof Field) {
-
- if (/* an extension field */ object.extend !== undefined) {
- if (/* already handled */ object.extensionField) { // remove its sister field
- object.extensionField.parent.remove(object.extensionField);
- object.extensionField = null;
- } else { // cancel the extension
- var index = this.deferred.indexOf(object);
- /* istanbul ignore else */
- if (index > -1)
- this.deferred.splice(index, 1);
- }
- }
-
- } else if (object instanceof Enum) {
-
- if (exposeRe.test(object.name))
- delete object.parent[object.name]; // unexpose enum values
-
- } else if (object instanceof Namespace) {
-
- for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace
- this._handleRemove(object._nestedArray[i]);
-
- if (exposeRe.test(object.name))
- delete object.parent[object.name]; // unexpose namespaces
-
- }
-};
-
-Root._configure = function() {
- Type = require('./type');
- parse = require('./parse');
- common = require('./common');
-
- Field = require("./field");
- Enum = require("./enum");
- OneOf = require("./oneof");
- util = require("./util");
-};
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/roots.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/roots.js
deleted file mode 100644
index 70ad6602..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/roots.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/13.
- */
-
-
-module.exports = {};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/rpc/service.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/rpc/service.js
deleted file mode 100644
index b0c8243e..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/rpc/service.js
+++ /dev/null
@@ -1,141 +0,0 @@
-"use strict";
-module.exports = Service;
-var util = require("../util");
-
-// Extends EventEmitter
-(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;
-
-/**
- * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.
- *
- * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.
- * @typedef rpc.ServiceMethodCallback
- * @template TRes extends Message
- * @type {function}
- * @param {Error|null} error Error, if any
- * @param {TRes} [response] Response message
- * @returns {undefined}
- */
-
-/**
- * A service method part of a {@link rpc.Service} as created by {@link Service.create}.
- * @typedef rpc.ServiceMethod
- * @template TReq extends Message
- * @template TRes extends Message
- * @type {function}
- * @param {TReq|Properties} request Request message or plain object
- * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message
- * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`
- */
-
-/**
- * Constructs a new RPC service instance.
- * @classdesc An RPC service as returned by {@link Service#create}.
- * @exports rpc.Service
- * @extends util.EventEmitter
- * @constructor
- * @param {RPCImpl} rpcImpl RPC implementation
- * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
- * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
- */
-function Service(rpcImpl, requestDelimited, responseDelimited) {
-
- if (typeof rpcImpl !== "function")
- throw TypeError("rpcImpl must be a function");
-
- util.EventEmitter.call(this);
-
- /**
- * RPC implementation. Becomes `null` once the service is ended.
- * @type {RPCImpl|null}
- */
- this.rpcImpl = rpcImpl;
-
- /**
- * Whether requests are length-delimited.
- * @type {boolean}
- */
- this.requestDelimited = Boolean(requestDelimited);
-
- /**
- * Whether responses are length-delimited.
- * @type {boolean}
- */
- this.responseDelimited = Boolean(responseDelimited);
-}
-
-/**
- * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.
- * @param {Method|rpc.ServiceMethod} method Reflected or static method
- * @param {Constructor} requestCtor Request constructor
- * @param {Constructor} responseCtor Response constructor
- * @param {TReq|Properties} request Request message or plain object
- * @param {rpc.ServiceMethodCallback} callback Service callback
- * @returns {undefined}
- * @template TReq extends Message
- * @template TRes extends Message
- */
-Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {
-
- if (!request)
- throw TypeError("request must be specified");
-
- var self = this;
- if (!callback)
- return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);
-
- if (!self.rpcImpl) {
- setTimeout(function() { callback(Error("already ended")); }, 0);
- return undefined;
- }
-
- try {
- return self.rpcImpl(
- method,
- requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(),
- function rpcCallback(err, response) {
-
- if (err) {
- self.emit("error", err, method);
- return callback(err);
- }
-
- if (response === null) {
- self.end(/* endedByRPC */ true);
- return undefined;
- }
-
- if (!(response instanceof responseCtor)) {
- try {
- response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response);
- } catch (err) {
- self.emit("error", err, method);
- return callback(err);
- }
- }
-
- self.emit("data", response, method);
- return callback(null, response);
- }
- );
- } catch (err) {
- self.emit("error", err, method);
- setTimeout(function() { callback(err); }, 0);
- return undefined;
- }
-};
-
-/**
- * Ends this service and emits the `end` event.
- * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.
- * @returns {rpc.Service} `this`
- */
-Service.prototype.end = function end(endedByRPC) {
- if (this.rpcImpl) {
- if (!endedByRPC) // signal end to rpcImpl
- this.rpcImpl(null, null, null);
- this.rpcImpl = null;
- this.emit("end").off();
- }
- return this;
-};
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/service.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/service.js
deleted file mode 100644
index e7c30e5d..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/service.js
+++ /dev/null
@@ -1,173 +0,0 @@
-"use strict";
-module.exports = Service;
-
-// extends Namespace
-var Namespace = require("./namespace");
-((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service";
-
-var Method,
- util,
- rpc;
-
-/**
- * Constructs a new service instance.
- * @classdesc Reflected service.
- * @extends NamespaceBase
- * @constructor
- * @param {string} name Service name
- * @param {Object.} [options] Service options
- * @throws {TypeError} If arguments are invalid
- */
-function Service(name, options) {
- Namespace.call(this, name, options);
-
- /**
- * Service methods.
- * @type {Object.}
- */
- this.methods = {}; // toJSON, marker
-
- /**
- * Cached methods as an array.
- * @type {Method[]|null}
- * @private
- */
- this._methodsArray = null;
-}
-
-/**
- * Service descriptor.
- * @interface IService
- * @extends INamespace
- * @property {Object.} methods Method descriptors
- */
-
-/**
- * Constructs a service from a service descriptor.
- * @param {string} name Service name
- * @param {IService} json Service descriptor
- * @returns {Service} Created service
- * @throws {TypeError} If arguments are invalid
- */
-Service.fromJSON = function fromJSON(name, json) {
- var service = new Service(name, json.options);
- /* istanbul ignore else */
- if (json.methods)
- for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)
- service.add(Method.fromJSON(names[i], json.methods[names[i]]));
- if (json.nested)
- service.addJSON(json.nested);
- service.comment = json.comment;
- return service;
-};
-
-/**
- * Converts this service to a service descriptor.
- * @param {IToJSONOptions} [toJSONOptions] JSON conversion options
- * @returns {IService} Service descriptor
- */
-Service.prototype.toJSON = function toJSON(toJSONOptions) {
- var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);
- var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
- return util.toObject([
- "options" , inherited && inherited.options || undefined,
- "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},
- "nested" , inherited && inherited.nested || undefined,
- "comment" , keepComments ? this.comment : undefined
- ]);
-};
-
-/**
- * Methods of this service as an array for iteration.
- * @name Service#methodsArray
- * @type {Method[]}
- * @readonly
- */
-Object.defineProperty(Service.prototype, "methodsArray", {
- get: function() {
- return this._methodsArray || (this._methodsArray = util.toArray(this.methods));
- }
-});
-
-function clearCache(service) {
- service._methodsArray = null;
- return service;
-}
-
-/**
- * @override
- */
-Service.prototype.get = function get(name) {
- return this.methods[name]
- || Namespace.prototype.get.call(this, name);
-};
-
-/**
- * @override
- */
-Service.prototype.resolveAll = function resolveAll() {
- var methods = this.methodsArray;
- for (var i = 0; i < methods.length; ++i)
- methods[i].resolve();
- return Namespace.prototype.resolve.call(this);
-};
-
-/**
- * @override
- */
-Service.prototype.add = function add(object) {
-
- /* istanbul ignore if */
- if (this.get(object.name))
- throw Error("duplicate name '" + object.name + "' in " + this);
-
- if (object instanceof Method) {
- this.methods[object.name] = object;
- object.parent = this;
- return clearCache(this);
- }
- return Namespace.prototype.add.call(this, object);
-};
-
-/**
- * @override
- */
-Service.prototype.remove = function remove(object) {
- if (object instanceof Method) {
-
- /* istanbul ignore if */
- if (this.methods[object.name] !== object)
- throw Error(object + " is not a member of " + this);
-
- delete this.methods[object.name];
- object.parent = null;
- return clearCache(this);
- }
- return Namespace.prototype.remove.call(this, object);
-};
-
-/**
- * Creates a runtime service using the specified rpc implementation.
- * @param {RPCImpl} rpcImpl RPC implementation
- * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
- * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
- * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.
- */
-Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {
- var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);
- for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {
- var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, "");
- rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({
- m: method,
- q: method.resolvedRequestType.ctor,
- s: method.resolvedResponseType.ctor
- });
- }
- return rpcService;
-};
-
-Service._configure = function (){
- Method = require("./method");
- util = require("./util");
- rpc = require("./rpc/service");
-};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/tokenize.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/tokenize.js
deleted file mode 100644
index ce2ca698..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/tokenize.js
+++ /dev/null
@@ -1,396 +0,0 @@
-module.exports = tokenize;
-
-var delimRe = /[\s{}=;:[\],'"()<>]/g,
- stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
- stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g;
-
-var setCommentRe = /^ *[*/]+ */,
- setCommentAltRe = /^\s*\*?\/*/,
- setCommentSplitRe = /\n/g,
- whitespaceRe = /\s/,
- unescapeRe = /\\(.?)/g;
-
-var unescapeMap = {
- "0": "\0",
- "r": "\r",
- "n": "\n",
- "t": "\t"
-};
-
-/**
- * Unescapes a string.
- * @param {string} str String to unescape
- * @returns {string} Unescaped string
- * @property {Object.} map Special characters map
- * @memberof tokenize
- */
-function unescape(str) {
- return str.replace(unescapeRe, function($0, $1) {
- switch ($1) {
- case "\\":
- case "":
- return $1;
- default:
- return unescapeMap[$1] || "";
- }
- });
-}
-
-tokenize.unescape = unescape;
-
-/**
- * Gets the next token and advances.
- * @typedef TokenizerHandleNext
- * @type {function}
- * @returns {string|null} Next token or `null` on eof
- */
-
-/**
- * Peeks for the next token.
- * @typedef TokenizerHandlePeek
- * @type {function}
- * @returns {string|null} Next token or `null` on eof
- */
-
-/**
- * Pushes a token back to the stack.
- * @typedef TokenizerHandlePush
- * @type {function}
- * @param {string} token Token
- * @returns {undefined}
- */
-
-/**
- * Skips the next token.
- * @typedef TokenizerHandleSkip
- * @type {function}
- * @param {string} expected Expected token
- * @param {boolean} [optional=false] If optional
- * @returns {boolean} Whether the token matched
- * @throws {Error} If the token didn't match and is not optional
- */
-
-/**
- * Gets the comment on the previous line or, alternatively, the line comment on the specified line.
- * @typedef TokenizerHandleCmnt
- * @type {function}
- * @param {number} [line] Line number
- * @returns {string|null} Comment text or `null` if none
- */
-
-/**
- * Handle object returned from {@link tokenize}.
- * @interface ITokenizerHandle
- * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof)
- * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof)
- * @property {TokenizerHandlePush} push Pushes a token back to the stack
- * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws
- * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any
- * @property {number} line Current line number
- */
-
-/**
- * Tokenizes the given .proto source and returns an object with useful utility functions.
- * @param {string} source Source contents
- * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode.
- * @returns {ITokenizerHandle} Tokenizer handle
- */
-function tokenize(source, alternateCommentMode) {
- /* eslint-disable callback-return */
- source = source.toString();
-
- var offset = 0,
- length = source.length,
- line = 1,
- commentType = null,
- commentText = null,
- commentLine = 0,
- commentLineEmpty = false;
-
- var stack = [];
-
- var stringDelim = null;
-
- /* istanbul ignore next */
- /**
- * Creates an error for illegal syntax.
- * @param {string} subject Subject
- * @returns {Error} Error created
- * @inner
- */
- function illegal(subject) {
- return Error("illegal " + subject + " (line " + line + ")");
- }
-
- /**
- * Reads a string till its end.
- * @returns {string} String read
- * @inner
- */
- function readString() {
- var re = stringDelim === "'" ? stringSingleRe : stringDoubleRe;
- re.lastIndex = offset - 1;
- var match = re.exec(source);
- if (!match)
- throw illegal("string");
- offset = re.lastIndex;
- push(stringDelim);
- stringDelim = null;
- return unescape(match[1]);
- }
-
- /**
- * Gets the character at `pos` within the source.
- * @param {number} pos Position
- * @returns {string} Character
- * @inner
- */
- function charAt(pos) {
- return source.charAt(pos);
- }
-
- /**
- * Sets the current comment text.
- * @param {number} start Start offset
- * @param {number} end End offset
- * @returns {undefined}
- * @inner
- */
- function setComment(start, end) {
- commentType = source.charAt(start++);
- commentLine = line;
- commentLineEmpty = false;
- var lookback;
- if (alternateCommentMode) {
- lookback = 2; // alternate comment parsing: "//" or "/*"
- } else {
- lookback = 3; // "///" or "/**"
- }
- var commentOffset = start - lookback,
- c;
- do {
- if (--commentOffset < 0 ||
- (c = source.charAt(commentOffset)) === "\n") {
- commentLineEmpty = true;
- break;
- }
- } while (c === " " || c === "\t");
- var lines = source
- .substring(start, end)
- .split(setCommentSplitRe);
- for (var i = 0; i < lines.length; ++i)
- lines[i] = lines[i]
- .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, "")
- .trim();
- commentText = lines
- .join("\n")
- .trim();
- }
-
- function isDoubleSlashCommentLine(startOffset) {
- var endOffset = findEndOfLine(startOffset);
-
- // see if remaining line matches comment pattern
- var lineText = source.substring(startOffset, endOffset);
- // look for 1 or 2 slashes since startOffset would already point past
- // the first slash that started the comment.
- var isComment = /^\s*\/{1,2}/.test(lineText);
- return isComment;
- }
-
- function findEndOfLine(cursor) {
- // find end of cursor's line
- var endOffset = cursor;
- while (endOffset < length && charAt(endOffset) !== "\n") {
- endOffset++;
- }
- return endOffset;
- }
-
- /**
- * Obtains the next token.
- * @returns {string|null} Next token or `null` on eof
- * @inner
- */
- function next() {
- if (stack.length > 0)
- return stack.shift();
- if (stringDelim)
- return readString();
- var repeat,
- prev,
- curr,
- start,
- isDoc;
- do {
- if (offset === length)
- return null;
- repeat = false;
- while (whitespaceRe.test(curr = charAt(offset))) {
- if (curr === "\n")
- ++line;
- if (++offset === length)
- return null;
- }
-
- if (charAt(offset) === "/") {
- if (++offset === length) {
- throw illegal("comment");
- }
- if (charAt(offset) === "/") { // Line
- if (!alternateCommentMode) {
- // check for triple-slash comment
- isDoc = charAt(start = offset + 1) === "/";
-
- while (charAt(++offset) !== "\n") {
- if (offset === length) {
- return null;
- }
- }
- ++offset;
- if (isDoc) {
- setComment(start, offset - 1);
- }
- ++line;
- repeat = true;
- } else {
- // check for double-slash comments, consolidating consecutive lines
- start = offset;
- isDoc = false;
- if (isDoubleSlashCommentLine(offset)) {
- isDoc = true;
- do {
- offset = findEndOfLine(offset);
- if (offset === length) {
- break;
- }
- offset++;
- } while (isDoubleSlashCommentLine(offset));
- } else {
- offset = Math.min(length, findEndOfLine(offset) + 1);
- }
- if (isDoc) {
- setComment(start, offset);
- }
- line++;
- repeat = true;
- }
- } else if ((curr = charAt(offset)) === "*") { /* Block */
- // check for /** (regular comment mode) or /* (alternate comment mode)
- start = offset + 1;
- isDoc = alternateCommentMode || charAt(start) === "*";
- do {
- if (curr === "\n") {
- ++line;
- }
- if (++offset === length) {
- throw illegal("comment");
- }
- prev = curr;
- curr = charAt(offset);
- } while (prev !== "*" || curr !== "/");
- ++offset;
- if (isDoc) {
- setComment(start, offset - 2);
- }
- repeat = true;
- } else {
- return "/";
- }
- }
- } while (repeat);
-
- // offset !== length if we got here
-
- var end = offset;
- delimRe.lastIndex = 0;
- var delim = delimRe.test(charAt(end++));
- if (!delim)
- while (end < length && !delimRe.test(charAt(end)))
- ++end;
- var token = source.substring(offset, offset = end);
- if (token === "\"" || token === "'")
- stringDelim = token;
- return token;
- }
-
- /**
- * Pushes a token back to the stack.
- * @param {string} token Token
- * @returns {undefined}
- * @inner
- */
- function push(token) {
- stack.push(token);
- }
-
- /**
- * Peeks for the next token.
- * @returns {string|null} Token or `null` on eof
- * @inner
- */
- function peek() {
- if (!stack.length) {
- var token = next();
- if (token === null)
- return null;
- push(token);
- }
- return stack[0];
- }
-
- /**
- * Skips a token.
- * @param {string} expected Expected token
- * @param {boolean} [optional=false] Whether the token is optional
- * @returns {boolean} `true` when skipped, `false` if not
- * @throws {Error} When a required token is not present
- * @inner
- */
- function skip(expected, optional) {
- var actual = peek(),
- equals = actual === expected;
- if (equals) {
- next();
- return true;
- }
- if (!optional)
- throw illegal("token '" + actual + "', '" + expected + "' expected");
- return false;
- }
-
- /**
- * Gets a comment.
- * @param {number} [trailingLine] Line number if looking for a trailing comment
- * @returns {string|null} Comment text
- * @inner
- */
- function cmnt(trailingLine) {
- var ret = null;
- if (trailingLine === undefined) {
- if (commentLine === line - 1 && (alternateCommentMode || commentType === "*" || commentLineEmpty)) {
- ret = commentText;
- }
- } else {
- /* istanbul ignore else */
- if (commentLine < trailingLine) {
- peek();
- }
- if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === "/")) {
- ret = commentText;
- }
- }
- return ret;
- }
-
- return Object.defineProperty({
- next: next,
- peek: peek,
- push: push,
- skip: skip,
- cmnt: cmnt
- }, "line", {
- get: function() { return line; }
- });
- /* eslint-enable callback-return */
-}
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/type.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/type.js
deleted file mode 100644
index 844da0a7..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/type.js
+++ /dev/null
@@ -1,584 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/13.
- */
-
-
-module.exports = Type;
-
-var Namespace = require("./namespace");
-((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type";
-
-
-var Enum,
- Field,
- Message,
- OneOf,
- Writer,
- Reader,
- util,
- verifier,
- encoder,
- decoder,
- Service,
- wrappers,
- converter,
- MapField;
-
-
-
-function Type(name, options) {
- Namespace.call(this, name, options);
-
- /**
- * Message fields.
- * @type {Object.}
- */
- this.fields = {}; // toJSON, marker
-
- /**
- * Oneofs declared within this namespace, if any.
- * @type {Object.}
- */
- this.oneofs = undefined; // toJSON
-
- /**
- * Extension ranges, if any.
- * @type {number[][]}
- */
- this.extensions = undefined; // toJSON
-
- /**
- * Reserved ranges, if any.
- * @type {Array.}
- */
- this.reserved = undefined; // toJSON
-
- /*?
- * Whether this type is a legacy group.
- * @type {boolean|undefined}
- */
- this.group = undefined; // toJSON 这个可能不需要,因为不支持
-
- /**
- * Cached fields by id.
- * @type {Object.|null}
- * @private
- */
- this._fieldsById = null;
-
- /**
- * Cached fields as an array.
- * @type {Field[]|null}
- * @private
- */
- this._fieldsArray = null;
-
- /**
- * Cached oneofs as an array.
- * @type {OneOf[]|null}
- * @private
- */
- this._oneofsArray = null;
-
- /**
- * Cached constructor.
- * @type {Constructor<{}>}
- * @private
- */
- this._ctor = null;
-}
-
-
-Object.defineProperties(Type.prototype, {
-
- /**
- * Message fields by id.
- * @name Type#fieldsById
- * @type {Object.}
- * @readonly
- */
- fieldsById: {
- get: function() {
-
- /* istanbul ignore if */
- if (this._fieldsById)
- return this._fieldsById;
-
- this._fieldsById = {};
- for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {
- var field = this.fields[names[i]],
- id = field.id;
-
- /* istanbul ignore if */
- if (this._fieldsById[id])
- throw Error("duplicate id " + id + " in " + this);
-
- this._fieldsById[id] = field;
- }
- return this._fieldsById;
- }
- },
-
- /**
- * Fields of this message as an array for iteration.
- * @name Type#fieldsArray
- * @type {Field[]}
- * @readonly
- */
- fieldsArray: {
- get: function() {
- return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));
- }
- },
-
- /**
- * Oneofs of this message as an array for iteration.
- * @name Type#oneofsArray
- * @type {OneOf[]}
- * @readonly
- */
- oneofsArray: {
- get: function() {
- return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));
- }
- },
-
- /**
- * The registered constructor, if any registered, otherwise a generic constructor.
- * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.
- * @name Type#ctor
- * @type {Constructor<{}>}
- */
- ctor: {
- get: function() {
- return this._ctor || (this.ctor = Type.generateConstructor(this));
- },
- set: function(ctor) {
-
- // Ensure proper prototype
- var prototype = ctor.prototype;
- if (!(prototype instanceof Message)) {
- (ctor.prototype = new Message()).constructor = ctor;
- util.merge(ctor.prototype, prototype);
- }
-
- // Classes and messages reference their reflected type
- ctor.$type = ctor.prototype.$type = this;
-
- // Mix in static methods
- util.merge(ctor, Message, true);
- util.merge(ctor.prototype, Message, true);
-
-
- this._ctor = ctor;
-
- // Messages have non-enumerable default values on their prototype
- var i = 0;
- for (; i < /* initializes */ this.fieldsArray.length; ++i)
- this._fieldsArray[i].resolve(); // ensures a proper value
-
- // Messages have non-enumerable getters and setters for each virtual oneof field
- var ctorProperties = {};
- for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) {
- var oneofName = this._oneofsArray[i].resolve().name;
-
- var oneOfGetAndSet = (function(fieldNames){
- var fieldMap = {};
- for (var i = 0; i < fieldNames.length; ++i)
- fieldMap[fieldNames[i]] = 0;
-
- return {
- setter : function (name){
- if(fieldNames.indexOf(name) < 0) return;
- fieldMap[name] = 1;
- for (var i = 0; i < fieldNames.length; ++i)
- if (fieldNames[i] !== name)
- delete this[/*"_"+*/fieldNames[i]];
- },
-
- getter : function (){
- for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)
- if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)
- return keys[i];
- }
-
- }
- })(this._oneofsArray[i].oneof);
-
- ctorProperties[oneofName] = {
- get: oneOfGetAndSet.getter,
- set: oneOfGetAndSet.setter
- };
- //var fieldNames = this._oneofsArray[i].oneof;
- //for (var j = 0 ; j < fieldNames.length; j++){
- // var fieldName = fieldNames[j];
- // ctorProperties[fieldName] = {
- // set : (function(oneofName, fieldName){
- // return function (value){
- // this[oneofName] = fieldName;
- // this["_"+fieldName] = value;
- // }
- // })(oneofName , fieldName),
- // get : (function(fieldName){
- // return function (){
- // return this["_"+fieldName];
- // }
- // })(fieldName)
- // }
- //}
- }
-
- if (i) {
- //util.merge(ctor.prototype, ctorProperties, true);
- Object.defineProperties(ctor.prototype, ctorProperties);
- }
- }
- }
-});
-
-
-//生成一个构造函数
-Type.generateConstructor = function generateConstructor(mtype) {
- return function (p){
- for (var i = 0, field; i < mtype.fieldsArray.length; i++){
- if((field = mtype._fieldsArray[i]).map){
- this[field.name] = {};
- }else if(field.repeated){
- this[field.name] = [];
- }
- }
-
- if(p){
- for (var ks = Object.keys(p), j = 0; j < ks.length; ++j) {
- if (p[ks[j]] != null) {
- this[ks[j]] = p[ks[j]]
- }
- }
- }
- };
-};
-
-
-function clearCache(type) {
- type._fieldsById = type._fieldsArray = type._oneofsArray = null;
- delete type.encode;
- delete type.decode;
- delete type.verify;
- return type;
-}
-
-
-
-Type.fromJSON = function fromJSON(name, json) {
- var type = new Type(name, json.options);
- type.extensions = json.extensions;
- type.reserved = json.reserved;
- var names = Object.keys(json.fields),
- i = 0;
- for (; i < names.length; ++i)
- type.add(
- ( typeof json.fields[names[i]].keyType !== "undefined"
- ? MapField.fromJSON
- : Field.fromJSON )(names[i], json.fields[names[i]])
- );
- if (json.oneofs)
- for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)
- type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));
- if (json.nested)
- for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {
- var nested = json.nested[names[i]];
- type.add( // most to least likely
- ( nested.id !== undefined
- ? Field.fromJSON
- : nested.fields !== undefined
- ? Type.fromJSON
- : nested.values !== undefined
- ? Enum.fromJSON
- : nested.methods !== undefined
- ? Service.fromJSON
- : Namespace.fromJSON )(names[i], nested)
- );
- }
- if (json.extensions && json.extensions.length)
- type.extensions = json.extensions;
- if (json.reserved && json.reserved.length)
- type.reserved = json.reserved;
- if (json.group)
- type.group = true;
- if (json.comment)
- type.comment = json.comment;
- return type;
-};
-
-Type.prototype.toJSON = function toJSON(toJSONOptions) {
- var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);
- var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
-
- return {
- "options" : inherited && inherited.options || undefined,
- "oneofs" : Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),
- "fields" : Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},
- "extensions" : this.extensions && this.extensions.length ? this.extensions : undefined,
- "reserved" : this.reserved && this.reserved.length ? this.reserved : undefined,
- "group" : this.group || undefined,
- "nested" : inherited && inherited.nested || undefined,
- "comment" : keepComments ? this.comment : undefined
- };
-};
-
-Type.prototype.resolveAll = function resolveAll() {
- var fields = this.fieldsArray, i = 0;
- while (i < fields.length)
- fields[i++].resolve();
- var oneofs = this.oneofsArray; i = 0;
- while (i < oneofs.length)
- oneofs[i++].resolve();
- return Namespace.prototype.resolveAll.call(this);
-};
-
-Type.prototype.get = function get(name) {
- return this.fields[name]
- || this.oneofs && this.oneofs[name]
- || this.nested && this.nested[name]
- || null;
-};
-
-Type.prototype.add = function add(object) {
-
- if (this.get(object.name))
- throw Error("duplicate name '" + object.name + "' in " + this);
-
- if (object instanceof Field && object.extend === undefined) {
- if (this._fieldsById && this._fieldsById[object.id])
- throw Error("duplicate id " + object.id + " in " + this);
- if (this.isReservedId(object.id))
- throw Error("id " + object.id + " is reserved in " + this);
- if (this.isReservedName(object.name))
- throw Error("name '" + object.name + "' is reserved in " + this);
-
- if (object.parent)
- object.parent.remove(object);
- this.fields[object.name] = object;
- object.message = this;
- object.onAdd(this);
- return clearCache(this);
- }
- if (object instanceof OneOf) {
- if (!this.oneofs)
- this.oneofs = {};
- this.oneofs[object.name] = object;
- object.onAdd(this);
- return clearCache(this);
- }
- return Namespace.prototype.add.call(this, object);
-};
-
-Type.prototype.remove = function remove(object) {
- if (object instanceof Field && object.extend === undefined) {
- // See Type#add for the reason why extension fields are excluded here.
-
- /* istanbul ignore if */
- if (!this.fields || this.fields[object.name] !== object)
- throw Error(object + " is not a member of " + this);
-
- delete this.fields[object.name];
- object.parent = null;
- object.onRemove(this);
- return clearCache(this);
- }
- if (object instanceof OneOf) {
-
- /* istanbul ignore if */
- if (!this.oneofs || this.oneofs[object.name] !== object)
- throw Error(object + " is not a member of " + this);
-
- delete this.oneofs[object.name];
- object.parent = null;
- object.onRemove(this);
- return clearCache(this);
- }
- return Namespace.prototype.remove.call(this, object);
-};
-
-Type.prototype.isReservedId = function isReservedId(id) {
- return Namespace.isReservedId(this.reserved, id);
-};
-
-Type.prototype.isReservedName = function isReservedName(name) {
- return Namespace.isReservedName(this.reserved, name);
-};
-
-Type.prototype.create = function create(properties) {
- return new this.ctor(properties);
-};
-
-
-Type.prototype.setup = function setup() {
- // Sets up everything at once so that the prototype chain does not have to be re-evaluated
- // multiple times (V8, soft-deopt prototype-check).
-
- var fullName = this.fullName,
- types = [];
- for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)
- types.push(this._fieldsArray[i].resolve().resolvedType);
-
- // Replace setup methods with type-specific generated functions
- this.encode = encoder(this)({
- Writer : Writer,
- types : types,
- util : util
- });
-
-
- this.decode = decoder(this)({
- Reader : Reader,
- types : types,
- util : util
- });
- this.verify = verifier(this)({
- types : types,
- util : util
- });
-
- this.fromObject = converter.fromObject(this)({
- types : types,
- util : util
- });
- this.toObject = converter.toObject(this)({
- types : types,
- util : util
- });
-
- // Inject custom wrappers for common types
- var wrapper = wrappers[fullName];
- if (wrapper) {
- var originalThis = Object.create(this);
- // if (wrapper.fromObject) {
- originalThis.fromObject = this.fromObject;
- this.fromObject = wrapper.fromObject.bind(originalThis);
- // }
- // if (wrapper.toObject) {
- originalThis.toObject = this.toObject;
- this.toObject = wrapper.toObject.bind(originalThis);
- // }
- }
-
- return this;
-};
-
-/**
- * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.
- * @param {Message<{}>|Object.} message Message instance or plain object
- * @param {Writer} [writer] Writer to encode to
- * @returns {Writer} writer
- */
-
-Type.prototype.encode = function encode_setup(message, writer) {
- return this.setup().encode(message, writer); // overrides this method
-};
-
-/**
- * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.
- * @param {Message<{}>|Object.} message Message instance or plain object
- * @param {Writer} [writer] Writer to encode to
- * @returns {Writer} writer
- */
-Type.prototype.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
-};
-
-/**
- * Decodes a message of this type.
- * @param {Reader|Uint8Array|ArrayBuffer} reader Reader or buffer to decode from
- * @param {number} [length] Length of the message, if known beforehand
- * @returns {Message<{}>} Decoded message
- * @throws {Error} If the payload is not a reader or valid buffer
- */
-
-Type.prototype.decode = function decode_setup(reader, length) {
- return this.setup().decode(reader, length); // overrides this method
-};
-/**
- * Decodes a message of this type preceeded by its byte length as a varint.
- * @param {Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {Message<{}>} Decoded message
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {util.ProtocolError} If required fields are missing
- */
-Type.prototype.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof Reader))
- reader = Reader.create(reader);
- return this.decode(reader, reader.uint32());
-};
-
-/**
- * Verifies that field values are valid and that required fields are present.
- * @param {Object.} message Plain object to verify
- * @returns {null|string} `null` if valid, otherwise the reason why it is not
- */
-
-Type.prototype.verify = function verify_setup(message) {
- return this.setup().verify(message); // overrides this method
-};
-
-/**
- * Creates a new message of this type from a plain object. Also converts values to their respective internal types.
- * @param {Object.} object Plain object to convert
- * @returns {Message<{}>} Message instance
- */
-Type.prototype.fromObject = function fromObject(object) {
- return this.setup().fromObject(object);
-};
-
-/**
- * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.
- * @interface IConversionOptions
- * @property {Function} [longs] Long conversion type.
- * Valid values are `String` and `Number` (the global types).
- * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.
- * @property {Function} [enums] Enum value conversion type.
- * Only valid value is `String` (the global type).
- * Defaults to copy the present value, which is the numeric id.
- * @property {Function} [bytes] Bytes value conversion type.
- * Valid values are `Array` and (a base64 encoded) `String` (the global types).
- * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.
- * @property {boolean} [defaults=false] Also sets default values on the resulting object
- * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`
- * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`
- * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any
- * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings
- */
-
-/**
- * Creates a plain object from a message of this type. Also converts values to other types if specified.
- * @param {Message<{}>} message Message instance
- * @param {IConversionOptions} [options] Conversion options
- * @returns {Object.} Plain object
- */
-Type.prototype.toObject = function toObject(message, options) {
- return this.setup().toObject(message, options);
-};
-
-Type.d = function decorateType(typeName) {
- return function typeDecorator(target) {
- util.decorateType(target, typeName);
- };
-};
-
-Type._configure = function (){
- Enum = require("./enum");
- Field = require("./field");
- Message = require("./message");
- OneOf = require("./oneof");
- Writer = require("./writer");
- Reader = require("./reader");
- util = require("./util");
- verifier = require("./verifier");
- encoder = require("./encoder");
- decoder = require("./decoder");
- Service = require("./service");
- wrappers = require("./wrappers");
- converter = require("./converter");
- MapField = require("./mapField");
-
-};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/types.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/types.js
deleted file mode 100644
index 6c0c93fb..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/types.js
+++ /dev/null
@@ -1,199 +0,0 @@
-"use strict";
-
-/**
- * Common type constants.
- * @namespace
- */
-var types = module.exports;
-var util = require("./util");
-
-var s = [
- "double", // 0
- "float", // 1
- "int32", // 2
- "uint32", // 3
- "sint32", // 4
- "fixed32", // 5
- "sfixed32", // 6
- "int64", // 7
- "uint64", // 8
- "sint64", // 9
- "fixed64", // 10
- "sfixed64", // 11
- "bool", // 12
- "string", // 13
- "bytes" // 14
-];
-
-function bake(values, offset) {
- var i = 0, o = {};
- offset |= 0;
- while (i < values.length) o[s[i + offset]] = values[i++];
- return o;
-}
-
-/**
- * Basic type wire types.
- * @type {Object.}
- * @const
- * @property {number} double=1 Fixed64 wire type
- * @property {number} float=5 Fixed32 wire type
- * @property {number} int32=0 Varint wire type
- * @property {number} uint32=0 Varint wire type
- * @property {number} sint32=0 Varint wire type
- * @property {number} fixed32=5 Fixed32 wire type
- * @property {number} sfixed32=5 Fixed32 wire type
- * @property {number} int64=0 Varint wire type
- * @property {number} uint64=0 Varint wire type
- * @property {number} sint64=0 Varint wire type
- * @property {number} fixed64=1 Fixed64 wire type
- * @property {number} sfixed64=1 Fixed64 wire type
- * @property {number} bool=0 Varint wire type
- * @property {number} string=2 Ldelim wire type
- * @property {number} bytes=2 Ldelim wire type
- */
-types.basic = bake([
- /* double */ 1,
- /* float */ 5,
- /* int32 */ 0,
- /* uint32 */ 0,
- /* sint32 */ 0,
- /* fixed32 */ 5,
- /* sfixed32 */ 5,
- /* int64 */ 0,
- /* uint64 */ 0,
- /* sint64 */ 0,
- /* fixed64 */ 1,
- /* sfixed64 */ 1,
- /* bool */ 0,
- /* string */ 2,
- /* bytes */ 2
-]);
-
-/**
- * Basic type defaults.
- * @type {Object.}
- * @const
- * @property {number} double=0 Double default
- * @property {number} float=0 Float default
- * @property {number} int32=0 Int32 default
- * @property {number} uint32=0 Uint32 default
- * @property {number} sint32=0 Sint32 default
- * @property {number} fixed32=0 Fixed32 default
- * @property {number} sfixed32=0 Sfixed32 default
- * @property {number} int64=0 Int64 default
- * @property {number} uint64=0 Uint64 default
- * @property {number} sint64=0 Sint32 default
- * @property {number} fixed64=0 Fixed64 default
- * @property {number} sfixed64=0 Sfixed64 default
- * @property {boolean} bool=false Bool default
- * @property {string} string="" String default
- * @property {Array.} bytes=Array(0) Bytes default
- * @property {null} message=null Message default
- */
-types.defaults = bake([
- /* double */ 0,
- /* float */ 0,
- /* int32 */ 0,
- /* uint32 */ 0,
- /* sint32 */ 0,
- /* fixed32 */ 0,
- /* sfixed32 */ 0,
- /* int64 */ 0,
- /* uint64 */ 0,
- /* sint64 */ 0,
- /* fixed64 */ 0,
- /* sfixed64 */ 0,
- /* bool */ false,
- /* string */ "",
- /* bytes */ util.emptyArray,
- /* message */ null
-]);
-
-/**
- * Basic long type wire types.
- * @type {Object.}
- * @const
- * @property {number} int64=0 Varint wire type
- * @property {number} uint64=0 Varint wire type
- * @property {number} sint64=0 Varint wire type
- * @property {number} fixed64=1 Fixed64 wire type
- * @property {number} sfixed64=1 Fixed64 wire type
- */
-types.long = bake([
- /* int64 */ 0,
- /* uint64 */ 0,
- /* sint64 */ 0,
- /* fixed64 */ 1,
- /* sfixed64 */ 1
-], 7);
-
-/**
- * Allowed types for map keys with their associated wire type.
- * @type {Object.}
- * @const
- * @property {number} int32=0 Varint wire type
- * @property {number} uint32=0 Varint wire type
- * @property {number} sint32=0 Varint wire type
- * @property {number} fixed32=5 Fixed32 wire type
- * @property {number} sfixed32=5 Fixed32 wire type
- * @property {number} int64=0 Varint wire type
- * @property {number} uint64=0 Varint wire type
- * @property {number} sint64=0 Varint wire type
- * @property {number} fixed64=1 Fixed64 wire type
- * @property {number} sfixed64=1 Fixed64 wire type
- * @property {number} bool=0 Varint wire type
- * @property {number} string=2 Ldelim wire type
- */
-types.mapKey = bake([
- /* int32 */ 0,
- /* uint32 */ 0,
- /* sint32 */ 0,
- /* fixed32 */ 5,
- /* sfixed32 */ 5,
- /* int64 */ 0,
- /* uint64 */ 0,
- /* sint64 */ 0,
- /* fixed64 */ 1,
- /* sfixed64 */ 1,
- /* bool */ 0,
- /* string */ 2
-], 2);
-
-/**
- * Allowed types for packed repeated fields with their associated wire type.
- * @type {Object.}
- * @const
- * @property {number} double=1 Fixed64 wire type
- * @property {number} float=5 Fixed32 wire type
- * @property {number} int32=0 Varint wire type
- * @property {number} uint32=0 Varint wire type
- * @property {number} sint32=0 Varint wire type
- * @property {number} fixed32=5 Fixed32 wire type
- * @property {number} sfixed32=5 Fixed32 wire type
- * @property {number} int64=0 Varint wire type
- * @property {number} uint64=0 Varint wire type
- * @property {number} sint64=0 Varint wire type
- * @property {number} fixed64=1 Fixed64 wire type
- * @property {number} sfixed64=1 Fixed64 wire type
- * @property {number} bool=0 Varint wire type
- */
-types.packed = bake([
- /* double */ 1,
- /* float */ 5,
- /* int32 */ 0,
- /* uint32 */ 0,
- /* sint32 */ 0,
- /* fixed32 */ 5,
- /* sfixed32 */ 5,
- /* int64 */ 0,
- /* uint64 */ 0,
- /* sint64 */ 0,
- /* fixed64 */ 1,
- /* sfixed64 */ 1,
- /* bool */ 0
-]);
-
-types._configure = function (){
- util = require('./util');
-}
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/utf8.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/utf8.js
deleted file mode 100644
index d0a1c1af..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/utf8.js
+++ /dev/null
@@ -1,105 +0,0 @@
-"use strict";
-
-/**
- * A minimal UTF8 implementation for number arrays.
- * @memberof util
- * @namespace
- */
-var utf8 = module.exports;
-
-/**
- * Calculates the UTF8 byte length of a string.
- * @param {string} string String
- * @returns {number} Byte length
- */
-utf8.length = function utf8_length(string) {
- var len = 0,
- c = 0;
- for (var i = 0; i < string.length; ++i) {
- c = string.charCodeAt(i);
- if (c < 128)
- len += 1;
- else if (c < 2048)
- len += 2;
- else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
- ++i;
- len += 4;
- } else
- len += 3;
- }
- return len;
-};
-
-/**
- * Reads UTF8 bytes as a string.
- * @param {Uint8Array} buffer Source buffer
- * @param {number} start Source start
- * @param {number} end Source end
- * @returns {string} String read
- */
-utf8.read = function utf8_read(buffer, start, end) {
- var len = end - start;
- if (len < 1)
- return "";
- var parts = null,
- chunk = [],
- i = 0, // char offset
- t; // temporary
- while (start < end) {
- t = buffer[start++];
- if (t < 128)
- chunk[i++] = t;
- else if (t > 191 && t < 224)
- chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
- else if (t > 239 && t < 365) {
- t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
- chunk[i++] = 0xD800 + (t >> 10);
- chunk[i++] = 0xDC00 + (t & 1023);
- } else
- chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
- if (i > 8191) {
- (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
- i = 0;
- }
- }
- if (parts) {
- if (i)
- parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
- return parts.join("");
- }
- return String.fromCharCode.apply(String, chunk.slice(0, i));
-};
-
-/**
- * Writes a string as UTF8 bytes.
- * @param {string} string Source string
- * @param {Uint8Array} buffer Destination buffer
- * @param {number} offset Destination offset
- * @returns {number} Bytes written
- */
-utf8.write = function utf8_write(string, buffer, offset) {
- var start = offset,
- c1, // character 1
- c2; // character 2
- for (var i = 0; i < string.length; ++i) {
- c1 = string.charCodeAt(i);
- if (c1 < 128) {
- buffer[offset++] = c1;
- } else if (c1 < 2048) {
- buffer[offset++] = c1 >> 6 | 192;
- buffer[offset++] = c1 & 63 | 128;
- } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
- c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
- ++i;
- buffer[offset++] = c1 >> 18 | 240;
- buffer[offset++] = c1 >> 12 & 63 | 128;
- buffer[offset++] = c1 >> 6 & 63 | 128;
- buffer[offset++] = c1 & 63 | 128;
- } else {
- buffer[offset++] = c1 >> 12 | 224;
- buffer[offset++] = c1 >> 6 & 63 | 128;
- buffer[offset++] = c1 & 63 | 128;
- }
- }
- return offset - start;
-};
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/util.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/util.js
deleted file mode 100644
index 6240e914..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/util.js
+++ /dev/null
@@ -1,278 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/12.
- */
-var util = module.exports;
-
-var roots = require("./roots");
-util.LongBits = require("./longBits");
-util.Long = require("./long");
-util.pool = require('./pool');
-util.float = require('./float');
-util.asPromise = require('./asPromise');
-util.EventEmitter = require('./EventEmitter');
-util.path = require('./path');
-util.base64 =require('./base64');
-util.utf8 = require('./utf8');
-
-util.compareFieldsById = function compareFieldsById(a, b){
- return a.id - b.id;
-};
-
-util.toArray = function toArray(object) {
- if (object) {
- var keys = Object.keys(object),
- array = new Array(keys.length),
- index = 0;
- while (index < keys.length)
- array[index] = object[keys[index++]];
- return array;
- }
- return [];
-};
-
-util.toObject = function toObject(array) {
- var object = {},
- index = 0;
- while (index < array.length) {
- var key = array[index++],
- val = array[index++];
- if (val !== undefined)
- object[key] = val;
- }
- return object;
-};
-
-util.isString = function isString(value) {
- return typeof value === "string" || value instanceof String;
-};
-
-var safePropBackslashRe = /\\/g,
- safePropQuoteRe = /"/g;
-
-/**
- * Tests whether the specified name is a reserved word in JS.
- * @param {string} name Name to test
- * @returns {boolean} `true` if reserved, otherwise `false`
- */
-util.isReserved = function isReserved(name) {
- return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);
-};
-
-util.isObject = function isObject(value) {
- return value && typeof value === "object";
-};
-
-util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array;
-
-util.oneOfGetter = function getOneOf(fieldNames) {
- var fieldMap = {};
- for (var i = 0; i < fieldNames.length; ++i)
- fieldMap[fieldNames[i]] = 1;
-
- /**
- * @returns {string|undefined} Set field name, if any
- * @this Object
- * @ignore
- */
- return function() { // eslint-disable-line consistent-return
- for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)
- if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)
- return keys[i];
- };
-};
-
-util.oneOfSetter = function setOneOf(fieldNames) {
-
- /**
- * @param {string} name Field name
- * @returns {undefined}
- * @this Object
- * @ignore
- */
- return function(name) {
- for (var i = 0; i < fieldNames.length; ++i)
- if (fieldNames[i] !== name)
- delete this[/*"_"+*/fieldNames[i]];//设置为私有属性
- };
-};
-
-
-util.merge = function merge(dst, src, ifNotSet) { // used by converters
- for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)
- if (dst[keys[i]] === undefined || !ifNotSet)
- dst[keys[i]] = src[keys[i]];
- return dst;
-};
-
-util.decorateType = function decorateType(ctor, typeName) {
-
- /* istanbul ignore if */
- if (ctor.$type) {
- if (typeName && ctor.$type.name !== typeName) {
- util.decorateRoot.remove(ctor.$type);
- ctor.$type.name = typeName;
- util.decorateRoot.add(ctor.$type);
- }
- return ctor.$type;
- }
-
- /* istanbul ignore next */
- if (!Type)
- Type = require("./type");
-
- var type = new Type(typeName || ctor.name);
- util.decorateRoot.add(type);
- type.ctor = ctor; // sets up .encode, .decode etc.
- Object.defineProperty(ctor, "$type", { value: type, enumerable: false });
- Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false });
- return type;
-};
-
-util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes
-
-util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes
-
-util.longToHash = function longToHash(value) {
- return value
- ? util.LongBits.from(value).toHash()
- : util.LongBits.zeroHash;
-};
-
-util.copy = function(obj){
- if(typeof obj != 'object'){
- return obj;
- }
- var newObj = {};
- for (var attr in obj) {
- newObj[attr] = obj[attr];
- }
- return newObj;
-};
-
-function deepCopy(obj){
- if(typeof obj != 'object'){
- return obj;
- }
- var newobj = {};
- for ( var attr in obj) {
- newobj[attr] = deepCopy(obj[attr]);
- }
- return newobj;
-}
-
-util.deepCopy = deepCopy;
-
-util.ProtocolError =function newError(name) {
-
- function CustomError(message, properties) {
-
- if (!(this instanceof CustomError))
- return new CustomError(message, properties);
-
- // Error.call(this, message);
- // ^ just returns a new error instance because the ctor can be called as a function
-
- Object.defineProperty(this, "message", { get: function() { return message; } });
-
- /* istanbul ignore next */
- if (Error.captureStackTrace) // node
- Error.captureStackTrace(this, CustomError);
- else
- Object.defineProperty(this, "stack", { value: (new Error()).stack || "" });
-
- if (properties)
- merge(this, properties);
- }
-
- (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;
-
- Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } });
-
- CustomError.prototype.toString = function toString() {
- return this.name + ": " + this.message;
- };
-
- return CustomError;
-}
-
-util.toJSONOptions = {
- longs: String,
- enums: String,
- bytes: String,
- json: true
-};
-
-util.Buffer = (function() {
- return null;
-})();
-
-
-util.newBuffer = function newBuffer(sizeOrArray) {
- /* istanbul ignore next */
- return typeof sizeOrArray === "number"
- ? new util.Array(sizeOrArray)
- : typeof Uint8Array === "undefined"
- ? sizeOrArray
- : new Uint8Array(sizeOrArray);
-};
-
-util.stringToBytes =function stringToBytes( str ) {
- var bytes = [];
- var len, c;
- len = str.length;
- for(var i = 0; i < len; i++) {
- c = str.charCodeAt(i);
- if(c >= 0x010000 && c <= 0x10FFFF) {
- bytes.push(((c >> 18) & 0x07) | 0xF0);
- bytes.push(((c >> 12) & 0x3F) | 0x80);
- bytes.push(((c >> 6) & 0x3F) | 0x80);
- bytes.push((c & 0x3F) | 0x80);
- } else if(c >= 0x000800 && c <= 0x00FFFF) {
- bytes.push(((c >> 12) & 0x0F) | 0xE0);
- bytes.push(((c >> 6) & 0x3F) | 0x80);
- bytes.push((c & 0x3F) | 0x80);
- } else if(c >= 0x000080 && c <= 0x0007FF) {
- bytes.push(((c >> 6) & 0x1F) | 0xC0);
- bytes.push((c & 0x3F) | 0x80);
- } else {
- bytes.push(c & 0xFF);
- }
- }
- return bytes;
-
-};
-
-util.byteToString = function byteToString(arr) {
- if(typeof arr === 'string') {
- return arr;
- }
- var str = '',
- _arr = arr;
- for(var i = 0; i < _arr.length; i++) {
- var one = _arr[i].toString(2),
- v = one.match(/^1+?(?=0)/);
- if(v && one.length == 8) {
- var bytesLength = v[0].length;
- var store = _arr[i].toString(2).slice(7 - bytesLength);
- for(var st = 1; st < bytesLength; st++) {
- store += _arr[st + i].toString(2).slice(2);
- }
- str += String.fromCharCode(parseInt(store, 2));
- i += bytesLength - 1;
- } else {
- str += String.fromCharCode(_arr[i]);
- }
- }
- return str;
-}
-
-
-util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {
- return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
- };
-
-Object.defineProperty(util, "decorateRoot", {
- get: function() {
- return roots["decorated"] || (roots["decorated"] = new (require("./root"))());
- }
-});
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/verifier.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/verifier.js
deleted file mode 100644
index 933d7548..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/verifier.js
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * Created by zhangmiao on 2018/3/14.
- */
-module.exports = verifier;
-
-var Enum;
-var util;
-
-function invalid(field, expected) {
- return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected";
-}
-
-function verifyValue(field, fieldIndex, ref, options){
- var _types = options.types;
- if(field.resolvedType){
- if(field.resolvedType instanceof Enum){
- var keys = Object.keys(field.resolvedType.values);
- if (keys.indexOf(ref)<0){
- //没有找到时候
- return invalid(field, "enum value");
- }
- }else {
- var e = _types[fieldIndex].verify(ref);
- if(e)
- return field.name + "."+ e;
- }
- } else {
- switch (field.type) {
- case "int32":
- case "uint32":
- case "sint32":
- case "fixed32":
- case "sfixed32":
- if (!util.isInteger(ref))
- return invalid(field, "integer");
- break;
- case "int64":
- case "uint64":
- case "sint64":
- case "fixed64":
- case "sfixed64":
- if(!util.isInteger(ref)&&!(ref&&util.isInteger(ref.low)&&util.isInteger(ref.high)))
- return invalid(field, "integer|Long");
- break;
- case "float":
- case "double":
- if(typeof ref!=="number")
- return invalid(field, "number");
- break;
- case "bool":
- if(typeof ref!=="boolean")
- return invalid(field, "boolean");
- break;
- case "string":
- if(!util.isString(ref))
- return invalid(field, "string");
- break;
- case "bytes":
- if(!(ref&&typeof ref.length==="number"||util.isString(ref)))
- return invalid(field, "buffer");
- break;
- }
- }
-}
-
-function verifyKey(field, ref){
- switch(field.keyType){
- case "int32":
- case "uint32":
- case "sint32":
- case "fixed32":
- case "sfixed32":
- if(!util.key32Re.test(ref))
- return invalid(field, "integer key");
- break;
- case "int64":
- case "uint64":
- case "sint64":
- case "fixed64":
- case "sfixed64":
- if(!util.key64Re.test(ref))
- return invalid(field, "integer|Long key");
- break;
- case "bool":
- if(!util.key2Re.test(ref))
- return invalid(field, "boolean key");
- break;
- }
-}
-
-function verifier(mtype){
- return function (options){
- return function (m){
- var invalidDes;
- if(typeof m !== 'object' || m === null)
- return "object expected";
-
- var oneofs = mtype.oneofsArray,
- seenFirstField = {};
- var p;
- if(oneofs.length)
- p = {};
- for (var i = 0; i < mtype.fieldsArray.length; ++i){
- var field = mtype._fieldsArray[i].resolve(),
- ref = m[field.name];
- if(!field.optional || (ref!=null&& m.hasOwnProperty(field.name))){
- var _i;
- if (field.map){
- if(!util.isObject(ref))
- return invalid(field, "object");
- var k=Object.keys(ref);
- for (_i = 0; _i < k.length; ++_i){
- //检查key值的合法性
- invalidDes = verifyKey(field, k[_i]);
- if(invalidDes){
- return invalidDes;
- }
- //检查value值的合法性
- invalidDes = verifyValue(field, i, ref[k[_i]], options);
- if(invalidDes){
- return invalidDes;
- }
- }
- } else if(field.repeated){
- if(!Array.isArray(ref)){
- return invalid(field, "array");
- }
-
- for (_i = 0; _i < ref.length; ++_i) {
- invalidDes = verifyValue(field, i, ref[_i], options);
- if(invalidDes){
- return invalidDes;
- }
- }
- } else {
- if(field.partOf) {
- var oneofPropName = field.partOf.name;
- if (seenFirstField[field.partOf.name] === 1)
- if(p[oneofPropName] === 1)
- return field.partOf.name + ": multiple values";
- p[oneofPropName] = 1
- }
- invalidDes = verifyValue(field, i, ref, options);
- if(invalidDes){
- return invalidDes;
- }
- }
- }
- }
- }
- }
-}
-
-verifier._configure = function(){
- Enum = require("./enum");
- util = require("./util");
-};
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/wrappers.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/wrappers.js
deleted file mode 100644
index 0df56cca..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/wrappers.js
+++ /dev/null
@@ -1,81 +0,0 @@
-var wrappers = exports;
-
-
-var Message;
-
-/**
- * From object converter part of an {@link IWrapper}.
- * @typedef WrapperFromObjectConverter
- * @type {function}
- * @param {Object.} object Plain object
- * @returns {Message<{}>} Message instance
- * @this Type
- */
-
-/**
- * To object converter part of an {@link IWrapper}.
- * @typedef WrapperToObjectConverter
- * @type {function}
- * @param {Message<{}>} message Message instance
- * @param {IConversionOptions} [options] Conversion options
- * @returns {Object.} Plain object
- * @this Type
- */
-
-/**
- * Common type wrapper part of {@link wrappers}.
- * @interface IWrapper
- * @property {WrapperFromObjectConverter} [fromObject] From object converter
- * @property {WrapperToObjectConverter} [toObject] To object converter
- */
-
-// Custom wrapper for Any
-wrappers[".google.protobuf.Any"] = {
-
- fromObject: function(object) {
-
- // unwrap value type if mapped
- if (object && object["@type"]) {
- var type = this.lookup(object["@type"]);
- /* istanbul ignore else */
- if (type) {
- // type_url does not accept leading "."
- var type_url = object["@type"].charAt(0) === "." ?
- object["@type"].substr(1) : object["@type"];
- // type_url prefix is optional, but path seperator is required
- return this.create({
- type_url: "/" + type_url,
- value: type.encode(type.fromObject(object)).finish()
- });
- }
- }
-
- return this.fromObject(object);
- },
-
- toObject: function(message, options) {
-
- // decode value if requested and unmapped
- if (options && options.json && message.type_url && message.value) {
- // Only use fully qualified type name after the last '/'
- var name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1);
- var type = this.lookup(name);
- /* istanbul ignore else */
- if (type)
- message = type.decode(message.value);
- }
-
- // wrap value if unmapped
- if (!(message instanceof this.ctor) && message instanceof Message) {
- var object = message.$type.toObject(message, options);
- object["@type"] = message.$type.fullName;
- return object;
- }
-
- return this.toObject(message, options);
- }
-};
-
-wrappers._configure = function () {
- Message = require("./message");
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/writer.js b/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/writer.js
deleted file mode 100644
index 2866ee0c..00000000
--- a/miniprogram/packageAPI/pages/ar/3dmarker-ar/protobuf/src/writer.js
+++ /dev/null
@@ -1,468 +0,0 @@
-module.exports = Writer;
-
-
-var util = require('./util');
-var LongBits;
-
-var BufferWriter; // cyclic
-
-var base64;
-var utf8 = require('./utf8');
-
-/**
- * Constructs a new writer operation instance.
- * @classdesc Scheduled writer operation.
- * @constructor
- * @param {function(*, Uint8Array, number)} fn Function to call
- * @param {number} len Value byte length
- * @param {*} val Value to write
- * @ignore
- */
-function Op(fn, len, val) {
-
- /**
- * Function to call.
- * @type {function(Uint8Array, number, *)}
- */
- this.fn = fn;
-
- /**
- * Value byte length.
- * @type {number}
- */
- this.len = len;
-
- /**
- * Next operation.
- * @type {Writer.Op|undefined}
- */
- this.next = undefined;
-
- /**
- * Value to write.
- * @type {*}
- */
- this.val = val; // type varies
-}
-
-/* istanbul ignore next */
-function noop() {} // eslint-disable-line no-empty-function
-
-/**
- * Constructs a new writer state instance.
- * @classdesc Copied writer state.
- * @memberof Writer
- * @constructor
- * @param {Writer} writer Writer to copy state from
- * @ignore
- */
-function State(writer) {
-
- /**
- * Current head.
- * @type {Writer.Op}
- */
- this.head = writer.head;
-
- /**
- * Current tail.
- * @type {Writer.Op}
- */
- this.tail = writer.tail;
-
- /**
- * Current buffer length.
- * @type {number}
- */
- this.len = writer.len;
-
- /**
- * Next state.
- * @type {State|null}
- */
- this.next = writer.states;
-}
-
-/**
- * Constructs a new writer instance.
- * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.
- * @constructor
- */
-function Writer() {
-
- /**
- * Current length.
- * @type {number}
- */
- this.len = 0;
-
- /**
- * Operations head.
- * @type {Object}
- */
- this.head = new Op(noop, 0, 0);
-
- /**
- * Operations tail
- * @type {Object}
- */
- this.tail = this.head;
-
- /**
- * Linked forked states.
- * @type {Object|null}
- */
- this.states = null;
-
- // When a value is written, the writer calculates its byte length and puts it into a linked
- // list of operations to perform when finish() is called. This both allows us to allocate
- // buffers of the exact required size and reduces the amount of work we have to do compared
- // to first calculating over objects and then encoding over objects. In our case, the encoding
- // part is just a linked list walk calling operations with already prepared values.
-}
-
-/**
- * Creates a new writer.
- * @function
- * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}
- */
-Writer.create = util.Buffer
- ? function create_buffer_setup() {
- return (Writer.create = function create_buffer() {
- return new BufferWriter();
- })();
-}
- /* istanbul ignore next */
- : function create_array() {
- return new Writer();
-};
-
-/**
- * Allocates a buffer of the specified size.
- * @param {number} size Buffer size
- * @returns {Uint8Array} Buffer
- */
-Writer.alloc = function alloc(size) {
- return new util.Array(size);
-};
-
-// Use Uint8Array buffer pool in the browser, just like node does with buffers
-/* istanbul ignore else */
-if (util.Array !== Array)
- Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);
-
-/**
- * Pushes a new operation to the queue.
- * @param {function(Uint8Array, number, *)} fn Function to call
- * @param {number} len Value byte length
- * @param {number} val Value to write
- * @returns {Writer} `this`
- * @private
- */
-Writer.prototype._push = function push(fn, len, val) {
- this.tail = this.tail.next = new Op(fn, len, val);
- this.len += len;
- return this;
-};
-
-function writeByte(val, buf, pos) {
- buf[pos] = val & 255;
-}
-
-function writeVarint32(val, buf, pos) {
- while (val > 127) {
- buf[pos++] = val & 127 | 128;
- val >>>= 7;
- }
- buf[pos] = val;
-}
-
-/**
- * Constructs a new varint writer operation instance.
- * @classdesc Scheduled varint writer operation.
- * @extends Op
- * @constructor
- * @param {number} len Value byte length
- * @param {number} val Value to write
- * @ignore
- */
-function VarintOp(len, val) {
- this.len = len;
- this.next = undefined;
- this.val = val;
-}
-
-VarintOp.prototype = Object.create(Op.prototype);
-VarintOp.prototype.fn = writeVarint32;
-
-/**
- * Writes an unsigned 32 bit value as a varint.
- * @param {number} value Value to write
- * @returns {Writer} `this`
- */
-Writer.prototype.uint32 = function write_uint32(value) {
- // here, the call to this.push has been inlined and a varint specific Op subclass is used.
- // uint32 is by far the most frequently used operation and benefits significantly from this.
- this.len += (this.tail = this.tail.next = new VarintOp(
- (value = value >>> 0) //将有符号的数变为无符号的数
- < 128 ? 1 //2的7次方
- : value < 16384 ? 2 //2的14次方
- : value < 2097152 ? 3 //2的21次方
- : value < 268435456 ? 4 //2的28次方
- : 5, //2的35次方 最多32次方,所以最多是5
- value)).len;
- return this;
-};
-
-/**
- * Writes a signed 32 bit value as a varint.
- * @function
- * @param {number} value Value to write
- * @returns {Writer} `this`
- */
-Writer.prototype.int32 = function write_int32(value) {
- return value < 0
- ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec
- : this.uint32(value);
-};
-
-/**
- * Writes a 32 bit value as a varint, zig-zag encoded.
- * @param {number} value Value to write
- * @returns {Writer} `this`
- */
-Writer.prototype.sint32 = function write_sint32(value) {
- return this.uint32((value << 1 ^ value >> 31) >>> 0);
-};
-
-function writeVarint64(val, buf, pos) {
- while (val.hi) {
- buf[pos++] = val.lo & 127 | 128;
- val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;
- val.hi >>>= 7;
- }
- while (val.lo > 127) {
- buf[pos++] = val.lo & 127 | 128;
- val.lo = val.lo >>> 7;
- }
- buf[pos++] = val.lo;
-}
-
-/**
- * Writes an unsigned 64 bit value as a varint.
- * @param {Long|number|string} value Value to write
- * @returns {Writer} `this`
- * @throws {TypeError} If `value` is a string and no long library is present.
- */
-Writer.prototype.uint64 = function write_uint64(value) {
- var bits = LongBits.from(value);
- return this._push(writeVarint64, bits.length(), bits);
-};
-
-/**
- * Writes a signed 64 bit value as a varint.
- * @function
- * @param {Long|number|string} value Value to write
- * @returns {Writer} `this`
- * @throws {TypeError} If `value` is a string and no long library is present.
- */
-Writer.prototype.int64 = Writer.prototype.uint64;
-
-/**
- * Writes a signed 64 bit value as a varint, zig-zag encoded.
- * @param {Long|number|string} value Value to write
- * @returns {Writer} `this`
- * @throws {TypeError} If `value` is a string and no long library is present.
- */
-Writer.prototype.sint64 = function write_sint64(value) {
- var bits = LongBits.from(value).zzEncode();
- return this._push(writeVarint64, bits.length(), bits);
-};
-
-/**
- * Writes a boolish value as a varint.
- * @param {boolean} value Value to write
- * @returns {Writer} `this`
- */
-Writer.prototype.bool = function write_bool(value) {
- return this._push(writeByte, 1, value ? 1 : 0);
-};
-
-function writeFixed32(val, buf, pos) {
- buf[pos ] = val & 255;
- buf[pos + 1] = val >>> 8 & 255;
- buf[pos + 2] = val >>> 16 & 255;
- buf[pos + 3] = val >>> 24;
-}
-
-/**
- * Writes an unsigned 32 bit value as fixed 32 bits.
- * @param {number} value Value to write
- * @returns {Writer} `this`
- */
-Writer.prototype.fixed32 = function write_fixed32(value) {
- return this._push(writeFixed32, 4, value >>> 0);
-};
-
-/**
- * Writes a signed 32 bit value as fixed 32 bits.
- * @function
- * @param {number} value Value to write
- * @returns {Writer} `this`
- */
-Writer.prototype.sfixed32 = Writer.prototype.fixed32;
-
-/**
- * Writes an unsigned 64 bit value as fixed 64 bits.
- * @param {Long|number|string} value Value to write
- * @returns {Writer} `this`
- * @throws {TypeError} If `value` is a string and no long library is present.
- */
-Writer.prototype.fixed64 = function write_fixed64(value) {
- var bits = LongBits.from(value);
- return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);
-};
-
-/**
- * Writes a signed 64 bit value as fixed 64 bits.
- * @function
- * @param {Long|number|string} value Value to write
- * @returns {Writer} `this`
- * @throws {TypeError} If `value` is a string and no long library is present.
- */
-Writer.prototype.sfixed64 = Writer.prototype.fixed64;
-
-/**
- * Writes a float (32 bit).
- * @function
- * @param {number} value Value to write
- * @returns {Writer} `this`
- */
-Writer.prototype.float = function write_float(value) {
- return this._push(util.float.writeFloatLE, 4, value);
-};
-
-/**
- * Writes a double (64 bit float).
- * @function
- * @param {number} value Value to write
- * @returns {Writer} `this`
- */
-Writer.prototype.double = function write_double(value) {
- return this._push(util.float.writeDoubleLE, 8, value);
-};
-
-var writeBytes = util.Array.prototype.set
- ? function writeBytes_set(val, buf, pos) {
- buf.set(val, pos); // also works for plain array values
-}
- /* istanbul ignore next */
- : function writeBytes_for(val, buf, pos) {
- for (var i = 0; i < val.length; ++i)
- buf[pos + i] = val[i];
-};
-
-/**
- * Writes a sequence of bytes.
- * @param {Uint8Array|string} value Buffer or string to write
- * @returns {Writer} `this`
- */
-Writer.prototype.bytes = function write_bytes(value) {
- var len = value.length >>> 0;
- if (!len)
- return this._push(writeByte, 1, 0);
-
- if (util.isString(value)) {
- //len = (value = util.stringToBytes(value)).length;
- //var buf = Writer.alloc(len = base64.length(value));
- //base64.decode(value, buf, 0);
- //value = buf;
- var buf = Writer.alloc(len = utf8.length(value));
- utf8.write(value, buf, 0);
- value = buf;
- }
- return this.uint32(len)._push(writeBytes, len, value);
-};
-
-/**
- * Writes a string.
- * @param {string} value Value to write
- * @returns {Writer} `this`
- */
-Writer.prototype.string = function write_string(value) {
- var len = utf8.length(value);
- return len
- ? this.uint32(len)._push(utf8.write, len, value)
- : this._push(writeByte, 1, 0);
-};
-
-/**
- * Forks this writer's state by pushing it to a stack.
- * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.
- * @returns {Writer} `this`
- */
-Writer.prototype.fork = function fork() {
- this.states = new State(this);
- this.head = this.tail = new Op(noop, 0, 0);
- this.len = 0;
- return this;
-};
-
-/**
- * Resets this instance to the last state.
- * @returns {Writer} `this`
- */
-Writer.prototype.reset = function reset() {
- if (this.states) {
- this.head = this.states.head;
- this.tail = this.states.tail;
- this.len = this.states.len;
- this.states = this.states.next;
- } else {
- this.head = this.tail = new Op(noop, 0, 0);
- this.len = 0;
- }
- return this;
-};
-
-/**
- * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.
- * @returns {Writer} `this`
- */
-Writer.prototype.ldelim = function ldelim() {
- var head = this.head,
- tail = this.tail,
- len = this.len;
- this.reset().uint32(len);
- if (len) {
- this.tail.next = head.next; // skip noop
- this.tail = tail;
- this.len += len;
- }
- return this;
-};
-
-/**
- * Finishes the write operation.
- * @returns {Uint8Array} Finished buffer
- */
-Writer.prototype.finish = function finish() {
- var head = this.head.next, // skip noop
- buf = this.constructor.alloc(this.len),
- pos = 0;
- while (head) {
- head.fn(head.val, buf, pos);
- pos += head.len;
- head = head.next;
- }
- // this.head = this.tail = null;
- return buf;
-};
-
-Writer._configure = function() {
-
- //util = require("./util");
- LongBits = require("./longBits");
- base64 = require('./base64');
- utf8 = require('./utf8');
-};
diff --git a/miniprogram/packageAPI/pages/ar/behavior/behavior-ar.js b/miniprogram/packageAPI/pages/ar/behavior/behavior-ar.js
deleted file mode 100644
index c6b3453d..00000000
--- a/miniprogram/packageAPI/pages/ar/behavior/behavior-ar.js
+++ /dev/null
@@ -1,102 +0,0 @@
-module.exports = Behavior({
- // 全局变量
- session: undefined, // 全局的VKsession对象
- canvas: undefined, // canvas
- // XRFrame相关变量
- xrScene: undefined, // xr-frame 的场景
- xrCamera: undefined, // xr-frame 的相机
- xrFrameReady: undefined, // xr-frame初始化完毕
- // WebGL相关
- camera: undefined, // 主要相机
- // ThreeJs 相关变量
- gl: undefined, // 全局gl对象
- THREE: undefined, // THREE 对象
- // 全局 data
- data: {
- domWidth: 0,
- domHeight: 0,
- width: 0, // canvas大小
- height: 0, // canvas大小
- widthScale: 1, // canvas宽度缩放值
- heightScale: 0.8, // canvas高度缩放值
- cameraPosition: 0, // 相机朝向,默认后置摄像头
- },
- methods: {
- onReady() {
- // 获取canvas
- wx.createSelectorQuery()
- .select('#canvas')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- // 运算画布大小
- this.calcCanvasSize()
-
- // 页面自定义初始化
- if (this.init) this.init()
- })
- },
- calcCanvasSize() {
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const width = info.windowWidth * this.data.widthScale * pixelRatio
- const height = info.windowHeight * this.data.heightScale * pixelRatio
- // 存在 webgl Canvas的情况下,写入大小
- if (this.canvas) {
- this.canvas.width = width
- this.canvas.height = height
- }
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.setData({
- width,
- height,
- domWidth: info.windowWidth * this.data.widthScale,
- domHeight: info.windowHeight * this.data.heightScale,
- })
- },
- // 前后摄像头
- switchCamera() {
- if (this.session.config) {
- const config = this.session.config
- let cameraPosNext
- if (this.data.cameraPosition === 0) {
- cameraPosNext = 1
- } else {
- cameraPosNext = 0
- }
- config.cameraPosition = cameraPosNext
- this.session.config = config
- this.setData({
- cameraPosition: cameraPosNext
- })
- }
- },
- // 限帧逻辑
- initLoop() {
- // 限制调用帧率,暂时去掉
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- const session = this.session
-
- // 逐帧渲染
- const onFrame = timestamp => {
- try {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- this.loop()
- }
- } catch (e) {
- console.error(e)
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/behavior/behavior-three-shoe.js b/miniprogram/packageAPI/pages/ar/behavior/behavior-three-shoe.js
deleted file mode 100644
index 0557bf90..00000000
--- a/miniprogram/packageAPI/pages/ar/behavior/behavior-three-shoe.js
+++ /dev/null
@@ -1,146 +0,0 @@
-const threeBehavior = Behavior({
- methods: {
- updateThreeMatrix() {
- // 同步 VKCamera 矩阵信息到 Three Camera
- if (VKCamera) {
- // VK接管相机矩阵
- this.camera.matrixAutoUpdate = false
-
- // VK ViewMatrix 返回列主序
- this.camera.matrixWorldInverse.fromArray(VKCamera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = VKCamera.getProjectionMatrix(NEAR, FAR)
-
- // projectionMatrix[0] = projectionMatrix[0] / 2;
- // projectionMatrix[5] = projectionMatrix[5] / 2;
-
- // VK 返回列主序
- // 设置 投影矩阵
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- // 存在model,更新矩阵
- if (this.modelWrap && this.points3d && this.shoeTransform) {
- // console.log('toUpdate')
- const THREE = this.THREE
-
- // 顶点偏移矩阵
- const positionMat = new THREE.Matrix4()
- // 认为点 0 0 0
- positionMat.setPosition(0, 0, 0)
-
- // Anchor返回矩阵,实际上就是完整的 modelView matrix
- const anchorMatrix = new THREE.Matrix4()
- // 目前返回的是行主序矩阵
- anchorMatrix.set(
- this.shoeTransform[0],
- this.shoeTransform[1],
- this.shoeTransform[2],
- this.shoeTransform[3],
- this.shoeTransform[4],
- this.shoeTransform[5],
- this.shoeTransform[6],
- this.shoeTransform[7],
- this.shoeTransform[8],
- this.shoeTransform[9],
- this.shoeTransform[10],
- this.shoeTransform[11],
- this.shoeTransform[12],
- this.shoeTransform[13],
- this.shoeTransform[14],
- this.shoeTransform[15],
- )
- // 两者叠加
- // const modelWorld = positionMat.multiply(anchorMatrix);
-
- const modelWorld = anchorMatrix
-
- const pos = new THREE.Vector3()
- const quaternion = new THREE.Quaternion()
- const scale = new THREE.Vector3()
-
- // 解析出 实际的 信息
- modelWorld.decompose(pos, quaternion, scale)
- console.log(pos, quaternion, scale)
-
- // 设置到容器节点上
- this.modelWrap.position.set(pos.x, pos.y, pos.z)
- this.modelWrap.quaternion.set(quaternion.x, quaternion.y, quaternion.z, quaternion.w)
- this.modelWrap.scale.set(scale.x, scale.y, scale.z)
-
- if (this.model) {
- // 先把模型放置在脚踝
- // this.model.position.set(this.points3d[0].x, this.points3d[0].y, this.points3d[0].z);
- }
-
- if (this.hintBoxList && this.hintBoxList.length > 0) {
- // console.log('ready to set', this.hintBoxList);
- // 存在提示列表,则更新点信息
- for (let i = 0; i < this.hintBoxList.length; i++) {
- const hintBox = this.hintBoxList[i]
- hintBox.position.set(this.points3d[i].x, this.points3d[i].y, this.points3d[i].z)
- }
- // console.log('seted', this.hintBoxList);
- }
-
- // debug 用信息
- if (!loggerOnce) {
- // console.log('positionMat', positionMat);
- // console.log('anchorMat', anchorMat);
- // console.log('modelWorld', modelWorld);
-
- // console.log('projectionMatrix', this.camera.projectionMatrix);
-
- // console.log('this.modelWrap.position', this.modelWrap.position);
- // console.log('this.modelWrap.quaternion', this.modelWrap.quaternion);
- // console.log('this.modelWrap.scale', this.modelWrap.scale);
-
- // console.log('domSize', this.data.domWidth, this.data.domHeight)
- // VK 直接数值
- console.log('joints', Array.from(this.points3d))
- console.log('viewMatrix', Array.from(VKCamera.viewMatrix))
- console.log('projectionMatrix', Array.from(VKCamera.getProjectionMatrix(NEAR, FAR)))
- console.log('anchorTransform', Array.from(this.shoeTransform))
-
- loggerOnce = true
- }
- }
-
- // 渲染 Three 场景
- this.renderer.autoClearColor = false
- this.renderer.state.setCullFace(this.THREE.CullFaceBack)
- this.renderer.render(this.scene, this.camera)
- // 为什么去掉这句话会画不出来,我感觉大概率是YUV的面朝向错了
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- addShoeHintBox() {
- const THREE = this.THREE
-
- const wrap = this.modelWrap
-
- const geometry = new THREE.BoxGeometry(1, 1, 1)
- const boxScale = 0.3
-
- const hintBoxList = []
- for (let i = 0; i < 8; i++) {
- const colorHex = (i * 2).toString(16)
- const material = new THREE.MeshPhysicalMaterial({
- metalness: 0.0,
- roughness: 0.5,
- color: parseInt(`${colorHex}${colorHex}${colorHex}${colorHex}${colorHex}${colorHex}`, 16),
- })
- const mesh = new THREE.Mesh(geometry, material)
- mesh.position.set(0, 0, 0)
- mesh.scale.set(boxScale, boxScale, boxScale)
- wrap.add(mesh)
- hintBoxList.push(mesh)
- }
-
- this.hintBoxList = hintBoxList
- },
- },
-})
-
-export default threeBehavior
diff --git a/miniprogram/packageAPI/pages/ar/behavior/behavior-three.js b/miniprogram/packageAPI/pages/ar/behavior/behavior-three.js
deleted file mode 100644
index 8d8482b9..00000000
--- a/miniprogram/packageAPI/pages/ar/behavior/behavior-three.js
+++ /dev/null
@@ -1,458 +0,0 @@
-import { createScopedThreejs } from 'threejs-miniprogram'
-import { registerGLTFLoader } from '../loaders/gltf-loader'
-
-const threeBehavior = Behavior({
- methods: {
- // 针对 threejs 的初始化逻辑
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // glTF loader
- this.loader = new this.THREE.GLTFLoader()
-
- // 相机
- this.camera = new THREE.PerspectiveCamera(50, 0.7, 0.1, 1000)
-
- // 场景
- const scene = this.scene = new THREE.Scene()
- const sceneCull = this.sceneCull = new THREE.Scene()
-
- // 光源
- const ambientLight = new THREE.AmbientLight(0x555555) // 氛围光
- scene.add(ambientLight)
- const dirLight = new THREE.DirectionalLight(0xffffff, 1) // 平行光
- dirLight.position.set(1, 1, 1)
- scene.add(dirLight)
-
- const ambientLightCull = new THREE.AmbientLight(0x555555) // 氛围光
- sceneCull.add(ambientLightCull)
- const dirLightCull = new THREE.DirectionalLight(0xffffff, 1) // 平行光
- dirLightCull.position.set(1, 1, 1)
- sceneCull.add(dirLightCull)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- initYUVShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO(program) {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- return vao
- },
- initYUV() {
- this.initYUVShader()
- this._vao = this.initVAO(this._program)
- },
- renderYUV(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- initDepthShaderHint() {
- const gl = this.gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_texture_float')
- if (!ext) console.warn('OES_texture_float not support')
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- precision highp float;
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
- uniform sampler2D depth_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 depth_color = texture2D(depth_texture, v_texCoord);
- gl_FragColor = vec4(depth_color.rgb, 1.0);
- }
- `
-
- 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 program = this._depthProgram = gl.createProgram()
- this._depthProgram.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformTexture = gl.getUniformLocation(program, 'depth_texture')
- gl.uniform1i(uniformTexture, 5)
-
- this._depthDt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initDepthVAOHint() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._depthProgram, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0.3, 0.3, 1, 0.3, 0.3, 1, 1, 1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._depthProgram, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._depthVao = vao
- },
- initDepthShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
-
- const dvs = `#version 300 es
- precision highp float;
- in vec2 a_position;
- in vec2 a_texCoord;
- uniform mat3 displayTransform;
- uniform sampler2D depth_texture;
- out vec2 v_texCoord;
-
- void main() {
- vec3 p = displayTransform * vec3(a_position, 1);
- v_texCoord = a_texCoord;
- vec4 depth_color = texture(depth_texture, v_texCoord);
- gl_Position = vec4(p.x, p.y, p.z, 1);
- }
- `
-
- const dfs = `#version 300 es
- precision highp float;
- uniform sampler2D depth_texture;
- out vec4 FragColor;
- in vec2 v_texCoord;
-
- void main() {
- vec4 depth_color = texture(depth_texture, v_texCoord);
- gl_FragDepth = depth_color.r;
- // FragColor = vec4(depth_color.rgb, 1.0);
- }
- `
- const vertShader = gl.createShader(gl.VERTEX_SHADER)
- gl.shaderSource(vertShader, dvs)
- gl.compileShader(vertShader)
-
- const fragShader = gl.createShader(gl.FRAGMENT_SHADER)
- gl.shaderSource(fragShader, dfs)
- gl.compileShader(fragShader)
-
- const program = this._depthOutputProgram = gl.createProgram()
- this._depthOutputProgram.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformDepthTexture = gl.getUniformLocation(this._depthOutputProgram, 'depth_texture')
- gl.uniform1i(uniformDepthTexture, 5)
- gl.getUniformLocation(this._depthOutputProgram, 'displayTransform')
-
- gl.useProgram(currentProgram)
- },
- initDepthGL() {
- // 初始化提示
- this.initDepthShaderHint()
- this.initDepthVAOHint()
- // 初始化深度纹理相关
- this.initDepthShader()
- this._vaoDepth = this.initVAO(this._depthOutputProgram)
- },
- renderDepthGLHint(frame) {
- const gl = this.renderer.getContext()
- const displayTransform = frame.getDisplayTransform()
-
- // DepthBuffer
- const depthBufferRes = frame.getDepthBuffer()
- const depthBuffer = new Float32Array(depthBufferRes.DepthAddress)
-
- // console.log('depthBuffer', depthBuffer[0], depthBuffer[16], depthBuffer[16 * 16], depthBuffer[56 * 56]);
-
- const texture = gl.createTexture()
- gl.bindTexture(gl.TEXTURE_2D, texture)
- 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.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
-
- const width = depthBufferRes.width
- const height = depthBufferRes.height
-
- // 先直接采用 uint8 写入深度纹理,使用浮点写入的方法会存在锯齿
- const data = new Uint8Array(width * height * 4)
- for (let i = 0; i < depthBuffer.length; i++) {
- const num = parseInt(depthBuffer[i] * 255)
- data[i] = num
- }
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, data)
-
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._depthProgram)
- this.ext.bindVertexArrayOES(this._depthVao)
-
- gl.uniformMatrix3fv(this._depthDt, false, displayTransform)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, texture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- },
- renderDepthGL(frame) {
- const gl = this.renderer.getContext()
- const displayTransform = frame.getDisplayTransform()
-
- // DepthBuffer
- const depthBufferRes = frame.getDepthBuffer()
- const depthBuffer = new Float32Array(depthBufferRes.DepthAddress)
-
- const texture = gl.createTexture()
- gl.bindTexture(gl.TEXTURE_2D, texture)
- 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.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
-
- const width = depthBufferRes.width
- const height = depthBufferRes.height
-
- // 先直接采用 uint8 写入深度纹理,使用浮点写入的方法会存在锯齿
- const data = new Uint8Array(width * height * 4)
- for (let i = 0; i < depthBuffer.length; i++) {
- const num = parseInt(depthBuffer[i] * 255)
- data[i] = num
- }
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, data)
-
- // console.log('gl depth texture end')
-
- // 绘制左下角提示
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const bindingTexture = gl.getParameter(gl.TEXTURE_BINDING_2D)
-
- gl.useProgram(this._depthProgram)
- this.ext.bindVertexArrayOES(this._depthVao)
-
- gl.uniformMatrix3fv(this._depthDt, false, displayTransform)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, texture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
-
- // console.log('gl hint end')
-
- // 写入深度遮挡纹理到深度值
-
- gl.enable(gl.DEPTH_TEST)
- gl.depthMask(true)
- gl.depthFunc(gl.ALWAYS)
-
- this.ext.bindVertexArrayOES(this._vaoDepth)
- gl.useProgram(this._depthOutputProgram)
-
- gl.uniformMatrix3fv(this._depthDt, false, displayTransform)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5Depth = gl.getParameter(gl.TEXTURE_BINDING_2D)
-
- gl.bindTexture(gl.TEXTURE_2D, texture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5Depth)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture)
-
- this.ext.bindVertexArrayOES(currentVAO)
-
- gl.depthMask(false)
-
- gl.depthFunc(gl.LESS)
-
- // console.log('gl depth draw end')
- },
- },
-})
-
-export default threeBehavior
diff --git a/miniprogram/packageAPI/pages/ar/behavior/behavior-xrframe.js b/miniprogram/packageAPI/pages/ar/behavior/behavior-xrframe.js
deleted file mode 100644
index f9b88e6f..00000000
--- a/miniprogram/packageAPI/pages/ar/behavior/behavior-xrframe.js
+++ /dev/null
@@ -1,229 +0,0 @@
-const xrFrameBehavior = Behavior({
- yuvMat: undefined, // yuv纹理
- yuvMatInit: undefined, // yuv纹理是否已经初始化
- DT: undefined, // 缓存displayMatrix
- methods: {
- // xrScene Ready 事件回调
- handleXRSceneReady(detail) {
- console.log('handleXRSceneReady', detail)
- const xrFrameSystem = wx.getXrFrameSystem()
-
- this.xrCamera = detail.detail.camera
- this.xrCameraTrs = this.xrCamera.el.getComponent(xrFrameSystem.Transform)
- this.xrScene = detail.detail.scene
- this.xrFrameReady = true
- if (this.initXRFrame) {
- this.initXRFrame()
- }
- },
- // 绑定自定义 YUV effect
- registerYUVEffect() {
- const xrFrameSystem = wx.getXrFrameSystem()
- xrFrameSystem.registerEffect('ar-yuv-self', scene => scene.createEffect({
- properties: [
- {
- key: 'u_displayMatrix',
- type: 6,
- default: [
- 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 1, 0,
- 0, 0, 0, 1
- ]
- }
- ],
- images: [
- {
- key: 'u_yTexture',
- default: 'black',
- macro: 'WX_AR_CAMERA_READY'
- },
- {
- key: 'u_uvTexture',
- default: 'white'
- },
- {
- key: 'u_depthTexture',
- default: 'white',
- macro: 'WX_AR_CAMERA_DEPTH'
- }
- ],
- defaultRenderQueue: 2000,
- passes: [{
- renderStates: {
- cullOn: false,
- blendOn: false,
- depthWrite: false
- },
- lightMode: 'ForwardBase',
- useMaterialRenderStates: true,
- shaders: [0, 1]
- }],
- shaders:
-[
- `#version 100
-attribute vec3 a_position;
-attribute vec2 a_texCoord;
-
-precision highp float;
-
-uniform highp mat4 u_view;
-uniform highp mat4 u_viewInverse;
-uniform highp mat4 u_vp;
-uniform highp mat4 u_projection;
-
-uniform highp mat4 u_world;
-
-
-uniform highp mat4 u_displayMatrix;
-varying highp vec2 v_texCoord;
-
-void main() {
- v_texCoord = a_texCoord;
- vec4 pos = u_displayMatrix * vec4(a_position.xy, 1., 1.);
-
- gl_Position = pos;
-}
-`,
- `#version 100
-precision mediump float;
-precision highp int;
-
-uniform sampler2D u_yTexture;
-uniform sampler2D u_uvTexture;
-varying highp vec2 v_texCoord;
-
-float unpack(float h, float l) {
- return h * 0.94117647 + l * 0.0588235;
-}
-
-void main()
-{
- vec4 yColor = texture2D(u_yTexture, v_texCoord);
- vec4 uvColor = texture2D(u_uvTexture, v_texCoord);
-
-#ifdef WX_AR_CAMERA_READY
-
- float Y, U, V;
- float R, G, B;
- Y = yColor.r;
- U = unpack(uvColor.r, uvColor.g) - 0.5;
- V = unpack(uvColor.b, uvColor.a) - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragData[0] = vec4(B, G, R, 1.0);
-#else
- gl_FragData[0] = vec4(0.0, 0.0, 0.0, 1.0);
-
-#endif
-}
-`
-]
- }))
- },
- // 初始化 xr-frame 相机 YUV 数据绘制流程节点
- initXRYUVCamera() {
- const xrFrameSystem = wx.getXrFrameSystem()
- const scene = this.xrScene
- const { assets, rootShadow } = scene
-
- const el = scene.createElement(xrFrameSystem.XRNode, {
- layer: 1
- })
-
- const yuvGeometry = assets.getAsset('geometry', 'ar-camera-plane')
- let yuvEffect = assets.getAsset('effect', 'ar-yuv-self')
-
- if (!yuvEffect) {
- this.registerYUVEffect()
- yuvEffect = assets.getAsset('effect', 'ar-yuv-self')
- }
-
- const yuvMat = scene.createMaterial(yuvEffect)
- yuvMat.renderQueue = 1 // 第一个绘制
- const mesh = el.addComponent(xrFrameSystem.Mesh, {
- geometry: yuvGeometry,
- material: yuvMat
- })
-
- // 相机yuv纹理
- this.yuvMat = yuvMat
- this.yuvMatInit = false
-
- // 不进入正常的剔除
- rootShadow.addChild(el)
-
- console.log('initXRYUVCamera end')
- },
- updataXRYUV(frame) {
- // console.log('update yuv')
- const xrFrameSystem = wx.getXrFrameSystem()
- const scene = this.xrScene
- const yuv = frame.getCameraRawTextureData()
- // 未创建相机贴图缓存,先创建
- if (!this.cameraTexures) {
- this.cameraTexures = {
- y: scene.createTexture({
- width: yuv.width,
- height: yuv.height,
- source: [yuv.yAddress],
- pixelFormat: xrFrameSystem.ETextureFormat.R8
- }),
- uv: scene.createTexture({
- width: yuv.width / 2,
- height: yuv.height / 2,
- source: [yuv.uvAddress],
- pixelFormat: xrFrameSystem.ETextureFormat.RGBA4
- })
- }
- }
- const { y, uv, depth } = this.cameraTexures
-
- const cameraYUVMat = this.yuvMat
- // 未绑定贴图的情况下,绑定贴图
- if (!this.yuvMatInit) {
- cameraYUVMat.setTexture('u_yTexture', y)
- cameraYUVMat.setTexture('u_uvTexture', uv)
- // depth && cameraYUVMat.setTexture('u_depthTexture', depth);
- this.yuvMatInit = true
- }
-
- // 更新displayMat
- const dt = frame.getDisplayTransform()
- if (!this.DT) { this.DT = new xrFrameSystem.Matrix4() }
- this.DT.setArray([
- dt[0], dt[1], dt[2], 0,
- dt[3], dt[4], dt[5], 0,
- dt[6], dt[7], dt[8], 0,
- 0, 0, 0, 1
- ])
- cameraYUVMat.setMatrix('u_displayMatrix', this.DT)
-
- // YUV纹理更新
- y.update({ buffer: yuv.yAddress })
- uv.update({ buffer: yuv.uvAddress })
-
- // console.log('update yuv end')
- },
- updataXRCameraMatrix(VKCamera, near, far) {
- // 同步 VKCamera 矩阵信息到 xrFrame Camera
- if (VKCamera) {
- const viewMat = VKCamera.viewMatrix
- const projMat = VKCamera.getProjectionMatrix(near, far)
-
- // 更新 viewMatrix
- this.xrCamera.changeViewMatrix(true, viewMat)
-
- // 更新 projectMatrix
- const halfFov = Math.atan(1 / projMat[5]) * 180 / Math.PI
- this.xrCamera.setData({ near, far, fov: 2 * halfFov })
- this.xrCamera.changeProjectMatrix(true, projMat)
- }
- },
- },
-})
-
-export default xrFrameBehavior
diff --git a/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.js b/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.js
deleted file mode 100644
index 964f1c32..00000000
--- a/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.js
+++ /dev/null
@@ -1,234 +0,0 @@
-import arBehavior from '../behavior/behavior-ar'
-import xrFrameBehavior from '../behavior/behavior-xrframe'
-
-// VK 投影矩阵参数定义
-const NEAR = 0.01
-const FAR = 1000
-
-const loggerOnce = false
-
-Component({
- behaviors: [arBehavior, xrFrameBehavior],
- data: {
- theme: 'light',
- widthScale: 1, // canvas宽度缩放值
- heightScale: 0.85, // canvas高度缩放值
- hintBoxList: [], // 显示提示盒子列表
- },
- markerIndex: 0, // 使用的 marker 索引
- hintInfo: undefined, // 提示框信息
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
-
- methods: {
- // 对应案例的初始化逻辑,由统一的 behavior 触发
- init() {
- // 初始化VK
- // start完毕后,进行更新渲染循环
- this.initVK()
- },
- initVK() {
- // VKSession 配置
- const session = this.session = wx.createVKSession({
- track: {
- body: {
- mode: 1
- }
- },
- version: 'v1',
- gl: this.gl
- })
-
- try {
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- // VKSession EVENT resize
- session.on('resize', () => {
- this.calcCanvasSize()
- })
-
- // 开启躯体三维识别
- session.update3DMode({ open3d: true })
-
- // VKSession EVENT addAnchors
- session.on('addAnchors', anchors => {
- console.log('addAnchor', anchors)
- })
-
- // VKSession EVENT updateAnchors
- session.on('updateAnchors', anchors => {
- // console.log("updateAnchors", anchors);
-
- const anchor = anchors[0]
- // 目前只处理一个返回的躯体
- if (anchor) {
- // console.log('id', anchor.id);
- // console.log('type', anchor.type);
- // console.log('transform', anchor.transform);
- // console.log('mesh', anchor.mesh);
- // console.log('origin', anchor.origin);
- // console.log('size', anchor.size);
- // console.log('detectId', anchor.detectId);
- // console.log('confidence', anchor.confidence);
- // console.log('points3d', anchor.points3d);
-
- this.bodyTransform = anchor.transform
- this.bodyPosition3D = anchor.points3d
-
- this.updateHintBoxVisble(this.hintBoxList, true)
- }
- })
-
- // VKSession removeAnchors
- // 识别目标丢失时不断触发
- session.on('removeAnchors', anchors => {
- // console.log("removeAnchors");
-
- this.updateHintBoxVisble(this.hintBoxList, false)
- })
-
- console.log('ready to initloop')
- // start 初始化完毕后,进行更新渲染循环
- this.initLoop()
- })
- } catch (e) {
- console.error(e)
- }
- },
- // 针对 xr-frame 的初始化逻辑
- async initXRFrame() {
- const xrFrameSystem = wx.getXrFrameSystem()
- const scene = this.xrScene
- const { rootShadow } = scene
-
- // 缓存主相机
- this.xrCameraMain = this.xrCamera
- this.xrCameraMainTrs = this.xrCameraTrs
-
- // 初始化YUV相机配置
- this.initXRYUVCamera()
-
- // === 初始躯体挂载点 ===
- this.bodyWrap = scene.createElement(xrFrameSystem.XRNode)
- this.bodyWrapTrs = this.bodyWrap.getComponent(xrFrameSystem.Transform)
- rootShadow.addChild(this.bodyWrap)
-
- // 加载提示点
- this.hintBoxList = this.getHintBox(xrFrameSystem, scene, this.bodyWrap)
- },
- loop() {
- // console.log('loop')
-
- // 获取 VKFrame
- const frame = this.session.getVKFrame(this.data.width, this.data.height)
-
- // 成功获取 VKFrame 才进行
- if (!frame) { return }
-
- // 更新相机 YUV 数据
- this.updataXRYUV(frame)
-
- // 获取 VKCamera
- const VKCamera = frame.camera
-
- // 更新 xrFrame 相机矩阵
- this.updataXRCameraMatrix(VKCamera, NEAR, FAR)
-
- // 存在bodyWrao,执行信息同步逻辑
- if (this.bodyWrap && this.bodyTransform) {
- const xrFrameSystem = wx.getXrFrameSystem()
-
- if (!this.DT) { this.DT = new xrFrameSystem.Matrix4() }
- if (!this.DT2) { this.DT2 = new xrFrameSystem.Matrix4() }
-
- // 目前VK返回的是行主序矩阵
- // xrframe 矩阵存储为列主序
- this.DT.setArray(this.bodyTransform)
- this.DT.transpose(this.DT2)
- this.bodyWrapTrs.setLocalMatrix(this.DT2)
-
- // 更新提示点位置
- this.updateHintBoxPosition(this.hintBoxList, this.bodyPosition3D)
- }
- },
- getHintBox(xrFrameSystem, scene, wrap) {
- // 初始化提示点
- const geometryHint = scene.assets.getAsset('geometry', 'sphere')
- const effectCube = scene.assets.getAsset('effect', 'standard')
- const boxScale = 0.03
- const hintBoxList = []
- for (let i = 0; i < 24; i++) {
- const colorFloat = i / 24
- const el = scene.createElement(xrFrameSystem.XRNode, {
- position: '0 0 0',
- scale: `${boxScale} ${boxScale} ${boxScale}`,
- })
- const elTrs = el.getComponent(xrFrameSystem.Transform)
- const mat = scene.createMaterial(effectCube)
-
- const colorR = 1.0 - colorFloat
- mat.setVector('u_baseColorFactor', xrFrameSystem.Vector4.createFromNumber(1.0, colorR, colorR, 1.0))
-
- const mesh = el.addComponent(xrFrameSystem.Mesh, {
- geometry: geometryHint,
- material: mat,
- })
-
- wrap.addChild(el)
- // elTrs.visible = false;
-
- hintBoxList.push(elTrs)
- }
-
- return hintBoxList
- },
- updateHintBoxPosition(hintBoxList, points3d) {
- if (hintBoxList && hintBoxList.length > 0) {
- // console.log('ready to set', hintBoxList);
- // 存在提示列表,则更新点信息
- for (let i = 0; i < hintBoxList.length; i++) {
- const hintBox = hintBoxList[i]
- hintBox.position.x = points3d[i].x
- hintBox.position.y = points3d[i].y
- hintBox.position.z = points3d[i].z
- }
- }
- },
- updateHintBoxVisble(hintBoxList, visible) {
- if (hintBoxList && hintBoxList.length > 0) {
- // console.log('ready to set', hintBoxList);
- // 存在提示列表,则更新点信息
- for (let i = 0; i < hintBoxList.length; i++) {
- const hintBox = hintBoxList[i]
- if (hintBox.visible !== visible) {
- hintBox.visible = visible
- }
- }
- }
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.json b/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.json
deleted file mode 100644
index 4c0decbe..00000000
--- a/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "usingComponents": {
- "xr-frame-canvas": "../components/xr-frame/index"
- },
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "躯体三维识别",
- "pageOrientation": "auto"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.wxml b/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.wxml
deleted file mode 100644
index d1c6a513..00000000
--- a/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.wxml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 提示:摄像头对准人体,然后会显示24个关键点的三维坐标提示小球;横屏情况,会自动切换横屏小程序(需保证设备没有开启竖屏锁定)
-
-
-
diff --git a/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.wxss b/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.wxss
deleted file mode 100644
index bbf49147..00000000
--- a/miniprogram/packageAPI/pages/ar/body-detect-3d/body-detect-3d.wxss
+++ /dev/null
@@ -1,69 +0,0 @@
-.canvas-wrap {
- position: relative;
- width: 100%;
- background-color: #000;
-}
-
-.canvas-wrap canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.canvas-wrap #canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-
-.hint-bottom {
- position: absolute;
- left: 20px;
- right: 20px;
- bottom: 20px;
- padding: 5px 10px;
- font-size: 14px;
- color: #fff;
- background-color: rgba(0, 0, 0, 0.4);
- border-radius: 6px;
-}
-
-.hint-bottom .btn-wrap {
- display: flex;
-}
-
-.hint-bottom .btn{
- margin: 10px 5px;
- font-size: 14px;
- line-height: 18px;
-}
-.wrap-option {
- position: absolute;
- left: 20rpx;
- right: 0;
- bottom: 20rpx;
- height: 10%;
- display: flex;
-}
-
-.wrap-option button {
- flex: 1;
- margin: 20rpx 20rpx 20rpx 0;
- font-size: 30rpx;
- line-height: 1.2;
-}
-.hint-bottom .btn-wrap {
- display: flex;
-}
-
-.hint-bottom .btn{
- flex: 1;
- margin: 10px 5px;
- font-size: 18px;
- line-height: 24px;
-}
diff --git a/miniprogram/packageAPI/pages/ar/body-detect/behavior.js b/miniprogram/packageAPI/pages/ar/body-detect/behavior.js
deleted file mode 100644
index edcb2695..00000000
--- a/miniprogram/packageAPI/pages/ar/body-detect/behavior.js
+++ /dev/null
@@ -1,201 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- cameraPosition: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 3
- },
- body: {
- mode: 1
- }
- },
- gl: this.gl,
- version: 'v1',
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- session.on('addAnchors', anchors => {
- this.data.anchor2DList = anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size
- }))
- })
- session.on('updateAnchors', anchors => {
- this.data.anchor2DList = []
- this.data.anchor2DList = this.data.anchor2DList.concat(anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size
- })))
-
- console.log('显示data')
- console.log(this.data)
- })
- session.on('removeAnchors', anchors => {
- this.data.anchor2DList = []
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/body-detect/body-detect.js b/miniprogram/packageAPI/pages/ar/body-detect/body-detect.js
deleted file mode 100644
index a1671252..00000000
--- a/miniprogram/packageAPI/pages/ar/body-detect/body-detect.js
+++ /dev/null
@@ -1,308 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-// 顶点着色器
-const VSHADER_SOURCE = '' +
- 'attribute vec4 a_Position;\n' + // 声明attribute变量a_Position,用来存放顶点位置信息
- 'void main(){\n' +
- ' gl_Position = a_Position;\n' + // 将顶点坐标赋值给顶点着色器内置变量gl_Position
- ' gl_PointSize = 4.0;\n' + // 设置顶点大小
- '}\n'
-
-// 片元着色器
-const FSHADER_SOURCE = '' +
- '#ifdef GL_ES\n' +
- ' precision mediump float;\n' + // 设置精度
- '#endif\n' +
- 'varying vec4 v_Color;\n' + // 声明varying变量v_Color,用来接收顶点着色器传送的片元颜色信息
- 'void main(){\n' +
- ' float d = distance(gl_PointCoord, vec2(0.5, 0.5));\n' + // 计算像素距离中心点的距离
- ' if(d < 0.5) {\n' + // 距离大于0.5放弃片元,小于0.5保留片元
- ' gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n' +
- ' } else { discard; }\n' +
- '}\n'
-
-// 初始化着色器函数
-let initShadersDone = false
-
-function initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE) {
- // 创建顶点着色器对象
- const vertexShader = loadShader(gl, gl.VERTEX_SHADER, VSHADER_SOURCE)
- // 创建片元着色器对象
- const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, FSHADER_SOURCE)
-
- if (!vertexShader || !fragmentShader) {
- return null
- }
-
- // 创建程序对象program
- const program = gl.createProgram()
- if (!gl.createProgram()) {
- return null
- }
- // 分配顶点着色器和片元着色器到program
- gl.attachShader(program, vertexShader)
- gl.attachShader(program, fragmentShader)
- // 链接program
- gl.linkProgram(program)
-
- // 检查程序对象是否连接成功
- const linked = gl.getProgramParameter(program, gl.LINK_STATUS)
- if (!linked) {
- const error = gl.getProgramInfoLog(program)
- console.log('程序对象连接失败: ' + error)
- gl.deleteProgram(program)
- gl.deleteShader(fragmentShader)
- gl.deleteShader(vertexShader)
- return null
- }
- // 返回程序program对象
- initShadersDone = true
- return program
-}
-
-function loadShader(gl, type, source) {
- // 创建顶点着色器对象
- const shader = gl.createShader(type)
- if (shader == null) {
- console.log('创建着色器失败')
- return null
- }
-
- // 引入着色器源代码
- gl.shaderSource(shader, source)
-
- // 编译着色器
- gl.compileShader(shader)
-
- // 检查顶是否编译成功
- const compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS)
- if (!compiled) {
- const error = gl.getShaderInfoLog(shader)
- console.log('编译着色器失败: ' + error)
- gl.deleteShader(shader)
- return null
- }
-
- return shader
-}
-
-// 初始化顶点坐标和顶点颜色
-function initVertexBuffers(gl, anchor2DList) {
- const flattenPoints = []
- anchor2DList.forEach(anchor => {
- anchor.points.forEach(point => {
- const {
- x,
- y
- } = point
- flattenPoints.push(x * 2 - 1, 1 - y * 2)
- })
- })
-
- const vertices = new Float32Array(flattenPoints)
- const n = flattenPoints.length / 2
-
- // 创建缓冲区对象
- const buffer = gl.createBuffer()
- // 将顶点坐标和顶点颜色信息写入缓冲区对象
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer)
- gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW)
-
- // 获取顶点着色器attribute变量a_Position存储地址, 分配缓存并开启
- const a_Position = gl.getAttribLocation(gl.program, 'a_Position')
- gl.vertexAttribPointer(a_Position, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(a_Position)
- return n
-}
-
-const EDGE_VSHADER_SOURCE =
- `
- attribute vec2 aPosition;
- varying vec2 posJudge;
-
- void main(void) {
- gl_Position = vec4(aPosition.x, aPosition.y, 1.0, 1.0);
- posJudge = aPosition;
- }
-`
-
-const EDGE_FSHADER_SOURCE =
- `
- precision highp float;
- uniform vec2 rightTopPoint;
- uniform vec2 centerPoint;
- varying vec2 posJudge;
-
- float box(float x, float y){
- float xc = x - centerPoint.x;
- float yc = y - centerPoint.y;
- vec2 point = vec2(xc, yc);
- float right = rightTopPoint.x;
- float top = rightTopPoint.y;
- float line_width = 0.01;
- vec2 b1 = 1.0 - step(vec2(right,top), abs(point));
- float outer = b1.x * b1.y;
- vec2 b2 = 1.0 - step(vec2(right-line_width,top-line_width), abs(point));
- float inner = b2.x * b2.y;
- return outer - inner;
- }
-
- void main(void) {
- if(box(posJudge.x, posJudge.y) == 0.0 ) discard;
-
- gl_FragColor = vec4(box(posJudge.x, posJudge.y), 0.0, 0.0, 1.0);
-
- }
-`
-
-function initRectEdgeBuffer(gl, x, y, width, height) {
- const shaderProgram = gl.program
- const centerX = x * 2 - 1 + width
- const centerY = -1 * (y * 2 - 1) - height
- const right = width
- const top = height
- const vertices = [
- -1.0, 1.0,
- -1.0, -1.0,
- 1.0, 1.0,
- 1.0, -1.0
- ]
-
- const vertexBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW)
- const aPosition = gl.getAttribLocation(shaderProgram, 'aPosition')
- gl.enableVertexAttribArray(aPosition)
- gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, 0, 0)
-
- const rightTop = [
- right, top
- ]
- const rightTopLoc = gl.getUniformLocation(shaderProgram, 'rightTopPoint')
- gl.uniform2fv(rightTopLoc, rightTop)
-
- const centerPoint = [
- centerX, centerY
- ]
- const centerPointLoc = gl.getUniformLocation(shaderProgram, 'centerPoint')
- gl.uniform2fv(centerPointLoc, centerPoint)
-
- const length = vertices.length / 2
-
- return length
-}
-
-function onDrawRectEdge(gl, x, y, width, height) {
- width = Math.round(width * 100) / 100
- height = Math.round(height * 100) / 100
- const n = initRectEdgeBuffer(gl, x, y, width, height)
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, n)
-}
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- initShadersDone = false
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({
- theme
- }) => {
- this.setData({
- theme
- })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- },
- switchCamera(event) {
- if (this.session.config) {
- const config = this.session.config
- const pos = Number(event.currentTarget.dataset.value)
- config.cameraPosition = pos
- this.session.config = config
- this.setData({
- cameraPosition: event.currentTarget.dataset.value
- })
- }
- },
- render(frame) {
- const gl = this.gl
-
- this.renderGL(frame)
-
- const camera = frame.camera
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
-
- const anchor2DList = this.data.anchor2DList
-
- if (!anchor2DList || anchor2DList.length <= 0) {
-
- } else {
- if (!initShadersDone) {
- this.vertexProgram = initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE)
- this.rectEdgeProgram = initShaders(gl, EDGE_VSHADER_SOURCE, EDGE_FSHADER_SOURCE)
- if (!this.vertexProgram || !this.rectEdgeProgram) {
- console.log('初始化着色器失败')
- return
- }
- console.log('初始化着色器成功')
- }
-
- gl.useProgram(this.vertexProgram)
- gl.program = this.vertexProgram
- // 初始化顶点坐标和顶点颜色
- const n = initVertexBuffers(gl, anchor2DList)
-
- // 绘制点
- gl.drawArrays(gl.POINTS, 0, n)
-
- gl.useProgram(this.rectEdgeProgram)
- gl.program = this.rectEdgeProgram
-
- for (let i = 0; i < anchor2DList.length; i++) {
- onDrawRectEdge(gl, anchor2DList[i].origin.x, anchor2DList[i].origin.y, anchor2DList[i].size.width, anchor2DList[i].size.height)
- }
- }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/body-detect/body-detect.json b/miniprogram/packageAPI/pages/ar/body-detect/body-detect.json
deleted file mode 100644
index 31346dcf..00000000
--- a/miniprogram/packageAPI/pages/ar/body-detect/body-detect.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "实时人体检测",
- "pageOrientation": "auto"
-}
diff --git a/miniprogram/packageAPI/pages/ar/body-detect/body-detect.wxml b/miniprogram/packageAPI/pages/ar/body-detect/body-detect.wxml
deleted file mode 100644
index 74830143..00000000
--- a/miniprogram/packageAPI/pages/ar/body-detect/body-detect.wxml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
- 提示:将摄像头对准人体, 检测到的人体将会被标记出识别框和人体部位标记点(需保证设备没有开启竖屏锁定)
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/body-detect/body-detect.wxss b/miniprogram/packageAPI/pages/ar/body-detect/body-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/body-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/body-detect/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/body-detect/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/behavior.js b/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/behavior.js
deleted file mode 100644
index ca548e4d..00000000
--- a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/behavior.js
+++ /dev/null
@@ -1,167 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- cameraPosition: 0,
- gl: this.gl,
- version: 'v1'
- })
-
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- this.setData({
- buttonDisable: false
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.js b/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.js
deleted file mode 100644
index 5820d49f..00000000
--- a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.js
+++ /dev/null
@@ -1,78 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-import cameraBufferBehavior from './cameraBufferBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-// 初始化着色器函数
-let initShadersDone = false
-
-Component({
- behaviors: [getBehavior(), yuvBehavior, cameraBufferBehavior],
- data: {
- theme: 'light',
- cameraPosition: 0,
- buttonDisable: true,
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- initShadersDone = false
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({
- theme
- }) => {
- this.setData({
- theme
- })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- this.initCameraBufferGL()
-
- initShadersDone = true
- },
- render(frame) {
- if (!initShadersDone) return
- const gl = this.gl
-
- this.renderGL(frame)
- this.renderCameraBufferGL(frame)
-
- const camera = frame.camera
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.json b/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.json
deleted file mode 100644
index 67bbd59d..00000000
--- a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "相机帧测试"
-}
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.less b/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.less
deleted file mode 100644
index d48ce922..00000000
--- a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.less
+++ /dev/null
@@ -1 +0,0 @@
-/* packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.wxml b/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.wxml
deleted file mode 100644
index cceaf532..00000000
--- a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.wxml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
- 提示:将摄像头对准场景, 检测到的场景会标记出相机缓冲图信息
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.wxss b/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBuffer-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBufferBehavior.js b/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBufferBehavior.js
deleted file mode 100644
index 278c4f5d..00000000
--- a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/cameraBufferBehavior.js
+++ /dev/null
@@ -1,144 +0,0 @@
-const cameraBufferBehavior = Behavior({
- methods: {
- initCameraBufferShader() {
- const gl = this.gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_texture_float')
- if (!ext) console.warn('OES_texture_float not support')
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- precision highp float;
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
- uniform sampler2D cameraBuffer_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 cameraBuffer_color = texture2D(cameraBuffer_texture, v_texCoord);
- gl_FragColor = vec4(cameraBuffer_color.rgb, 1.0);
- }
- `
- 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 program = this._cameraBufferProgram = gl.createProgram()
- this._cameraBufferProgram.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformTexture = gl.getUniformLocation(program, 'cameraBuffer_texture')
- gl.uniform1i(uniformTexture, 5)
-
- this._cameraBufferDt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initCameraBufferVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const width = Math.floor(this.canvas.width / 16) * 16
- const height = this.canvas.height
-
- const posAttr = gl.getAttribLocation(this._cameraBufferProgram, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0.3, 0.3, 1, 0.3, 0.3, 1, 1, 1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._cameraBufferProgram, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._cameraBufferVao = vao
- },
- initCameraBufferGL() {
- this.initCameraBufferShader()
- this.initCameraBufferVAO()
- this.once = 1
- },
-
- renderCameraBufferGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const displayTransform = frame.getDisplayTransform()
-
- const width = Math.floor(this.canvas.width / 16) * 16
- const height = this.canvas.height
-
- const cameraBufferRes = frame.getCameraBuffer(width, height)
-
- const texture = gl.createTexture()
- if (cameraBufferRes) {
- const cameraBuffer = new Uint8Array(cameraBufferRes)
-
- const data = new Uint8Array(width * height * 4)
- for (let i = 0; i < cameraBuffer.length; i++) {
- const num = parseInt(cameraBuffer[i] * 255)
- data[i] = num
- }
-
- gl.bindTexture(gl.TEXTURE_2D, texture)
- 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.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
-
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, data)
- }
-
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._cameraBufferProgram)
- this.ext.bindVertexArrayOES(this._cameraBufferVao)
-
- gl.uniformMatrix3fv(this._cameraBufferDt, false, displayTransform)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, texture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- },
- },
-})
-
-export default cameraBufferBehavior
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/yuvBehavior.js
deleted file mode 100644
index 147d1f65..00000000
--- a/miniprogram/packageAPI/pages/ar/cameraBuffer-detect/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
-
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.js b/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.js
deleted file mode 100644
index fd192560..00000000
--- a/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.js
+++ /dev/null
@@ -1,216 +0,0 @@
-import arBehavior from '../behavior/behavior-ar'
-import threeBehavior from '../behavior/behavior-three'
-
-// VK 投影矩阵参数定义
-const NEAR = 0.01
-const FAR = 1000
-
-Component({
- behaviors: [arBehavior, threeBehavior],
- data: {
- theme: 'light',
- widthScale: 1, // canvas宽度缩放值
- heightScale: 0.57, // canvas高度缩放值
- jpgUrl: '',
- },
- useLoopLog: false, // 是否开启循环log
- imgIndex: 0,
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
-
- methods: {
- // 对应案例的初始化逻辑,由统一的 behavior 触发
- init() {
- // 初始化 Three.js,用于模型相关的渲染
- this.initTHREE()
-
- // 初始化 GL,基于 Three.js 的 Context,用于相机YUV渲染
- this.initYUV()
-
- // 初始化VK
- // start完毕后,进行更新渲染循环
- this.initVK()
-
- this.useLoopLog = false
- this.imgIndex = 0
- },
- initVK() {
- // VKSession 配置
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 1
- },
- },
- version: 'v2',
- gl: this.gl
- })
-
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- // VKSession EVENT resize
- session.on('resize', () => {
- this.calcCanvasSize()
- })
-
- // VKSession EVENT addAnchors
- session.on('addAnchors', anchors => {
- })
-
- // VKSession EVENT updateAnchors
- session.on('updateAnchors', anchors => {
-
- })
-
- // VKSession removeAnchors
- // 识别目标丢失时,会触发一次
- session.on('removeAnchors', anchors => {
- // console.log('removeAnchors', anchors)
- })
-
- console.log('ready to initloop')
- // start 初始化完毕后,进行更新渲染循环
- this.initLoop()
-
- // 绘制双面,以及去掉清屏,用于显示yuv
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- })
- },
- loop() {
- // 获取 VKFrame
- const frame = this.session.getVKFrame(this.canvas.width, this.canvas.height)
-
- // 成功获取 VKFrame 才进行
- if (!frame) { return }
-
- // 更新相机 YUV 数据
- this.renderYUV(frame)
-
- // 获取 VKCamera
- const VKCamera = frame.camera
-
- if (this.useLoopLog) {
- // let transformStr = '';
- // for (let i = 0; i < 16; i++)
- // transformStr += VKCamera.transform[i] + ' ';
- // console.log('VKCamera.transform', transformStr);
-
- console.log('timeStamp', frame.timestamp)
-
- let viewMatrixStr = ''
- for (let i = 0; i < 16; i++) viewMatrixStr += VKCamera.viewMatrix[i] + ' '
- // console.log('VKCamera.viewMatrix', viewMatrixStr);
- if (this.preTimestamp && this.preTimestamp === frame.timestamp) {
- if (this.preViewMatrixStr && this.preViewMatrixStr !== viewMatrixStr) {
- console.log('preViewMatrixStr', this.preViewMatrixStr)
- console.log('viewMatrixStr', viewMatrixStr)
- console.log('Timestamp is same. But viewMatrix is not same')
- }
- }
- this.preTimestamp = frame.timestamp
- this.preViewMatrixStr = viewMatrixStr
- }
- },
- getJpgImg() {
- console.log('Function getJpgImg')
-
- // 按需写入获取 jpg 的 大小 和质量
- const width = 640
- const height = 480
- const quality = 90
-
- // 获取 VKFrame
- const frame = this.session.getVKFrame(width, height)
-
- // 成功获取 VKFrame 才进行
- if (!frame) { return }
-
- console.log('getCameraJpgBuffer: ', width, height, quality)
-
- const t1 = new Date().getTime()
- const jpgBuffer = frame.getCameraJpgBuffer(width, height, quality)
- const t2 = new Date().getTime()
-
- console.log(`getCameraJpgBuffer cost ${t2 - t1}ms`)
-
- // console.log('jpgBuffer', jpgBuffer);
-
- const jpgUrl = this.saveLocalJPG(jpgBuffer, 'cameraJPG')
-
- console.log('jpgUrl', jpgUrl)
-
- this.setData({
- jpgUrl
- })
- },
- saveLocalJPG(bufferContent, name) {
- const url = `${wx.env.USER_DATA_PATH}/${name + this.imgIndex + '.jpg'}`
-
- const fs = wx.getFileSystemManager()
- try {
- // 存在即删除
- const unlinkRes = fs.unlinkSync(url)
- // console.log('unlinkSync', unlinkRes)
-
- this.imgIndex++
- const newUrl = `${wx.env.USER_DATA_PATH}/${name + this.imgIndex + '.jpg'}`
-
- // console.log('write newUrl', newUrl)
- // 写入,新图片
- const writeRes = fs.writeFileSync(
- newUrl,
- bufferContent,
- 'utf8'
- )
-
- return newUrl
- } catch (e) {
- // 利用catch实现,此时,为新写入
- try {
- // console.log('write url', url)
-
- // 写入
- const writeRes = fs.writeFileSync(
- url,
- bufferContent,
- 'utf8'
- )
- } catch (e) {
- console.error(e)
- }
- }
-
- return url
- },
- getLog() {
- console.log('Function getLog')
-
- this.useLoopLog = !this.useLoopLog
- },
-
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.json b/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.json
deleted file mode 100644
index e3d44279..00000000
--- a/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "相机帧获取jpg图片"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.wxml b/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.wxml
deleted file mode 100644
index 94b774db..00000000
--- a/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.wxml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
- 提示:点击获取,会将摄像头资源转成贴图(需基础库3.4.4)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.wxss b/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.wxss
deleted file mode 100644
index d0e3c835..00000000
--- a/miniprogram/packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg.wxss
+++ /dev/null
@@ -1,107 +0,0 @@
-.canvas-wrap {
- position: relative;
- width: 100%;
- background-color: #000;
-}
-
-.canvas-wrap #canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.hint-box {
- position: absolute;
- left: 0%;
- top: 0%;
- width: 0;
- height: 0;
-}
-.hint-id {
- position: absolute;
- left: -6rpx;
- right: -6rpx;
- bottom: 100%;
- color: #fff;
- font-size: 20rpx;
- line-height: 40rpx;
- text-align: center;
- text-overflow: ellipsis;
- background-color: #07c160;
- border-radius: 8rpx;
-
-}
-
-.wrap-fix {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.hint-words {
- position: absolute;
- left: 20rpx;
- top: 20rpx;
- right: 20rpx;
- padding: 10rpx 20rpx;
- line-height: 40rpx;
- text-align: center;
- border-radius: 6rpx;
- background-color: rgba(0, 0, 0, .3);
- font-size: 26rpx;
- color: #fff;
-}
-
-
-.hint-img-wrap {
- position: absolute;
- left: 25%;
- bottom: 0%;
- width: 50%;
- height: 30%;
-}
-
-.hint-img-box {
- position: absolute;
- left: 5%;
- top: 5%;
- right: 5%;
- bottom: 5%;
- background-color: #fafafa;
- border: 4rpx solid;
-}
-
-.hint-img {
- position: absolute;
- left: 4%;
- top: 4%;
- width: 92%;
- height: 92%;
-}
-
-.wrap-option {
- position: absolute;
- left: 20rpx;
- right: 0;
- bottom: 30%;
- height: 10%;
- flex-direction: column;
- display: flex;
-}
-
-.wrap-option .row {
- flex: 1;
- display: flex;
- flex-direction: row;
- text-align: center;
-}
-.wrap-option button {
- flex: 1;
- margin: 5rpx 20rpx 20rpx 0;
- font-size: 30rpx;
- line-height: 1.2;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/components/xr-frame-render/index.js b/miniprogram/packageAPI/pages/ar/components/xr-frame-render/index.js
deleted file mode 100644
index 79e843e8..00000000
--- a/miniprogram/packageAPI/pages/ar/components/xr-frame-render/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-Component({
- behaviors: [],
- properties: {
- },
- data: {
- renderTargetWidth: 0,
- renderTargetHeight: 0,
- pixelRatioReady: false,
- },
- lifetimes: {},
- methods: {
- handleReady({ detail }) {
- const xrScene = this.scene = detail.value
- console.log('xr-scene', xrScene)
-
- const camera = this.scene.getElementById('camera').getComponent('camera')
-
- // 暴露scene对象到外部进行定制
- this.triggerEvent('sceneReady', { scene: xrScene, camera })
- },
- }
-})
diff --git a/miniprogram/packageAPI/pages/ar/components/xr-frame-render/index.json b/miniprogram/packageAPI/pages/ar/components/xr-frame-render/index.json
deleted file mode 100644
index a40d18e7..00000000
--- a/miniprogram/packageAPI/pages/ar/components/xr-frame-render/index.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "usingComponents": {},
- "renderer": "xr-frame"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/components/xr-frame-render/index.wxml b/miniprogram/packageAPI/pages/ar/components/xr-frame-render/index.wxml
deleted file mode 100644
index 9b86d1a4..00000000
--- a/miniprogram/packageAPI/pages/ar/components/xr-frame-render/index.wxml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/components/xr-frame-render/index.wxss b/miniprogram/packageAPI/pages/ar/components/xr-frame-render/index.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/components/xr-frame/index.js b/miniprogram/packageAPI/pages/ar/components/xr-frame/index.js
deleted file mode 100644
index 1d224043..00000000
--- a/miniprogram/packageAPI/pages/ar/components/xr-frame/index.js
+++ /dev/null
@@ -1,31 +0,0 @@
-Component({
- behaviors: [],
- properties: {
- },
- data: {
- renderTargetWidth: 0,
- renderTargetHeight: 0,
- pixelRatioReady: false,
- },
- lifetimes: {},
- methods: {
- handleReady({ detail }) {
- const xrScene = this.scene = detail.value
- console.log('xr-scene', xrScene)
-
- // 获取屏幕比例,用作后处理rt比例
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- this.setData({
- pixelRatioReady: true,
- renderTargetWidth: info.windowWidth * pixelRatio,
- renderTargetHeight: info.windowHeight * pixelRatio,
- })
-
- const camera = this.scene.getElementById('camera').getComponent('camera')
-
- // 暴露scene对象到外部进行定制
- this.triggerEvent('sceneReady', { scene: xrScene, camera })
- },
- }
-})
diff --git a/miniprogram/packageAPI/pages/ar/components/xr-frame/index.json b/miniprogram/packageAPI/pages/ar/components/xr-frame/index.json
deleted file mode 100644
index a40d18e7..00000000
--- a/miniprogram/packageAPI/pages/ar/components/xr-frame/index.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "usingComponents": {},
- "renderer": "xr-frame"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/components/xr-frame/index.wxml b/miniprogram/packageAPI/pages/ar/components/xr-frame/index.wxml
deleted file mode 100644
index 436f009d..00000000
--- a/miniprogram/packageAPI/pages/ar/components/xr-frame/index.wxml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/components/xr-frame/index.wxss b/miniprogram/packageAPI/pages/ar/components/xr-frame/index.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/depth-detect/behavior.js b/miniprogram/packageAPI/pages/ar/depth-detect/behavior.js
deleted file mode 100644
index 18600958..00000000
--- a/miniprogram/packageAPI/pages/ar/depth-detect/behavior.js
+++ /dev/null
@@ -1,172 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- depth: {
- mode: 1
- }
- },
- cameraPosition: 0,
- gl: this.gl,
- version: 'v1'
- })
-
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- this.setData({
- buttonDisable: false
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/depth-detect/depth-detect.js b/miniprogram/packageAPI/pages/ar/depth-detect/depth-detect.js
deleted file mode 100644
index 002a5cf0..00000000
--- a/miniprogram/packageAPI/pages/ar/depth-detect/depth-detect.js
+++ /dev/null
@@ -1,77 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-import depthBehavior from './depthBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-// 初始化着色器函数
-let initShadersDone = false
-
-Component({
- behaviors: [getBehavior(), yuvBehavior, depthBehavior],
- data: {
- theme: 'light',
- cameraPosition: 0,
- buttonDisable: true,
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- initShadersDone = false
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({
- theme
- }) => {
- this.setData({
- theme
- })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- this.initDepthGL()
- initShadersDone = true
- },
- render(frame) {
- if (!initShadersDone) return
- const gl = this.gl
-
- this.renderGL(frame)
- this.renderDepthGL(frame)
-
- const camera = frame.camera
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/depth-detect/depth-detect.json b/miniprogram/packageAPI/pages/ar/depth-detect/depth-detect.json
deleted file mode 100644
index 948da4ab..00000000
--- a/miniprogram/packageAPI/pages/ar/depth-detect/depth-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "实时深度图检测"
-}
diff --git a/miniprogram/packageAPI/pages/ar/depth-detect/depth-detect.wxml b/miniprogram/packageAPI/pages/ar/depth-detect/depth-detect.wxml
deleted file mode 100644
index d6b7e042..00000000
--- a/miniprogram/packageAPI/pages/ar/depth-detect/depth-detect.wxml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
- 提示:将摄像头对准场景, 检测到的场景会标记出深度图信息
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/depth-detect/depth-detect.wxss b/miniprogram/packageAPI/pages/ar/depth-detect/depth-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/depth-detect/depthBehavior.js b/miniprogram/packageAPI/pages/ar/depth-detect/depthBehavior.js
deleted file mode 100644
index 0bde2dbb..00000000
--- a/miniprogram/packageAPI/pages/ar/depth-detect/depthBehavior.js
+++ /dev/null
@@ -1,168 +0,0 @@
-const depthBehavior = Behavior({
- methods: {
- initDepthShader() {
- const gl = this.gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_texture_float')
- if (!ext) console.warn('OES_texture_float not support')
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- precision highp float;
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
- uniform sampler2D depth_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 depth_color = texture2D(depth_texture, v_texCoord);
- gl_FragColor = vec4(depth_color.rgb, 1.0);
- }
- `
- 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 program = this._depthProgram = gl.createProgram()
- this._depthProgram.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformTexture = gl.getUniformLocation(program, 'depth_texture')
- gl.uniform1i(uniformTexture, 5)
-
- this._depthDt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initDepthVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._depthProgram, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0.3, 0.3, 1, 0.3, 0.3, 1, 1, 1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._depthProgram, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._depthVao = vao
- },
- initDepthGL() {
- this.initDepthShader()
- this.initDepthVAO()
- },
- renderDepthGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- // const depthTexture = frame.getDepthTexture(gl)
- const displayTransform = frame.getDisplayTransform()
- // if (depthTexture) {
- // const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- // const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- // const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- // gl.useProgram(this._depthProgram)
- // this.ext.bindVertexArrayOES(this._depthVao)
-
- // gl.uniformMatrix3fv(this._dt, false, displayTransform)
-
- // const ext = gl.getExtension("OES_texture_float");
- // if (!ext) console.warn('OES_texture_float not support');
-
- // gl.activeTexture(gl.TEXTURE0 + 5)
- // const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- // gl.bindTexture(gl.TEXTURE_2D, depthTexture)
-
- // gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- // gl.activeTexture(gl.TEXTURE0 + 5)
- // gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- // gl.useProgram(currentProgram)
- // gl.activeTexture(currentActiveTexture)
- // this.ext.bindVertexArrayOES(currentVAO)
- // }
-
- // DepthBuffer
- const depthBufferRes = frame.getDepthBuffer()
- const depthBuffer = new Float32Array(depthBufferRes.DepthAddress)
-
- const texture = gl.createTexture()
- gl.bindTexture(gl.TEXTURE_2D, texture)
- 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.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
-
- const width = depthBufferRes.width
- const height = depthBufferRes.height
-
- const ext = gl.getExtension('OES_texture_float')
- if (ext) {
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.FLOAT, depthBuffer)
- } else {
- const data = new Uint8Array(width * height * 4)
- for (let i = 0; i < depthBuffer.length; i++) {
- const num = parseInt(depthBuffer[i] * 255)
- data[i] = num
- }
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, data)
- }
-
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._depthProgram)
- this.ext.bindVertexArrayOES(this._depthVao)
-
- gl.uniformMatrix3fv(this._depthDt, false, displayTransform)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, texture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- },
- },
-})
-
-export default depthBehavior
diff --git a/miniprogram/packageAPI/pages/ar/depth-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/depth-detect/yuvBehavior.js
deleted file mode 100644
index 147d1f65..00000000
--- a/miniprogram/packageAPI/pages/ar/depth-detect/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
-
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.js b/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.js
deleted file mode 100644
index 48ac5ed3..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.js
+++ /dev/null
@@ -1,214 +0,0 @@
-import arBehavior from '../behavior/behavior-ar'
-import xrFrameBehavior from '../behavior/behavior-xrframe'
-
-// VK 投影矩阵参数定义
-const NEAR = 0.01
-const FAR = 1000
-
-const loggerOnce = false
-
-Component({
- behaviors: [arBehavior, xrFrameBehavior],
- data: {
- theme: 'light',
- widthScale: 1, // canvas宽度缩放值
- heightScale: 0.8, // canvas高度缩放值
- hintBoxList: [], // 显示提示盒子列表,
- cameraPosition: 1 // 默认前置
- },
- markerIndex: 0, // 使用的 marker 索引
- hintInfo: undefined, // 提示框信息
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
-
- methods: {
- // 对应案例的初始化逻辑,由统一的 behavior 触发
- init() {
- // 初始化VK
- // start完毕后,进行更新渲染循环
- this.initVK()
- },
- initVK() {
- // VKSession 配置
- const session = this.session = wx.createVKSession({
- track: {
- face: {
- mode: 1
- }
- },
- cameraPosition: 1,
- version: 'v1',
- gl: this.gl
- })
-
- try {
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- // VKSession EVENT resize
- session.on('resize', () => {
- this.calcCanvasSize()
- })
-
- // 开启三维识别
- session.update3DMode({ open3d: true })
-
- // VKSession EVENT addAnchors
- session.on('addAnchors', anchors => {
- console.log('addAnchor', anchors)
- })
-
- // VKSession EVENT updateAnchors
- session.on('updateAnchors', anchors => {
- // console.log("updateAnchors", anchors);
-
- const anchor = anchors[0]
- // 目前只处理一个返回的结果
- if (anchor) {
- this.wrapTransform = anchor.transform
- this.position3D = anchor.points3d
-
- if (this.faceGLTFTrs && this.faceGLTFTrs.visible !== true) {
- this.faceGLTFTrs.visible = true
- }
- if (this.glassesGLTFTrs && this.glassesGLTFTrs.visible !== true) {
- this.glassesGLTFTrs.visible = true
- }
- }
- })
-
- // VKSession removeAnchors
- // 识别目标丢失时不断触发
- session.on('removeAnchors', anchors => {
- // console.log("removeAnchors");
-
- if (this.faceGLTFTrs && this.faceGLTFTrs.visible !== false) {
- this.faceGLTFTrs.visible = false
- }
-
- if (this.glassesGLTFTrs && this.glassesGLTFTrs.visible !== false) {
- this.glassesGLTFTrs.visible = false
- }
- })
-
- console.log('ready to initloop')
- // start 初始化完毕后,进行更新渲染循环
- this.initLoop()
- })
- } catch (e) {
- console.error(e)
- }
- },
- // 针对 xr-frame 的初始化逻辑
- async initXRFrame() {
- const xrFrameSystem = wx.getXrFrameSystem()
- const scene = this.xrScene
- const { rootShadow } = scene
-
- // 缓存主相机
- this.xrCameraMain = this.xrCamera
- this.xrCameraMainTrs = this.xrCameraTrs
-
- // 初始化YUV相机配置
- this.initXRYUVCamera()
-
- // === 初始挂载点 ===
- this.faceWrap = scene.createElement(xrFrameSystem.XRNode)
- this.faceWrapTrs = this.faceWrap.getComponent(xrFrameSystem.Transform)
- rootShadow.addChild(this.faceWrap)
-
- // 加载脸模
- const face = await scene.assets.loadAsset({
- type: 'gltf',
- assetId: 'gltf-face',
- src: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/face.glb',
- })
- const faceElem = scene.createElement(xrFrameSystem.XRGLTF, {
- model: 'gltf-face',
- position: '0 0 0',
- scale: '1 1 1',
- })
- const faceGLTF = faceElem.getComponent(xrFrameSystem.GLTF)
- this.faceElem = faceElem
- this.faceGLTFTrs = faceElem.getComponent(xrFrameSystem.Transform)
- this.faceWrap.addChild(faceElem)
-
- for (const mesh of faceGLTF.meshes) {
- // 通过alphaMode 的 Setter 设置,或者写入renderState,但需要手动控制宏
- mesh.material.alphaMode = 'BLEND'
- mesh.material.setVector('u_baseColorFactor', xrFrameSystem.Vector4.createFromNumber(1, 1, 1, 0.0))
- }
-
- // 加载眼镜
- const glasses = await scene.assets.loadAsset({
- type: 'gltf',
- assetId: 'gltf-glasses',
- src: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/glasses.glb',
- })
- const glassesElem = scene.createElement(xrFrameSystem.XRGLTF, {
- model: 'gltf-glasses',
- position: '0 0 0',
- scale: '1 1 1',
- })
- const glassesGLTF = glassesElem.getComponent(xrFrameSystem.GLTF)
- this.glassesElem = glassesElem
- this.glassesGLTFTrs = glassesElem.getComponent(xrFrameSystem.Transform)
- this.faceWrap.addChild(glassesElem)
- },
- loop() {
- // console.log('loop')
-
- // 获取 VKFrame
- const frame = this.session.getVKFrame(this.data.width, this.data.height)
-
- // 成功获取 VKFrame 才进行
- if (!frame) { return }
-
- // 更新相机 YUV 数据
- this.updataXRYUV(frame)
-
- // 获取 VKCamera
- const VKCamera = frame.camera
-
- // 更新 xrFrame 相机矩阵
- this.updataXRCameraMatrix(VKCamera, NEAR, FAR)
-
- // 存在faceWrap,执行信息同步逻辑
- if (this.faceWrap && this.wrapTransform) {
- const xrFrameSystem = wx.getXrFrameSystem()
-
- if (!this.DT) { this.DT = new xrFrameSystem.Matrix4() }
- if (!this.DT2) { this.DT2 = new xrFrameSystem.Matrix4() }
-
- // 目前VK返回的是行主序矩阵
- // xrframe 矩阵存储为列主序
- this.DT.setArray(this.wrapTransform)
- this.DT.transpose(this.DT2)
- this.faceWrapTrs.setLocalMatrix(this.DT2)
- }
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.json b/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.json
deleted file mode 100644
index b9425689..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "usingComponents": {
- "xr-frame-canvas": "../components/xr-frame/index"
- },
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "人脸三维识别-眼镜试戴"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.wxml b/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.wxml
deleted file mode 100644
index 125e27cf..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.wxml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 提示:摄像头对准人脸,会显示眼镜以及用于深度遮挡的透明的头模
-
-
-
diff --git a/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.wxss b/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.wxss
deleted file mode 100644
index 5c615558..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect-3d-glasses/face-detect-3d-glasses.wxss
+++ /dev/null
@@ -1,45 +0,0 @@
-.canvas-wrap {
- position: relative;
- width: 100%;
- background-color: #000;
-}
-
-.canvas-wrap canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.canvas-wrap #canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-
-.hint-bottom {
- position: absolute;
- left: 20px;
- right: 20px;
- bottom: 20px;
- padding: 5px 10px;
- font-size: 14px;
- color: #fff;
- background-color: rgba(0, 0, 0, 0.4);
- border-radius: 6px;
-}
-
-.hint-bottom .btn-wrap {
- display: flex;
-}
-
-.hint-bottom .btn{
- flex: 1;
- margin: 10px 5px;
- font-size: 18px;
- line-height: 24px;
-}
diff --git a/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.js b/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.js
deleted file mode 100644
index 83f3c2e4..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.js
+++ /dev/null
@@ -1,298 +0,0 @@
-import arBehavior from '../behavior/behavior-ar'
-import xrFrameBehavior from '../behavior/behavior-xrframe'
-
-// VK 投影矩阵参数定义
-const NEAR = 0.01
-const FAR = 1000
-
-const loggerOnce = false
-
-Component({
- behaviors: [arBehavior, xrFrameBehavior],
- data: {
- theme: 'light',
- widthScale: 1, // canvas宽度缩放值
- heightScale: 0.8, // canvas高度缩放值
- hintBoxList: [], // 显示提示盒子列表,
- },
- markerIndex: 0, // 使用的 marker 索引
- hintInfo: undefined, // 提示框信息
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
-
- methods: {
- // 对应案例的初始化逻辑,由统一的 behavior 触发
- init() {
- // 初始化VK
- // start完毕后,进行更新渲染循环
- this.initVK()
- },
- initVK() {
- // VKSession 配置
- const session = this.session = wx.createVKSession({
- track: {
- face: {
- mode: 1
- }
- },
- version: 'v1',
- gl: this.gl
- })
-
- try {
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- // VKSession EVENT resize
- session.on('resize', () => {
- this.calcCanvasSize()
- })
-
- // 开启三维识别
- session.update3DMode({ open3d: true })
-
- // VKSession EVENT addAnchors
- session.on('addAnchors', anchors => {
- console.log('addAnchor', anchors)
- })
-
- let preAnchorNumber = 0
- // VKSession EVENT updateAnchors
- session.on('updateAnchors', anchors => {
- // console.log("updateAnchors", anchors);
-
- // 遍历不同的识别目标
- for (let i = 0; i < anchors.length; i++) {
- const anchor = anchors[i]
-
- let faceWrap = this.faceWrapMap[i]
- if (!faceWrap) {
- this.initBindingNode(i)
-
- faceWrap = this.faceWrapMap[i]
- }
-
- const xrFrameSystem = wx.getXrFrameSystem()
-
- // 更新显示状态
- this.updateHintBoxVisble(faceWrap.hintBoxList, true)
- if (faceWrap.faceGLTFTrs.visible !== true) {
- faceWrap.faceGLTFTrs.visible = true
- }
-
- // 执行信息同步逻辑
-
- if (!this.DT) { this.DT = new xrFrameSystem.Matrix4() }
- if (!this.DT2) { this.DT2 = new xrFrameSystem.Matrix4() }
-
- // 目前VK返回的是行主序矩阵
- // xrframe 矩阵存储为列主序
- this.DT.setArray(anchor.transform)
- this.DT.transpose(this.DT2)
- faceWrap.wrapTrs.setLocalMatrix(this.DT2)
-
- // 更新提示点位置
- this.updateHintBoxPosition(faceWrap.hintBoxList, anchor.points3d)
- }
-
- // 由于目前,减少识别目标不会触发remove事件,所以先通过数量判断处理隐藏
- if (preAnchorNumber > anchors.length) {
- // 遍历被隐藏的目标
- for (let i = preAnchorNumber - 1; i >= anchors.length; i--) {
- const faceWrap = this.faceWrapMap[i]
- if (faceWrap) {
- this.updateHintBoxVisble(faceWrap.hintBoxList, false)
- if (faceWrap.faceGLTFTrs.visible !== false) {
- faceWrap.faceGLTFTrs.visible = false
- }
- }
- }
- }
-
- preAnchorNumber = anchors.length
- })
-
- // VKSession removeAnchors
- // 识别目标丢失时不断触发
- session.on('removeAnchors', anchors => {
- // console.log("removeAnchors");
-
- if (preAnchorNumber !== 0) {
- for (let i = 0; i < preAnchorNumber; i++) {
- const faceWrap = this.faceWrapMap[i]
- if (faceWrap) {
- this.updateHintBoxVisble(faceWrap.hintBoxList, false)
- if (faceWrap.faceGLTFTrs.visible !== false) {
- faceWrap.faceGLTFTrs.visible = false
- }
- }
- }
- }
- preAnchorNumber = 0
- })
-
- console.log('ready to initloop')
- // start 初始化完毕后,进行更新渲染循环
- this.initLoop()
- })
- } catch (e) {
- console.error(e)
- }
- },
- // 针对 xr-frame 的初始化逻辑
- async initXRFrame() {
- const scene = this.xrScene
-
- // 缓存主相机
- this.xrCameraMain = this.xrCamera
- this.xrCameraMainTrs = this.xrCameraTrs
-
- // 初始化YUV相机配置
- this.initXRYUVCamera()
-
- // 加载脸模
- this.faceGLTF = await scene.assets.loadAsset({
- type: 'gltf',
- assetId: 'gltf-face',
- src: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/face.glb',
- })
-
- // 初始化识别挂载点容器
- this.faceWrapMap = {}
- },
- initBindingNode(index) {
- const xrFrameSystem = wx.getXrFrameSystem()
- const scene = this.xrScene
- const { rootShadow } = scene
-
- // 用于管理每一个挂载元素
- const wrapInfo = {}
-
- // === 初始挂载点 ===
- const faceWrap = scene.createElement(xrFrameSystem.XRNode)
- const faceWrapTrs = faceWrap.getComponent(xrFrameSystem.Transform)
- rootShadow.addChild(faceWrap)
-
- wrapInfo.wrapElem = faceWrap
- wrapInfo.wrapTrs = faceWrapTrs
-
- const faceElem = scene.createElement(xrFrameSystem.XRGLTF, {
- model: 'gltf-face',
- position: '0 0 0',
- scale: '1 1 1',
- })
- const faceGLTF = faceElem.getComponent(xrFrameSystem.GLTF)
- const faceGLTFTrs = faceElem.getComponent(xrFrameSystem.Transform)
- faceWrap.addChild(faceElem)
-
- wrapInfo.faceGLTFTrs = faceGLTFTrs
-
- for (const mesh of faceGLTF.meshes) {
- // 通过alphaMode 的 Setter 设置,或者写入renderState,但需要手动控制宏
- mesh.material.alphaMode = 'BLEND'
- mesh.material.setVector('u_baseColorFactor', xrFrameSystem.Vector4.createFromNumber(1, 1, 1, 0.4))
- }
-
- // 加载提示点
- wrapInfo.hintBoxList = this.getHintBox(xrFrameSystem, scene, faceWrap)
-
- this.faceWrapMap[index] = wrapInfo
- },
- loop() {
- // console.log('loop')
-
- // 获取 VKFrame
- const frame = this.session.getVKFrame(this.data.width, this.data.height)
-
- // 成功获取 VKFrame 才进行
- if (!frame) { return }
-
- // 更新相机 YUV 数据
- this.updataXRYUV(frame)
-
- // 获取 VKCamera
- const VKCamera = frame.camera
-
- // 更新 xrFrame 相机矩阵
- this.updataXRCameraMatrix(VKCamera, NEAR, FAR)
- },
- getHintBox(xrFrameSystem, scene, wrap) {
- // 初始化提示点
- const geometryHint = scene.assets.getAsset('geometry', 'sphere')
- const effectCube = scene.assets.getAsset('effect', 'standard')
- const boxScale = 0.03
- const hintBoxList = []
- for (let i = 0; i < 106; i++) {
- const colorFloat = i / 106
- const el = scene.createElement(xrFrameSystem.XRNode, {
- position: '0 0 0',
- scale: `${boxScale} ${boxScale} ${boxScale}`,
- })
- const elTrs = el.getComponent(xrFrameSystem.Transform)
- const mat = scene.createMaterial(effectCube)
-
- const colorR = 1.0 - colorFloat
- mat.setVector('u_baseColorFactor', xrFrameSystem.Vector4.createFromNumber(1.0, colorR, colorR, 1.0))
-
- const mesh = el.addComponent(xrFrameSystem.Mesh, {
- geometry: geometryHint,
- material: mat,
- })
-
- wrap.addChild(el)
- // elTrs.visible = false;
-
- hintBoxList.push(elTrs)
- }
-
- return hintBoxList
- },
- updateHintBoxPosition(hintBoxList, points3d) {
- if (hintBoxList && hintBoxList.length > 0) {
- // console.log('ready to set', hintBoxList);
- // 存在提示列表,则更新点信息
- for (let i = 0; i < hintBoxList.length; i++) {
- const hintBox = hintBoxList[i]
- hintBox.position.x = points3d[i].x
- hintBox.position.y = points3d[i].y
- hintBox.position.z = points3d[i].z
- }
- }
- },
- updateHintBoxVisble(hintBoxList, visible) {
- if (hintBoxList && hintBoxList.length > 0) {
- // console.log('ready to set', hintBoxList);
- // 存在提示列表,则更新点信息
- for (let i = 0; i < hintBoxList.length; i++) {
- const hintBox = hintBoxList[i]
- if (hintBox.visible !== visible) {
- hintBox.visible = visible
- }
- }
- }
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.json b/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.json
deleted file mode 100644
index 8e843827..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "usingComponents": {
- "xr-frame-canvas": "../components/xr-frame/index"
- },
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "人脸三维识别"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.wxml b/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.wxml
deleted file mode 100644
index a042e8b1..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.wxml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 提示:摄像头对准人脸,然后会显示106个关键点的三维坐标提示小球,以及通用的半透明脸模模型(支持多个人脸识别)
-
-
-
diff --git a/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.wxss b/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.wxss
deleted file mode 100644
index 5c615558..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect-3d/face-detect-3d.wxss
+++ /dev/null
@@ -1,45 +0,0 @@
-.canvas-wrap {
- position: relative;
- width: 100%;
- background-color: #000;
-}
-
-.canvas-wrap canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.canvas-wrap #canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-
-.hint-bottom {
- position: absolute;
- left: 20px;
- right: 20px;
- bottom: 20px;
- padding: 5px 10px;
- font-size: 14px;
- color: #fff;
- background-color: rgba(0, 0, 0, 0.4);
- border-radius: 6px;
-}
-
-.hint-bottom .btn-wrap {
- display: flex;
-}
-
-.hint-bottom .btn{
- flex: 1;
- margin: 10px 5px;
- font-size: 18px;
- line-height: 24px;
-}
diff --git a/miniprogram/packageAPI/pages/ar/face-detect/behavior.js b/miniprogram/packageAPI/pages/ar/face-detect/behavior.js
deleted file mode 100644
index 071f621e..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect/behavior.js
+++ /dev/null
@@ -1,201 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- cameraPosition: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- face: {
- mode: 1
- }
- },
- cameraPosition: 1,
- version: 'v1',
- gl: this.gl
- })
-
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- session.on('addAnchors', anchors => {
- this.data.anchor2DList = anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size
- }))
- })
- session.on('updateAnchors', anchors => {
- this.data.anchor2DList = []
- // 摄像头实时检测人脸的时候 updateAnchors 会在每帧触发,所以性能要求更高,用 gl 画
- this.data.anchor2DList = this.data.anchor2DList.concat(anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size
- })))
- })
- session.on('removeAnchors', anchors => {
- this.data.anchor2DList = []
- })
-
- this.setData({
- buttonDisable: false
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/face-detect/face-detect.js b/miniprogram/packageAPI/pages/ar/face-detect/face-detect.js
deleted file mode 100644
index ebcd9a0f..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect/face-detect.js
+++ /dev/null
@@ -1,310 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-// 顶点着色器
-const VSHADER_SOURCE = '' +
- 'attribute vec4 a_Position;\n' + // 声明attribute变量a_Position,用来存放顶点位置信息
- 'void main(){\n' +
- ' gl_Position = a_Position;\n' + // 将顶点坐标赋值给顶点着色器内置变量gl_Position
- ' gl_PointSize = 4.0;\n' + // 设置顶点大小
- '}\n'
-
-// 片元着色器
-const FSHADER_SOURCE = '' +
- '#ifdef GL_ES\n' +
- ' precision mediump float;\n' + // 设置精度
- '#endif\n' +
- 'varying vec4 v_Color;\n' + // 声明varying变量v_Color,用来接收顶点着色器传送的片元颜色信息
- 'void main(){\n' +
- ' float d = distance(gl_PointCoord, vec2(0.5, 0.5));\n' + // 计算像素距离中心点的距离
- ' if(d < 0.5) {\n' + // 距离大于0.5放弃片元,小于0.5保留片元
- ' gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n' +
- ' } else { discard; }\n' +
- '}\n'
-
-// 初始化着色器函数
-let initShadersDone = false
-
-function initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE) {
- // 创建顶点着色器对象
- const vertexShader = loadShader(gl, gl.VERTEX_SHADER, VSHADER_SOURCE)
- // 创建片元着色器对象
- const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, FSHADER_SOURCE)
-
- if (!vertexShader || !fragmentShader) {
- return null
- }
-
- // 创建程序对象program
- const program = gl.createProgram()
- if (!gl.createProgram()) {
- return null
- }
- // 分配顶点着色器和片元着色器到program
- gl.attachShader(program, vertexShader)
- gl.attachShader(program, fragmentShader)
- // 链接program
- gl.linkProgram(program)
-
- // 检查程序对象是否连接成功
- const linked = gl.getProgramParameter(program, gl.LINK_STATUS)
- if (!linked) {
- const error = gl.getProgramInfoLog(program)
- console.log('程序对象连接失败: ' + error)
- gl.deleteProgram(program)
- gl.deleteShader(fragmentShader)
- gl.deleteShader(vertexShader)
- return null
- }
- // 返回程序program对象
- initShadersDone = true
- return program
-}
-
-function loadShader(gl, type, source) {
- // 创建顶点着色器对象
- const shader = gl.createShader(type)
- if (shader == null) {
- console.log('创建着色器失败')
- return null
- }
-
- // 引入着色器源代码
- gl.shaderSource(shader, source)
-
- // 编译着色器
- gl.compileShader(shader)
-
- // 检查顶是否编译成功
- const compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS)
- if (!compiled) {
- const error = gl.getShaderInfoLog(shader)
- console.log('编译着色器失败: ' + error)
- gl.deleteShader(shader)
- return null
- }
-
- return shader
-}
-
-// 初始化顶点坐标和顶点颜色
-function initVertexBuffers(gl, anchor2DList) {
- const flattenPoints = []
- anchor2DList.forEach(anchor => {
- anchor.points.forEach(point => {
- const {
- x,
- y
- } = point
- flattenPoints.push(x * 2 - 1, 1 - y * 2)
- })
- })
-
- const vertices = new Float32Array(flattenPoints)
- const n = flattenPoints.length / 2
-
- // 创建缓冲区对象
- const buffer = gl.createBuffer()
- // 将顶点坐标和顶点颜色信息写入缓冲区对象
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer)
- gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW)
-
- // 获取顶点着色器attribute变量a_Position存储地址, 分配缓存并开启
- const a_Position = gl.getAttribLocation(gl.program, 'a_Position')
- gl.vertexAttribPointer(a_Position, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(a_Position)
- return n
-}
-
-const EDGE_VSHADER_SOURCE =
- `
- attribute vec2 aPosition;
- varying vec2 posJudge;
-
- void main(void) {
- gl_Position = vec4(aPosition.x, aPosition.y, 1.0, 1.0);
- posJudge = aPosition;
- }
-`
-
-const EDGE_FSHADER_SOURCE =
- `
- precision highp float;
- uniform vec2 rightTopPoint;
- uniform vec2 centerPoint;
- varying vec2 posJudge;
-
- float box(float x, float y){
- float xc = x - centerPoint.x;
- float yc = y - centerPoint.y;
- vec2 point = vec2(xc, yc);
- float right = rightTopPoint.x;
- float top = rightTopPoint.y;
- float line_width = 0.01;
- vec2 b1 = 1.0 - step(vec2(right,top), abs(point));
- float outer = b1.x * b1.y;
- vec2 b2 = 1.0 - step(vec2(right-line_width,top-line_width), abs(point));
- float inner = b2.x * b2.y;
- return outer - inner;
- }
-
- void main(void) {
- if(box(posJudge.x, posJudge.y) == 0.0 ) discard;
-
- gl_FragColor = vec4(box(posJudge.x, posJudge.y), 0.0, 0.0, 1.0);
-
- }
-`
-
-function initRectEdgeBuffer(gl, x, y, width, height) {
- const shaderProgram = gl.program
- const centerX = x * 2 - 1 + width
- const centerY = -1 * (y * 2 - 1) - height
- const right = width
- const top = height
- const vertices = [
- -1.0, 1.0,
- -1.0, -1.0,
- 1.0, 1.0,
- 1.0, -1.0
- ]
-
- const vertexBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW)
- const aPosition = gl.getAttribLocation(shaderProgram, 'aPosition')
- gl.enableVertexAttribArray(aPosition)
- gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, 0, 0)
-
- const rightTop = [
- right, top
- ]
- const rightTopLoc = gl.getUniformLocation(shaderProgram, 'rightTopPoint')
- gl.uniform2fv(rightTopLoc, rightTop)
-
- const centerPoint = [
- centerX, centerY
- ]
- const centerPointLoc = gl.getUniformLocation(shaderProgram, 'centerPoint')
- gl.uniform2fv(centerPointLoc, centerPoint)
-
- const length = vertices.length / 2
-
- return length
-}
-
-function onDrawRectEdge(gl, x, y, width, height) {
- width = Math.round(width * 100) / 100
- height = Math.round(height * 100) / 100
- const n = initRectEdgeBuffer(gl, x, y, width, height)
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, n)
-}
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- theme: 'light',
- cameraPosition: 1,
- buttonDisable: true,
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- initShadersDone = false
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({
- theme
- }) => {
- this.setData({
- theme
- })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- },
- switchCamera(event) {
- if (this.session.config) {
- const config = this.session.config
- const pos = Number(event.currentTarget.dataset.value)
- config.cameraPosition = pos
- this.session.config = config
- this.setData({
- cameraPosition: event.currentTarget.dataset.value
- })
- }
- },
- render(frame) {
- const gl = this.gl
-
- this.renderGL(frame)
-
- const camera = frame.camera
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
-
- const anchor2DList = this.data.anchor2DList
-
- if (!anchor2DList || anchor2DList.length <= 0) {
-
- } else {
- if (!initShadersDone) {
- this.vertexProgram = initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE)
- this.rectEdgeProgram = initShaders(gl, EDGE_VSHADER_SOURCE, EDGE_FSHADER_SOURCE)
- if (!this.vertexProgram || !this.rectEdgeProgram) {
- console.log('初始化着色器失败')
- return
- }
- console.log('初始化着色器成功')
- }
-
- gl.useProgram(this.vertexProgram)
- gl.program = this.vertexProgram
- // 初始化顶点坐标和顶点颜色
- const n = initVertexBuffers(gl, anchor2DList)
-
- // 绘制点
- gl.drawArrays(gl.POINTS, 0, n)
-
- gl.useProgram(this.rectEdgeProgram)
- gl.program = this.rectEdgeProgram
-
- for (let i = 0; i < anchor2DList.length; i++) {
- onDrawRectEdge(gl, anchor2DList[i].origin.x, anchor2DList[i].origin.y, anchor2DList[i].size.width, anchor2DList[i].size.height)
- }
- }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/face-detect/face-detect.json b/miniprogram/packageAPI/pages/ar/face-detect/face-detect.json
deleted file mode 100644
index 30c2e417..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect/face-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "实时人脸检测"
-}
diff --git a/miniprogram/packageAPI/pages/ar/face-detect/face-detect.wxml b/miniprogram/packageAPI/pages/ar/face-detect/face-detect.wxml
deleted file mode 100644
index b4041507..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect/face-detect.wxml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
- 提示:将摄像头对准人脸, 检测到的人脸将会被标记出识别框和面部标记点
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/face-detect/face-detect.wxss b/miniprogram/packageAPI/pages/ar/face-detect/face-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/face-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/face-detect/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/face-detect/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.js
deleted file mode 100644
index f5ac2062..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.js
+++ /dev/null
@@ -1,742 +0,0 @@
-import { loadPly } from './loaders/ply/ply-loader'
-import { loadSplat } from './loaders/splat/splat-loader'
-import CameraWebGL from './webgl2/camera-webGL'
-import CubeInstanceWebGL from './webgl2/cubeInstance-webGL'
-import SplatWebGL, { SplatRenderTexture } from './webgl2/splat-webGL'
-import YUVRenderWebGL from './webgl2/yuv-webGL'
-
-import * as glMatrix from './util/gl-matrix-min'
-
-const { mat4 } = glMatrix
-
-// VK 投影矩阵参数定义
-const NEAR = 0.01
-const FAR = 1000
-
-const renderScale = 1
-
-Component({
- behaviors: [],
- data: {
- theme: 'light',
- widthScale: 1, // canvas宽度缩放值
- heightScale: 1, // canvas高度缩放值
- renderByXRFrame: false, // 是否使用 xr-frame渲染
- renderByWebGL2: true, // 是否使用WebGL2渲染
- workerOn: true,
- maxGaussians: 50000,
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- attached() {
- console.log('页面attached')
-
- console.log('[worker] 排序 worker 的创建')
- this.worker = wx.createWorker('workers/gaussianSplatting/index.js')
- console.log('[worker] 具体 worker', this.worker)
- },
- detached() {
- console.log('页面detached')
-
- if (this.worker) this.worker.terminate()
- },
- ready() {
- console.log('页面准备完全')
- },
- },
- methods: {
- onReady() {
- // 获取canvas
- wx.createSelectorQuery()
- .select('#canvas')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const width = info.windowWidth * this.data.widthScale * pixelRatio * renderScale
- const height = info.windowHeight * this.data.heightScale * pixelRatio * renderScale
- // 存在 webgl Canvas的情况下,写入大小
- if (this.canvas) {
- this.canvas.width = width
- this.canvas.height = height
- }
- console.log(`canvas size: width = ${width} , height = ${height}`)
- console.log(`window size: width = ${info.windowWidth} , height = ${info.windowHeight}`)
-
- this.setData({
- width,
- height,
- })
-
- // 页面自定义初始化
- if (this.init) this.init()
- })
- },
- // 对应案例的初始化逻辑,由统一的 arBehavior 触发
- init() {
- console.log('== Page Init start ==')
-
- // 注册 各类渲染器
- if (this.data.renderByWebGL2) {
- this.initWebGL2()
- } else if (this.data.renderByXRFrame) {
- this.initXRFrame()
- }
-
- this.initVK()
- },
- initVK() {
- // VKSession 配置
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 1
- },
- },
- version: 'v2',
- gl: this.gl
- })
-
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- // VKSession EVENT resize
- session.on('resize', () => {
- })
-
- // VKSession EVENT addAnchors
- session.on('addAnchors', anchors => {
- // console.log("addAnchor", anchors);
- })
-
- // VKSession EVENT updateAnchors
- session.on('updateAnchors', anchors => {
- })
-
- // VKSession removeAnchors
- session.on('removeAnchors', anchors => {
- // console.log('removeAnchors', anchors)
- })
-
- console.log('ready to initloop')
- // start 初始化完毕后,进行更新渲染循环
- this.initLoop()
- })
- },
- initLoop() {
- // 限制调用帧率,暂时去掉
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- const session = this.session
-
- // 逐帧渲染
- const onFrame = timestamp => {
- try {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- this.requestRender()
- }
- } catch (e) {
- console.error(e)
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- },
- initPLY(id) {
- console.log('== PLY Init start ==')
-
- const host = 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo'
- // const host = 'http://127.0.0.1:8030'
- // const host = 'http://10.9.169.133:8030'
-
- let type
-
- // 加载 splat
- type = 'splat'
- const pcSrc = `${host}/splat/${id}.splat`
-
- console.log('splat src', pcSrc)
-
- wx.downloadFile({
- url: pcSrc,
- timeout: 200000,
- success: (res) => {
- console.log('downloadFile 下载回调', res)
-
- const filePath = res.tempFilePath
-
- const fs = wx.getFileSystemManager()
-
- /**
- * 因为微信读文件,最大只能读100MB的,所以需要分块读取。
- */
- const fd = fs.openSync({ filePath })
- const stats = fs.fstatSync({ fd })
- console.log('fd stats', stats)
- let size = stats.size
- if (size > 0) {
- const buffer = new ArrayBuffer(size)
- const viewU8 = new Uint8Array(buffer)
- let offset = 0
- let uindex = 0
- while (size > 0) {
- const chunkSize = Math.min(size, 100 * 1024 * 1024/* 100MB */)
-
- const res = fs.readFileSync(
- filePath,
- undefined,
- offset,
- chunkSize,
- )
- const resU8 = new Uint8Array(res)
- viewU8.set(new Uint8Array(res), uindex)
- uindex += resU8.length
-
- // console.log('res', res)
- // console.log('uindex', uindex);
- // console.log('offset', offset);
- // console.log('chunkSize', chunkSize)
-
- offset += chunkSize
- size -= chunkSize
- }
- fs.close({ fd })
-
- // console.log('buffer', buffer)
-
- let info
-
- const maxGaussians = this.data.maxGaussians
-
- switch (type) {
- case 'ply':
- info = loadPly(buffer, maxGaussians)
- console.log('plyLoader return', info)
- break
- case 'splat':
- info = loadSplat(buffer, maxGaussians)
- console.log('splatLoader return', info)
- break
- }
-
- // 提供渲染的高斯球数
- const renderCount = this.renderCount = info.count
-
- // 全部用 f32 存储
- // this.sabPositions = wx.createSharedArrayBuffer(renderCount * 4 * 3)
- // this.sabOpacities= wx.createSharedArrayBuffer(renderCount * 4)
- // this.sabCov3Da = wx.createSharedArrayBuffer(renderCount * 4 * 3)
- // this.sabCov3Db = wx.createSharedArrayBuffer(renderCount * 4 * 3)
- // this.sabcolors = wx.createSharedArrayBuffer(renderCount * 4 * 3)
-
- // console.log('创建 worker 共享内存', this.sabPositions, this.sabOpacities, this.sabCov3Da, this.sabCov3Db, this.sabcolors)
-
- // 初始化 worker 相关
- this.initWorker(info, {
- // sabPositions: this.sabPositions,
- // sabOpacities: this.sabOpacities,
- // sabCov3Da: this.sabCov3Da,
- // sabCov3Db: this.sabCov3Db,
- // sabcolors: this.sabcolors,
- })
- } else {
- wx.hideLoading()
- wx.showToast({
- title: res.errMsg,
- icon: 'none',
- duration: 2000
- })
- console.error('file size is 0')
- }
- },
- fail(res) {
- wx.hideLoading()
- wx.showToast({
- title: res.errMsg,
- icon: 'none',
- duration: 2000
- })
- console.error(res)
- }
- })
- },
- initWorker(plyInfo, config) {
- console.log('== Worker Init start ==')
-
- // 监听worker回调
- this.worker.onMessage((res) => {
- if (res.type === 'execFunc_init') {
- // worker 初始化 回调
- console.log('[Worker callback] gaussianSplatting init callBack', res)
-
- this.camera.isWorkerInit = true
- this.camera.updateByVK()
- } else if (res.type === 'execFunc_sort') {
- // worker 排序 回调
- // console.log(res)
-
- this.camera.isWorkerSorting = false
-
- const data = res.result.data
-
- const start = new Date().getTime()
-
- const gl = this.gl
-
- const updateBuffer = (buffer, data) => {
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer)
- gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW)
- }
-
- // const positions = new Float32Array(this.sabPositions.buffer);
- // const opacities = new Float32Array(this.sabOpacities.buffer);
- // const cov3Da = new Float32Array(this.sabCov3Da.buffer);
- // const cov3Db = new Float32Array(this.sabCov3Db.buffer);
- // const colors = new Float32Array(this.sabcolors.buffer);
-
- const positions = new Float32Array(data.positions)
- const opacities = new Float32Array(data.opacities)
- const cov3Da = new Float32Array(data.cov3Da)
- const cov3Db = new Float32Array(data.cov3Db)
- const colors = new Float32Array(data.colors)
-
- updateBuffer(this.splat.buffers.center, positions)
- updateBuffer(this.splat.buffers.opacity, opacities)
- updateBuffer(this.splat.buffers.covA, cov3Da)
- updateBuffer(this.splat.buffers.covB, cov3Db)
- updateBuffer(this.splat.buffers.color, colors)
-
- // 设定绘制的高斯球数量
- this.gaussiansCount = data.gaussiansCount
-
- const end = new Date().getTime()
- // const sortTime = `${((end - start)/1000).toFixed(3)}s`
- // console.log(`updateBuffer ${sortTime}`)
-
- // this.canvas.requestAnimationFrame(this.requestRender.bind(this));
-
- // console.log('execFunc_sort end')
- }
- })
-
- // 提交初始数据到 worker 侧
- this.worker.postMessage({
- type: 'execFunc_init',
- params: [plyInfo, config]
- })
- },
- // 后续为 webGL2 相关,为了方便开发,先放在一起
- initWebGL2() {
- console.log('== InitWebGL2 start ==')
- const gl = this.gl = this.canvas.getContext('webgl2')
- console.log('webgl2 context', gl)
-
- // Setup Camera
- const cameraParameters = {
- up: [0, 1.0, 0.0],
- target: [0, 0, 0],
- camera: [Math.PI / 2, Math.PI / 2, 10], // theta phi radius
- }
- this.camera = new CameraWebGL(gl, this.worker, cameraParameters)
-
- // Setup Instance Mesh
- this.cubeInstance = new CubeInstanceWebGL(gl)
-
- // Setup Splat
- this.initSplat(gl)
-
- // Setup YUV
- this.initYUV(gl)
- },
- // Gaussian Splat数据
- initSplat(gl) {
- // 初始化 splat 绘制到的 renderTexture
- this.splatRT = new SplatRenderTexture(gl)
-
- // 初始化 splat 渲染器
- this.splat = new SplatWebGL(gl)
- },
- // VK 摄像机数据渲染
- initYUV(gl) {
- this.YUVRender = new YUVRenderWebGL(gl)
- },
- requestRender() {
- // console.log('request render')
- // 限帧
- const now = Date.now()
- const last = this.lastRenderTime || 0
- const mill = now - last
- if (mill < 30) {
- return
- }
- this.lastRenderTime = now
-
- const gl = this.gl
-
- // Clear State
- gl.viewport(0, 0, gl.canvas.width, gl.canvas.height)
- gl.bindFramebuffer(gl.FRAMEBUFFER, null)
- gl.clearColor(0.8, 0.8, 0.8, 1.0)
-
- // Clear
- gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)
-
- // 先关掉深度测试
- gl.disable(gl.DEPTH_TEST)
-
- // 获取 VKFrame
- const frame = this.session.getVKFrame(this.canvas.width, this.canvas.height)
-
- // 成功获取 VKFrame 才进行
- if (!frame) { return }
-
- // 获取 VKCamera
- const VKCamera = frame.camera
-
- // 相机
- if (VKCamera) {
- const viewMatrix = VKCamera.viewMatrix
- const projectionMatrix = VKCamera.getProjectionMatrix(NEAR, FAR)
- // 视图矩阵
- this.camera.viewMatrix = viewMatrix
- // 投影矩阵
- this.camera.projMatrix = projectionMatrix
- this.camera.updateByVK()
- }
-
- // Draw YUV
- this.drawYUV(gl, frame)
-
- // Draw Splat
- this.drawSplat(gl)
-
- // 恢复渲染状态
- // cullFace
- // gl.enable(gl.CULL_FACE);
- // gl.cullFace(gl.BACK);
- gl.disable(gl.CULL_FACE)
- // gl.cullFace(gl.BACK);
- // 深度测试
- gl.enable(gl.DEPTH_TEST)
-
- // drawCubeMesh
- const projMatrix = this.camera.projMatrix
- const viewMatrix = this.camera.viewMatrix
- let modelMatrix = mat4.create()
- // hintTest Info
- if (!this.isPlaced) {
- const hitTestRes = this.session.hitTest(0.5, 0.5)
- if (hitTestRes.length) {
- // hitTestRes 返回 transform 为列主序矩阵
- const hintScale = 0.01
- mat4.scale(modelMatrix, hitTestRes[0].transform, [hintScale * 3, hintScale, hintScale * 3])
- } else {
- // 放在很远,相当于移除屏幕
- modelMatrix = [
- 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 1, 0,
- 0, 0, 1000, 1
- ]
- }
- } else {
- modelMatrix = this.hintModelMatrix
- }
-
- this.drawCubeMesh(gl, projMatrix, viewMatrix, modelMatrix)
- },
- drawYUV(gl, frame) {
- // 获取 VKFrame 信息
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
-
- if (!yTexture || !uvTexture) {
- return
- }
-
- // 进行 YUV 准备
- const yuvRender = this.YUVRender
-
- // YUV 需要绘制背面
- gl.disable(gl.CULL_FACE)
-
- // 先将YUV绘制到主屏
- gl.bindFramebuffer(gl.FRAMEBUFFER, null)
-
- gl.useProgram(yuvRender.programInfo.program)
- // VAO
- gl.bindVertexArray(yuvRender.vao)
- // position
- gl.bindBuffer(gl.ARRAY_BUFFER, yuvRender.buffers.position)
- gl.vertexAttribPointer(yuvRender.programInfo.attribLocations.vertexPosition, 3, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(yuvRender.programInfo.attribLocations.vertexPosition)
- // texCoord
- gl.bindBuffer(gl.ARRAY_BUFFER, yuvRender.buffers.texCoord)
- gl.vertexAttribPointer(yuvRender.programInfo.attribLocations.vertexTexcoord, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(yuvRender.programInfo.attribLocations.vertexTexcoord)
- // indices
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, yuvRender.buffers.indices)
-
- // displayTransform
- gl.uniformMatrix3fv(yuvRender.programInfo.uniformLocations.displayTransform, false, displayTransform)
-
- // 设置使用的纹理单元
- gl.uniform1i(yuvRender.programInfo.uniformLocations.yTexture, 1) // 纹理单元 1
- gl.uniform1i(yuvRender.programInfo.uniformLocations.uvTexture, 2) // 纹理单元 2
-
- // UNPACK_FLIP_Y_WEBGL
- gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true)
-
- // 设定 Y、UV 纹理到纹理单元
- gl.activeTexture(gl.TEXTURE1)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
- gl.activeTexture(gl.TEXTURE2)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- // draw RenderTexture
- gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0)
-
- // 恢复 Cull_face
- gl.enable(gl.CULL_FACE)
- },
- drawCubeMesh(gl, projMatrix, viewMatrix, modelMatrix) {
- // mesh
- const meshCube = this.cubeInstance
- // Tell WebGL to use our program when drawing
- gl.useProgram(meshCube.programInfo.program)
- // VAO
- gl.bindVertexArray(meshCube.vao)
- // mesh position
- gl.bindBuffer(gl.ARRAY_BUFFER, meshCube.positionBuffer)
- gl.vertexAttribPointer(meshCube.programInfo.attribLocations.vertexPosition, 3, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(meshCube.programInfo.attribLocations.vertexPosition)
- // mesh color
- gl.bindBuffer(gl.ARRAY_BUFFER, meshCube.colorBuffer)
- gl.vertexAttribPointer(meshCube.programInfo.attribLocations.vertexColor, 4, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(meshCube.programInfo.attribLocations.vertexColor)
-
- // Tell WebGL which indices to use to index the vertices
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, meshCube.indices)
-
- // Set the shader uniforms
- gl.uniformMatrix4fv(
- meshCube.programInfo.uniformLocations.projectionMatrix,
- false,
- projMatrix
- )
- gl.uniformMatrix4fv(
- meshCube.programInfo.uniformLocations.viewMatrix,
- false,
- viewMatrix
- )
- gl.uniformMatrix4fv(
- meshCube.programInfo.uniformLocations.modelMatrix,
- false,
- modelMatrix
- )
-
- // draw
- const vertexCount = 36
- const type = gl.UNSIGNED_SHORT
- const offset = 0
- gl.drawElements(gl.TRIANGLES, vertexCount, type, offset)
- },
- drawSplat(gl) {
- // 通用准备
- const cam = this.camera
-
- // 进行 Splat renderTexture 准备
- const splatRT = this.splatRT
-
- const splatRTFrameBuffer = this.splatRT.frameBuffer
-
- gl.bindFramebuffer(gl.FRAMEBUFFER, splatRTFrameBuffer)
-
- gl.clearColor(0, 0, 0, 0.0)
- gl.clear(gl.COLOR_BUFFER_BIT)
-
- // Set Splat state
- gl.disable(gl.DEPTH_TEST)
- gl.enable(gl.BLEND)
- gl.blendFunc(gl.ONE_MINUS_DST_ALPHA, gl.ONE)
-
- // console.log('drawSplat')
-
- // 开启 Splat 绘制流程
- const splat = this.splat
- const program = splat.program
- // Use Program
- gl.useProgram(program)
- // VAO
- gl.bindVertexArray(splat.vao)
-
- // Original implementation parameters
- const canvasWidth = gl.canvas.width
- const canvasHeight = gl.canvas.height
- const tan_fovy = Math.tan(cam.fov_y * 0.5)
- const tan_fovx = tan_fovy * canvasWidth / canvasHeight
- const focal_y = canvasHeight / (2 * tan_fovy)
- const focal_x = canvasWidth / (2 * tan_fovx)
-
- gl.uniform1f(gl.getUniformLocation(program, 'canvas_width'), canvasWidth)
- gl.uniform1f(gl.getUniformLocation(program, 'canvas_height'), canvasHeight)
- gl.uniform1f(gl.getUniformLocation(program, 'focal_x'), focal_x)
- gl.uniform1f(gl.getUniformLocation(program, 'focal_y'), focal_y)
- gl.uniform1f(gl.getUniformLocation(program, 'tan_fovx'), tan_fovx)
- gl.uniform1f(gl.getUniformLocation(program, 'tan_fovy'), tan_fovy)
- gl.uniform1f(gl.getUniformLocation(program, 'scale_modifier'), 1.0)
- gl.uniformMatrix4fv(gl.getUniformLocation(program, 'modelViewMatrix'), false, cam.mvm)
- gl.uniformMatrix4fv(gl.getUniformLocation(program, 'modelViewProjectMatrix'), false, cam.mvpm)
-
- // Draw Splat
- gl.drawArraysInstanced(gl.TRIANGLE_STRIP, 0, 4, this.gaussiansCount)
-
- // 最后将RT绘制 到 主屏
- gl.bindFramebuffer(gl.FRAMEBUFFER, null)
-
- gl.useProgram(splatRT.programInfo.program)
- // VAO
- gl.bindVertexArray(splatRT.vao)
- // position
- gl.bindBuffer(gl.ARRAY_BUFFER, splatRT.buffers.position)
- gl.vertexAttribPointer(splatRT.programInfo.attribLocations.vertexPosition, 3, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(splatRT.programInfo.attribLocations.vertexPosition)
- // texCoord
- gl.bindBuffer(gl.ARRAY_BUFFER, splatRT.buffers.texCoord)
- gl.vertexAttribPointer(splatRT.programInfo.attribLocations.vertexTexcoord, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(splatRT.programInfo.attribLocations.vertexTexcoord)
- // indices
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, splatRT.buffers.indices)
-
- gl.uniform1i(splatRT.programInfo.attribLocations.uSplat, 0) // 纹理单元0
-
- // 设定 RT 纹理到纹理单元
- gl.activeTexture(gl.TEXTURE0)
- gl.bindTexture(gl.TEXTURE_2D, splatRT.rt)
-
- // set Blend
- gl.enable(gl.BLEND)
- gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
-
- // draw RenderTexture
- gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0)
- },
- onTapControl(e) {
- const dataSet = e.target.dataset
-
- const id = dataSet.id
-
- // hintTest Info
- const hitTestRes = this.session.hitTest(0.5, 0.5)
- if (hitTestRes.length) {
- // 命中才进行后续的具体加载
- // hitTestRes 返回 transform 为列主序矩阵
-
- const splatModelMatrix = mat4.create()
- const modelMatrixLocal = mat4.create()
- const modelMatrixT = mat4.create()
- const modelMatrixR = mat4.create()
- const modelMatrixS = mat4.create()
- let splatScale = 0.2
- let splatRotationAngle = 0
- let splatRotationFlag = [0, 1, 0]
- let splatTranslate = [0, 0, 0]
-
- // 针对不同场景设置不同的 世界矩阵
- switch (id) {
- case 'room':
- splatScale = 0.6
- splatTranslate = [0, -1, 0]
- splatRotationAngle = -Math.PI / 180 * 26
- splatRotationFlag = [1, 0, 0]
- break
- case 'garden':
- splatScale = 0.6
- splatTranslate = [0, -2, 0]
- splatRotationAngle = -Math.PI / 180 * 20
- splatRotationFlag = [1, 0, 0]
- break
- case 'stump':
- splatScale = 0.6
- splatTranslate = [0, 0, 0]
- break
- case 'oneflower':
- splatScale = 0.2
- splatTranslate = [-0.5, -2, -4]
- splatRotationAngle = -Math.PI / 180 * 40
- splatRotationFlag = [1, 0, 0]
- break
- case 'usj':
- splatTranslate = [0, 1, 0]
- break
- case 'sakura':
- splatTranslate = [-1.6, 0, -1]
- break
- case '0517cruch':
- splatScale = 0.5
- splatTranslate = [0, 0, 0]
- break
- default:
- break
- }
-
- mat4.scale(modelMatrixS, mat4.create(), [splatScale, splatScale, splatScale])
- mat4.rotate(modelMatrixR, modelMatrixS, splatRotationAngle, splatRotationFlag)
- mat4.translate(modelMatrixT, modelMatrixR, splatTranslate)
- mat4.copy(modelMatrixLocal, modelMatrixT)
-
- // Y轴反转矩阵
- const fixMatrix = mat4.create()
- mat4.rotate(fixMatrix, mat4.create(), Math.PI, [0, 0, 1])
-
- // 本地矩阵
- const modelMatrixLocalFix = mat4.create()
- mat4.multiply(modelMatrixLocalFix, fixMatrix, modelMatrixLocal)
-
- // 世界矩阵
- mat4.multiply(splatModelMatrix, hitTestRes[0].transform, modelMatrixLocalFix)
-
- this.camera.modelMatrix = splatModelMatrix
-
- // locak Hint
- const hintModelMatrix = mat4.create()
- const hintScale = 0.01
- mat4.scale(hintModelMatrix, hitTestRes[0].transform, [hintScale * 3, hintScale, hintScale * 3])
- this.hintModelMatrix = hintModelMatrix
- this.isPlaced = true
-
- // 开始处理 ply 资源
- this.initPLY(id)
- }
- },
- changeMaxGaussianCount(e) {
- this.setData({
- maxGaussians: e.detail.value
- })
-
- console.log('slider maxGaussians:', this.data.maxGaussians)
- },
- switchWorker(e) {
- this.setData({
- workerOn: e.detail.value
- })
-
- this.camera.setWorkerOn(this.data.workerOn)
-
- console.log('switch WorkerOn:', this.data.workerOn)
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.json b/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.json
deleted file mode 100644
index a1a70f95..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "usingComponents": {
- },
- "disableScroll": true,
- "renderer": "webview",
- "navigationBarTitleText": "Gaussian Splatting AR预览"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.wxml b/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.wxml
deleted file mode 100644
index a38d46c0..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.wxml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 经典 Splat
-
-
-
-
-
- 自制 Splat
-
-
-
-
-
-
-
-
- 最大高斯球数
-
- 是否开启 worker 排序
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.wxss b/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.wxss
deleted file mode 100644
index 6d8d74ff..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar.wxss
+++ /dev/null
@@ -1,86 +0,0 @@
-.canvas-wrap {
- position: relative;
- width: 100%;
- background-color: #000;
-}
-
-.canvas-wrap canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.canvas-wrap #canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.control-wrap {
- position: absolute;
- right: 20rpx;
- top: 20rpx;
- padding: 10rpx 20rpx;
- width: 180rpx;
- height: 510rpx;
- background-color: rgba(50, 50, 50, 0.6);
- border-radius: 10rpx;
-}
-
-.control-wrap .block {
- width: 100%;
- display: flex;
- flex-direction: column;
-}
-
-.control-wrap .btn {
- width: 100%;
- flex: 1;
- font-size: 20rpx;
- margin-bottom: 14rpx;
- padding-left: 10rpx;
- padding-right: 10rpx;
-}
-
-.input-wrap {
- position: absolute;
- left: 20rpx;
- right: 260rpx;
- top: 20rpx;
- padding: 10rpx 20rpx;
- height: 200rpx;
- background-color: rgba(50, 50, 50, 0.6);
- border-radius: 10rpx;
-}
-.input-wrap .slider {
- margin-bottom: 30rpx;
-}
-
-.input-wrap .checkbox-wrap {
- width: 100%;
- text-align: center;
-}
-
-.checkbox-wrap .words {
- vertical-align: middle;
- color: #fff;
- font-size: 30rpx;
- font-weight: bold;
-}
-.checkbox-wrap .checkbox {
- vertical-align: middle;
- margin-left: 20rpx;
-}
-
-.control-wrap .title, .input-wrap .title {
- color: #fff;
- width: 100%;
- text-align: center;
- font-size: 24rpx;
- font-weight: bold;
- margin-bottom: 10rpx;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.js
deleted file mode 100644
index 3d5a1e31..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.js
+++ /dev/null
@@ -1,707 +0,0 @@
-import { loadPly } from './loaders/ply/ply-loader'
-import { loadSplat } from './loaders/splat/splat-loader'
-import CameraWebGL from './webgl2/camera-webGL'
-import CubeInstanceWebGL from './webgl2/cubeInstance-webGL'
-import SplatWebGL, { SplatRenderTexture } from './webgl2/splat-webGL'
-
-import * as glMatrix from './util/gl-matrix-min'
-
-const { mat4 } = glMatrix
-
-const renderScale = 1
-
-const baseMatrix = mat4.create()
-
-Component({
- behaviors: [],
- data: {
- theme: 'light',
- widthScale: 1, // canvas宽度缩放值
- heightScale: 1, // canvas高度缩放值
- renderByXRFrame: false, // 是否使用 xr-frame渲染
- renderByWebGL2: true, // 是否使用WebGL2渲染
- workerOn: true,
- maxGaussians: 50000,
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- attached() {
- console.log('页面attached')
-
- console.log('[worker] 排序 worker 的创建')
- this.worker = wx.createWorker('workers/gaussianSplatting/index.js')
- console.log('[worker] 具体 worker', this.worker)
- },
- detached() {
- console.log('页面detached')
-
- if (this.worker) this.worker.terminate()
- },
- ready() {
- console.log('页面准备完全')
- },
- },
- methods: {
- onReady() {
- // 获取canvas
- wx.createSelectorQuery()
- .select('#canvas')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const width = info.windowWidth * this.data.widthScale * pixelRatio * renderScale
- const height = info.windowHeight * this.data.heightScale * pixelRatio * renderScale
- // 存在 webgl Canvas的情况下,写入大小
- if (this.canvas) {
- this.canvas.width = width
- this.canvas.height = height
- }
- console.log(`canvas size: width = ${width} , height = ${height}`)
- console.log(`window size: width = ${info.windowWidth} , height = ${info.windowHeight}`)
-
- this.setData({
- width,
- height,
- })
-
- // 页面自定义初始化
- if (this.init) this.init()
- })
- },
- // 对应案例的初始化逻辑,由统一的 arBehavior 触发
- init() {
- console.log('== Page Init start ==')
-
- // 注册 各类渲染器
- if (this.data.renderByWebGL2) {
- this.initWebGL2()
- } else if (this.data.renderByXRFrame) {
- this.initXRFrame()
- }
- },
- initPLY(id) {
- console.log('== PLY Init start ==')
-
- const host = 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo'
- // const host = 'http://127.0.0.1:8030'
- // const host = 'http://10.9.169.149:8030'
-
- let type
-
- // 加载 ply
- // type = 'ply';
- // const pcSrc = `${host}/ply/oneflower.cleaned.ply`;
- // const pcSrc = `${host}/ply/point_cloud.ply`;
- // const pcSrc = `${host}/ply/room.ply`;
- // const pcSrc = `${host}/ply/gs_USJ_Mario_enter.cleaned.ply`;
- // const pcSrc = `${host}/ply/oneflower.ply`;
- // const pcSrc = `${host}/ply/sakura.ply`;
- // const pcSrc = `${host}/ply/sakura.cleaned.ply`;
- // const pcSrc = `${host}/ply/sakura.compressed.ply`;
-
- // 加载 splat
- type = 'splat'
- const pcSrc = `${host}/splat/${id}.splat`
-
- const splatModelMatrix = mat4.create()
- const modelMatrixLocal = mat4.create()
- const modelMatrixT = mat4.create()
- const modelMatrixR = mat4.create()
- const modelMatrixS = mat4.create()
- let splatScale = 1
- let splatRotationAngle = 0
- let splatRotationFlag = [0, 1, 0]
- let splatTranslate = [0, 0, 0]
-
- // 针对不同场景设置不同的 本地矩阵
- // Setup Camera
- switch (id) {
- case 'room':
- splatScale = 0.6
- splatTranslate = [0, -3, 0]
- splatRotationAngle = -Math.PI / 180 * 26
- splatRotationFlag = [1, 0, 0]
- this.camera.updateCameraInfo(
- // target
- [0, 0, 0],
- // theta
- -Math.PI / 2,
- // phi
- Math.PI / 2,
- // raidus
- 1
- )
- break
- case 'garden':
- splatScale = 0.6
- splatTranslate = [0, -2, 0]
- splatRotationAngle = -Math.PI / 180 * 20
- splatRotationFlag = [1, 0, 0]
- this.camera.updateCameraInfo(
- // target
- [0, 0, 0],
- // theta
- -Math.PI / 2,
- // phi
- Math.PI / 2,
- // raidus
- 2
- )
- break
- case 'stump':
- splatScale = 0.5
- splatTranslate = [0, 0, 0]
- this.camera.updateCameraInfo(
- // target
- [0, 0, 0],
- // theta
- -Math.PI * 2 / 3,
- // phi
- Math.PI / 4,
- // raidus
- 2
- )
- break
- case 'oneflower':
- splatScale = 0.1
- splatTranslate = [-0.5, -2, -4]
- splatRotationAngle = -Math.PI / 180 * 40
- splatRotationFlag = [1, 0, 0]
- this.camera.updateCameraInfo(
- // target
- [0, 0, 0],
- // theta
- 0,
- // phi
- Math.PI / 2,
- // raidus
- 1
- )
- break
- case 'usj':
- splatTranslate = [0, 1, 0]
- this.camera.updateCameraInfo(
- // target
- [0, 0, 0],
- // theta
- -Math.PI * 7 / 6,
- // phi
- Math.PI / 2,
- // raidus
- 1
- )
- break
- case 'sakura':
- splatTranslate = [-1.6, 0, -1]
- this.camera.updateCameraInfo(
- // target
- [0, 0, 0],
- // theta
- Math.PI * 3 / 11,
- // phi
- Math.PI * 3 / 5,
- // raidus
- 1
- )
- break
- case '0517cruch':
- splatTranslate = [0, 0, 0]
- this.camera.updateCameraInfo(
- // target
- [0, 0, 0],
- // theta
- -Math.PI / 2,
- // phi
- Math.PI / 2,
- // raidus
- 1
- )
- break
- }
-
- mat4.scale(modelMatrixS, mat4.create(), [splatScale, splatScale, splatScale])
- mat4.rotate(modelMatrixR, modelMatrixS, splatRotationAngle, splatRotationFlag)
- mat4.translate(modelMatrixT, modelMatrixR, splatTranslate)
- mat4.copy(modelMatrixLocal, modelMatrixT)
-
- // Y轴反转矩阵
- const fixMatrix = mat4.create()
- mat4.rotate(fixMatrix, mat4.create(), Math.PI, [0, 0, 1])
-
- // 本地矩阵
- const modelMatrixLocalFix = mat4.create()
- mat4.multiply(modelMatrixLocalFix, fixMatrix, modelMatrixLocal)
-
- // 世界矩阵
- const modelWorld = mat4.create()
- // mat4.translate(modelWorld, mat4.create(), [0, 1, 0])
- mat4.multiply(splatModelMatrix, modelWorld, modelMatrixLocalFix)
- this.camera.modelMatrix = splatModelMatrix
-
- console.log('splat src', pcSrc)
-
- wx.downloadFile({
- url: pcSrc,
- timeout: 200000,
- success: (res) => {
- console.log('downloadFile 下载回调', res)
-
- const filePath = res.tempFilePath
-
- const fs = wx.getFileSystemManager()
-
- /**
- * 因为微信读文件,最大只能读100MB的,所以需要分块读取。
- */
- const fd = fs.openSync({ filePath })
- const stats = fs.fstatSync({ fd })
- console.log('fd stats', stats)
- let size = stats.size
- if (size > 0) {
- const buffer = new ArrayBuffer(size)
- const viewU8 = new Uint8Array(buffer)
- let offset = 0
- let uindex = 0
- while (size > 0) {
- const chunkSize = Math.min(size, 100 * 1024 * 1024 /* 100MB */)
-
- const res = fs.readFileSync(
- filePath,
- undefined,
- offset,
- chunkSize,
- )
- const resU8 = new Uint8Array(res)
- viewU8.set(new Uint8Array(res), uindex)
- uindex += resU8.length
-
- // console.log('res', res)
- // console.log('uindex', uindex);
- // console.log('offset', offset);
- // console.log('chunkSize', chunkSize)
-
- offset += chunkSize
- size -= chunkSize
- }
- fs.close({ fd })
-
- // console.log('buffer', buffer)
-
- let info
-
- const maxGaussians = this.data.maxGaussians
-
- switch (type) {
- case 'ply':
- info = loadPly(buffer, maxGaussians)
- console.log('plyLoader return', info)
- break
- case 'splat':
- info = loadSplat(buffer, maxGaussians)
- console.log('splatLoader return', info)
- break
- }
-
- // 提供渲染的高斯球数
- const renderCount = this.renderCount = info.count
-
- // 全部用 f32 存储
- // this.sabPositions = wx.createSharedArrayBuffer(renderCount * 4 * 3)
- // this.sabOpacities= wx.createSharedArrayBuffer(renderCount * 4)
- // this.sabCov3Da = wx.createSharedArrayBuffer(renderCount * 4 * 3)
- // this.sabCov3Db = wx.createSharedArrayBuffer(renderCount * 4 * 3)
- // this.sabcolors = wx.createSharedArrayBuffer(renderCount * 4 * 3)
-
- // console.log('创建 worker 共享内存', this.sabPositions, this.sabOpacities, this.sabCov3Da, this.sabCov3Db, this.sabcolors)
-
- // 初始化 worker 相关
- this.initWorker(info, {
- // sabPositions: this.sabPositions,
- // sabOpacities: this.sabOpacities,
- // sabCov3Da: this.sabCov3Da,
- // sabCov3Db: this.sabCov3Db,
- // sabcolors: this.sabcolors,
- })
- } else {
- wx.hideLoading()
- wx.showToast({
- title: res.errMsg,
- icon: 'none',
- duration: 2000
- })
- console.error('file size is 0')
- }
- },
- fail(res) {
- wx.hideLoading()
- wx.showToast({
- title: res.errMsg,
- icon: 'none',
- duration: 2000
- })
- console.error(res)
- }
- })
- },
-
- initWorker(plyInfo, config) {
- console.log('== Worker Init start ==')
-
- // 监听worker回调
- this.worker.onMessage((res) => {
- if (res.type === 'execFunc_init') {
- // worker 初始化 回调
- console.log('[Worker callback] gaussianSplatting init callBack', res)
-
- this.camera.isWorkerInit = true
- this.camera.update()
- } else if (res.type === 'execFunc_sort') {
- // worker 排序 回调
- // console.log(res)
-
- this.camera.isWorkerSorting = false
-
- const data = res.result.data
-
- const start = new Date().getTime()
-
- const gl = this.gl
-
- const updateBuffer = (buffer, data) => {
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer)
- gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW)
- }
-
- const positions = new Float32Array(data.positions)
- const opacities = new Float32Array(data.opacities)
- const cov3Da = new Float32Array(data.cov3Da)
- const cov3Db = new Float32Array(data.cov3Db)
- const colors = new Float32Array(data.colors)
-
- // const positions = new Float32Array(this.sabPositions.buffer);
- // const opacities = new Float32Array(this.sabOpacities.buffer);
- // const cov3Da = new Float32Array(this.sabCov3Da.buffer);
- // const cov3Db = new Float32Array(this.sabCov3Db.buffer);
- // const colors = new Float32Array(this.sabcolors.buffer);
-
- updateBuffer(this.splat.buffers.center, positions)
- updateBuffer(this.splat.buffers.opacity, opacities)
- updateBuffer(this.splat.buffers.covA, cov3Da)
- updateBuffer(this.splat.buffers.covB, cov3Db)
- updateBuffer(this.splat.buffers.color, colors)
-
- // 设定绘制的高斯球数量
- this.gaussiansCount = data.gaussiansCount
-
- const end = new Date().getTime()
- // const sortTime = `${((end - start)/1000).toFixed(3)}s`
- // console.log(`updateBuffer ${sortTime}`)
-
- this.canvas.requestAnimationFrame(this.requestRender.bind(this))
-
- // console.log('execFunc_sort end')
- }
- })
-
- // 提交初始数据到 worker 侧
- this.worker.postMessage({
- type: 'execFunc_init',
- params: [plyInfo, config]
- })
- },
- // 后续为 webGL2 相关,为了方便开发,先放在一起
- initWebGL2() {
- console.log('== InitWebGL2 start ==')
- const gl = this.gl = this.canvas.getContext('webgl2')
- console.log('webgl2 context', gl)
-
- // Setup Camera
- const cameraParameters = {
- up: [0, 1.0, 0.0],
- target: [0, 0, 0],
- camera: [Math.PI / 2, Math.PI / 2, 1], // theta phi radius
- }
- this.camera = new CameraWebGL(gl, this.worker, cameraParameters)
-
- // Setup Instance Mesh
- this.cubeInstance = new CubeInstanceWebGL(gl)
-
- // Setup Splat
- this.initSplat(gl)
- },
- initSplat(gl) {
- // 初始化 splat 绘制到的 renderTexture
- this.splatRT = new SplatRenderTexture(gl)
-
- // 初始化 splat 渲染器
- this.splat = new SplatWebGL(gl)
- },
- requestRender() {
- // console.log('requestRender')
-
- // 限帧
- const now = Date.now()
- const last = this.lastRenderTime || 0
- const mill = now - last
- if (mill < 30) {
- return
- }
- this.lastRenderTime = now
-
- const gl = this.gl
-
- // Clear State
- gl.viewport(0, 0, gl.canvas.width, gl.canvas.height)
- gl.bindFramebuffer(gl.FRAMEBUFFER, null)
- gl.clearColor(0.8, 0.8, 0.8, 1.0)
-
- // clear
- gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)
-
- // 先关掉深度测试
- gl.disable(gl.DEPTH_TEST)
-
- this.drawSplat(gl)
-
- // resetState
- gl.disable(gl.CULL_FACE)
- // 深度测试
- gl.enable(gl.DEPTH_TEST)
-
- // drawCubeMesh
- const projMatrix = this.camera.projMatrix
- const viewMatrix = this.camera.viewMatrix
- const modelMatrix = mat4.create()
- const cubeScale = 0.02
- mat4.scale(modelMatrix, mat4.create(), [cubeScale, cubeScale, cubeScale])
- this.drawCubeMesh(gl, projMatrix, viewMatrix, modelMatrix)
- },
- drawCubeMesh(gl, projMatrix, viewMatrix, modelMatrix) {
- // mesh
- const meshCube = this.cubeInstance
- // Tell WebGL to use our program when drawing
- gl.useProgram(meshCube.programInfo.program)
- // VAO
- gl.bindVertexArray(meshCube.vao)
- // mesh position
- gl.bindBuffer(gl.ARRAY_BUFFER, meshCube.positionBuffer)
- gl.vertexAttribPointer(meshCube.programInfo.attribLocations.vertexPosition, 3, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(meshCube.programInfo.attribLocations.vertexPosition)
- // mesh color
- gl.bindBuffer(gl.ARRAY_BUFFER, meshCube.colorBuffer)
- gl.vertexAttribPointer(meshCube.programInfo.attribLocations.vertexColor, 4, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(meshCube.programInfo.attribLocations.vertexColor)
-
- // Tell WebGL which indices to use to index the vertices
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, meshCube.indices)
-
- // Set the shader uniforms
- gl.uniformMatrix4fv(
- meshCube.programInfo.uniformLocations.projectionMatrix,
- false,
- projMatrix
- )
- gl.uniformMatrix4fv(
- meshCube.programInfo.uniformLocations.viewMatrix,
- false,
- viewMatrix
- )
- gl.uniformMatrix4fv(
- meshCube.programInfo.uniformLocations.modelMatrix,
- false,
- modelMatrix
- )
-
- // draw
- const vertexCount = 36
- const type = gl.UNSIGNED_SHORT
- const offset = 0
- gl.drawElements(gl.TRIANGLES, vertexCount, type, offset)
- },
- drawSplat(gl) {
- // 通用准备
- const cam = this.camera
-
- // 进行 Splat renderTexture 准备
- const splatRT = this.splatRT
-
- const splatRTFrameBuffer = this.splatRT.frameBuffer
-
- gl.viewport(0, 0, gl.canvas.width, gl.canvas.height)
- gl.bindFramebuffer(gl.FRAMEBUFFER, splatRTFrameBuffer)
-
- gl.clearColor(0, 0, 0, 0.0)
- gl.clear(gl.COLOR_BUFFER_BIT)
-
- // Set Splat state
- gl.disable(gl.DEPTH_TEST)
- gl.enable(gl.BLEND)
- gl.blendFunc(gl.ONE_MINUS_DST_ALPHA, gl.ONE)
- // gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
-
- // console.log('drawSplat')
-
- // 开启 Splat 绘制流程
- const splat = this.splat
- const program = splat.program
- // Use Program
- gl.useProgram(program)
- // VAO
- gl.bindVertexArray(splat.vao)
-
- // Original implementation parameters
- const canvasWidth = gl.canvas.width
- const canvasHeight = gl.canvas.height
- const tan_fovy = Math.tan(cam.fov_y * 0.5)
- const tan_fovx = tan_fovy * canvasWidth / canvasHeight
- const focal_y = canvasHeight / (2 * tan_fovy)
- const focal_x = canvasWidth / (2 * tan_fovx)
-
- gl.uniform1f(gl.getUniformLocation(program, 'canvas_width'), canvasWidth)
- gl.uniform1f(gl.getUniformLocation(program, 'canvas_height'), canvasHeight)
- gl.uniform1f(gl.getUniformLocation(program, 'focal_x'), focal_x)
- gl.uniform1f(gl.getUniformLocation(program, 'focal_y'), focal_y)
- gl.uniform1f(gl.getUniformLocation(program, 'tan_fovx'), tan_fovx)
- gl.uniform1f(gl.getUniformLocation(program, 'tan_fovy'), tan_fovy)
- gl.uniform1f(gl.getUniformLocation(program, 'scale_modifier'), 1.0)
- gl.uniformMatrix4fv(gl.getUniformLocation(program, 'modelViewMatrix'), false, cam.mvm)
- gl.uniformMatrix4fv(gl.getUniformLocation(program, 'modelViewProjectMatrix'), false, cam.mvpm)
- // gl.uniformMatrix4fv(gl.getUniformLocation(program, 'modelmatrix'), false, baseMatrix)
- // gl.uniformMatrix4fv(gl.getUniformLocation(program, 'viewmatrix'), false, cam.vm)
-
- // Draw Splat
- gl.drawArraysInstanced(gl.TRIANGLE_STRIP, 0, 4, this.gaussiansCount)
-
- // resetState
- gl.enable(gl.BLEND)
- gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
-
- // 最后将RT绘制 到 主屏
- gl.bindFramebuffer(gl.FRAMEBUFFER, null)
-
- gl.useProgram(splatRT.programInfo.program)
- // VAO
- gl.bindVertexArray(splatRT.vao)
- // position
- gl.bindBuffer(gl.ARRAY_BUFFER, splatRT.buffers.position)
- gl.vertexAttribPointer(splatRT.programInfo.attribLocations.vertexPosition, 3, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(splatRT.programInfo.attribLocations.vertexPosition)
- // texCoord
- gl.bindBuffer(gl.ARRAY_BUFFER, splatRT.buffers.texCoord)
- gl.vertexAttribPointer(splatRT.programInfo.attribLocations.vertexTexcoord, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(splatRT.programInfo.attribLocations.vertexTexcoord)
- // indices
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, splatRT.buffers.indices)
-
- // draw RenderTexture
- gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0)
- },
- // webGL触摸相关逻辑
- onTouchStartWebGL(e) {
- // console.log(e);
-
- if (e.touches.length === 1) {
- this.camera.lastTouch.x1 = e.touches[0].clientX
- this.camera.lastTouch.y1 = e.touches[0].clientY
- this.camera.lastTouch.x2 = null
- this.camera.lastTouch.y2 = null
- this.camera.lastTouch.distance = 0
- } else if (e.touches.length === 2) {
- const touch1 = e.touches[0]
- const touch2 = e.touches[1]
-
- this.camera.lastTouch.x1 = touch1.clientX
- this.camera.lastTouch.y1 = touch1.clientY
- this.camera.lastTouch.x2 = touch2.clientX
- this.camera.lastTouch.y2 = touch2.clientY
-
- const distanceX = touch1.clientX - touch2.clientX
- const distanceY = touch1.clientY - touch2.clientY
- this.camera.lastTouch.distance = Math.sqrt(distanceX * distanceX + distanceY * distanceY)
- }
- },
- onTouchMoveWebGL(e) {
- // console.log(e);
-
- const moveScale = 1
-
- if (e.touches.length === 1) {
- const touch = e.touches[0]
- // 单指移动镜头
- const movementX = touch.clientX - this.camera.lastTouch.x1
- const movementY = touch.clientY - this.camera.lastTouch.y1
- this.camera.lastTouch.x1 = touch.clientX
- this.camera.lastTouch.y1 = touch.clientY
-
- if (Math.abs(movementX) < 50 && Math.abs(movementY) < 50) {
- // 只处理小移动
- this.camera.theta += movementX * 0.01 * 0.3 * moveScale
- this.camera.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.camera.phi - movementY * 0.01 * moveScale))
- }
- } else if (e.touches.length === 2) {
- // 支持单指变双指,兼容双指操作但是两根手指触屏时间不一致的情况
- const touch1 = e.touches[0]
- const touch2 = e.touches[1]
-
- const distanceX = touch1.clientX - touch2.clientX
- const distanceY = touch1.clientY - touch2.clientY
- const distance = Math.sqrt(distanceX * distanceX + distanceY * distanceY)
-
- if (this.camera.lastTouch.x2 === null && this.camera.lastTouch.y2 === null) {
- this.camera.lastTouch.x1 = touch1.clientX
- this.camera.lastTouch.y1 = touch1.clientY
- this.camera.lastTouch.x2 = touch2.clientX
- this.camera.lastTouch.y2 = touch2.clientY
-
- this.camera.lastTouch.distance = distance
- } else {
- // 双指开始滑动
- let deltaScale = distance - this.camera.lastTouch.distance
- this.camera.lastTouch.distance = distance
-
- if (deltaScale < -2) {
- deltaScale = -2
- } else if (deltaScale > 2) {
- deltaScale = 2
- }
-
- const newRaidus = this.camera.radius - deltaScale * 0.2
- this.camera.radius = newRaidus > 0 ? newRaidus : this.camera.radius
- }
- }
-
- this.camera.update()
-
- this.canvas.requestAnimationFrame(this.requestRender.bind(this))
- },
- onTapControl(e) {
- const dataSet = e.target.dataset
-
- const id = dataSet.id
-
- // 开始处理 ply 资源
- this.initPLY(id)
- },
- changeMaxGaussianCount(e) {
- this.setData({
- maxGaussians: e.detail.value
- })
-
- console.log('slider maxGaussians:', this.data.maxGaussians)
- },
- switchWorker(e) {
- this.setData({
- workerOn: e.detail.value
- })
-
- this.camera.setWorkerOn(this.data.workerOn)
-
- console.log('switch WorkerOn:', this.data.workerOn)
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.json b/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.json
deleted file mode 100644
index 772758f8..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "usingComponents": {
- "xr-frame-render-canvas": "../components/xr-frame-render/index"
- },
- "disableScroll": true,
- "renderer": "webview",
- "navigationBarTitleText": "Gaussian Splatting 预览"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.wxml b/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.wxml
deleted file mode 100644
index 133a02b9..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.wxml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 经典 Splat
-
-
-
-
-
- 自制 Splat
-
-
-
-
-
-
-
-
- 最大高斯球数
-
- 是否开启 worker 排序
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.wxss b/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.wxss
deleted file mode 100644
index 6d8d74ff..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/gaussian-splatting.wxss
+++ /dev/null
@@ -1,86 +0,0 @@
-.canvas-wrap {
- position: relative;
- width: 100%;
- background-color: #000;
-}
-
-.canvas-wrap canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.canvas-wrap #canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.control-wrap {
- position: absolute;
- right: 20rpx;
- top: 20rpx;
- padding: 10rpx 20rpx;
- width: 180rpx;
- height: 510rpx;
- background-color: rgba(50, 50, 50, 0.6);
- border-radius: 10rpx;
-}
-
-.control-wrap .block {
- width: 100%;
- display: flex;
- flex-direction: column;
-}
-
-.control-wrap .btn {
- width: 100%;
- flex: 1;
- font-size: 20rpx;
- margin-bottom: 14rpx;
- padding-left: 10rpx;
- padding-right: 10rpx;
-}
-
-.input-wrap {
- position: absolute;
- left: 20rpx;
- right: 260rpx;
- top: 20rpx;
- padding: 10rpx 20rpx;
- height: 200rpx;
- background-color: rgba(50, 50, 50, 0.6);
- border-radius: 10rpx;
-}
-.input-wrap .slider {
- margin-bottom: 30rpx;
-}
-
-.input-wrap .checkbox-wrap {
- width: 100%;
- text-align: center;
-}
-
-.checkbox-wrap .words {
- vertical-align: middle;
- color: #fff;
- font-size: 30rpx;
- font-weight: bold;
-}
-.checkbox-wrap .checkbox {
- vertical-align: middle;
- margin-left: 20rpx;
-}
-
-.control-wrap .title, .input-wrap .title {
- color: #fff;
- width: 100%;
- text-align: center;
- font-size: 24rpx;
- font-weight: bold;
- margin-bottom: 10rpx;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/loaders/ply/ply-loader.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/loaders/ply/ply-loader.js
deleted file mode 100644
index 7668bd31..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/loaders/ply/ply-loader.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import { wxDecodeAdapter, computeCov3D } from '../util-loader.js'
-
-// implementation from https://github.com/kishimisu/Gaussian-Splatting-WebGL
-export function loadPly(content, maxGaussians) {
- // Read header
- console.log('loadPly', content)
- const contentStart = wxDecodeAdapter(content.slice(0, 2000), true)
- // const contentStart = new TextDecoder('utf-8').decode(content.slice(0, 2000))
- const headerEnd = contentStart.indexOf('end_header') + 'end_header'.length + 1
- const [header] = contentStart.split('end_header')
-
- console.log('header', header)
-
- // Get number of gaussians
- const regex = /element vertex (\d+)/
- const match = header.match(regex)
- let gaussianCount = parseInt(match[1])
-
- console.log(`load splatCount: ${gaussianCount}`)
-
- gaussianCount = Math.min(gaussianCount, maxGaussians)
-
- // Create arrays for gaussian properties
- const positions = []
- const opacities = []
- const colors = []
- const cov3Ds = []
-
- // Helpers
- const sigmoid = (m1) => 1 / (1 + Math.exp(-m1))
- const NUM_PROPS = 62
-
- // Create a dataview to access the buffer's content on a byte levele
- const view = new DataView(content)
-
- // Get a slice of the dataview relative to a splat index
- const fromDataView = (splatID, start, end) => {
- const startOffset = headerEnd + splatID * NUM_PROPS * 4 + start * 4
-
- if (end == null) return view.getFloat32(startOffset, true)
-
- return new Float32Array(end - start).map((_, i) => view.getFloat32(startOffset + i * 4, true))
- }
-
- // Extract all properties for a gaussian splat using the dataview
- const extractSplatData = (splatID) => {
- const position = fromDataView(splatID, 0, 3)
- // const n = fromDataView(splatID, 3, 6) // Not used
- const harmonic = fromDataView(splatID, 6, 9)
-
- const H_END = 6 + 48 // Offset of the last harmonic coefficient
- const opacity = fromDataView(splatID, H_END)
- const scale = fromDataView(splatID, H_END + 1, H_END + 4)
- const rotation = fromDataView(splatID, H_END + 4, H_END + 8)
-
- return {
- position, harmonic, opacity, scale, rotation
- }
- }
-
- // gaussianCount = 10;
-
- for (let i = 0; i < gaussianCount; i++) {
- // Extract data for current gaussian
- let {
- position, harmonic, opacity, scale, rotation
- } = extractSplatData(i)
-
- // Normalize quaternion
- let length2 = 0
-
- for (let j = 0; j < 4; j++) length2 += rotation[j] * rotation[j]
-
- const length = Math.sqrt(length2)
-
- // console.log('scale', scale[0], scale[1], scale[2]);
- // console.log('rotation', rotation[0], rotation[1], rotation[2], rotation[3]);
-
- rotation = rotation.map(v => v / length)
-
- // Exponentiate scale
- scale = scale.map(v => Math.exp(v))
-
- // console.log('scalee', scale[0], scale[1], scale[2]);
- // console.log('rotatione', rotation[0], rotation[1], rotation[2], rotation[3]);
-
- // Activate alpha
- opacity = sigmoid(opacity)
- opacities.push(opacity)
-
- // (Webgl-specific) Equivalent to computeColorFromSH() with degree 0:
- // Use the first spherical harmonic to pre-compute the color.
- // This allow to avoid sending harmonics to the web worker or GPU,
- // but removes view-dependent lighting effects like reflections.
- // If we were to use a degree > 0, we would need to recompute the color
- // each time the camera moves, and send many more harmonics to the worker:
- // Degree 1: 4 harmonics needed (12 floats) per gaussian
- // Degree 2: 9 harmonics needed (27 floats) per gaussian
- // Degree 3: 16 harmonics needed (48 floats) per gaussian
- const SH_C0 = 0.28209479177387814
- const color = [
- 0.5 + SH_C0 * harmonic[0],
- 0.5 + SH_C0 * harmonic[1],
- 0.5 + SH_C0 * harmonic[2]
- ]
- colors.push(...color)
- // harmonics.push(...harmonic)
-
- // (Webgl-specific) Pre-compute the 3D covariance matrix from
- // the rotation and scale in order to avoid recomputing it at each frame.
- // This also allow to avoid sending rotations and scales to the web worker or GPU.
- const cov3D = computeCov3D(scale, 1, rotation)
- cov3Ds.push(...cov3D)
- // rotations.push(...rotation)
- // scales.push(...scale)
-
- positions.push(...position)
- }
-
- return {
- positions, opacities, colors, cov3Ds, count: gaussianCount
- }
-}
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/loaders/splat/splat-loader.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/loaders/splat/splat-loader.js
deleted file mode 100644
index 22fb9747..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/loaders/splat/splat-loader.js
+++ /dev/null
@@ -1,76 +0,0 @@
-import { wxDecodeAdapter, computeCov3D } from '../util-loader.js'
-
-const RowSizeBytes = 32
-const CenterSizeBytes = 12
-const ScaleSizeBytes = 12
-const RotationSizeBytes = 4
-const ColorSizeBytes = 4
-
-const perPI = Math.PI / 180
-
-export function loadSplat(content, maxGaussians) {
- console.log('loadSplat', content)
-
- const start = new Date().getTime()
-
- // Create arrays for gaussian properties
- const positions = []
- const opacities = []
- const colors = []
- const cov3Ds = []
-
- const inBuffer = content
-
- let splatCount = inBuffer.byteLength / RowSizeBytes
- console.log(`load splatCount: ${splatCount}`)
-
- splatCount = Math.min(splatCount, maxGaussians)
-
- // splatCount = 10;
-
- for (let i = 0; i < splatCount; i++) {
- // Standard .splat row layout:
- // XYZ - Position (Float32)
- // XYZ - Scale (Float32)
- // RGBA - colors (uint8)
- // IJKL - quaternion/rot (uint8)
- const inBase = i * RowSizeBytes
-
- const inCenter = new Float32Array(inBuffer, inBase, 3)
- const inScale = new Float32Array(inBuffer, inBase + CenterSizeBytes, 3)
- const inColor = new Uint8Array(inBuffer, inBase + CenterSizeBytes + ScaleSizeBytes, 4)
- const inRotation = new Uint8Array(inBuffer, inBase + CenterSizeBytes +
- ScaleSizeBytes + ColorSizeBytes, 4)
-
- let rotation = [(inRotation[0] - 128) / 128, (inRotation[1] - 128) / 128, (inRotation[2] - 128) / 128, (inRotation[3] - 128) / 128]
-
- // Normalize quaternion
- let length2 = 0
- for (let j = 0; j < 4; j++) length2 += rotation[j] * rotation[j]
- const length = Math.sqrt(length2)
- rotation = rotation.map(v => v / length)
-
- // console.log('scale', inScale[0], inScale[1], inScale[2]);
- // console.log('rotation', rotation[0], rotation[1], rotation[2], rotation[3]);
-
- // Activate alpha
- const opacity = inColor[3] / 255
-
- opacities.push(opacity)
- colors.push(inColor[0] / 255, inColor[1] / 255, inColor[2] / 255)
-
- const cov3D = computeCov3D(inScale, 1, rotation)
- cov3Ds.push(...cov3D)
-
- positions.push(...inCenter)
- }
-
- const end = new Date().getTime()
-
- const sortTime = `${((end - start) / 1000).toFixed(3)}s`
- console.log(`parse ${splatCount} gaussians in ${sortTime}.`)
-
- return {
- positions, opacities, colors, cov3Ds, count: splatCount
- }
-}
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/loaders/util-loader.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/loaders/util-loader.js
deleted file mode 100644
index e92726ab..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/loaders/util-loader.js
+++ /dev/null
@@ -1,77 +0,0 @@
-import * as glMatrix from '../util/gl-matrix-min'
-
-const { mat3 } = glMatrix
-const tmp = mat3.create()
-const S = mat3.create()
-const R = mat3.create()
-const M = mat3.create()
-const Sigma = mat3.create()
-
-function computeCov3D(scale, mod, rot) {
- // Create scaling matrix
- mat3.set(
- S,
- mod * scale[0],
- 0,
- 0,
- 0,
- mod * scale[1],
- 0,
- 0,
- 0,
- mod * scale[2]
- )
-
- const r = rot[0]
- const x = rot[1]
- const y = rot[2]
- const z = rot[3]
-
- // Compute rotation matrix from quaternion
- mat3.set(
- R,
- 1.0 - 2.0 * (y * y + z * z),
- 2.0 * (x * y - r * z),
- 2.0 * (x * z + r * y),
- 2.0 * (x * y + r * z),
- 1.0 - 2.0 * (x * x + z * z),
- 2.0 * (y * z - r * x),
- 2.0 * (x * z - r * y),
- 2.0 * (y * z + r * x),
- 1.0 - 2.0 * (x * x + y * y)
- )
-
- mat3.multiply(M, S, R) // M = S * R
-
- // Compute 3D world covariance matrix Sigma
- mat3.multiply(Sigma, mat3.transpose(tmp, M), M) // Sigma = transpose(M) * M
-
- // Covariance is symmetric, only store upper right
- const cov3D = [
- Sigma[0], Sigma[1], Sigma[2],
- Sigma[4], Sigma[5], Sigma[8]
- ]
- return cov3D
-}
-
-function wxDecodeAdapter(buffer, isUTF8) {
- const array = new Uint8Array(buffer)
- let str = ''
-
- for (let i = 0; i < array.length; i++) {
- str += String.fromCharCode(array[i])
- }
-
- if (isUTF8) {
- // utf8 str fix
- // https://developer.mozilla.org/zh-CN/docs/Web/API/WindowBase64/btoa
- str = decodeURIComponent(encodeURIComponent(str))
- }
-
- return str
-}
-
-export {
- wxDecodeAdapter,
- computeCov3D
-}
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/util/gl-matrix-min.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/util/gl-matrix-min.js
deleted file mode 100644
index 63ed7904..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/util/gl-matrix-min.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*!
-@fileoverview gl-matrix - High performance matrix and vector operations
-@author Brandon Jones
-@author Colin MacKenzie IV
-@version 3.4.0
-
-Copyright (c) 2015-2021, Brandon Jones, Colin MacKenzie IV.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).glMatrix={})}(this,(function(t){"use strict";var n=1e-6,a="undefined"!=typeof Float32Array?Float32Array:Array,r=Math.random,u="zyx";var e=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});var o=Object.freeze({__proto__:null,EPSILON:n,get ARRAY_TYPE(){return a},RANDOM:r,ANGLE_ORDER:u,setMatrixArrayType:function(t){a=t},toRadian:function(t){return t*e},equals:function(t,a){return Math.abs(t-a)<=n*Math.max(1,Math.abs(t),Math.abs(a))}});function i(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],h=a[1],c=a[2],s=a[3];return t[0]=r*i+e*h,t[1]=u*i+o*h,t[2]=r*c+e*s,t[3]=u*c+o*s,t}function h(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t}var c=i,s=h,M=Object.freeze({__proto__:null,create:function(){var t=new a(4);return a!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},clone:function(t){var n=new a(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},fromValues:function(t,n,r,u){var e=new a(4);return e[0]=t,e[1]=n,e[2]=r,e[3]=u,e},set:function(t,n,a,r,u){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t},transpose:function(t,n){if(t===n){var a=n[1];t[1]=n[2],t[2]=a}else t[0]=n[0],t[1]=n[2],t[2]=n[1],t[3]=n[3];return t},invert:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=a*e-u*r;return o?(o=1/o,t[0]=e*o,t[1]=-r*o,t[2]=-u*o,t[3]=a*o,t):null},adjoint:function(t,n){var a=n[0];return t[0]=n[3],t[1]=-n[1],t[2]=-n[2],t[3]=a,t},determinant:function(t){return t[0]*t[3]-t[2]*t[1]},multiply:i,rotate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=Math.sin(a),h=Math.cos(a);return t[0]=r*h+e*i,t[1]=u*h+o*i,t[2]=r*-i+e*h,t[3]=u*-i+o*h,t},scale:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],h=a[1];return t[0]=r*i,t[1]=u*i,t[2]=e*h,t[3]=o*h,t},fromRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=a,t[2]=-a,t[3]=r,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t},str:function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3])},LDU:function(t,n,a,r){return t[2]=r[2]/r[0],a[0]=r[0],a[1]=r[1],a[3]=r[3]-t[2]*a[1],[t,n,a]},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t},subtract:h,exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=a[0],h=a[1],c=a[2],s=a[3];return Math.abs(r-i)<=n*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(u-h)<=n*Math.max(1,Math.abs(u),Math.abs(h))&&Math.abs(e-c)<=n*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(o-s)<=n*Math.max(1,Math.abs(o),Math.abs(s))},multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t},multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t},mul:c,sub:s});function f(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=a[0],s=a[1],M=a[2],f=a[3],l=a[4],v=a[5];return t[0]=r*c+e*s,t[1]=u*c+o*s,t[2]=r*M+e*f,t[3]=u*M+o*f,t[4]=r*l+e*v+i,t[5]=u*l+o*v+h,t}function l(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t[4]=n[4]-a[4],t[5]=n[5]-a[5],t}var v=f,b=l,m=Object.freeze({__proto__:null,create:function(){var t=new a(6);return a!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},clone:function(t){var n=new a(6);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n},copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},fromValues:function(t,n,r,u,e,o){var i=new a(6);return i[0]=t,i[1]=n,i[2]=r,i[3]=u,i[4]=e,i[5]=o,i},set:function(t,n,a,r,u,e,o){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t[4]=e,t[5]=o,t},invert:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],h=a*e-r*u;return h?(h=1/h,t[0]=e*h,t[1]=-r*h,t[2]=-u*h,t[3]=a*h,t[4]=(u*i-e*o)*h,t[5]=(r*o-a*i)*h,t):null},determinant:function(t){return t[0]*t[3]-t[1]*t[2]},multiply:f,rotate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=Math.sin(a),s=Math.cos(a);return t[0]=r*s+e*c,t[1]=u*s+o*c,t[2]=r*-c+e*s,t[3]=u*-c+o*s,t[4]=i,t[5]=h,t},scale:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=a[0],s=a[1];return t[0]=r*c,t[1]=u*c,t[2]=e*s,t[3]=o*s,t[4]=i,t[5]=h,t},translate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=a[0],s=a[1];return t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=r*c+e*s+i,t[5]=u*c+o*s+h,t},fromRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=a,t[2]=-a,t[3]=r,t[4]=0,t[5]=0,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t[4]=0,t[5]=0,t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=n[0],t[5]=n[1],t},str:function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t},subtract:l,multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a,t},multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t[4]=n[4]+a[4]*r,t[5]=n[5]+a[5]*r,t},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=t[4],h=t[5],c=a[0],s=a[1],M=a[2],f=a[3],l=a[4],v=a[5];return Math.abs(r-c)<=n*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(u-s)<=n*Math.max(1,Math.abs(u),Math.abs(s))&&Math.abs(e-M)<=n*Math.max(1,Math.abs(e),Math.abs(M))&&Math.abs(o-f)<=n*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(i-l)<=n*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(h-v)<=n*Math.max(1,Math.abs(h),Math.abs(v))},mul:v,sub:b});function d(){var t=new a(9);return a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function p(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=n[6],s=n[7],M=n[8],f=a[0],l=a[1],v=a[2],b=a[3],m=a[4],d=a[5],p=a[6],x=a[7],y=a[8];return t[0]=f*r+l*o+v*c,t[1]=f*u+l*i+v*s,t[2]=f*e+l*h+v*M,t[3]=b*r+m*o+d*c,t[4]=b*u+m*i+d*s,t[5]=b*e+m*h+d*M,t[6]=p*r+x*o+y*c,t[7]=p*u+x*i+y*s,t[8]=p*e+x*h+y*M,t}function x(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t[4]=n[4]-a[4],t[5]=n[5]-a[5],t[6]=n[6]-a[6],t[7]=n[7]-a[7],t[8]=n[8]-a[8],t}var y=p,q=x,g=Object.freeze({__proto__:null,create:d,fromMat4:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t},clone:function(t){var n=new a(9);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n},copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},fromValues:function(t,n,r,u,e,o,i,h,c){var s=new a(9);return s[0]=t,s[1]=n,s[2]=r,s[3]=u,s[4]=e,s[5]=o,s[6]=i,s[7]=h,s[8]=c,s},set:function(t,n,a,r,u,e,o,i,h,c){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t[4]=e,t[5]=o,t[6]=i,t[7]=h,t[8]=c,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},transpose:function(t,n){if(t===n){var a=n[1],r=n[2],u=n[5];t[1]=n[3],t[2]=n[6],t[3]=a,t[5]=n[7],t[6]=r,t[7]=u}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t},invert:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],h=n[6],c=n[7],s=n[8],M=s*o-i*c,f=-s*e+i*h,l=c*e-o*h,v=a*M+r*f+u*l;return v?(v=1/v,t[0]=M*v,t[1]=(-s*r+u*c)*v,t[2]=(i*r-u*o)*v,t[3]=f*v,t[4]=(s*a-u*h)*v,t[5]=(-i*a+u*e)*v,t[6]=l*v,t[7]=(-c*a+r*h)*v,t[8]=(o*a-r*e)*v,t):null},adjoint:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],h=n[6],c=n[7],s=n[8];return t[0]=o*s-i*c,t[1]=u*c-r*s,t[2]=r*i-u*o,t[3]=i*h-e*s,t[4]=a*s-u*h,t[5]=u*e-a*i,t[6]=e*c-o*h,t[7]=r*h-a*c,t[8]=a*o-r*e,t},determinant:function(t){var n=t[0],a=t[1],r=t[2],u=t[3],e=t[4],o=t[5],i=t[6],h=t[7],c=t[8];return n*(c*e-o*h)+a*(-c*u+o*i)+r*(h*u-e*i)},multiply:p,translate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=n[6],s=n[7],M=n[8],f=a[0],l=a[1];return t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=i,t[5]=h,t[6]=f*r+l*o+c,t[7]=f*u+l*i+s,t[8]=f*e+l*h+M,t},rotate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=n[6],s=n[7],M=n[8],f=Math.sin(a),l=Math.cos(a);return t[0]=l*r+f*o,t[1]=l*u+f*i,t[2]=l*e+f*h,t[3]=l*o-f*r,t[4]=l*i-f*u,t[5]=l*h-f*e,t[6]=c,t[7]=s,t[8]=M,t},scale:function(t,n,a){var r=a[0],u=a[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=u*n[3],t[4]=u*n[4],t[5]=u*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t},fromRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromMat2d:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},fromQuat:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=a+a,i=r+r,h=u+u,c=a*o,s=r*o,M=r*i,f=u*o,l=u*i,v=u*h,b=e*o,m=e*i,d=e*h;return t[0]=1-M-v,t[3]=s-d,t[6]=f+m,t[1]=s+d,t[4]=1-c-v,t[7]=l-b,t[2]=f-m,t[5]=l+b,t[8]=1-c-M,t},normalFromMat4:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],h=n[6],c=n[7],s=n[8],M=n[9],f=n[10],l=n[11],v=n[12],b=n[13],m=n[14],d=n[15],p=a*i-r*o,x=a*h-u*o,y=a*c-e*o,q=r*h-u*i,g=r*c-e*i,_=u*c-e*h,A=s*b-M*v,w=s*m-f*v,z=s*d-l*v,R=M*m-f*b,O=M*d-l*b,j=f*d-l*m,E=p*j-x*O+y*R+q*z-g*w+_*A;return E?(E=1/E,t[0]=(i*j-h*O+c*R)*E,t[1]=(h*z-o*j-c*w)*E,t[2]=(o*O-i*z+c*A)*E,t[3]=(u*O-r*j-e*R)*E,t[4]=(a*j-u*z+e*w)*E,t[5]=(r*z-a*O-e*A)*E,t[6]=(b*_-m*g+d*q)*E,t[7]=(m*y-v*_-d*x)*E,t[8]=(v*g-b*y+d*p)*E,t):null},projection:function(t,n,a){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/a,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t[6]=n[6]+a[6],t[7]=n[7]+a[7],t[8]=n[8]+a[8],t},subtract:x,multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t[8]=n[8]*a,t},multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t[4]=n[4]+a[4]*r,t[5]=n[5]+a[5]*r,t[6]=n[6]+a[6]*r,t[7]=n[7]+a[7]*r,t[8]=n[8]+a[8]*r,t},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=t[4],h=t[5],c=t[6],s=t[7],M=t[8],f=a[0],l=a[1],v=a[2],b=a[3],m=a[4],d=a[5],p=a[6],x=a[7],y=a[8];return Math.abs(r-f)<=n*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(u-l)<=n*Math.max(1,Math.abs(u),Math.abs(l))&&Math.abs(e-v)<=n*Math.max(1,Math.abs(e),Math.abs(v))&&Math.abs(o-b)<=n*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(i-m)<=n*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(h-d)<=n*Math.max(1,Math.abs(h),Math.abs(d))&&Math.abs(c-p)<=n*Math.max(1,Math.abs(c),Math.abs(p))&&Math.abs(s-x)<=n*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(M-y)<=n*Math.max(1,Math.abs(M),Math.abs(y))},mul:y,sub:q});function _(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function A(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=n[6],s=n[7],M=n[8],f=n[9],l=n[10],v=n[11],b=n[12],m=n[13],d=n[14],p=n[15],x=a[0],y=a[1],q=a[2],g=a[3];return t[0]=x*r+y*i+q*M+g*b,t[1]=x*u+y*h+q*f+g*m,t[2]=x*e+y*c+q*l+g*d,t[3]=x*o+y*s+q*v+g*p,x=a[4],y=a[5],q=a[6],g=a[7],t[4]=x*r+y*i+q*M+g*b,t[5]=x*u+y*h+q*f+g*m,t[6]=x*e+y*c+q*l+g*d,t[7]=x*o+y*s+q*v+g*p,x=a[8],y=a[9],q=a[10],g=a[11],t[8]=x*r+y*i+q*M+g*b,t[9]=x*u+y*h+q*f+g*m,t[10]=x*e+y*c+q*l+g*d,t[11]=x*o+y*s+q*v+g*p,x=a[12],y=a[13],q=a[14],g=a[15],t[12]=x*r+y*i+q*M+g*b,t[13]=x*u+y*h+q*f+g*m,t[14]=x*e+y*c+q*l+g*d,t[15]=x*o+y*s+q*v+g*p,t}function w(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=r+r,h=u+u,c=e+e,s=r*i,M=r*h,f=r*c,l=u*h,v=u*c,b=e*c,m=o*i,d=o*h,p=o*c;return t[0]=1-(l+b),t[1]=M+p,t[2]=f-d,t[3]=0,t[4]=M-p,t[5]=1-(s+b),t[6]=v+m,t[7]=0,t[8]=f+d,t[9]=v-m,t[10]=1-(s+l),t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t}function z(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function R(t,n){var a=n[0],r=n[1],u=n[2],e=n[4],o=n[5],i=n[6],h=n[8],c=n[9],s=n[10];return t[0]=Math.hypot(a,r,u),t[1]=Math.hypot(e,o,i),t[2]=Math.hypot(h,c,s),t}function O(t,n){var r=new a(3);R(r,n);var u=1/r[0],e=1/r[1],o=1/r[2],i=n[0]*u,h=n[1]*e,c=n[2]*o,s=n[4]*u,M=n[5]*e,f=n[6]*o,l=n[8]*u,v=n[9]*e,b=n[10]*o,m=i+M+b,d=0;return m>0?(d=2*Math.sqrt(m+1),t[3]=.25*d,t[0]=(f-v)/d,t[1]=(l-c)/d,t[2]=(h-s)/d):i>M&&i>b?(d=2*Math.sqrt(1+i-M-b),t[3]=(f-v)/d,t[0]=.25*d,t[1]=(h+s)/d,t[2]=(l+c)/d):M>b?(d=2*Math.sqrt(1+M-i-b),t[3]=(l-c)/d,t[0]=(h+s)/d,t[1]=.25*d,t[2]=(f+v)/d):(d=2*Math.sqrt(1+b-i-M),t[3]=(h-s)/d,t[0]=(l+c)/d,t[1]=(f+v)/d,t[2]=.25*d),t}function j(t,n,a,r,u){var e=1/Math.tan(n/2);if(t[0]=e/a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=u&&u!==1/0){var o=1/(r-u);t[10]=(u+r)*o,t[14]=2*u*r*o}else t[10]=-1,t[14]=-2*r;return t}var E=j;function P(t,n,a,r,u,e,o){var i=1/(n-a),h=1/(r-u),c=1/(e-o);return t[0]=-2*i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(n+a)*i,t[13]=(u+r)*h,t[14]=(o+e)*c,t[15]=1,t}var T=P;function S(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t[4]=n[4]-a[4],t[5]=n[5]-a[5],t[6]=n[6]-a[6],t[7]=n[7]-a[7],t[8]=n[8]-a[8],t[9]=n[9]-a[9],t[10]=n[10]-a[10],t[11]=n[11]-a[11],t[12]=n[12]-a[12],t[13]=n[13]-a[13],t[14]=n[14]-a[14],t[15]=n[15]-a[15],t}var D=A,F=S,I=Object.freeze({__proto__:null,create:function(){var t=new a(16);return a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},clone:function(t){var n=new a(16);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},fromValues:function(t,n,r,u,e,o,i,h,c,s,M,f,l,v,b,m){var d=new a(16);return d[0]=t,d[1]=n,d[2]=r,d[3]=u,d[4]=e,d[5]=o,d[6]=i,d[7]=h,d[8]=c,d[9]=s,d[10]=M,d[11]=f,d[12]=l,d[13]=v,d[14]=b,d[15]=m,d},set:function(t,n,a,r,u,e,o,i,h,c,s,M,f,l,v,b,m){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t[4]=e,t[5]=o,t[6]=i,t[7]=h,t[8]=c,t[9]=s,t[10]=M,t[11]=f,t[12]=l,t[13]=v,t[14]=b,t[15]=m,t},identity:_,transpose:function(t,n){if(t===n){var a=n[1],r=n[2],u=n[3],e=n[6],o=n[7],i=n[11];t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=a,t[6]=n[9],t[7]=n[13],t[8]=r,t[9]=e,t[11]=n[14],t[12]=u,t[13]=o,t[14]=i}else t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=n[1],t[5]=n[5],t[6]=n[9],t[7]=n[13],t[8]=n[2],t[9]=n[6],t[10]=n[10],t[11]=n[14],t[12]=n[3],t[13]=n[7],t[14]=n[11],t[15]=n[15];return t},invert:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],h=n[6],c=n[7],s=n[8],M=n[9],f=n[10],l=n[11],v=n[12],b=n[13],m=n[14],d=n[15],p=a*i-r*o,x=a*h-u*o,y=a*c-e*o,q=r*h-u*i,g=r*c-e*i,_=u*c-e*h,A=s*b-M*v,w=s*m-f*v,z=s*d-l*v,R=M*m-f*b,O=M*d-l*b,j=f*d-l*m,E=p*j-x*O+y*R+q*z-g*w+_*A;return E?(E=1/E,t[0]=(i*j-h*O+c*R)*E,t[1]=(u*O-r*j-e*R)*E,t[2]=(b*_-m*g+d*q)*E,t[3]=(f*g-M*_-l*q)*E,t[4]=(h*z-o*j-c*w)*E,t[5]=(a*j-u*z+e*w)*E,t[6]=(m*y-v*_-d*x)*E,t[7]=(s*_-f*y+l*x)*E,t[8]=(o*O-i*z+c*A)*E,t[9]=(r*z-a*O-e*A)*E,t[10]=(v*g-b*y+d*p)*E,t[11]=(M*y-s*g-l*p)*E,t[12]=(i*w-o*R-h*A)*E,t[13]=(a*R-r*w+u*A)*E,t[14]=(b*x-v*q-m*p)*E,t[15]=(s*q-M*x+f*p)*E,t):null},adjoint:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],h=n[6],c=n[7],s=n[8],M=n[9],f=n[10],l=n[11],v=n[12],b=n[13],m=n[14],d=n[15],p=a*i-r*o,x=a*h-u*o,y=a*c-e*o,q=r*h-u*i,g=r*c-e*i,_=u*c-e*h,A=s*b-M*v,w=s*m-f*v,z=s*d-l*v,R=M*m-f*b,O=M*d-l*b,j=f*d-l*m;return t[0]=i*j-h*O+c*R,t[1]=u*O-r*j-e*R,t[2]=b*_-m*g+d*q,t[3]=f*g-M*_-l*q,t[4]=h*z-o*j-c*w,t[5]=a*j-u*z+e*w,t[6]=m*y-v*_-d*x,t[7]=s*_-f*y+l*x,t[8]=o*O-i*z+c*A,t[9]=r*z-a*O-e*A,t[10]=v*g-b*y+d*p,t[11]=M*y-s*g-l*p,t[12]=i*w-o*R-h*A,t[13]=a*R-r*w+u*A,t[14]=b*x-v*q-m*p,t[15]=s*q-M*x+f*p,t},determinant:function(t){var n=t[0],a=t[1],r=t[2],u=t[3],e=t[4],o=t[5],i=t[6],h=t[7],c=t[8],s=t[9],M=t[10],f=t[11],l=t[12],v=t[13],b=t[14],m=n*o-a*e,d=n*i-r*e,p=a*i-r*o,x=c*v-s*l,y=c*b-M*l,q=s*b-M*v;return h*(n*q-a*y+r*x)-u*(e*q-o*y+i*x)+t[15]*(c*p-s*d+M*m)-f*(l*p-v*d+b*m)},multiply:A,translate:function(t,n,a){var r,u,e,o,i,h,c,s,M,f,l,v,b=a[0],m=a[1],d=a[2];return n===t?(t[12]=n[0]*b+n[4]*m+n[8]*d+n[12],t[13]=n[1]*b+n[5]*m+n[9]*d+n[13],t[14]=n[2]*b+n[6]*m+n[10]*d+n[14],t[15]=n[3]*b+n[7]*m+n[11]*d+n[15]):(r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=n[6],s=n[7],M=n[8],f=n[9],l=n[10],v=n[11],t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=i,t[5]=h,t[6]=c,t[7]=s,t[8]=M,t[9]=f,t[10]=l,t[11]=v,t[12]=r*b+i*m+M*d+n[12],t[13]=u*b+h*m+f*d+n[13],t[14]=e*b+c*m+l*d+n[14],t[15]=o*b+s*m+v*d+n[15]),t},scale:function(t,n,a){var r=a[0],u=a[1],e=a[2];return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*u,t[5]=n[5]*u,t[6]=n[6]*u,t[7]=n[7]*u,t[8]=n[8]*e,t[9]=n[9]*e,t[10]=n[10]*e,t[11]=n[11]*e,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},rotate:function(t,a,r,u){var e,o,i,h,c,s,M,f,l,v,b,m,d,p,x,y,q,g,_,A,w,z,R,O,j=u[0],E=u[1],P=u[2],T=Math.hypot(j,E,P);return T0?(r[0]=2*(h*i+M*u+c*o-s*e)/f,r[1]=2*(c*i+M*e+s*u-h*o)/f,r[2]=2*(s*i+M*o+h*e-c*u)/f):(r[0]=2*(h*i+M*u+c*o-s*e),r[1]=2*(c*i+M*e+s*u-h*o),r[2]=2*(s*i+M*o+h*e-c*u)),w(t,n,r),t},getTranslation:z,getScaling:R,getRotation:O,decompose:function(t,n,a,r){n[0]=r[12],n[1]=r[13],n[2]=r[14];var u=r[0],e=r[1],o=r[2],i=r[4],h=r[5],c=r[6],s=r[8],M=r[9],f=r[10];a[0]=Math.hypot(u,e,o),a[1]=Math.hypot(i,h,c),a[2]=Math.hypot(s,M,f);var l=1/a[0],v=1/a[1],b=1/a[2],m=u*l,d=e*v,p=o*b,x=i*l,y=h*v,q=c*b,g=s*l,_=M*v,A=f*b,w=m+y+A,z=0;return w>0?(z=2*Math.sqrt(w+1),t[3]=.25*z,t[0]=(q-_)/z,t[1]=(g-p)/z,t[2]=(d-x)/z):m>y&&m>A?(z=2*Math.sqrt(1+m-y-A),t[3]=(q-_)/z,t[0]=.25*z,t[1]=(d+x)/z,t[2]=(g+p)/z):y>A?(z=2*Math.sqrt(1+y-m-A),t[3]=(g-p)/z,t[0]=(d+x)/z,t[1]=.25*z,t[2]=(q+_)/z):(z=2*Math.sqrt(1+A-m-y),t[3]=(d-x)/z,t[0]=(g+p)/z,t[1]=(q+_)/z,t[2]=.25*z),t},fromRotationTranslationScale:function(t,n,a,r){var u=n[0],e=n[1],o=n[2],i=n[3],h=u+u,c=e+e,s=o+o,M=u*h,f=u*c,l=u*s,v=e*c,b=e*s,m=o*s,d=i*h,p=i*c,x=i*s,y=r[0],q=r[1],g=r[2];return t[0]=(1-(v+m))*y,t[1]=(f+x)*y,t[2]=(l-p)*y,t[3]=0,t[4]=(f-x)*q,t[5]=(1-(M+m))*q,t[6]=(b+d)*q,t[7]=0,t[8]=(l+p)*g,t[9]=(b-d)*g,t[10]=(1-(M+v))*g,t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t},fromRotationTranslationScaleOrigin:function(t,n,a,r,u){var e=n[0],o=n[1],i=n[2],h=n[3],c=e+e,s=o+o,M=i+i,f=e*c,l=e*s,v=e*M,b=o*s,m=o*M,d=i*M,p=h*c,x=h*s,y=h*M,q=r[0],g=r[1],_=r[2],A=u[0],w=u[1],z=u[2],R=(1-(b+d))*q,O=(l+y)*q,j=(v-x)*q,E=(l-y)*g,P=(1-(f+d))*g,T=(m+p)*g,S=(v+x)*_,D=(m-p)*_,F=(1-(f+b))*_;return t[0]=R,t[1]=O,t[2]=j,t[3]=0,t[4]=E,t[5]=P,t[6]=T,t[7]=0,t[8]=S,t[9]=D,t[10]=F,t[11]=0,t[12]=a[0]+A-(R*A+E*w+S*z),t[13]=a[1]+w-(O*A+P*w+D*z),t[14]=a[2]+z-(j*A+T*w+F*z),t[15]=1,t},fromQuat:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=a+a,i=r+r,h=u+u,c=a*o,s=r*o,M=r*i,f=u*o,l=u*i,v=u*h,b=e*o,m=e*i,d=e*h;return t[0]=1-M-v,t[1]=s+d,t[2]=f-m,t[3]=0,t[4]=s-d,t[5]=1-c-v,t[6]=l+b,t[7]=0,t[8]=f+m,t[9]=l-b,t[10]=1-c-M,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},frustum:function(t,n,a,r,u,e,o){var i=1/(a-n),h=1/(u-r),c=1/(e-o);return t[0]=2*e*i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*e*h,t[6]=0,t[7]=0,t[8]=(a+n)*i,t[9]=(u+r)*h,t[10]=(o+e)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*e*2*c,t[15]=0,t},perspectiveNO:j,perspective:E,perspectiveZO:function(t,n,a,r,u){var e=1/Math.tan(n/2);if(t[0]=e/a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=u&&u!==1/0){var o=1/(r-u);t[10]=u*o,t[14]=u*r*o}else t[10]=-1,t[14]=-r;return t},perspectiveFromFieldOfView:function(t,n,a,r){var u=Math.tan(n.upDegrees*Math.PI/180),e=Math.tan(n.downDegrees*Math.PI/180),o=Math.tan(n.leftDegrees*Math.PI/180),i=Math.tan(n.rightDegrees*Math.PI/180),h=2/(o+i),c=2/(u+e);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-i)*h*.5,t[9]=(u-e)*c*.5,t[10]=r/(a-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*a/(a-r),t[15]=0,t},orthoNO:P,ortho:T,orthoZO:function(t,n,a,r,u,e,o){var i=1/(n-a),h=1/(r-u),c=1/(e-o);return t[0]=-2*i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(n+a)*i,t[13]=(u+r)*h,t[14]=e*c,t[15]=1,t},lookAt:function(t,a,r,u){var e,o,i,h,c,s,M,f,l,v,b=a[0],m=a[1],d=a[2],p=u[0],x=u[1],y=u[2],q=r[0],g=r[1],A=r[2];return Math.abs(b-q)0&&(s*=l=1/Math.sqrt(l),M*=l,f*=l);var v=h*f-c*M,b=c*s-i*f,m=i*M-h*s;return(l=v*v+b*b+m*m)>0&&(v*=l=1/Math.sqrt(l),b*=l,m*=l),t[0]=v,t[1]=b,t[2]=m,t[3]=0,t[4]=M*m-f*b,t[5]=f*v-s*m,t[6]=s*b-M*v,t[7]=0,t[8]=s,t[9]=M,t[10]=f,t[11]=0,t[12]=u,t[13]=e,t[14]=o,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t[6]=n[6]+a[6],t[7]=n[7]+a[7],t[8]=n[8]+a[8],t[9]=n[9]+a[9],t[10]=n[10]+a[10],t[11]=n[11]+a[11],t[12]=n[12]+a[12],t[13]=n[13]+a[13],t[14]=n[14]+a[14],t[15]=n[15]+a[15],t},subtract:S,multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=n[11]*a,t[12]=n[12]*a,t[13]=n[13]*a,t[14]=n[14]*a,t[15]=n[15]*a,t},multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t[4]=n[4]+a[4]*r,t[5]=n[5]+a[5]*r,t[6]=n[6]+a[6]*r,t[7]=n[7]+a[7]*r,t[8]=n[8]+a[8]*r,t[9]=n[9]+a[9]*r,t[10]=n[10]+a[10]*r,t[11]=n[11]+a[11]*r,t[12]=n[12]+a[12]*r,t[13]=n[13]+a[13]*r,t[14]=n[14]+a[14]*r,t[15]=n[15]+a[15]*r,t},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[11]===n[11]&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[15]===n[15]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=t[4],h=t[5],c=t[6],s=t[7],M=t[8],f=t[9],l=t[10],v=t[11],b=t[12],m=t[13],d=t[14],p=t[15],x=a[0],y=a[1],q=a[2],g=a[3],_=a[4],A=a[5],w=a[6],z=a[7],R=a[8],O=a[9],j=a[10],E=a[11],P=a[12],T=a[13],S=a[14],D=a[15];return Math.abs(r-x)<=n*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(u-y)<=n*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(e-q)<=n*Math.max(1,Math.abs(e),Math.abs(q))&&Math.abs(o-g)<=n*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(i-_)<=n*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(h-A)<=n*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(c-w)<=n*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(s-z)<=n*Math.max(1,Math.abs(s),Math.abs(z))&&Math.abs(M-R)<=n*Math.max(1,Math.abs(M),Math.abs(R))&&Math.abs(f-O)<=n*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(l-j)<=n*Math.max(1,Math.abs(l),Math.abs(j))&&Math.abs(v-E)<=n*Math.max(1,Math.abs(v),Math.abs(E))&&Math.abs(b-P)<=n*Math.max(1,Math.abs(b),Math.abs(P))&&Math.abs(m-T)<=n*Math.max(1,Math.abs(m),Math.abs(T))&&Math.abs(d-S)<=n*Math.max(1,Math.abs(d),Math.abs(S))&&Math.abs(p-D)<=n*Math.max(1,Math.abs(p),Math.abs(D))},mul:D,sub:F});function L(){var t=new a(3);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function V(t){var n=t[0],a=t[1],r=t[2];return Math.hypot(n,a,r)}function k(t,n,r){var u=new a(3);return u[0]=t,u[1]=n,u[2]=r,u}function Q(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t}function Y(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t}function Z(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t}function N(t,n){var a=n[0]-t[0],r=n[1]-t[1],u=n[2]-t[2];return Math.hypot(a,r,u)}function X(t,n){var a=n[0]-t[0],r=n[1]-t[1],u=n[2]-t[2];return a*a+r*r+u*u}function B(t){var n=t[0],a=t[1],r=t[2];return n*n+a*a+r*r}function U(t,n){var a=n[0],r=n[1],u=n[2],e=a*a+r*r+u*u;return e>0&&(e=1/Math.sqrt(e)),t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function G(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function W(t,n,a){var r=n[0],u=n[1],e=n[2],o=a[0],i=a[1],h=a[2];return t[0]=u*h-e*i,t[1]=e*o-r*h,t[2]=r*i-u*o,t}var C,H=Q,J=Y,K=Z,$=N,tt=X,nt=V,at=B,rt=(C=L(),function(t,n,a,r,u,e){var o,i;for(n||(n=3),a||(a=0),i=r?Math.min(r*n+a,t.length):t.length,o=a;o0&&(o=1/Math.sqrt(o)),t[0]=a*o,t[1]=r*o,t[2]=u*o,t[3]=e*o,t}function yt(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function qt(t,n,a,r){var u=n[0],e=n[1],o=n[2],i=n[3];return t[0]=u+r*(a[0]-u),t[1]=e+r*(a[1]-e),t[2]=o+r*(a[2]-o),t[3]=i+r*(a[3]-i),t}function gt(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}var _t=Mt,At=ft,wt=lt,zt=bt,Rt=mt,Ot=dt,jt=pt,Et=function(){var t=et();return function(n,a,r,u,e,o){var i,h;for(a||(a=4),r||(r=0),h=u?Math.min(u*a+r,n.length):n.length,i=r;i=1);do{h=(e=2*r()-1)*e+(o=2*r()-1)*o}while(h>=1);var c=Math.sqrt((1-i)/h);return t[0]=n*a,t[1]=n*u,t[2]=n*e*c,t[3]=n*o*c,t},transformMat4:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3];return t[0]=a[0]*r+a[4]*u+a[8]*e+a[12]*o,t[1]=a[1]*r+a[5]*u+a[9]*e+a[13]*o,t[2]=a[2]*r+a[6]*u+a[10]*e+a[14]*o,t[3]=a[3]*r+a[7]*u+a[11]*e+a[15]*o,t},transformQuat:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=a[0],i=a[1],h=a[2],c=a[3],s=c*r+i*e-h*u,M=c*u+h*r-o*e,f=c*e+o*u-i*r,l=-o*r-i*u-h*e;return t[0]=s*c+l*-o+M*-h-f*-i,t[1]=M*c+l*-i+f*-o-s*-h,t[2]=f*c+l*-h+s*-i-M*-o,t[3]=n[3],t},zero:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},str:function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},exactEquals:gt,equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=a[0],h=a[1],c=a[2],s=a[3];return Math.abs(r-i)<=n*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(u-h)<=n*Math.max(1,Math.abs(u),Math.abs(h))&&Math.abs(e-c)<=n*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(o-s)<=n*Math.max(1,Math.abs(o),Math.abs(s))},sub:_t,mul:At,div:wt,dist:zt,sqrDist:Rt,len:Ot,sqrLen:jt,forEach:Et});function Tt(){var t=new a(4);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function St(t,n,a){a*=.5;var r=Math.sin(a);return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=Math.cos(a),t}function Dt(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],h=a[1],c=a[2],s=a[3];return t[0]=r*s+o*i+u*c-e*h,t[1]=u*s+o*h+e*i-r*c,t[2]=e*s+o*c+r*h-u*i,t[3]=o*s-r*i-u*h-e*c,t}function Ft(t,n,a){a*=.5;var r=n[0],u=n[1],e=n[2],o=n[3],i=Math.sin(a),h=Math.cos(a);return t[0]=r*h+o*i,t[1]=u*h+e*i,t[2]=e*h-u*i,t[3]=o*h-r*i,t}function It(t,n,a){a*=.5;var r=n[0],u=n[1],e=n[2],o=n[3],i=Math.sin(a),h=Math.cos(a);return t[0]=r*h-e*i,t[1]=u*h+o*i,t[2]=e*h+r*i,t[3]=o*h-u*i,t}function Lt(t,n,a){a*=.5;var r=n[0],u=n[1],e=n[2],o=n[3],i=Math.sin(a),h=Math.cos(a);return t[0]=r*h+u*i,t[1]=u*h-r*i,t[2]=e*h+o*i,t[3]=o*h-e*i,t}function Vt(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=Math.sqrt(a*a+r*r+u*u),i=Math.exp(e),h=o>0?i*Math.sin(o)/o:0;return t[0]=a*h,t[1]=r*h,t[2]=u*h,t[3]=i*Math.cos(o),t}function kt(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=Math.sqrt(a*a+r*r+u*u),i=o>0?Math.atan2(o,e)/o:0;return t[0]=a*i,t[1]=r*i,t[2]=u*i,t[3]=.5*Math.log(a*a+r*r+u*u+e*e),t}function Qt(t,a,r,u){var e,o,i,h,c,s=a[0],M=a[1],f=a[2],l=a[3],v=r[0],b=r[1],m=r[2],d=r[3];return(o=s*v+M*b+f*m+l*d)<0&&(o=-o,v=-v,b=-b,m=-m,d=-d),1-o>n?(e=Math.acos(o),i=Math.sin(e),h=Math.sin((1-u)*e)/i,c=Math.sin(u*e)/i):(h=1-u,c=u),t[0]=h*s+c*v,t[1]=h*M+c*b,t[2]=h*f+c*m,t[3]=h*l+c*d,t}function Yt(t,n){var a,r=n[0]+n[4]+n[8];if(r>0)a=Math.sqrt(r+1),t[3]=.5*a,a=.5/a,t[0]=(n[5]-n[7])*a,t[1]=(n[6]-n[2])*a,t[2]=(n[1]-n[3])*a;else{var u=0;n[4]>n[0]&&(u=1),n[8]>n[3*u+u]&&(u=2);var e=(u+1)%3,o=(u+2)%3;a=Math.sqrt(n[3*u+u]-n[3*e+e]-n[3*o+o]+1),t[u]=.5*a,a=.5/a,t[3]=(n[3*e+o]-n[3*o+e])*a,t[e]=(n[3*e+u]+n[3*u+e])*a,t[o]=(n[3*o+u]+n[3*u+o])*a}return t}var Zt=ot,Nt=it,Xt=ht,Bt=ct,Ut=st,Gt=Dt,Wt=vt,Ct=yt,Ht=qt,Jt=dt,Kt=Jt,$t=pt,tn=$t,nn=xt,an=gt;var rn,un,en,on,hn,cn,sn=(rn=L(),un=k(1,0,0),en=k(0,1,0),function(t,n,a){var r=G(n,a);return r<-.999999?(W(rn,un,n),nt(rn)<1e-6&&W(rn,en,n),U(rn,rn),St(t,rn,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(W(rn,n,a),t[0]=rn[0],t[1]=rn[1],t[2]=rn[2],t[3]=1+r,nn(t,t))}),Mn=(on=Tt(),hn=Tt(),function(t,n,a,r,u,e){return Qt(on,n,u,e),Qt(hn,a,r,e),Qt(t,on,hn,2*e*(1-e)),t}),fn=(cn=d(),function(t,n,a,r){return cn[0]=a[0],cn[3]=a[1],cn[6]=a[2],cn[1]=r[0],cn[4]=r[1],cn[7]=r[2],cn[2]=-n[0],cn[5]=-n[1],cn[8]=-n[2],nn(t,Yt(t,cn))}),ln=Object.freeze({__proto__:null,create:Tt,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},setAxisAngle:St,getAxisAngle:function(t,a){var r=2*Math.acos(a[3]),u=Math.sin(r/2);return u>n?(t[0]=a[0]/u,t[1]=a[1]/u,t[2]=a[2]/u):(t[0]=1,t[1]=0,t[2]=0),r},getAngle:function(t,n){var a=Ct(t,n);return Math.acos(2*a*a-1)},multiply:Dt,rotateX:Ft,rotateY:It,rotateZ:Lt,calculateW:function(t,n){var a=n[0],r=n[1],u=n[2];return t[0]=a,t[1]=r,t[2]=u,t[3]=Math.sqrt(Math.abs(1-a*a-r*r-u*u)),t},exp:Vt,ln:kt,pow:function(t,n,a){return kt(t,n),Wt(t,t,a),Vt(t,t),t},slerp:Qt,random:function(t){var n=r(),a=r(),u=r(),e=Math.sqrt(1-n),o=Math.sqrt(n);return t[0]=e*Math.sin(2*Math.PI*a),t[1]=e*Math.cos(2*Math.PI*a),t[2]=o*Math.sin(2*Math.PI*u),t[3]=o*Math.cos(2*Math.PI*u),t},invert:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=a*a+r*r+u*u+e*e,i=o?1/o:0;return t[0]=-a*i,t[1]=-r*i,t[2]=-u*i,t[3]=e*i,t},conjugate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t},fromMat3:Yt,fromEuler:function(t,n,a,r){var e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:u,o=Math.PI/360;n*=o,r*=o,a*=o;var i=Math.sin(n),h=Math.cos(n),c=Math.sin(a),s=Math.cos(a),M=Math.sin(r),f=Math.cos(r);switch(e){case"xyz":t[0]=i*s*f+h*c*M,t[1]=h*c*f-i*s*M,t[2]=h*s*M+i*c*f,t[3]=h*s*f-i*c*M;break;case"xzy":t[0]=i*s*f-h*c*M,t[1]=h*c*f-i*s*M,t[2]=h*s*M+i*c*f,t[3]=h*s*f+i*c*M;break;case"yxz":t[0]=i*s*f+h*c*M,t[1]=h*c*f-i*s*M,t[2]=h*s*M-i*c*f,t[3]=h*s*f+i*c*M;break;case"yzx":t[0]=i*s*f+h*c*M,t[1]=h*c*f+i*s*M,t[2]=h*s*M-i*c*f,t[3]=h*s*f-i*c*M;break;case"zxy":t[0]=i*s*f-h*c*M,t[1]=h*c*f+i*s*M,t[2]=h*s*M+i*c*f,t[3]=h*s*f-i*c*M;break;case"zyx":t[0]=i*s*f-h*c*M,t[1]=h*c*f+i*s*M,t[2]=h*s*M-i*c*f,t[3]=h*s*f+i*c*M;break;default:throw new Error("Unknown angle order "+e)}return t},str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},clone:Zt,fromValues:Nt,copy:Xt,set:Bt,add:Ut,mul:Gt,scale:Wt,dot:Ct,lerp:Ht,length:Jt,len:Kt,squaredLength:$t,sqrLen:tn,normalize:nn,exactEquals:an,equals:function(t,n){return Math.abs(yt(t,n))>=.999999},rotationTo:sn,sqlerp:Mn,setAxes:fn});function vn(t,n,a){var r=.5*a[0],u=.5*a[1],e=.5*a[2],o=n[0],i=n[1],h=n[2],c=n[3];return t[0]=o,t[1]=i,t[2]=h,t[3]=c,t[4]=r*c+u*h-e*i,t[5]=u*c+e*o-r*h,t[6]=e*c+r*i-u*o,t[7]=-r*o-u*i-e*h,t}function bn(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t}var mn=Xt;var dn=Xt;function pn(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[4],h=a[5],c=a[6],s=a[7],M=n[4],f=n[5],l=n[6],v=n[7],b=a[0],m=a[1],d=a[2],p=a[3];return t[0]=r*p+o*b+u*d-e*m,t[1]=u*p+o*m+e*b-r*d,t[2]=e*p+o*d+r*m-u*b,t[3]=o*p-r*b-u*m-e*d,t[4]=r*s+o*i+u*c-e*h+M*p+v*b+f*d-l*m,t[5]=u*s+o*h+e*i-r*c+f*p+v*m+l*b-M*d,t[6]=e*s+o*c+r*h-u*i+l*p+v*d+M*m-f*b,t[7]=o*s-r*i-u*h-e*c+v*p-M*b-f*m-l*d,t}var xn=pn;var yn=Ct;var qn=Jt,gn=qn,_n=$t,An=_n;var wn=Object.freeze({__proto__:null,create:function(){var t=new a(8);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t},clone:function(t){var n=new a(8);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n},fromValues:function(t,n,r,u,e,o,i,h){var c=new a(8);return c[0]=t,c[1]=n,c[2]=r,c[3]=u,c[4]=e,c[5]=o,c[6]=i,c[7]=h,c},fromRotationTranslationValues:function(t,n,r,u,e,o,i){var h=new a(8);h[0]=t,h[1]=n,h[2]=r,h[3]=u;var c=.5*e,s=.5*o,M=.5*i;return h[4]=c*u+s*r-M*n,h[5]=s*u+M*t-c*r,h[6]=M*u+c*n-s*t,h[7]=-c*t-s*n-M*r,h},fromRotationTranslation:vn,fromTranslation:function(t,n){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*n[0],t[5]=.5*n[1],t[6]=.5*n[2],t[7]=0,t},fromRotation:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},fromMat4:function(t,n){var r=Tt();O(r,n);var u=new a(3);return z(u,n),vn(t,r,u),t},copy:bn,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},set:function(t,n,a,r,u,e,o,i,h){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t[4]=e,t[5]=o,t[6]=i,t[7]=h,t},getReal:mn,getDual:function(t,n){return t[0]=n[4],t[1]=n[5],t[2]=n[6],t[3]=n[7],t},setReal:dn,setDual:function(t,n){return t[4]=n[0],t[5]=n[1],t[6]=n[2],t[7]=n[3],t},getTranslation:function(t,n){var a=n[4],r=n[5],u=n[6],e=n[7],o=-n[0],i=-n[1],h=-n[2],c=n[3];return t[0]=2*(a*c+e*o+r*h-u*i),t[1]=2*(r*c+e*i+u*o-a*h),t[2]=2*(u*c+e*h+a*i-r*o),t},translate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=.5*a[0],h=.5*a[1],c=.5*a[2],s=n[4],M=n[5],f=n[6],l=n[7];return t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=o*i+u*c-e*h+s,t[5]=o*h+e*i-r*c+M,t[6]=o*c+r*h-u*i+f,t[7]=-r*i-u*h-e*c+l,t},rotateX:function(t,n,a){var r=-n[0],u=-n[1],e=-n[2],o=n[3],i=n[4],h=n[5],c=n[6],s=n[7],M=i*o+s*r+h*e-c*u,f=h*o+s*u+c*r-i*e,l=c*o+s*e+i*u-h*r,v=s*o-i*r-h*u-c*e;return Ft(t,n,a),r=t[0],u=t[1],e=t[2],o=t[3],t[4]=M*o+v*r+f*e-l*u,t[5]=f*o+v*u+l*r-M*e,t[6]=l*o+v*e+M*u-f*r,t[7]=v*o-M*r-f*u-l*e,t},rotateY:function(t,n,a){var r=-n[0],u=-n[1],e=-n[2],o=n[3],i=n[4],h=n[5],c=n[6],s=n[7],M=i*o+s*r+h*e-c*u,f=h*o+s*u+c*r-i*e,l=c*o+s*e+i*u-h*r,v=s*o-i*r-h*u-c*e;return It(t,n,a),r=t[0],u=t[1],e=t[2],o=t[3],t[4]=M*o+v*r+f*e-l*u,t[5]=f*o+v*u+l*r-M*e,t[6]=l*o+v*e+M*u-f*r,t[7]=v*o-M*r-f*u-l*e,t},rotateZ:function(t,n,a){var r=-n[0],u=-n[1],e=-n[2],o=n[3],i=n[4],h=n[5],c=n[6],s=n[7],M=i*o+s*r+h*e-c*u,f=h*o+s*u+c*r-i*e,l=c*o+s*e+i*u-h*r,v=s*o-i*r-h*u-c*e;return Lt(t,n,a),r=t[0],u=t[1],e=t[2],o=t[3],t[4]=M*o+v*r+f*e-l*u,t[5]=f*o+v*u+l*r-M*e,t[6]=l*o+v*e+M*u-f*r,t[7]=v*o-M*r-f*u-l*e,t},rotateByQuatAppend:function(t,n,a){var r=a[0],u=a[1],e=a[2],o=a[3],i=n[0],h=n[1],c=n[2],s=n[3];return t[0]=i*o+s*r+h*e-c*u,t[1]=h*o+s*u+c*r-i*e,t[2]=c*o+s*e+i*u-h*r,t[3]=s*o-i*r-h*u-c*e,i=n[4],h=n[5],c=n[6],s=n[7],t[4]=i*o+s*r+h*e-c*u,t[5]=h*o+s*u+c*r-i*e,t[6]=c*o+s*e+i*u-h*r,t[7]=s*o-i*r-h*u-c*e,t},rotateByQuatPrepend:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],h=a[1],c=a[2],s=a[3];return t[0]=r*s+o*i+u*c-e*h,t[1]=u*s+o*h+e*i-r*c,t[2]=e*s+o*c+r*h-u*i,t[3]=o*s-r*i-u*h-e*c,i=a[4],h=a[5],c=a[6],s=a[7],t[4]=r*s+o*i+u*c-e*h,t[5]=u*s+o*h+e*i-r*c,t[6]=e*s+o*c+r*h-u*i,t[7]=o*s-r*i-u*h-e*c,t},rotateAroundAxis:function(t,a,r,u){if(Math.abs(u)0){a=Math.sqrt(a);var r=n[0]/a,u=n[1]/a,e=n[2]/a,o=n[3]/a,i=n[4],h=n[5],c=n[6],s=n[7],M=r*i+u*h+e*c+o*s;t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=(i-r*M)/a,t[5]=(h-u*M)/a,t[6]=(c-e*M)/a,t[7]=(s-o*M)/a}return t},str:function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=t[4],h=t[5],c=t[6],s=t[7],M=a[0],f=a[1],l=a[2],v=a[3],b=a[4],m=a[5],d=a[6],p=a[7];return Math.abs(r-M)<=n*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(u-f)<=n*Math.max(1,Math.abs(u),Math.abs(f))&&Math.abs(e-l)<=n*Math.max(1,Math.abs(e),Math.abs(l))&&Math.abs(o-v)<=n*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(i-b)<=n*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(h-m)<=n*Math.max(1,Math.abs(h),Math.abs(m))&&Math.abs(c-d)<=n*Math.max(1,Math.abs(c),Math.abs(d))&&Math.abs(s-p)<=n*Math.max(1,Math.abs(s),Math.abs(p))}});function zn(){var t=new a(2);return a!=Float32Array&&(t[0]=0,t[1]=0),t}function Rn(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t}function On(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t}function jn(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t}function En(t,n){var a=n[0]-t[0],r=n[1]-t[1];return Math.hypot(a,r)}function Pn(t,n){var a=n[0]-t[0],r=n[1]-t[1];return a*a+r*r}function Tn(t){var n=t[0],a=t[1];return Math.hypot(n,a)}function Sn(t){var n=t[0],a=t[1];return n*n+a*a}var Dn=Tn,Fn=Rn,In=On,Ln=jn,Vn=En,kn=Pn,Qn=Sn,Yn=function(){var t=zn();return function(n,a,r,u,e,o){var i,h;for(a||(a=2),r||(r=0),h=u?Math.min(u*a+r,n.length):n.length,i=r;i0&&(u=1/Math.sqrt(u)),t[0]=n[0]*u,t[1]=n[1]*u,t},dot:function(t,n){return t[0]*n[0]+t[1]*n[1]},cross:function(t,n,a){var r=n[0]*a[1]-n[1]*a[0];return t[0]=t[1]=0,t[2]=r,t},lerp:function(t,n,a,r){var u=n[0],e=n[1];return t[0]=u+r*(a[0]-u),t[1]=e+r*(a[1]-e),t},random:function(t,n){n=void 0===n?1:n;var a=2*r()*Math.PI;return t[0]=Math.cos(a)*n,t[1]=Math.sin(a)*n,t},transformMat2:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[2]*u,t[1]=a[1]*r+a[3]*u,t},transformMat2d:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[2]*u+a[4],t[1]=a[1]*r+a[3]*u+a[5],t},transformMat3:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[3]*u+a[6],t[1]=a[1]*r+a[4]*u+a[7],t},transformMat4:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[4]*u+a[12],t[1]=a[1]*r+a[5]*u+a[13],t},rotate:function(t,n,a,r){var u=n[0]-a[0],e=n[1]-a[1],o=Math.sin(r),i=Math.cos(r);return t[0]=u*i-e*o+a[0],t[1]=u*o+e*i+a[1],t},angle:function(t,n){var a=t[0],r=t[1],u=n[0],e=n[1],o=Math.sqrt((a*a+r*r)*(u*u+e*e)),i=o&&(a*u+r*e)/o;return Math.acos(Math.min(Math.max(i,-1),1))},zero:function(t){return t[0]=0,t[1]=0,t},str:function(t){return"vec2("+t[0]+", "+t[1]+")"},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]},equals:function(t,a){var r=t[0],u=t[1],e=a[0],o=a[1];return Math.abs(r-e)<=n*Math.max(1,Math.abs(r),Math.abs(e))&&Math.abs(u-o)<=n*Math.max(1,Math.abs(u),Math.abs(o))},len:Dn,sub:Fn,mul:In,div:Ln,dist:Vn,sqrDist:kn,sqrLen:Qn,forEach:Yn});t.glMatrix=o,t.mat2=M,t.mat2d=m,t.mat3=g,t.mat4=I,t.quat=ln,t.quat2=wn,t.vec2=Zn,t.vec3=ut,t.vec4=Pt,Object.defineProperty(t,"__esModule",{value:!0})}));
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/util/render-xrframe.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/util/render-xrframe.js
deleted file mode 100644
index 1567db70..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/util/render-xrframe.js
+++ /dev/null
@@ -1,296 +0,0 @@
-import splat_vs from './shader/splat_xrframe_vs.glsl'
-import splat_fs from './shader/splat_xrframe_fs.glsl'
-
-const xrFrameRender = {
- // 对应案例的初始化逻辑,由统一的 behavior 触发
- init() {
- console.log('start init ply')
-
- const plySrc = 'http://10.9.233.66:8000/ply/point_cloud.ply'
-
- const filePath = wx.env.USER_DATA_PATH + '/point.ply'
- wx.downloadFile({
- filePath,
- url: plySrc,
- success: (res) => {
- console.log('下载回调', res)
- const fs = wx.getFileSystemManager()
- fs.readFile({
- filePath: res.filePath,
- position: 0,
- success: async (res) => {
- console.log('读文件回调,结果返回为', res)
-
- // const plyInfo = plyLoader.parsePLYBuffer(res.data);
-
- const plyInfo = loadPly(res.data)
-
- console.log('plyLoader return', plyInfo)
-
- // 初始化 worker 相关
- this._worker.postMessage({
- type: 'execFunc_init',
- params: [plyInfo]
- })
- },
- fail(res) {
- wx.hideLoading()
- wx.showToast({
- title: res.errMsg,
- icon: 'none',
- duration: 2000
- })
- console.error(res)
- }
- })
- },
- fail(res) {
- wx.hideLoading()
- wx.showToast({
- title: res.errMsg,
- icon: 'none',
- duration: 2000
- })
- console.error(res)
- }
- })
-
- // 监听worker回调
- this._worker.onMessage((res) => {
- if (res.type === 'execFunc_init') {
- // 初始化 worker 回调
- console.log('gaussianSplatting init callBack')
- console.log('res', res)
-
- this.initGSGeometry(res.result.count, res.result.vertexSize)
- } else if (res.type === 'execFunc_sort') {
- // worker 排序 回调
- // console.log('gaussianSplatting sort callBack', res.result)
-
- // const vb = getVertexBuffer(this.vertexData);
-
- this.geometryGeo.uploadVertexBuffer(0, res.result.vertexBuffer)
-
- // console.log('sort callback', this.geometryGeo, res.result.vertexBuffer)
- }
- })
- },
- initGSGeometry(gaussianCount, vertexSize) {
- console.log('initGSGeometry start')
-
- const xrFrameSystem = wx.getXrFrameSystem()
- const createGSEffect = (scene) => scene.createEffect({
- name: 'gaussianSplatting',
- defaultRenderQueue: 3000,
- properties: [
- {
- key: 'screen_width',
- type: xrFrameSystem.EUniformType.FLOAT,
- default: 0
- },
- {
- key: 'screen_height',
- type: xrFrameSystem.EUniformType.FLOAT,
- default: 0
- },
- {
- key: 'focal_x',
- type: xrFrameSystem.EUniformType.FLOAT,
- default: 0
- },
- {
- key: 'focal_y',
- type: xrFrameSystem.EUniformType.FLOAT,
- default: 0
- },
- {
- key: 'tan_fovx',
- type: xrFrameSystem.EUniformType.FLOAT,
- default: 0
- },
- {
- key: 'tan_fovy',
- type: xrFrameSystem.EUniformType.FLOAT,
- default: 0
- },
- {
- key: 'scale_modifier',
- type: xrFrameSystem.EUniformType.FLOAT,
- default: 1
- },
- ],
- images: [],
- passes: [
- {
- renderStates: {
- blendOn: true,
- depthWrite: false,
- cullOn: false,
- },
- lightMode: 'ForwardBase',
- useMaterialRenderStates: true,
- shaders: [0, 1]
- }
- ],
- shaders: [
- // Vertex Shader
- splat_vs,
- // Fragement Shader
- splat_fs
- ],
- })
-
- this.geometryRoot = this.xrScene.getElementById('geometryRoot')
-
- console.log('geometryRoot', this.geometryRoot)
-
- // 注册 Geometry 信息
- xrFrameSystem.registerGeometry('gaussian-splatting', scene => {
- console.log('registerGeometry')
- const vl = scene.createVertexLayout({
- attributes: [
- {
- name: 'a_center',
- format: xrFrameSystem.EVertexFormat.FLOAT3,
- offset: 0,
- },
- {
- name: 'a_opacity',
- format: xrFrameSystem.EVertexFormat.FLOAT,
- offset: 12,
- },
- {
- name: 'a_cov3Da',
- format: xrFrameSystem.EVertexFormat.FLOAT3,
- offset: 16,
- },
- {
- name: 'a_cov3Db',
- format: xrFrameSystem.EVertexFormat.FLOAT3,
- offset: 28,
- },
- {
- name: 'a_color',
- format: xrFrameSystem.EVertexFormat.FLOAT3,
- offset: 40,
- },
- {
- name: 'a_corner',
- format: xrFrameSystem.EVertexFormat.FLOAT2,
- offset: 52,
- },
- ],
- stride: 60
- })
-
- console.log('createVertexLayout')
-
- const indices = []
- const verticesPerInstance = 4
- const instanceCount = gaussianCount / verticesPerInstance
- for (let i = 0; i < instanceCount; i++) {
- // 对于每个实例,添加6个索引以形成2个三角形
- const base = i * 4 // 每个实例的基础顶点索引
- // 第一个三角形
- indices.push(base, base + 1, base + 2)
- // 第二个三角形
- indices.push(base + 2, base + 1, base + 3)
- }
-
- console.log('indices', indices)
-
- // VertexBuffer IndexBuffer 不能动态更改长度,需要一开始设定较大的长度。
- const vb = new Float32Array(gaussianCount * vertexSize)
- const ib = new Uint16Array(indices)
-
- console.log('vb', vb)
- console.log('ib', ib)
-
- const geo = scene.createGeometry(vl, vb, ib)
-
- geo.setBoundBall(new xrFrameSystem.Vector3(), 1)
- geo.addSubMesh(ib.length, 0, 0)
-
- return geo
- })
-
- console.log('gaussianSplatting geo')
-
- xrFrameSystem.registerEffect('gaussianSplatting', createGSEffect)
-
- console.log('gaussianSplatting effect')
-
- this.geoElem = this.xrScene.createElement(xrFrameSystem.XRMesh, {
- geometry: 'gaussian-splatting',
- position: '0 0 0',
- scale: '0.2 0.2 0.2'
- })
- this.geometryRoot.addChild(this.geoElem)
-
- console.log('init geo end')
-
- // 延时保证挂载与初始化完毕
- setTimeout(() => {
- this.meshGeo = this.geoElem.getComponent(xrFrameSystem.Mesh)
- this.geometryGeo = this.meshGeo.geometry
-
- this.matGeo = this.meshGeo.material
-
- const gsMaterial = this.xrScene.createMaterial(
- // 使用定制的效果
- this.xrScene.assets.getAsset('effect', 'gaussianSplatting')
- )
- console.log('gsMaterial', gsMaterial)
-
- // 设定 绘制双面
- // gsMaterial.setRenderState("cullOn", false);
-
- const frameWidth = this.xrScene.frameWidth
- const frameHeight = this.xrScene.frameHeight
- const tan_fovy = Math.tan(60 / 180 * Math.PI * 0.5)
- const tan_fovx = tan_fovy * frameWidth / frameHeight
- const focal_y = frameHeight / (2 * tan_fovy)
- const focal_x = frameWidth / (2 * tan_fovx)
-
- console.log('gsMaterial', gsMaterial)
-
- console.log('frameWidth', frameWidth)
- console.log('frameHeight', frameHeight)
- console.log('tan_fovy', tan_fovy)
- console.log('tan_fovx', tan_fovx)
- console.log('focal_y', focal_y)
- console.log('focal_x', focal_x)
-
- // 设定屏幕相关uniform
- gsMaterial.setFloat('screen_width', frameWidth)
- gsMaterial.setFloat('screen_height', frameHeight)
- gsMaterial.setFloat('tan_fovy', tan_fovy)
- gsMaterial.setFloat('tan_fovx', tan_fovx)
- gsMaterial.setFloat('focal_y', focal_y)
- gsMaterial.setFloat('focal_x', focal_x)
-
- this.meshGeo.material = gsMaterial
-
- console.log('meshGeo')
-
- // 初始化循环
- console.log('initRenderLoop')
- this.initRenderLoop()
- }, 200)
- },
- initRenderLoop() {
- // this.loopTimer = setInterval(this.loop.bind(this), 2000);
- this.loopTimer = setTimeout(this.loop.bind(this), 2000)
- },
- loop() {
- // console.log(this.xrCamera._viewMatrix)
- this._worker.postMessage({
- type: 'execFunc_sort',
- params: [
- {
- viewMatrix: this.xrCamera._viewMatrix
- }
- ]
- })
- }
-}
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/camera-webGL.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/camera-webGL.js
deleted file mode 100644
index 657134ec..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/camera-webGL.js
+++ /dev/null
@@ -1,210 +0,0 @@
-import * as glMatrix from '../util/gl-matrix-min'
-
-const { mat4, vec3, vec4 } = glMatrix
-
-class CameraWebGL {
- constructor(gl, worker, {target = [0, 0, 0], up = [0, 1, 0], camera = []} = {}) {
- this.gl = gl;
- this.worker = worker;
- this.target = [...target] // Position of look-at target
- this.up = [...up] // Up vector
-
- // Camera spherical coordinates (around the target)
- this.theta = camera[0] ?? -Math.PI/2
- this.phi = camera[1] ?? Math.PI/2
- this.radius = camera[2] ?? 3
-
- // Y Field of view
- // this.fov_y = 0.820176
- this.fov_y = Math.PI / 180 * 70;
-
- // False: orbit around object (mouse + wheel)
- // True: free-fly (mouse + AWSD)
- this.freeFly = false
-
- // Indicate that the camera moved and the splats need to be sorted
- this.needsWorkerUpdate = true
-
- // Is the user dragging the mouse?
- this.isDragging = false
-
- // Helper vectors
- this.pos = vec3.create()
- this.front = vec3.create()
- this.right = vec3.create()
-
- // Helper matrices
- this.modelMatrix = mat4.create()
- this.viewMatrix = mat4.create()
- this.projMatrix = mat4.create()
- this.viewProjMatrix = mat4.create()
- this.lastViewProjMatrix = mat4.create()
- this.sceneRotationMatrix = rotateAlign(this.up, [0, 1, 0])
-
- // Matrices sent to the GPU
- this.mm = mat4.create()
- this.vm = mat4.create()
- this.mvm = mat4.create()
- this.mvpm = mat4.create()
-
- // past Touch
- this.lastTouch = {}
-
- // 是否已经初始化
- this.isWorkerInit = false;
-
- // 是否在排序
- this.isWorkerSorting = false;
-
- // 是否开启 worker 更新
- this.workerOn = true;
-
- // 初始化
- this.update();
- }
-
- setWorkerOn(flag) {
- this.workerOn = flag
- }
-
- updateCameraInfo(target, theta, phi, radius) {
- this.target = [...target]
- this.theta = theta
- this.phi = phi
- this.radius = radius
- }
-
- getPos(radius = this.radius) {
- const pos = [
- radius * Math.sin(this.phi) * Math.cos(this.theta),
- radius * Math.cos(this.phi),
- radius * Math.sin(this.phi) * Math.sin(this.theta)
- ]
-
- return vec3.transformMat3(pos, pos, this.sceneRotationMatrix)
- }
-
- update() {
- // console.log(this.pos)
- const gl = this.gl;
- // Update current position
- vec3.add(this.pos, this.target, this.getPos(this.freeFly ? 1 : this.radius))
-
- // Create a lookAt view matrix
- mat4.lookAt(this.viewMatrix, this.pos, this.target, this.up)
-
- // Create a perspective projection matrix
- const aspect = gl.canvas.width / gl.canvas.height
- mat4.perspective(this.projMatrix, this.fov_y, aspect, 0.01, 1000)
-
- // Convert view and projection to target coordinate system
- // Original C++ reference: https://gitlab.inria.fr/sibr/sibr_core/-/blob/gaussian_code_release_union/src/projects/gaussianviewer/renderer/GaussianView.cpp#L464
- mat4.copy(this.mm, this.modelMatrix);
- // modelMatrix 进行反转Y轴
- // invertRow(this.mm, 1);
- mat4.multiply(this.mvm, this.viewMatrix, this.mm)
- mat4.multiply(this.mvpm, this.projMatrix, this.mvm)
-
- invertRow(this.mvm, 2)
-
- // invertRow(this.mvm, 1)
- // invertRow(this.mvpm, 1)
- // (Webgl-specific) Invert x-axis
- // invertRow(this.mvm, 0)
- // invertRow(this.mvpm, 0)
-
- // console.log('vm', this.vm);
- // console.log('pm', this.projMatrix);
-
- if (this.isWorkerInit){
- if (this.workerOn) {
- this.updateWorker();
- }
- }
- }
-
- updateByVK() {
- // Convert view and projection to target coordinate system
- // Original C++ reference: https://gitlab.inria.fr/sibr/sibr_core/-/blob/gaussian_code_release_union/src/projects/gaussianviewer/renderer/GaussianView.cpp#L464
- mat4.copy(this.mm, this.modelMatrix);
- // modelMatrix 进行反转Y轴
- // invertRow(this.mm, 1);
- mat4.multiply(this.mvm, this.viewMatrix, this.mm)
- mat4.multiply(this.mvpm, this.projMatrix, this.mvm)
-
- invertRow(this.mvm, 2)
-
- // invertRow(this.mvm, 1)
- // invertRow(this.mvpm, 1)
- // (Webgl-specific) Invert x-axis
- // invertRow(this.mvm, 0)
- // invertRow(this.mvpm, 0)
-
- // console.log('vm', this.vm);
- // console.log('pm', this.projMatrix);
-
- if (this.isWorkerInit){
- if (this.workerOn) {
- this.updateWorker();
- }
- }
- }
-
- updateWorker() {
- const worker = this.worker;
-
- // Calculate the dot product between last and current view-projection matrices
- // If they differ too much, the splats need to be sorted
- const dot = this.lastViewProjMatrix[2] * this.mvpm[2]
- + this.lastViewProjMatrix[6] * this.mvpm[6]
- + this.lastViewProjMatrix[10] * this.mvpm[10]
- if (Math.abs(dot - 1) > 0.01) {
- this.needsWorkerUpdate = true
- mat4.copy(this.lastViewProjMatrix, this.mvpm)
- }
-
- // Sort the splats as soon as the worker is available
- if (this.needsWorkerUpdate && !this.isWorkerSorting) {
- this.needsWorkerUpdate = false
- this.isWorkerSorting = true
- worker.postMessage({
- type: 'execFunc_sort',
- params: [
- {
- viewProjectionMatrix: this.mvpm
- }
- ]
- })
- }
- }
-}
-
-const invertRow = (mat, row) => {
- mat[row + 0] = -mat[row + 0]
- mat[row + 4] = -mat[row + 4]
- mat[row + 8] = -mat[row + 8]
- mat[row + 12] = -mat[row + 12]
-}
-
-// Calculate the rotation matrix that aligns v1 with v2
-// https://gist.github.com/kevinmoran/b45980723e53edeb8a5a43c49f134724
-function rotateAlign(v1, v2) {
- const axis = [
- v1[1] * v2[2] - v1[2] * v2[1],
- v1[2] * v2[0] - v1[0] * v2[2],
- v1[0] * v2[1] - v1[1] * v2[0]
- ]
-
- const cosA = v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]
- const k = 1.0 / (1.0 + cosA)
-
- const result = [
- (axis[0] * axis[0] * k) + cosA, (axis[1] * axis[0] * k) - axis[2], (axis[2] * axis[0] * k) + axis[1],
- (axis[0] * axis[1] * k) + axis[2], (axis[1] * axis[1] * k) + cosA, (axis[2] * axis[1] * k) - axis[0],
- (axis[0] * axis[2] * k) - axis[1], (axis[1] * axis[2] * k) + axis[0], (axis[2] * axis[2] * k) + cosA
- ]
-
- return result
-}
-
-export default CameraWebGL;
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/cubeInstance-webGL.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/cubeInstance-webGL.js
deleted file mode 100644
index 56aa5d0a..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/cubeInstance-webGL.js
+++ /dev/null
@@ -1,234 +0,0 @@
-const cubeVertexShader =
-`
-attribute vec4 aVertexPosition;
-attribute vec4 aVertexColor;
-
-uniform mat4 uModelMatrix;
-uniform mat4 uViewMatrix;
-uniform mat4 uProjectionMatrix;
-
-varying lowp vec4 vColor;
-
-void main(void) {
- gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * aVertexPosition;
-
- vColor = aVertexColor;
-}
-`
-
-const cubeFragmentShader =
-`
-varying lowp vec4 vColor;
-
-void main(void) {
- gl_FragColor = vColor;
-}
-`
-
-class CubeInstanceWebGL {
- constructor(gl) {
- // -- Init Program
- const shaderProgram = initShaderProgram(gl, cubeVertexShader, cubeFragmentShader)
-
- this.vao = gl.createVertexArray()
- gl.bindVertexArray(this.vao)
- this.positionBuffer = this.initVertexBuffer(gl)
- this.colorBuffer = this.initColorBuffer(gl)
- this.indices = this.initIndexBuffer(gl)
-
- this.programInfo = {
- program: shaderProgram,
- attribLocations: {
- vertexPosition: gl.getAttribLocation(shaderProgram, 'aVertexPosition'),
- vertexColor: gl.getAttribLocation(shaderProgram, 'aVertexColor'),
- },
- uniformLocations: {
- projectionMatrix: gl.getUniformLocation(shaderProgram, 'uProjectionMatrix'),
- viewMatrix: gl.getUniformLocation(shaderProgram, 'uViewMatrix'),
- modelMatrix: gl.getUniformLocation(shaderProgram, 'uModelMatrix'),
- },
- }
-
- // console.log('aVertexPosition', gl.getAttribLocation(shaderProgram, "aVertexPosition"))
- // console.log('aVertexColor', gl.getAttribLocation(shaderProgram, "aVertexColor"))
- }
-
- initVertexBuffer(gl) {
- // Create a buffer for the square's positions.
- const positionBuffer = gl.createBuffer()
-
- // Select the positionBuffer as the one to apply buffer
- // operations to from here out.
- gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer)
-
- const positions = [
- // Front face
- -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0,
-
- // Back face
- -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, -1.0,
-
- // Top face
- -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0,
-
- // Bottom face
- -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0, 1.0,
-
- // Right face
- 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0,
-
- // Left face
- -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0,
- ]
-
- // Now pass the list of positions into WebGL to build the
- // shape. We do this by creating a Float32Array from the
- // JavaScript array, then use it to fill the current buffer.
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW)
-
- return positionBuffer
- }
-
- initColorBuffer(gl) {
- const faceColors = [
- [1.0, 1.0, 1.0, 1.0], // Front face: white
- [1.0, 0.0, 0.0, 1.0], // Back face: red
- [0.0, 1.0, 0.0, 1.0], // Top face: green
- [0.0, 0.0, 1.0, 1.0], // Bottom face: blue
- [1.0, 1.0, 0.0, 1.0], // Right face: yellow
- [1.0, 0.0, 1.0, 1.0], // Left face: purple
- ]
-
- // Convert the array of colors into a table for all the vertices.
-
- let colors = []
-
- for (let j = 0; j < faceColors.length; ++j) {
- const c = faceColors[j]
- // Repeat each color four times for the four vertices of the face
- colors = colors.concat(c, c, c, c)
- }
-
- const colorBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW)
-
- return colorBuffer
- }
-
- initIndexBuffer(gl) {
- const indexBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer)
-
- // This array defines each face as two triangles, using the
- // indices into the vertex array to specify each triangle's
- // position.
-
- const indices = [
- 0,
- 1,
- 2,
- 0,
- 2,
- 3, // front
- 4,
- 5,
- 6,
- 4,
- 6,
- 7, // back
- 8,
- 9,
- 10,
- 8,
- 10,
- 11, // top
- 12,
- 13,
- 14,
- 12,
- 14,
- 15, // bottom
- 16,
- 17,
- 18,
- 16,
- 18,
- 19, // right
- 20,
- 21,
- 22,
- 20,
- 22,
- 23, // left
- ]
-
- // Now send the element array to GL
-
- gl.bufferData(
- gl.ELEMENT_ARRAY_BUFFER,
- new Uint16Array(indices),
- gl.STATIC_DRAW
- )
-
- return indexBuffer
- }
-}
-
-//
-// Initialize a shader program, so WebGL knows how to draw our data
-//
-function initShaderProgram(gl, vsSource, fsSource) {
- const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource)
- const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource)
-
- // Create the shader program
-
- const shaderProgram = gl.createProgram()
- gl.attachShader(shaderProgram, vertexShader)
- gl.attachShader(shaderProgram, fragmentShader)
- gl.linkProgram(shaderProgram)
-
- // If creating the shader program failed, alert
-
- if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
- console.error(
- `Unable to initialize the shader program: ${gl.getProgramInfoLog(
- shaderProgram
- )}`
- )
- return null
- }
-
- return shaderProgram
-}
-
-//
-// creates a shader of the given type, uploads the source and
-// compiles it.
-//
-function loadShader(gl, type, source) {
- const shader = gl.createShader(type)
-
- // Send the source to the shader object
-
- gl.shaderSource(shader, source)
-
- // Compile the shader program
-
- gl.compileShader(shader)
-
- // See if it compiled successfully
-
- if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
- console.error(
- `An error occurred compiling the shaders: ${gl.getShaderInfoLog(shader)}`
- )
- gl.deleteShader(shader)
- return null
- }
-
- return shader
-}
-
-export default CubeInstanceWebGL
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_fragment.glsl.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_fragment.glsl.js
deleted file mode 100644
index d121649d..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_fragment.glsl.js
+++ /dev/null
@@ -1,49 +0,0 @@
-export const splatFragmentShader =
-/* glsl */
-`#version 300 es
-precision mediump float;
-
-in vec3 col;
-in float scale_modif;
-in float depth;
-in vec4 con_o;
-in vec2 xy;
-in vec2 pixf;
-
-out vec4 fragColor;
-
-
-// Original CUDA implementation: https://github.com/graphdeco-inria/diff-gaussian-rasterization/blob/main/cuda_rasterizer/forward.cu#L263
-void main() {
-
- // Resample using conic matrix (cf. "Surface
- // Splatting" by Zwicker et al., 2001)
- vec2 d = xy - pixf;
- float power = -0.5 * (con_o.x * d.x * d.x + con_o.z * d.y * d.y) - con_o.y * d.x * d.y;
-
- if (power > 0.) {
- discard;
- }
-
- // (Custom) As the covariance matrix is calculated in a one-time operation on CPU in this implementation,
- // we need to apply the scale modifier differently to still allow for real-time scaling of the splats.
- power *= scale_modif;
-
- // Eq. (2) from 3D Gaussian splatting paper.
- float alpha = min(.99f, con_o.w * exp(power));
-
- // (Custom) Colorize with depth value instead of color (z-buffer visualization)
- vec3 color = col;
-
- if (alpha < 1./255.) {
- discard;
- }
-
- // Eq. (3) from 3D Gaussian splatting paper.
- fragColor = vec4(color * alpha, alpha);
-
- // fragColor = vec4(color , con_o.w);
-
- // fragColor = vec4(0.0, 0.0, 1.0, 1.0);
-}
-`
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_rt_fragment.glsl.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_rt_fragment.glsl.js
deleted file mode 100644
index 167dde76..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_rt_fragment.glsl.js
+++ /dev/null
@@ -1,15 +0,0 @@
-export const splatRTFragmentShader =
-/* glsl */
-`#version 300 es
-precision mediump float;
-
-uniform sampler2D u_splat;
-
-in vec2 v_uv;
-
-out vec4 fragColor;
-
-void main(void) {
- fragColor = texture(u_splat, v_uv);
-}
-`
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_rt_vertex.glsl.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_rt_vertex.glsl.js
deleted file mode 100644
index f811b35e..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_rt_vertex.glsl.js
+++ /dev/null
@@ -1,14 +0,0 @@
-export const splatRTVertexShader =
-/* glsl */
-`#version 300 es
-in vec3 a_pos;
-in vec2 a_texCoord;
-
-out vec2 v_uv;
-
-void main(void) {
- gl_Position = vec4(a_pos, 1.0);
-
- v_uv = a_texCoord;
-}
-`
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_vertex.glsl.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_vertex.glsl.js
deleted file mode 100644
index 78ea5cda..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/splat_vertex.glsl.js
+++ /dev/null
@@ -1,142 +0,0 @@
-export const splatVertexShader =
-/* glsl */
-`#version 300 es
-in vec3 a_center;
-in vec3 a_col;
-in float a_opacity;
-in vec3 a_covA;
-in vec3 a_covB;
-
-uniform float canvas_width;
-uniform float canvas_height;
-uniform float focal_x;
-uniform float focal_y;
-uniform float tan_fovx;
-uniform float tan_fovy;
-uniform float scale_modifier;
-uniform mat4 viewmatrix;
-uniform mat4 modelmatrix;
-uniform mat4 modelViewMatrix;
-uniform mat4 modelViewProjectMatrix;
-
-uniform vec3 boxmin;
-uniform vec3 boxmax;
-
-out vec3 col;
-out float depth;
-out float scale_modif;
-out vec4 con_o;
-out vec2 xy;
-out vec2 pixf;
-
-vec3 computeCov2D(vec3 mean, float focal_x, float focal_y, float tan_fovx, float tan_fovy, float[6] cov3D, mat4 viewmatrix) {
- vec4 t = viewmatrix * vec4(mean, 1.0);
-
- float limx = 1.3 * tan_fovx;
- float limy = 1.3 * tan_fovy;
- float txtz = t.x / t.z;
- float tytz = t.y / t.z;
- t.x = min(limx, max(-limx, txtz)) * t.z;
- t.y = min(limy, max(-limy, tytz)) * t.z;
-
- mat3 J = mat3(
- focal_x / t.z, 0, -(focal_x * t.x) / (t.z * t.z),
- 0, focal_y / t.z, -(focal_y * t.y) / (t.z * t.z),
- 0, 0, 0
- );
-
- mat3 W = mat3(
- viewmatrix[0][0], viewmatrix[1][0], viewmatrix[2][0],
- viewmatrix[0][1], viewmatrix[1][1], viewmatrix[2][1],
- viewmatrix[0][2], viewmatrix[1][2], viewmatrix[2][2]
- );
-
- mat3 T = W * J;
-
- mat3 Vrk = mat3(
- cov3D[0], cov3D[1], cov3D[2],
- cov3D[1], cov3D[3], cov3D[4],
- cov3D[2], cov3D[4], cov3D[5]
- );
-
- mat3 cov = transpose(T) * transpose(Vrk) * T;
-
- cov[0][0] += .3;
- cov[1][1] += .3;
- return vec3(cov[0][0], cov[0][1], cov[1][1]);
-}
-
-float ndc2Pix(float v, float S) {
- return ((v + 1.) * S - 1.) * .5;
-}
-
-#define hash33(p) fract(sin( (p) * mat3( 127.1,311.7,74.7 , 269.5,183.3,246.1 , 113.5,271.9,124.6) ) *43758.5453123)
-
-// Original CUDA implementation: https://github.com/graphdeco-inria/diff-gaussian-rasterization/blob/main/cuda_rasterizer/forward.cu#L156
-void main() {
- vec3 p_orig = a_center;
-
- // Transform point by projecting
- vec4 p_hom = modelViewProjectMatrix * vec4(p_orig, 1);
- float p_w = 1. / (p_hom.w + 1e-7);
- vec3 p_proj = p_hom.xyz * p_w;
-
- // Perform near culling, quit if outside.
- vec4 p_view = modelViewMatrix * vec4(p_orig, 1);
- if (p_view.z <= .1) {
- gl_Position = vec4(0, 0, 0, 1);
- return;
- }
-
-
- // (Webgl-specific) The covariance matrix is pre-computed on the CPU for faster performance
- float cov3D[6] = float[6](a_covA.x, a_covA.y, a_covA.z, a_covB.x, a_covB.y, a_covB.z);
- // computeCov3D(a_scale, scale_modifier, a_rot, cov3D);
-
- // Compute 2D screen-space covariance matrix
- vec3 cov = computeCov2D(p_orig, focal_x, focal_y, tan_fovx, tan_fovy, cov3D, modelViewMatrix);
-
- // Invert covariance (EWA algorithm)
- float det = (cov.x * cov.z - cov.y * cov.y);
- if (det == 0.) {
- gl_Position = vec4(0, 0, 0, 1);
- return;
- }
- float det_inv = 1. / det;
- vec3 conic = vec3(cov.z, -cov.y, cov.x) * det_inv;
-
- // Compute extent in screen space (by finding eigenvalues of
- // 2D covariance matrix). Use extent to compute the bounding
- // rectangle of the splat in screen space.
-
- float mid = 0.5 * (cov.x + cov.z);
- float lambda1 = mid + sqrt(max(0.1, mid * mid - det));
- float lambda2 = mid - sqrt(max(0.1, mid * mid - det));
- float my_radius = ceil(3. * sqrt(max(lambda1, lambda2)));
- vec2 point_image = vec2(ndc2Pix(p_proj.x, canvas_width), ndc2Pix(p_proj.y, canvas_height));
-
- // (Webgl-specific) As the covariance matrix is calculated as a one-time operation on CPU in this implementation,
- // we need to apply the scale modifier differently to still allow for real-time scaling of the splats.
- my_radius *= .15 + scale_modifier * .85;
- scale_modif = 1. / scale_modifier;
-
- // (Webgl-specific) Convert gl_VertexID from [0,1,2,3] to [-1,-1],[1,-1],[-1,1],[1,1]
- vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.;
- // Vertex position in screen space
- vec2 screen_pos = point_image + my_radius * corner;
-
- // Store some useful helper data for the fragment stage
- col = a_col;
- con_o = vec4(conic, a_opacity);
- xy = point_image;
- pixf = screen_pos;
- depth = p_view.z;
-
- // (Webgl-specific) Convert from screen-space to clip-space
- vec2 clip_pos = screen_pos / vec2(canvas_width, canvas_height) * 2. - 1.;
-
- gl_Position = vec4(clip_pos, 0, 1);
-
-
-}
-`
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/yuv_fragment.glsl.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/yuv_fragment.glsl.js
deleted file mode 100644
index 81c00605..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/yuv_fragment.glsl.js
+++ /dev/null
@@ -1,29 +0,0 @@
-export const YUVFragmentShader =
-/* glsl */
-`#version 300 es
-precision mediump float;
-
-uniform sampler2D u_y_texture;
-uniform sampler2D u_uv_texture;
-
-in vec2 v_uv;
-
-out vec4 fragColor;
-
-void main(void) {
- vec4 y_color = texture(u_y_texture, v_uv);
- vec4 uv_color = texture(u_uv_texture, v_uv);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- fragColor = vec4(R, G, B, 1.0);
-}
-`
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/yuv_vertex.glsl.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/yuv_vertex.glsl.js
deleted file mode 100644
index 04778b98..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/shaders/yuv_vertex.glsl.js
+++ /dev/null
@@ -1,18 +0,0 @@
-export const YUVVertexShader =
-/* glsl */
-`#version 300 es
-in vec3 a_pos;
-in vec2 a_texCoord;
-
-uniform mat3 u_displayTransform;
-
-out vec2 v_uv;
-
-void main(void) {
- vec3 p = u_displayTransform * a_pos;
-
- gl_Position = vec4(p, 1.0);
-
- v_uv = a_texCoord;
-}
-`
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/splat-webGL.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/splat-webGL.js
deleted file mode 100644
index 7bda6a5b..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/splat-webGL.js
+++ /dev/null
@@ -1,188 +0,0 @@
-import { splatVertexShader } from './shaders/splat_vertex.glsl'
-import { splatFragmentShader } from './shaders/splat_fragment.glsl'
-import { splatRTVertexShader } from './shaders/splat_rt_vertex.glsl'
-import { splatRTFragmentShader } from './shaders/splat_rt_fragment.glsl'
-
-class SplatWebGL {
- constructor(gl) {
- // Create shader program
- const program = createProgram(gl, splatVertexShader, splatFragmentShader)
-
- this.vao = gl.createVertexArray()
- gl.bindVertexArray(this.vao)
-
- const setupAttributeBuffer = (name, components) => {
- const location = gl.getAttribLocation(program, name)
- const buffer = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer)
- gl.enableVertexAttribArray(location)
- gl.vertexAttribPointer(location, components, gl.FLOAT, false, 0, 0)
- gl.vertexAttribDivisor(location, 1)
- return buffer
- }
-
- // Create attribute buffers
- const buffers = {
- color: setupAttributeBuffer('a_col', 3),
- center: setupAttributeBuffer('a_center', 3),
- opacity: setupAttributeBuffer('a_opacity', 1),
- covA: setupAttributeBuffer('a_covA', 3),
- covB: setupAttributeBuffer('a_covB', 3),
- }
-
- this.program = program
- this.buffers = buffers
- }
-}
-
-export class SplatRenderTexture {
- constructor(gl) {
- // 准备 RenderTexutre
- this.initRenderTexture(gl)
-
- // Create shader program
- const shaderProgram = createProgram(gl, splatRTVertexShader, splatRTFragmentShader)
-
- this.programInfo = {
- program: shaderProgram,
- attribLocations: {
- vertexPosition: gl.getAttribLocation(shaderProgram, 'a_pos'),
- vertexTexcoord: gl.getAttribLocation(shaderProgram, 'a_texCoord'),
- },
- uniformLocations: {
- uSplat: gl.getAttribLocation(shaderProgram, 'u_splat'),
- },
- }
-
- // init VAO
- this.initVAO(gl)
- }
-
- initRenderTexture(gl) {
- const targetTextureWidth = gl.canvas.width
- const targetTextureHeight = gl.canvas.height
- const targetTexture = gl.createTexture()
- gl.bindTexture(gl.TEXTURE_2D, targetTexture)
-
- this.renderTexture = targetTexture
-
- // 定义0级的大小和格式
- const level = 0
- const internalFormat = gl.RGBA
- const border = 0
- const format = gl.RGBA
- const type = gl.UNSIGNED_BYTE
- const data = null
- gl.texImage2D(
- gl.TEXTURE_2D,
- level,
- internalFormat,
- targetTextureWidth,
- targetTextureHeight,
- border,
- format,
- type,
- data
- )
-
- // 设置过滤,这样我们就不需要 mips
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
- 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)
-
- // 创建并绑定帧缓冲区
- const fb = gl.createFramebuffer()
- gl.bindFramebuffer(gl.FRAMEBUFFER, fb)
-
- // 将纹理附加为第一个颜色附件
- const attachmentPoint = gl.COLOR_ATTACHMENT0
- gl.framebufferTexture2D(gl.FRAMEBUFFER, attachmentPoint, gl.TEXTURE_2D, targetTexture, level)
-
- this.frameBuffer = fb
- this.rt = targetTexture
- }
-
- initVAO(gl) {
- this.vao = gl.createVertexArray()
- gl.bindVertexArray(this.vao)
-
- // positionBuffer
- const positionBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer)
- const positions = [
- -1.0, -1.0, 0.0,
- 1.0, -1.0, 0.0,
- 1.0, 1.0, 0.0,
- -1.0, 1.0, 0.0,
- ]
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW)
-
- // texCoordBuffer
- const texCoordBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer)
- // filpY
- const texCoord = [
- 0, 0,
- 1, 0,
- 1, 1,
- 0, 1
- ]
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(texCoord), gl.STATIC_DRAW)
-
- // indexBuffer
- const indexBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer)
- const indices = [
- 0,
- 1,
- 2,
- 0,
- 2,
- 3
- ]
- gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW)
-
- // Create attribute buffers
- const buffers = {
- position: positionBuffer,
- texCoord: texCoordBuffer,
- indices: indexBuffer
- }
-
- this.buffers = buffers
- }
-}
-
-// Create a program from a vertex and fragment shader
-function createProgram(gl, vertexShaderSource, fragmentShaderSource) {
- const program = gl.createProgram()
-
- const vertexShader = createShader(gl, gl.VERTEX_SHADER, vertexShaderSource)
- const fragmentShader = createShader(gl, gl.FRAGMENT_SHADER, fragmentShaderSource)
- gl.attachShader(program, vertexShader)
- gl.attachShader(program, fragmentShader)
- gl.linkProgram(program)
-
- const success = gl.getProgramParameter(program, gl.LINK_STATUS)
- if (success) return program
-
- console.log(gl.getProgramInfoLog(program))
- gl.deleteProgram(program)
-}
-
-// Create and compile a shader from source
-function createShader(gl, type, source) {
- const shader = gl.createShader(type)
- gl.shaderSource(shader, source)
- gl.compileShader(shader)
-
- const success = gl.getShaderParameter(shader, gl.COMPILE_STATUS)
-
- if (success) return shader
-
- console.log(gl.getShaderInfoLog(shader))
- gl.deleteShader(shader)
-}
-
-export default SplatWebGL
diff --git a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/yuv-webGL.js b/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/yuv-webGL.js
deleted file mode 100644
index 0475df34..00000000
--- a/miniprogram/packageAPI/pages/ar/gaussian-splatting/webgl2/yuv-webGL.js
+++ /dev/null
@@ -1,108 +0,0 @@
-import { YUVVertexShader } from './shaders/yuv_vertex.glsl'
-import { YUVFragmentShader } from './shaders/yuv_fragment.glsl'
-
-export class YUVRenderWebGL {
- constructor(gl) {
- // Create shader program
- const shaderProgram = createProgram(gl, YUVVertexShader, YUVFragmentShader)
-
- this.programInfo = {
- program: shaderProgram,
- attribLocations: {
- vertexPosition: gl.getAttribLocation(shaderProgram, 'a_pos'),
- vertexTexcoord: gl.getAttribLocation(shaderProgram, 'a_texCoord'),
- },
- uniformLocations: {
- displayTransform: gl.getUniformLocation(shaderProgram, 'u_displayTransform'),
- yTexture: gl.getUniformLocation(shaderProgram, 'u_y_texture'),
- uvTexture: gl.getUniformLocation(shaderProgram, 'u_uv_texture'),
- },
- }
-
- // init VAO
- this.initVAO(gl)
- }
-
- initVAO(gl) {
- this.vao = gl.createVertexArray()
- gl.bindVertexArray(this.vao)
-
- // positionBuffer
- const positionBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer)
- const positions = [
- -1.0, -1.0, 0.0,
- 1.0, -1.0, 0.0,
- 1.0, 1.0, 0.0,
- -1.0, 1.0, 0.0,
- ]
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW)
-
- // texCoordBuffer
- const texCoordBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer)
- // filpY
- const texCoord = [
- 0, 0,
- 1, 0,
- 1, 1,
- 0, 1
- ]
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(texCoord), gl.STATIC_DRAW)
-
- // indexBuffer
- const indexBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer)
- const indices = [
- 0,
- 1,
- 2,
- 0,
- 2,
- 3
- ]
- gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW)
-
- // Create attribute buffers
- const buffers = {
- position: positionBuffer,
- texCoord: texCoordBuffer,
- indices: indexBuffer
- }
-
- this.buffers = buffers
- }
-}
-
-// Create a program from a vertex and fragment shader
-function createProgram(gl, vertexShaderSource, fragmentShaderSource) {
- const program = gl.createProgram()
-
- const vertexShader = createShader(gl, gl.VERTEX_SHADER, vertexShaderSource)
- const fragmentShader = createShader(gl, gl.FRAGMENT_SHADER, fragmentShaderSource)
- gl.attachShader(program, vertexShader)
- gl.attachShader(program, fragmentShader)
- gl.linkProgram(program)
-
- const success = gl.getProgramParameter(program, gl.LINK_STATUS)
- if (success) return program
-
- console.log(gl.getProgramInfoLog(program))
- gl.deleteProgram(program)
-}
-
-// Create and compile a shader from source
-function createShader(gl, type, source) {
- const shader = gl.createShader(type)
- gl.shaderSource(shader, source)
- gl.compileShader(shader)
-
- const success = gl.getShaderParameter(shader, gl.COMPILE_STATUS)
-
- if (success) return shader
-
- console.log(gl.getShaderInfoLog(shader))
- gl.deleteShader(shader)
-}
-
-export default YUVRenderWebGL
diff --git a/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.js b/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.js
deleted file mode 100644
index a3ef4110..00000000
--- a/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.js
+++ /dev/null
@@ -1,235 +0,0 @@
-import arBehavior from '../behavior/behavior-ar'
-import xrFrameBehavior from '../behavior/behavior-xrframe'
-
-// VK 投影矩阵参数定义
-const NEAR = 0.01
-const FAR = 1000
-
-const loggerOnce = false
-
-Component({
- behaviors: [arBehavior, xrFrameBehavior],
- data: {
- theme: 'light',
- widthScale: 1, // canvas宽度缩放值
- heightScale: 0.8, // canvas高度缩放值
- hintBoxList: [], // 显示提示盒子列表
- },
- markerIndex: 0, // 使用的 marker 索引
- hintInfo: undefined, // 提示框信息
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
-
- methods: {
- // 对应案例的初始化逻辑,由统一的 behavior 触发
- init() {
- // 初始化VK
- // start完毕后,进行更新渲染循环
- this.initVK()
- },
- initVK() {
- // VKSession 配置
- const session = this.session = wx.createVKSession({
- track: {
- hand: {
- mode: 1
- }
- },
- version: 'v1',
- gl: this.gl
- })
-
- try {
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- // VKSession EVENT resize
- session.on('resize', () => {
- this.calcCanvasSize()
- })
-
- // 开启三维识别
- session.update3DMode({ open3d: true })
-
- // VKSession EVENT addAnchors
- session.on('addAnchors', anchors => {
- console.log('addAnchor', anchors)
- })
-
- // VKSession EVENT updateAnchors
- session.on('updateAnchors', anchors => {
- // console.log("updateAnchors", anchors);
-
- const anchor = anchors[0]
- // 目前只处理一个返回的手
- if (anchor) {
- // console.log('id', anchor.id);
- // console.log('type', anchor.type);
- // console.log('transform', anchor.transform);
- // console.log('mesh', anchor.mesh);
- // console.log('origin', anchor.origin);
- // console.log('size', anchor.size);
- // console.log('detectId', anchor.detectId);
- // console.log('confidence', anchor.confidence);
- // console.log('points3d', anchor.points3d);
-
- this.wrapTransform = anchor.transform
- this.position3D = anchor.points3d
-
- this.updateHintBoxVisble(this.hintBoxList, true)
- }
- })
-
- // VKSession removeAnchors
- // 识别目标丢失时不断触发
- session.on('removeAnchors', anchors => {
- // console.log("removeAnchors");
-
- this.updateHintBoxVisble(this.hintBoxList, false)
- })
-
- console.log('ready to initloop')
- // start 初始化完毕后,进行更新渲染循环
- this.initLoop()
- })
- } catch (e) {
- console.error(e)
- }
- },
- // 针对 xr-frame 的初始化逻辑
- async initXRFrame() {
- const xrFrameSystem = wx.getXrFrameSystem()
- const scene = this.xrScene
- const { rootShadow } = scene
-
- // 缓存主相机
- this.xrCameraMain = this.xrCamera
- this.xrCameraMainTrs = this.xrCameraTrs
-
- // 初始化YUV相机配置
- this.initXRYUVCamera()
-
- // === 初始s手挂载点 ===
- this.handWrap = scene.createElement(xrFrameSystem.XRNode)
- this.handWrapTrs = this.handWrap.getComponent(xrFrameSystem.Transform)
- rootShadow.addChild(this.handWrap)
-
- // 加载提示点
- this.hintBoxList = this.getHintBox(xrFrameSystem, scene, this.handWrap)
- },
- loop() {
- // console.log('loop')
-
- // 获取 VKFrame
- const frame = this.session.getVKFrame(this.data.width, this.data.height)
-
- // 成功获取 VKFrame 才进行
- if (!frame) { return }
-
- // 更新相机 YUV 数据
- this.updataXRYUV(frame)
-
- // 获取 VKCamera
- const VKCamera = frame.camera
-
- // 更新 xrFrame 相机矩阵
- this.updataXRCameraMatrix(VKCamera, NEAR, FAR)
-
- // 存在handWrap,执行信息同步逻辑
- if (this.handWrap && this.wrapTransform) {
- const xrFrameSystem = wx.getXrFrameSystem()
-
- if (!this.DT) { this.DT = new xrFrameSystem.Matrix4() }
- if (!this.DT2) { this.DT2 = new xrFrameSystem.Matrix4() }
-
- // 目前VK返回的是行主序矩阵
- // xrframe 矩阵存储为列主序
- this.DT.setArray(this.wrapTransform)
- this.DT.transpose(this.DT2)
- this.handWrapTrs.setLocalMatrix(this.DT2)
-
- // 更新提示点位置
- this.updateHintBoxPosition(this.hintBoxList, this.position3D)
- }
- },
- getHintBox(xrFrameSystem, scene, wrap) {
- // 初始化提示点
- const geometryHint = scene.assets.getAsset('geometry', 'sphere')
- const effectCube = scene.assets.getAsset('effect', 'standard')
- const boxScale = 0.006
- const hintBoxList = []
- for (let i = 0; i < 16; i++) {
- const colorFloat = i / 16
- const el = scene.createElement(xrFrameSystem.XRNode, {
- position: '0 0 0',
- scale: `${boxScale} ${boxScale} ${boxScale}`,
- })
- const elTrs = el.getComponent(xrFrameSystem.Transform)
- const mat = scene.createMaterial(effectCube)
-
- const colorR = 1.0 - colorFloat
- mat.setVector('u_baseColorFactor', xrFrameSystem.Vector4.createFromNumber(1.0, colorR, colorR, 1.0))
-
- const mesh = el.addComponent(xrFrameSystem.Mesh, {
- geometry: geometryHint,
- material: mat,
- })
-
- wrap.addChild(el)
- elTrs.visible = false
-
- hintBoxList.push(elTrs)
- }
-
- return hintBoxList
- },
- updateHintBoxPosition(hintBoxList, points3d) {
- if (hintBoxList && hintBoxList.length > 0) {
- // console.log('ready to set', hintBoxList);
- // 存在提示列表,则更新点信息
- for (let i = 0; i < hintBoxList.length; i++) {
- const hintBox = hintBoxList[i]
- hintBox.position.x = points3d[i].x
- hintBox.position.y = points3d[i].y
- hintBox.position.z = points3d[i].z
- }
- }
- },
- updateHintBoxVisble(hintBoxList, visible) {
- if (hintBoxList && hintBoxList.length > 0) {
- // console.log('ready to set', hintBoxList);
- // 存在提示列表,则更新点信息
- for (let i = 0; i < hintBoxList.length; i++) {
- const hintBox = hintBoxList[i]
- if (hintBox.visible !== visible) {
- hintBox.visible = visible
- }
- }
- }
- }
-
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.json b/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.json
deleted file mode 100644
index f2e25a2a..00000000
--- a/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "usingComponents": {
- "xr-frame-canvas": "../components/xr-frame/index"
- },
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "人手三维识别"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.wxml b/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.wxml
deleted file mode 100644
index 847d7a14..00000000
--- a/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.wxml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 提示:摄像头对准手,然后会显示16个关键点的三维坐标提示小球
-
-
-
diff --git a/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.wxss b/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.wxss
deleted file mode 100644
index 4c1b5153..00000000
--- a/miniprogram/packageAPI/pages/ar/hand-detect-3d/hand-detect-3d.wxss
+++ /dev/null
@@ -1,70 +0,0 @@
-.canvas-wrap {
- position: relative;
- width: 100%;
- background-color: #000;
-}
-
-.canvas-wrap canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.canvas-wrap #canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-
-.hint-bottom {
- position: absolute;
- left: 20px;
- right: 20px;
- bottom: 20px;
- padding: 5px 10px;
- font-size: 14px;
- color: #fff;
- background-color: rgba(0, 0, 0, 0.4);
- border-radius: 6px;
-}
-
-.hint-bottom .btn-wrap {
- display: flex;
-}
-
-.hint-bottom .btn{
- margin: 10px 5px;
- font-size: 14px;
- line-height: 18px;
-}
-.wrap-option {
- position: absolute;
- left: 20rpx;
- right: 0;
- bottom: 20rpx;
- height: 10%;
- display: flex;
-}
-
-.wrap-option button {
- flex: 1;
- margin: 20rpx 20rpx 20rpx 0;
- font-size: 30rpx;
- line-height: 1.2;
-}
-
-.hint-bottom .btn-wrap {
- display: flex;
-}
-
-.hint-bottom .btn{
- flex: 1;
- margin: 10px 5px;
- font-size: 18px;
- line-height: 24px;
-}
diff --git a/miniprogram/packageAPI/pages/ar/hand-detect/behavior.js b/miniprogram/packageAPI/pages/ar/hand-detect/behavior.js
deleted file mode 100644
index b24d6cf5..00000000
--- a/miniprogram/packageAPI/pages/ar/hand-detect/behavior.js
+++ /dev/null
@@ -1,201 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- cameraPosition: 0
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 3
- },
- hand: {
- mode: 1
- }
- },
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- session.on('addAnchors', anchors => {
- this.data.anchor2DList = anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size
- }))
- })
-
- session.on('updateAnchors', anchors => {
- this.data.anchor2DList = []
- // 摄像头实时检测人脸的时候 updateAnchors 会在每帧触发,所以性能要求更高,用 gl 画
- this.data.anchor2DList = this.data.anchor2DList.concat(anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size
- })))
- })
-
- session.on('removeAnchors', anchors => {
- this.data.anchor2DList = []
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/hand-detect/hand-detect.js b/miniprogram/packageAPI/pages/ar/hand-detect/hand-detect.js
deleted file mode 100644
index a1671252..00000000
--- a/miniprogram/packageAPI/pages/ar/hand-detect/hand-detect.js
+++ /dev/null
@@ -1,308 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-// 顶点着色器
-const VSHADER_SOURCE = '' +
- 'attribute vec4 a_Position;\n' + // 声明attribute变量a_Position,用来存放顶点位置信息
- 'void main(){\n' +
- ' gl_Position = a_Position;\n' + // 将顶点坐标赋值给顶点着色器内置变量gl_Position
- ' gl_PointSize = 4.0;\n' + // 设置顶点大小
- '}\n'
-
-// 片元着色器
-const FSHADER_SOURCE = '' +
- '#ifdef GL_ES\n' +
- ' precision mediump float;\n' + // 设置精度
- '#endif\n' +
- 'varying vec4 v_Color;\n' + // 声明varying变量v_Color,用来接收顶点着色器传送的片元颜色信息
- 'void main(){\n' +
- ' float d = distance(gl_PointCoord, vec2(0.5, 0.5));\n' + // 计算像素距离中心点的距离
- ' if(d < 0.5) {\n' + // 距离大于0.5放弃片元,小于0.5保留片元
- ' gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n' +
- ' } else { discard; }\n' +
- '}\n'
-
-// 初始化着色器函数
-let initShadersDone = false
-
-function initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE) {
- // 创建顶点着色器对象
- const vertexShader = loadShader(gl, gl.VERTEX_SHADER, VSHADER_SOURCE)
- // 创建片元着色器对象
- const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, FSHADER_SOURCE)
-
- if (!vertexShader || !fragmentShader) {
- return null
- }
-
- // 创建程序对象program
- const program = gl.createProgram()
- if (!gl.createProgram()) {
- return null
- }
- // 分配顶点着色器和片元着色器到program
- gl.attachShader(program, vertexShader)
- gl.attachShader(program, fragmentShader)
- // 链接program
- gl.linkProgram(program)
-
- // 检查程序对象是否连接成功
- const linked = gl.getProgramParameter(program, gl.LINK_STATUS)
- if (!linked) {
- const error = gl.getProgramInfoLog(program)
- console.log('程序对象连接失败: ' + error)
- gl.deleteProgram(program)
- gl.deleteShader(fragmentShader)
- gl.deleteShader(vertexShader)
- return null
- }
- // 返回程序program对象
- initShadersDone = true
- return program
-}
-
-function loadShader(gl, type, source) {
- // 创建顶点着色器对象
- const shader = gl.createShader(type)
- if (shader == null) {
- console.log('创建着色器失败')
- return null
- }
-
- // 引入着色器源代码
- gl.shaderSource(shader, source)
-
- // 编译着色器
- gl.compileShader(shader)
-
- // 检查顶是否编译成功
- const compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS)
- if (!compiled) {
- const error = gl.getShaderInfoLog(shader)
- console.log('编译着色器失败: ' + error)
- gl.deleteShader(shader)
- return null
- }
-
- return shader
-}
-
-// 初始化顶点坐标和顶点颜色
-function initVertexBuffers(gl, anchor2DList) {
- const flattenPoints = []
- anchor2DList.forEach(anchor => {
- anchor.points.forEach(point => {
- const {
- x,
- y
- } = point
- flattenPoints.push(x * 2 - 1, 1 - y * 2)
- })
- })
-
- const vertices = new Float32Array(flattenPoints)
- const n = flattenPoints.length / 2
-
- // 创建缓冲区对象
- const buffer = gl.createBuffer()
- // 将顶点坐标和顶点颜色信息写入缓冲区对象
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer)
- gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW)
-
- // 获取顶点着色器attribute变量a_Position存储地址, 分配缓存并开启
- const a_Position = gl.getAttribLocation(gl.program, 'a_Position')
- gl.vertexAttribPointer(a_Position, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(a_Position)
- return n
-}
-
-const EDGE_VSHADER_SOURCE =
- `
- attribute vec2 aPosition;
- varying vec2 posJudge;
-
- void main(void) {
- gl_Position = vec4(aPosition.x, aPosition.y, 1.0, 1.0);
- posJudge = aPosition;
- }
-`
-
-const EDGE_FSHADER_SOURCE =
- `
- precision highp float;
- uniform vec2 rightTopPoint;
- uniform vec2 centerPoint;
- varying vec2 posJudge;
-
- float box(float x, float y){
- float xc = x - centerPoint.x;
- float yc = y - centerPoint.y;
- vec2 point = vec2(xc, yc);
- float right = rightTopPoint.x;
- float top = rightTopPoint.y;
- float line_width = 0.01;
- vec2 b1 = 1.0 - step(vec2(right,top), abs(point));
- float outer = b1.x * b1.y;
- vec2 b2 = 1.0 - step(vec2(right-line_width,top-line_width), abs(point));
- float inner = b2.x * b2.y;
- return outer - inner;
- }
-
- void main(void) {
- if(box(posJudge.x, posJudge.y) == 0.0 ) discard;
-
- gl_FragColor = vec4(box(posJudge.x, posJudge.y), 0.0, 0.0, 1.0);
-
- }
-`
-
-function initRectEdgeBuffer(gl, x, y, width, height) {
- const shaderProgram = gl.program
- const centerX = x * 2 - 1 + width
- const centerY = -1 * (y * 2 - 1) - height
- const right = width
- const top = height
- const vertices = [
- -1.0, 1.0,
- -1.0, -1.0,
- 1.0, 1.0,
- 1.0, -1.0
- ]
-
- const vertexBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW)
- const aPosition = gl.getAttribLocation(shaderProgram, 'aPosition')
- gl.enableVertexAttribArray(aPosition)
- gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, 0, 0)
-
- const rightTop = [
- right, top
- ]
- const rightTopLoc = gl.getUniformLocation(shaderProgram, 'rightTopPoint')
- gl.uniform2fv(rightTopLoc, rightTop)
-
- const centerPoint = [
- centerX, centerY
- ]
- const centerPointLoc = gl.getUniformLocation(shaderProgram, 'centerPoint')
- gl.uniform2fv(centerPointLoc, centerPoint)
-
- const length = vertices.length / 2
-
- return length
-}
-
-function onDrawRectEdge(gl, x, y, width, height) {
- width = Math.round(width * 100) / 100
- height = Math.round(height * 100) / 100
- const n = initRectEdgeBuffer(gl, x, y, width, height)
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, n)
-}
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- initShadersDone = false
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({
- theme
- }) => {
- this.setData({
- theme
- })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- },
- switchCamera(event) {
- if (this.session.config) {
- const config = this.session.config
- const pos = Number(event.currentTarget.dataset.value)
- config.cameraPosition = pos
- this.session.config = config
- this.setData({
- cameraPosition: event.currentTarget.dataset.value
- })
- }
- },
- render(frame) {
- const gl = this.gl
-
- this.renderGL(frame)
-
- const camera = frame.camera
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
-
- const anchor2DList = this.data.anchor2DList
-
- if (!anchor2DList || anchor2DList.length <= 0) {
-
- } else {
- if (!initShadersDone) {
- this.vertexProgram = initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE)
- this.rectEdgeProgram = initShaders(gl, EDGE_VSHADER_SOURCE, EDGE_FSHADER_SOURCE)
- if (!this.vertexProgram || !this.rectEdgeProgram) {
- console.log('初始化着色器失败')
- return
- }
- console.log('初始化着色器成功')
- }
-
- gl.useProgram(this.vertexProgram)
- gl.program = this.vertexProgram
- // 初始化顶点坐标和顶点颜色
- const n = initVertexBuffers(gl, anchor2DList)
-
- // 绘制点
- gl.drawArrays(gl.POINTS, 0, n)
-
- gl.useProgram(this.rectEdgeProgram)
- gl.program = this.rectEdgeProgram
-
- for (let i = 0; i < anchor2DList.length; i++) {
- onDrawRectEdge(gl, anchor2DList[i].origin.x, anchor2DList[i].origin.y, anchor2DList[i].size.width, anchor2DList[i].size.height)
- }
- }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/hand-detect/hand-detect.json b/miniprogram/packageAPI/pages/ar/hand-detect/hand-detect.json
deleted file mode 100644
index 88f4016f..00000000
--- a/miniprogram/packageAPI/pages/ar/hand-detect/hand-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "实时手势检测"
-}
diff --git a/miniprogram/packageAPI/pages/ar/hand-detect/hand-detect.wxml b/miniprogram/packageAPI/pages/ar/hand-detect/hand-detect.wxml
deleted file mode 100644
index 7a811a03..00000000
--- a/miniprogram/packageAPI/pages/ar/hand-detect/hand-detect.wxml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
- 提示:将摄像头对准手部, 检测到的手部将会被标记出识别框和手部标记点
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/hand-detect/hand-detect.wxss b/miniprogram/packageAPI/pages/ar/hand-detect/hand-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/hand-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/hand-detect/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/hand-detect/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/loaders/gltf-clone.js b/miniprogram/packageAPI/pages/ar/loaders/gltf-clone.js
deleted file mode 100644
index 01b135e0..00000000
--- a/miniprogram/packageAPI/pages/ar/loaders/gltf-clone.js
+++ /dev/null
@@ -1,44 +0,0 @@
-export default function (gltf, THREE) {
- const clone = {
- animations: gltf.animations,
- scene: gltf.scene.clone(true)
- }
-
- const skinnedMeshes = {}
-
- gltf.scene.traverse(node => {
- if (node.isSkinnedMesh) {
- skinnedMeshes[node.name] = node
- }
- })
-
- const cloneBones = {}
- const cloneSkinnedMeshes = {}
-
- clone.scene.traverse(node => {
- if (node.isBone) {
- cloneBones[node.name] = node
- }
-
- if (node.isSkinnedMesh) {
- cloneSkinnedMeshes[node.name] = node
- }
- })
-
- for (const name in skinnedMeshes) {
- const skinnedMesh = skinnedMeshes[name]
- const skeleton = skinnedMesh.skeleton
- const cloneSkinnedMesh = cloneSkinnedMeshes[name]
-
- const orderedCloneBones = []
-
- for (let i = 0; i < skeleton.bones.length; ++i) {
- const cloneBone = cloneBones[skeleton.bones[i].name]
- orderedCloneBones.push(cloneBone)
- }
-
- cloneSkinnedMesh.bind(new THREE.Skeleton(orderedCloneBones, skeleton.boneInverses), cloneSkinnedMesh.matrixWorld)
- }
-
- return clone
-}
diff --git a/miniprogram/packageAPI/pages/ar/loaders/gltf-loader.js b/miniprogram/packageAPI/pages/ar/loaders/gltf-loader.js
deleted file mode 100644
index a8b9d75b..00000000
--- a/miniprogram/packageAPI/pages/ar/loaders/gltf-loader.js
+++ /dev/null
@@ -1,1647 +0,0 @@
-export function registerGLTFLoader(THREE) {
- THREE.GLTFLoader = (function () {
- function GLTFLoader() {
- this.manager = THREE.DefaultLoadingManager
- this.dracoLoader = null
- this.ddsLoader = null
- }
- GLTFLoader.prototype = {
- constructor: GLTFLoader,
- crossOrigin: 'anonymous',
- load(url, onLoad) {
- const scope = this
- let resourcePath
- if (this.resourcePath !== undefined) {
- resourcePath = this.resourcePath
- } else if (this.path !== undefined) {
- resourcePath = this.path
- } else {
- resourcePath = THREE.LoaderUtils.extractUrlBase(url)
- }
- scope.manager.itemStart(url)
- const _onError = function (e) {
- console.error(e)
- scope.manager.itemError(url)
- scope.manager.itemEnd(url)
- }
- const loader = new THREE.FileLoader(scope.manager)
- loader.setPath(this.path)
- loader.setResponseType('arraybuffer')
- loader.load(
- url,
- function (data) {
- try {
- scope.parse(
- data,
- resourcePath,
- function (gltf) {
- onLoad(gltf)
- scope.manager.itemEnd(url)
- },
- _onError
- )
- } catch (e) {
- _onError(e)
- }
- },
- null,
- _onError
- )
- },
- parse(data, path, onLoad, onError) {
- let content
- const extensions = {}
- if (typeof data === 'string') {
- content = data
- } else {
- const magic = THREE.LoaderUtils.decodeText(new Uint8Array(data, 0, 4))
- if (magic === BINARY_EXTENSION_HEADER_MAGIC) {
- try {
- extensions[EXTENSIONS.KHR_BINARY_GLTF] = new GLTFBinaryExtension(data)
- } catch (error) {
- if (onError) onError(error)
- return
- }
- content = extensions[EXTENSIONS.KHR_BINARY_GLTF].content
- } else {
- content = THREE.LoaderUtils.decodeText(new Uint8Array(data))
- }
- }
- const json = JSON.parse(content)
- if (json.asset === undefined || json.asset.version[0] < 2) {
- if (onError) onError(new Error('THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead.'))
- return
- }
- if (json.extensionsUsed) {
- for (let i = 0; i < json.extensionsUsed.length; ++i) {
- const extensionName = json.extensionsUsed[i]
- const extensionsRequired = json.extensionsRequired || []
- switch (extensionName) {
- case EXTENSIONS.KHR_LIGHTS_PUNCTUAL:
- extensions[extensionName] = new GLTFLightsExtension(json)
- break
- case EXTENSIONS.KHR_MATERIALS_UNLIT:
- extensions[extensionName] = new GLTFMaterialsUnlitExtension()
- break
- case EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:
- extensions[extensionName] = new GLTFMaterialsPbrSpecularGlossinessExtension()
- break
- case EXTENSIONS.KHR_DRACO_MESH_COMPRESSION:
- extensions[extensionName] = new GLTFDracoMeshCompressionExtension(json, this.dracoLoader)
- break
- case EXTENSIONS.MSFT_TEXTURE_DDS:
- extensions[EXTENSIONS.MSFT_TEXTURE_DDS] = new GLTFTextureDDSExtension(this.ddsLoader)
- break
- case EXTENSIONS.KHR_TEXTURE_TRANSFORM:
- extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM] = new GLTFTextureTransformExtension()
- break
- default:
- if (extensionsRequired.indexOf(extensionName) >= 0) {
- console.warn('THREE.GLTFLoader: Unknown extension "' + extensionName + '".')
- }
- }
- }
- }
- const parser = new GLTFParser(json, extensions, {
- path: path || this.resourcePath || '',
- crossOrigin: this.crossOrigin,
- manager: this.manager
- })
- parser.parse(onLoad, onError)
- }
- }
- function GLTFRegistry() {
- let objects = {}
- return {
- get(key) {
- return objects[key]
- },
- add(key, object) {
- objects[key] = object
- },
- remove(key) {
- delete objects[key]
- },
- removeAll() {
- objects = {}
- }
- }
- }
- var EXTENSIONS = {
- KHR_BINARY_GLTF: 'KHR_binary_glTF',
- KHR_DRACO_MESH_COMPRESSION: 'KHR_draco_mesh_compression',
- KHR_LIGHTS_PUNCTUAL: 'KHR_lights_punctual',
- KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: 'KHR_materials_pbrSpecularGlossiness',
- KHR_MATERIALS_UNLIT: 'KHR_materials_unlit',
- KHR_TEXTURE_TRANSFORM: 'KHR_texture_transform',
- MSFT_TEXTURE_DDS: 'MSFT_texture_dds'
- }
- function GLTFTextureDDSExtension(ddsLoader) {
- if (!ddsLoader) {
- throw new Error('THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader')
- }
- this.name = EXTENSIONS.MSFT_TEXTURE_DDS
- this.ddsLoader = ddsLoader
- }
- function GLTFLightsExtension(json) {
- this.name = EXTENSIONS.KHR_LIGHTS_PUNCTUAL
- const extension = (json.extensions && json.extensions[EXTENSIONS.KHR_LIGHTS_PUNCTUAL]) || {}
- this.lightDefs = extension.lights || []
- }
- GLTFLightsExtension.prototype.loadLight = function (lightIndex) {
- const lightDef = this.lightDefs[lightIndex]
- let lightNode
- const color = new THREE.Color(0xffffff)
- if (lightDef.color !== undefined) color.fromArray(lightDef.color)
- const range = lightDef.range !== undefined ? lightDef.range : 0
- switch (lightDef.type) {
- case 'directional':
- lightNode = new THREE.DirectionalLight(color)
- lightNode.target.position.set(0, 0, -1)
- lightNode.add(lightNode.target)
- break
- case 'point':
- lightNode = new THREE.PointLight(color)
- lightNode.distance = range
- break
- case 'spot':
- lightNode = new THREE.SpotLight(color)
- lightNode.distance = range
- lightDef.spot = lightDef.spot || {}
- lightDef.spot.innerConeAngle = lightDef.spot.innerConeAngle !== undefined ? lightDef.spot.innerConeAngle : 0
- lightDef.spot.outerConeAngle = lightDef.spot.outerConeAngle !== undefined ? lightDef.spot.outerConeAngle : Math.PI / 4.0
- lightNode.angle = lightDef.spot.outerConeAngle
- lightNode.penumbra = 1.0 - lightDef.spot.innerConeAngle / lightDef.spot.outerConeAngle
- lightNode.target.position.set(0, 0, -1)
- lightNode.add(lightNode.target)
- break
- default:
- throw new Error('THREE.GLTFLoader: Unexpected light type, "' + lightDef.type + '".')
- }
- lightNode.position.set(0, 0, 0)
- lightNode.decay = 2
- if (lightDef.intensity !== undefined) lightNode.intensity = lightDef.intensity
- lightNode.name = lightDef.name || ('light_' + lightIndex)
- return Promise.resolve(lightNode)
- }
- function GLTFMaterialsUnlitExtension() {
- this.name = EXTENSIONS.KHR_MATERIALS_UNLIT
- }
- GLTFMaterialsUnlitExtension.prototype.getMaterialType = function () {
- return THREE.MeshBasicMaterial
- }
- GLTFMaterialsUnlitExtension.prototype.extendParams = function (materialParams, materialDef, parser) {
- const pending = []
- materialParams.color = new THREE.Color(1.0, 1.0, 1.0)
- materialParams.opacity = 1.0
- const metallicRoughness = materialDef.pbrMetallicRoughness
- if (metallicRoughness) {
- if (Array.isArray(metallicRoughness.baseColorFactor)) {
- const array = metallicRoughness.baseColorFactor
- materialParams.color.fromArray(array)
- materialParams.opacity = array[3]
- }
- if (metallicRoughness.baseColorTexture !== undefined) {
- pending.push(parser.assignTexture(materialParams, 'map', metallicRoughness.baseColorTexture))
- }
- }
- return Promise.all(pending)
- }
- var BINARY_EXTENSION_HEADER_MAGIC = 'glTF'
- const BINARY_EXTENSION_HEADER_LENGTH = 12
- const BINARY_EXTENSION_CHUNK_TYPES = {
- JSON: 0x4E4F534A,
- BIN: 0x004E4942
- }
- function GLTFBinaryExtension(data) {
- this.name = EXTENSIONS.KHR_BINARY_GLTF
- this.content = null
- this.body = null
- const headerView = new DataView(data, 0, BINARY_EXTENSION_HEADER_LENGTH)
- this.header = {
- magic: THREE.LoaderUtils.decodeText(new Uint8Array(data.slice(0, 4))),
- version: headerView.getUint32(4, true),
- length: headerView.getUint32(8, true)
- }
- if (this.header.magic !== BINARY_EXTENSION_HEADER_MAGIC) {
- throw new Error('THREE.GLTFLoader: Unsupported glTF-Binary header.')
- } else if (this.header.version < 2.0) {
- throw new Error('THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.')
- }
- const chunkView = new DataView(data, BINARY_EXTENSION_HEADER_LENGTH)
- let chunkIndex = 0
- while (chunkIndex < chunkView.byteLength) {
- const chunkLength = chunkView.getUint32(chunkIndex, true)
- chunkIndex += 4
- const chunkType = chunkView.getUint32(chunkIndex, true)
- chunkIndex += 4
- if (chunkType === BINARY_EXTENSION_CHUNK_TYPES.JSON) {
- const contentArray = new Uint8Array(data, BINARY_EXTENSION_HEADER_LENGTH + chunkIndex, chunkLength)
- this.content = THREE.LoaderUtils.decodeText(contentArray)
- } else if (chunkType === BINARY_EXTENSION_CHUNK_TYPES.BIN) {
- const byteOffset = BINARY_EXTENSION_HEADER_LENGTH + chunkIndex
- this.body = data.slice(byteOffset, byteOffset + chunkLength)
- }
- chunkIndex += chunkLength
- }
- if (this.content === null) {
- throw new Error('THREE.GLTFLoader: JSON content not found.')
- }
- }
- function GLTFDracoMeshCompressionExtension(json, dracoLoader) {
- if (!dracoLoader) {
- throw new Error('THREE.GLTFLoader: No DRACOLoader instance provided.')
- }
- this.name = EXTENSIONS.KHR_DRACO_MESH_COMPRESSION
- this.json = json
- this.dracoLoader = dracoLoader
- }
- GLTFDracoMeshCompressionExtension.prototype.decodePrimitive = function (primitive, parser) {
- const json = this.json
- const dracoLoader = this.dracoLoader
- const bufferViewIndex = primitive.extensions[this.name].bufferView
- const gltfAttributeMap = primitive.extensions[this.name].attributes
- const threeAttributeMap = {}
- const attributeNormalizedMap = {}
- const attributeTypeMap = {}
- for (var attributeName in gltfAttributeMap) {
- var threeAttributeName = ATTRIBUTES[attributeName] || attributeName.toLowerCase()
- threeAttributeMap[threeAttributeName] = gltfAttributeMap[attributeName]
- }
- for (attributeName in primitive.attributes) {
- var threeAttributeName = ATTRIBUTES[attributeName] || attributeName.toLowerCase()
- if (gltfAttributeMap[attributeName] !== undefined) {
- const accessorDef = json.accessors[primitive.attributes[attributeName]]
- const componentType = WEBGL_COMPONENT_TYPES[accessorDef.componentType]
- attributeTypeMap[threeAttributeName] = componentType
- attributeNormalizedMap[threeAttributeName] = accessorDef.normalized === true
- }
- }
- return parser.getDependency('bufferView', bufferViewIndex).then(function (bufferView) {
- return new Promise(function (resolve) {
- dracoLoader.decodeDracoFile(
- bufferView,
- function (geometry) {
- for (const attributeName in geometry.attributes) {
- const attribute = geometry.attributes[attributeName]
- const normalized = attributeNormalizedMap[attributeName]
- if (normalized !== undefined) attribute.normalized = normalized
- }
- resolve(geometry)
- },
- threeAttributeMap,
- attributeTypeMap
- )
- })
- })
- }
- function GLTFTextureTransformExtension() {
- this.name = EXTENSIONS.KHR_TEXTURE_TRANSFORM
- }
- GLTFTextureTransformExtension.prototype.extendTexture = function (texture, transform) {
- texture = texture.clone()
- if (transform.offset !== undefined) {
- texture.offset.fromArray(transform.offset)
- }
- if (transform.rotation !== undefined) {
- texture.rotation = transform.rotation
- }
- if (transform.scale !== undefined) {
- texture.repeat.fromArray(transform.scale)
- }
- if (transform.texCoord !== undefined) {
- console.warn('THREE.GLTFLoader: Custom UV sets in "' + this.name + '" extension not yet supported.')
- }
- texture.needsUpdate = true
- return texture
- }
- function GLTFMaterialsPbrSpecularGlossinessExtension() {
- return {
- name: EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,
- specularGlossinessParams: ['color', 'map', 'lightMap', 'lightMapIntensity', 'aoMap', 'aoMapIntensity', 'emissive', 'emissiveIntensity', 'emissiveMap', 'bumpMap', 'bumpScale', 'normalMap', 'displacementMap', 'displacementScale', 'displacementBias', 'specularMap', 'specular', 'glossinessMap', 'glossiness', 'alphaMap', 'envMap', 'envMapIntensity', 'refractionRatio'],
- getMaterialType() {
- return THREE.ShaderMaterial
- },
- extendParams(materialParams, materialDef, parser) {
- const pbrSpecularGlossiness = materialDef.extensions[this.name]
- const shader = THREE.ShaderLib.standard
- const uniforms = THREE.UniformsUtils.clone(shader.uniforms)
- const specularMapParsFragmentChunk = ['#ifdef USE_SPECULARMAP', ' uniform sampler2D specularMap;', '#endif'].join('\n')
- const glossinessMapParsFragmentChunk = ['#ifdef USE_GLOSSINESSMAP', ' uniform sampler2D glossinessMap;', '#endif'].join('\n')
- const specularMapFragmentChunk = ['vec3 specularFactor = specular;', '#ifdef USE_SPECULARMAP', ' vec4 texelSpecular = texture2D( specularMap, vUv );', ' texelSpecular = sRGBToLinear( texelSpecular );', ' // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture', ' specularFactor *= texelSpecular.rgb;', '#endif'].join('\n')
- const glossinessMapFragmentChunk = ['float glossinessFactor = glossiness;', '#ifdef USE_GLOSSINESSMAP', ' vec4 texelGlossiness = texture2D( glossinessMap, vUv );', ' // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture', ' glossinessFactor *= texelGlossiness.a;', '#endif'].join('\n')
- const lightPhysicalFragmentChunk = ['PhysicalMaterial material;', 'material.diffuseColor = diffuseColor.rgb;', 'material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );', 'material.specularColor = specularFactor.rgb;'].join('\n')
- const fragmentShader = shader.fragmentShader.replace('uniform float roughness;', 'uniform vec3 specular;').replace('uniform float metalness;', 'uniform float glossiness;').replace('#include ', specularMapParsFragmentChunk).replace('#include ', glossinessMapParsFragmentChunk)
- .replace('#include ', specularMapFragmentChunk)
- .replace('#include ', glossinessMapFragmentChunk)
- .replace('#include ', lightPhysicalFragmentChunk)
- delete uniforms.roughness
- delete uniforms.metalness
- delete uniforms.roughnessMap
- delete uniforms.metalnessMap
- uniforms.specular = {
- value: new THREE.Color().setHex(0x111111)
- }
- uniforms.glossiness = {
- value: 0.5
- }
- uniforms.specularMap = {
- value: null
- }
- uniforms.glossinessMap = {
- value: null
- }
- materialParams.vertexShader = shader.vertexShader
- materialParams.fragmentShader = fragmentShader
- materialParams.uniforms = uniforms
- materialParams.defines = {
- STANDARD: ''
- }
- materialParams.color = new THREE.Color(1.0, 1.0, 1.0)
- materialParams.opacity = 1.0
- const pending = []
- if (Array.isArray(pbrSpecularGlossiness.diffuseFactor)) {
- const array = pbrSpecularGlossiness.diffuseFactor
- materialParams.color.fromArray(array)
- materialParams.opacity = array[3]
- }
- if (pbrSpecularGlossiness.diffuseTexture !== undefined) {
- pending.push(parser.assignTexture(materialParams, 'map', pbrSpecularGlossiness.diffuseTexture))
- }
- materialParams.emissive = new THREE.Color(0.0, 0.0, 0.0)
- materialParams.glossiness = pbrSpecularGlossiness.glossinessFactor !== undefined ? pbrSpecularGlossiness.glossinessFactor : 1.0
- materialParams.specular = new THREE.Color(1.0, 1.0, 1.0)
- if (Array.isArray(pbrSpecularGlossiness.specularFactor)) {
- materialParams.specular.fromArray(pbrSpecularGlossiness.specularFactor)
- }
- if (pbrSpecularGlossiness.specularGlossinessTexture !== undefined) {
- const specGlossMapDef = pbrSpecularGlossiness.specularGlossinessTexture
- pending.push(parser.assignTexture(materialParams, 'glossinessMap', specGlossMapDef))
- pending.push(parser.assignTexture(materialParams, 'specularMap', specGlossMapDef))
- }
- return Promise.all(pending)
- },
- createMaterial(params) {
- const material = new THREE.ShaderMaterial({
- defines: params.defines,
- vertexShader: params.vertexShader,
- fragmentShader: params.fragmentShader,
- uniforms: params.uniforms,
- fog: true,
- lights: true,
- opacity: params.opacity,
- transparent: params.transparent
- })
- material.isGLTFSpecularGlossinessMaterial = true
- material.color = params.color
- material.map = params.map === undefined ? null : params.map
- material.lightMap = null
- material.lightMapIntensity = 1.0
- material.aoMap = params.aoMap === undefined ? null : params.aoMap
- material.aoMapIntensity = 1.0
- material.emissive = params.emissive
- material.emissiveIntensity = 1.0
- material.emissiveMap = params.emissiveMap === undefined ? null : params.emissiveMap
- material.bumpMap = params.bumpMap === undefined ? null : params.bumpMap
- material.bumpScale = 1
- material.normalMap = params.normalMap === undefined ? null : params.normalMap
- if (params.normalScale) material.normalScale = params.normalScale
- material.displacementMap = null
- material.displacementScale = 1
- material.displacementBias = 0
- material.specularMap = params.specularMap === undefined ? null : params.specularMap
- material.specular = params.specular
- material.glossinessMap = params.glossinessMap === undefined ? null : params.glossinessMap
- material.glossiness = params.glossiness
- material.alphaMap = null
- material.envMap = params.envMap === undefined ? null : params.envMap
- material.envMapIntensity = 1.0
- material.refractionRatio = 0.98
- material.extensions.derivatives = true
- return material
- },
- cloneMaterial(source) {
- const target = source.clone()
- target.isGLTFSpecularGlossinessMaterial = true
- const params = this.specularGlossinessParams
- for (let i = 0,
- il = params.length; i < il; i++) {
- const value = source[params[i]]
- target[params[i]] = (value && value.isColor) ? value.clone() : value
- }
- return target
- },
- refreshUniforms(renderer, scene, camera, geometry, material) {
- if (material.isGLTFSpecularGlossinessMaterial !== true) {
- return
- }
- const uniforms = material.uniforms
- const defines = material.defines
- uniforms.opacity.value = material.opacity
- uniforms.diffuse.value.copy(material.color)
- uniforms.emissive.value.copy(material.emissive).multiplyScalar(material.emissiveIntensity)
- uniforms.map.value = material.map
- uniforms.specularMap.value = material.specularMap
- uniforms.alphaMap.value = material.alphaMap
- uniforms.lightMap.value = material.lightMap
- uniforms.lightMapIntensity.value = material.lightMapIntensity
- uniforms.aoMap.value = material.aoMap
- uniforms.aoMapIntensity.value = material.aoMapIntensity
- let uvScaleMap
- if (material.map) {
- uvScaleMap = material.map
- } else if (material.specularMap) {
- uvScaleMap = material.specularMap
- } else if (material.displacementMap) {
- uvScaleMap = material.displacementMap
- } else if (material.normalMap) {
- uvScaleMap = material.normalMap
- } else if (material.bumpMap) {
- uvScaleMap = material.bumpMap
- } else if (material.glossinessMap) {
- uvScaleMap = material.glossinessMap
- } else if (material.alphaMap) {
- uvScaleMap = material.alphaMap
- } else if (material.emissiveMap) {
- uvScaleMap = material.emissiveMap
- }
- if (uvScaleMap !== undefined) {
- if (uvScaleMap.isWebGLRenderTarget) {
- uvScaleMap = uvScaleMap.texture
- }
- if (uvScaleMap.matrixAutoUpdate === true) {
- uvScaleMap.updateMatrix()
- }
- uniforms.uvTransform.value.copy(uvScaleMap.matrix)
- }
- if (material.envMap) {
- uniforms.envMap.value = material.envMap
- uniforms.envMapIntensity.value = material.envMapIntensity
- uniforms.flipEnvMap.value = material.envMap.isCubeTexture ? -1 : 1
- uniforms.reflectivity.value = material.reflectivity
- uniforms.refractionRatio.value = material.refractionRatio
- uniforms.maxMipLevel.value = renderer.properties.get(material.envMap).__maxMipLevel
- }
- uniforms.specular.value.copy(material.specular)
- uniforms.glossiness.value = material.glossiness
- uniforms.glossinessMap.value = material.glossinessMap
- uniforms.emissiveMap.value = material.emissiveMap
- uniforms.bumpMap.value = material.bumpMap
- uniforms.normalMap.value = material.normalMap
- uniforms.displacementMap.value = material.displacementMap
- uniforms.displacementScale.value = material.displacementScale
- uniforms.displacementBias.value = material.displacementBias
- if (uniforms.glossinessMap.value !== null && defines.USE_GLOSSINESSMAP === undefined) {
- defines.USE_GLOSSINESSMAP = ''
- defines.USE_ROUGHNESSMAP = ''
- }
- if (uniforms.glossinessMap.value === null && defines.USE_GLOSSINESSMAP !== undefined) {
- delete defines.USE_GLOSSINESSMAP
- delete defines.USE_ROUGHNESSMAP
- }
- }
- }
- }
- function GLTFCubicSplineInterpolant(parameterPositions, sampleValues, sampleSize, resultBuffer) {
- THREE.Interpolant.call(this, parameterPositions, sampleValues, sampleSize, resultBuffer)
- }
- GLTFCubicSplineInterpolant.prototype = Object.create(THREE.Interpolant.prototype)
- GLTFCubicSplineInterpolant.prototype.constructor = GLTFCubicSplineInterpolant
- GLTFCubicSplineInterpolant.prototype.copySampleValue_ = function (index) {
- const result = this.resultBuffer
- const values = this.sampleValues
- const valueSize = this.valueSize
- const offset = index * valueSize * 3 + valueSize
- for (let i = 0; i !== valueSize; i++) {
- result[i] = values[offset + i]
- }
- return result
- }
- GLTFCubicSplineInterpolant.prototype.beforeStart_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_
- GLTFCubicSplineInterpolant.prototype.afterEnd_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_
- GLTFCubicSplineInterpolant.prototype.interpolate_ = function (i1, t0, t, t1) {
- const result = this.resultBuffer
- const values = this.sampleValues
- const stride = this.valueSize
- const stride2 = stride * 2
- const stride3 = stride * 3
- const td = t1 - t0
- const p = (t - t0) / td
- const pp = p * p
- const ppp = pp * p
- const offset1 = i1 * stride3
- const offset0 = offset1 - stride3
- const s2 = -2 * ppp + 3 * pp
- const s3 = ppp - pp
- const s0 = 1 - s2
- const s1 = s3 - pp + p
- for (let i = 0; i !== stride; i++) {
- const p0 = values[offset0 + i + stride]
- const m0 = values[offset0 + i + stride2] * td
- const p1 = values[offset1 + i + stride]
- const m1 = values[offset1 + i] * td
- result[i] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1
- }
- return result
- }
- const WEBGL_CONSTANTS = {
- FLOAT: 5126,
- FLOAT_MAT3: 35675,
- FLOAT_MAT4: 35676,
- FLOAT_VEC2: 35664,
- FLOAT_VEC3: 35665,
- FLOAT_VEC4: 35666,
- LINEAR: 9729,
- REPEAT: 10497,
- SAMPLER_2D: 35678,
- POINTS: 0,
- LINES: 1,
- LINE_LOOP: 2,
- LINE_STRIP: 3,
- TRIANGLES: 4,
- TRIANGLE_STRIP: 5,
- TRIANGLE_FAN: 6,
- UNSIGNED_BYTE: 5121,
- UNSIGNED_SHORT: 5123
- }
- var WEBGL_COMPONENT_TYPES = {
- 5120: Int8Array,
- 5121: Uint8Array,
- 5122: Int16Array,
- 5123: Uint16Array,
- 5125: Uint32Array,
- 5126: Float32Array
- }
- const WEBGL_FILTERS = {
- 9728: THREE.NearestFilter,
- 9729: THREE.LinearFilter,
- 9984: THREE.NearestMipmapNearestFilter,
- 9985: THREE.LinearMipmapNearestFilter,
- 9986: THREE.NearestMipmapLinearFilter,
- 9987: THREE.LinearMipmapLinearFilter
- }
- const WEBGL_WRAPPINGS = {
- 33071: THREE.ClampToEdgeWrapping,
- 33648: THREE.MirroredRepeatWrapping,
- 10497: THREE.RepeatWrapping
- }
- const WEBGL_TYPE_SIZES = {
- SCALAR: 1,
- VEC2: 2,
- VEC3: 3,
- VEC4: 4,
- MAT2: 4,
- MAT3: 9,
- MAT4: 16
- }
- var ATTRIBUTES = {
- POSITION: 'position',
- NORMAL: 'normal',
- TANGENT: 'tangent',
- TEXCOORD_0: 'uv',
- TEXCOORD_1: 'uv2',
- COLOR_0: 'color',
- WEIGHTS_0: 'skinWeight',
- JOINTS_0: 'skinIndex',
- }
- const PATH_PROPERTIES = {
- scale: 'scale',
- translation: 'position',
- rotation: 'quaternion',
- weights: 'morphTargetInfluences'
- }
- const INTERPOLATION = {
- CUBICSPLINE: undefined,
- LINEAR: THREE.InterpolateLinear,
- STEP: THREE.InterpolateDiscrete
- }
- const ALPHA_MODES = {
- OPAQUE: 'OPAQUE',
- MASK: 'MASK',
- BLEND: 'BLEND'
- }
- const MIME_TYPE_FORMATS = {
- 'image/png': THREE.RGBAFormat,
- 'image/jpeg': THREE.RGBFormat
- }
- function resolveURL(url, path) {
- if (typeof url !== 'string' || url === '') return ''
- if (/^https?:\/\//i.test(path) && /^\//.test(url)) {
- path = path.replace(/(^https?:\/\/[^\/]+).*/i, '$1')
- }
- if (/^(https?:)?\/\//i.test(url)) return url
- if (/^data:.*,.*$/i.test(url)) return url
- if (/^blob:.*$/i.test(url)) return url
- return path + url
- }
- let defaultMaterial
- function createDefaultMaterial() {
- defaultMaterial = defaultMaterial || new THREE.MeshStandardMaterial({
- color: 0xFFFFFF,
- emissive: 0x000000,
- metalness: 1,
- roughness: 1,
- transparent: false,
- depthTest: true,
- side: THREE.FrontSide
- })
- return defaultMaterial
- }
- function addUnknownExtensionsToUserData(knownExtensions, object, objectDef) {
- for (const name in objectDef.extensions) {
- if (knownExtensions[name] === undefined) {
- object.userData.gltfExtensions = object.userData.gltfExtensions || {}
- object.userData.gltfExtensions[name] = objectDef.extensions[name]
- }
- }
- }
- function assignExtrasToUserData(object, gltfDef) {
- if (gltfDef.extras !== undefined) {
- if (typeof gltfDef.extras === 'object') {
- Object.assign(object.userData, gltfDef.extras)
- } else {
- console.warn('THREE.GLTFLoader: Ignoring primitive type .extras, ' + gltfDef.extras)
- }
- }
- }
- function addMorphTargets(geometry, targets, parser) {
- let hasMorphPosition = false
- let hasMorphNormal = false
- for (var i = 0,
- il = targets.length; i < il; i++) {
- var target = targets[i]
- if (target.POSITION !== undefined) hasMorphPosition = true
- if (target.NORMAL !== undefined) hasMorphNormal = true
- if (hasMorphPosition && hasMorphNormal) break
- }
- if (!hasMorphPosition && !hasMorphNormal) return Promise.resolve(geometry)
- const pendingPositionAccessors = []
- const pendingNormalAccessors = []
- for (var i = 0,
- il = targets.length; i < il; i++) {
- var target = targets[i]
- if (hasMorphPosition) {
- var pendingAccessor = target.POSITION !== undefined ? parser.getDependency('accessor', target.POSITION) : geometry.attributes.position
- pendingPositionAccessors.push(pendingAccessor)
- }
- if (hasMorphNormal) {
- var pendingAccessor = target.NORMAL !== undefined ? parser.getDependency('accessor', target.NORMAL) : geometry.attributes.normal
- pendingNormalAccessors.push(pendingAccessor)
- }
- }
- return Promise.all([Promise.all(pendingPositionAccessors), Promise.all(pendingNormalAccessors)]).then(function (accessors) {
- const morphPositions = accessors[0]
- const morphNormals = accessors[1]
- for (var i = 0,
- il = morphPositions.length; i < il; i++) {
- if (geometry.attributes.position === morphPositions[i]) continue
- morphPositions[i] = cloneBufferAttribute(morphPositions[i])
- }
- for (var i = 0,
- il = morphNormals.length; i < il; i++) {
- if (geometry.attributes.normal === morphNormals[i]) continue
- morphNormals[i] = cloneBufferAttribute(morphNormals[i])
- }
- for (var i = 0,
- il = targets.length; i < il; i++) {
- const target = targets[i]
- const attributeName = 'morphTarget' + i
- if (hasMorphPosition) {
- if (target.POSITION !== undefined) {
- const positionAttribute = morphPositions[i]
- positionAttribute.name = attributeName
- const position = geometry.attributes.position
- for (var j = 0,
- jl = positionAttribute.count; j < jl; j++) {
- positionAttribute.setXYZ(j, positionAttribute.getX(j) + position.getX(j), positionAttribute.getY(j) + position.getY(j), positionAttribute.getZ(j) + position.getZ(j))
- }
- }
- }
- if (hasMorphNormal) {
- if (target.NORMAL !== undefined) {
- const normalAttribute = morphNormals[i]
- normalAttribute.name = attributeName
- const normal = geometry.attributes.normal
- for (var j = 0,
- jl = normalAttribute.count; j < jl; j++) {
- normalAttribute.setXYZ(j, normalAttribute.getX(j) + normal.getX(j), normalAttribute.getY(j) + normal.getY(j), normalAttribute.getZ(j) + normal.getZ(j))
- }
- }
- }
- }
- if (hasMorphPosition) geometry.morphAttributes.position = morphPositions
- if (hasMorphNormal) geometry.morphAttributes.normal = morphNormals
- return geometry
- })
- }
- function updateMorphTargets(mesh, meshDef) {
- mesh.updateMorphTargets()
- if (meshDef.weights !== undefined) {
- for (var i = 0,
- il = meshDef.weights.length; i < il; i++) {
- mesh.morphTargetInfluences[i] = meshDef.weights[i]
- }
- }
- if (meshDef.extras && Array.isArray(meshDef.extras.targetNames)) {
- const targetNames = meshDef.extras.targetNames
- if (mesh.morphTargetInfluences.length === targetNames.length) {
- mesh.morphTargetDictionary = {}
- for (var i = 0,
- il = targetNames.length; i < il; i++) {
- mesh.morphTargetDictionary[targetNames[i]] = i
- }
- } else {
- console.warn('THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.')
- }
- }
- }
- function createPrimitiveKey(primitiveDef) {
- const dracoExtension = primitiveDef.extensions && primitiveDef.extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION]
- let geometryKey
- if (dracoExtension) {
- geometryKey = 'draco:' + dracoExtension.bufferView + ':' + dracoExtension.indices + ':' + createAttributesKey(dracoExtension.attributes)
- } else {
- geometryKey = primitiveDef.indices + ':' + createAttributesKey(primitiveDef.attributes) + ':' + primitiveDef.mode
- }
- return geometryKey
- }
- function createAttributesKey(attributes) {
- let attributesKey = ''
- const keys = Object.keys(attributes).sort()
- for (let i = 0,
- il = keys.length; i < il; i++) {
- attributesKey += keys[i] + ':' + attributes[keys[i]] + ';'
- }
- return attributesKey
- }
- function cloneBufferAttribute(attribute) {
- if (attribute.isInterleavedBufferAttribute) {
- const count = attribute.count
- const itemSize = attribute.itemSize
- const array = attribute.array.slice(0, count * itemSize)
- for (let i = 0,
- j = 0; i < count; ++i) {
- array[j++] = attribute.getX(i)
- if (itemSize >= 2) array[j++] = attribute.getY(i)
- if (itemSize >= 3) array[j++] = attribute.getZ(i)
- if (itemSize >= 4) array[j++] = attribute.getW(i)
- }
- return new THREE.BufferAttribute(array, itemSize, attribute.normalized)
- }
- return attribute.clone()
- }
- function GLTFParser(json, extensions, options) {
- this.json = json || {}
- this.extensions = extensions || {}
- this.options = options || {}
- this.cache = new GLTFRegistry()
- this.primitiveCache = {}
- this.textureLoader = new THREE.TextureLoader(this.options.manager)
- this.textureLoader.setCrossOrigin(this.options.crossOrigin)
- this.fileLoader = new THREE.FileLoader(this.options.manager)
- this.fileLoader.setResponseType('arraybuffer')
- }
- GLTFParser.prototype.parse = function (onLoad, onError) {
- const parser = this
- const json = this.json
- const extensions = this.extensions
- this.cache.removeAll()
- this.markDefs()
- Promise.all([this.getDependencies('scene'), this.getDependencies('animation'), this.getDependencies('camera')]).then(function (dependencies) {
- const result = {
- scene: dependencies[0][json.scene || 0],
- scenes: dependencies[0],
- animations: dependencies[1],
- cameras: dependencies[2],
- asset: json.asset,
- parser,
- userData: {}
- }
- addUnknownExtensionsToUserData(extensions, result, json)
- assignExtrasToUserData(result, json)
- onLoad(result)
- })
- .catch(onError)
- }
- GLTFParser.prototype.markDefs = function () {
- const nodeDefs = this.json.nodes || []
- const skinDefs = this.json.skins || []
- const meshDefs = this.json.meshes || []
- const meshReferences = {}
- const meshUses = {}
- for (let skinIndex = 0,
- skinLength = skinDefs.length; skinIndex < skinLength; skinIndex++) {
- const joints = skinDefs[skinIndex].joints
- for (let i = 0,
- il = joints.length; i < il; i++) {
- nodeDefs[joints[i]].isBone = true
- }
- }
- for (let nodeIndex = 0,
- nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex++) {
- const nodeDef = nodeDefs[nodeIndex]
- if (nodeDef.mesh !== undefined) {
- if (meshReferences[nodeDef.mesh] === undefined) {
- meshReferences[nodeDef.mesh] = meshUses[nodeDef.mesh] = 0
- }
- meshReferences[nodeDef.mesh]++
- if (nodeDef.skin !== undefined) {
- meshDefs[nodeDef.mesh].isSkinnedMesh = true
- }
- }
- }
- this.json.meshReferences = meshReferences
- this.json.meshUses = meshUses
- }
- GLTFParser.prototype.getDependency = function (type, index) {
- const cacheKey = type + ':' + index
- let dependency = this.cache.get(cacheKey)
- if (!dependency) {
- switch (type) {
- case 'scene':
- dependency = this.loadScene(index)
- break
- case 'node':
- dependency = this.loadNode(index)
- break
- case 'mesh':
- dependency = this.loadMesh(index)
- break
- case 'accessor':
- dependency = this.loadAccessor(index)
- break
- case 'bufferView':
- dependency = this.loadBufferView(index)
- break
- case 'buffer':
- dependency = this.loadBuffer(index)
- break
- case 'material':
- dependency = this.loadMaterial(index)
- break
- case 'texture':
- dependency = this.loadTexture(index)
- break
- case 'skin':
- dependency = this.loadSkin(index)
- break
- case 'animation':
- dependency = this.loadAnimation(index)
- break
- case 'camera':
- dependency = this.loadCamera(index)
- break
- case 'light':
- dependency = this.extensions[EXTENSIONS.KHR_LIGHTS_PUNCTUAL].loadLight(index)
- break
- default:
- throw new Error('Unknown type: ' + type)
- }
- this.cache.add(cacheKey, dependency)
- }
- return dependency
- }
- GLTFParser.prototype.getDependencies = function (type) {
- let dependencies = this.cache.get(type)
- if (!dependencies) {
- const parser = this
- const defs = this.json[type + (type === 'mesh' ? 'es' : 's')] || []
- dependencies = Promise.all(defs.map(function (def, index) {
- return parser.getDependency(type, index)
- }))
- this.cache.add(type, dependencies)
- }
- return dependencies
- }
- GLTFParser.prototype.loadBuffer = function (bufferIndex) {
- const bufferDef = this.json.buffers[bufferIndex]
- const loader = this.fileLoader
- if (bufferDef.type && bufferDef.type !== 'arraybuffer') {
- throw new Error('THREE.GLTFLoader: ' + bufferDef.type + ' buffer type is not supported.')
- }
- if (bufferDef.uri === undefined && bufferIndex === 0) {
- return Promise.resolve(this.extensions[EXTENSIONS.KHR_BINARY_GLTF].body)
- }
- const options = this.options
- return new Promise(function (resolve, reject) {
- loader.load(
- resolveURL(bufferDef.uri, options.path),
- resolve,
- undefined,
- function () {
- reject(new Error('THREE.GLTFLoader: Failed to load buffer "' + bufferDef.uri + '".'))
- }
- )
- })
- }
- GLTFParser.prototype.loadBufferView = function (bufferViewIndex) {
- const bufferViewDef = this.json.bufferViews[bufferViewIndex]
- return this.getDependency('buffer', bufferViewDef.buffer).then(function (buffer) {
- const byteLength = bufferViewDef.byteLength || 0
- const byteOffset = bufferViewDef.byteOffset || 0
- return buffer.slice(byteOffset, byteOffset + byteLength)
- })
- }
- GLTFParser.prototype.loadAccessor = function (accessorIndex) {
- const parser = this
- const json = this.json
- const accessorDef = this.json.accessors[accessorIndex]
- if (accessorDef.bufferView === undefined && accessorDef.sparse === undefined) {
- return Promise.resolve(null)
- }
- const pendingBufferViews = []
- if (accessorDef.bufferView !== undefined) {
- pendingBufferViews.push(this.getDependency('bufferView', accessorDef.bufferView))
- } else {
- pendingBufferViews.push(null)
- }
- if (accessorDef.sparse !== undefined) {
- pendingBufferViews.push(this.getDependency('bufferView', accessorDef.sparse.indices.bufferView))
- pendingBufferViews.push(this.getDependency('bufferView', accessorDef.sparse.values.bufferView))
- }
- return Promise.all(pendingBufferViews).then(function (bufferViews) {
- const bufferView = bufferViews[0]
- const itemSize = WEBGL_TYPE_SIZES[accessorDef.type]
- const TypedArray = WEBGL_COMPONENT_TYPES[accessorDef.componentType]
- const elementBytes = TypedArray.BYTES_PER_ELEMENT
- const itemBytes = elementBytes * itemSize
- const byteOffset = accessorDef.byteOffset || 0
- const byteStride = accessorDef.bufferView !== undefined ? json.bufferViews[accessorDef.bufferView].byteStride : undefined
- const normalized = accessorDef.normalized === true
- let array; let
- bufferAttribute
- if (byteStride && byteStride !== itemBytes) {
- const ibSlice = Math.floor(byteOffset / byteStride)
- const ibCacheKey = 'InterleavedBuffer:' + accessorDef.bufferView + ':' + accessorDef.componentType + ':' + ibSlice + ':' + accessorDef.count
- let ib = parser.cache.get(ibCacheKey)
- if (!ib) {
- array = new TypedArray(bufferView, ibSlice * byteStride, accessorDef.count * byteStride / elementBytes)
- ib = new THREE.InterleavedBuffer(array, byteStride / elementBytes)
- parser.cache.add(ibCacheKey, ib)
- }
- bufferAttribute = new THREE.InterleavedBufferAttribute(ib, itemSize, (byteOffset % byteStride) / elementBytes, normalized)
- } else {
- if (bufferView === null) {
- array = new TypedArray(accessorDef.count * itemSize)
- } else {
- array = new TypedArray(bufferView, byteOffset, accessorDef.count * itemSize)
- }
- bufferAttribute = new THREE.BufferAttribute(array, itemSize, normalized)
- }
- if (accessorDef.sparse !== undefined) {
- const itemSizeIndices = WEBGL_TYPE_SIZES.SCALAR
- const TypedArrayIndices = WEBGL_COMPONENT_TYPES[accessorDef.sparse.indices.componentType]
- const byteOffsetIndices = accessorDef.sparse.indices.byteOffset || 0
- const byteOffsetValues = accessorDef.sparse.values.byteOffset || 0
- const sparseIndices = new TypedArrayIndices(bufferViews[1], byteOffsetIndices, accessorDef.sparse.count * itemSizeIndices)
- const sparseValues = new TypedArray(bufferViews[2], byteOffsetValues, accessorDef.sparse.count * itemSize)
- if (bufferView !== null) {
- bufferAttribute.setArray(bufferAttribute.array.slice())
- }
- for (let i = 0,
- il = sparseIndices.length; i < il; i++) {
- const index = sparseIndices[i]
- bufferAttribute.setX(index, sparseValues[i * itemSize])
- if (itemSize >= 2) bufferAttribute.setY(index, sparseValues[i * itemSize + 1])
- if (itemSize >= 3) bufferAttribute.setZ(index, sparseValues[i * itemSize + 2])
- if (itemSize >= 4) bufferAttribute.setW(index, sparseValues[i * itemSize + 3])
- if (itemSize >= 5) throw new Error('THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.')
- }
- }
- return bufferAttribute
- })
- }
- GLTFParser.prototype.loadTexture = function (textureIndex) {
- const parser = this
- const json = this.json
- const options = this.options
- const textureLoader = this.textureLoader
- // var URL = global.URL;
- const textureDef = json.textures[textureIndex]
- const textureExtensions = textureDef.extensions || {}
- let source
- if (textureExtensions[EXTENSIONS.MSFT_TEXTURE_DDS]) {
- source = json.images[textureExtensions[EXTENSIONS.MSFT_TEXTURE_DDS].source]
- } else {
- source = json.images[textureDef.source]
- }
- let sourceURI = source.uri
- let isObjectURL = false
- if (source.bufferView !== undefined) {
- sourceURI = parser.getDependency('bufferView', source.bufferView).then(function (bufferView) {
- isObjectURL = true
- // 微信小程序不支持 Blob 对象,则使用 base64 编码的字符串来创建 data URI
- const base64Str = wx.arrayBufferToBase64(bufferView)
- sourceURI = `data:${source.mimeType};base64,${base64Str}`
- return sourceURI
- })
- }
- return Promise.resolve(sourceURI).then(function (sourceURI) {
- let loader = THREE.Loader.Handlers.get(sourceURI)
- if (!loader) {
- loader = textureExtensions[EXTENSIONS.MSFT_TEXTURE_DDS] ? parser.extensions[EXTENSIONS.MSFT_TEXTURE_DDS].ddsLoader : textureLoader
- }
- return new Promise(function (resolve, reject) {
- loader.load(resolveURL(sourceURI, options.path), resolve, undefined, reject)
- })
- }).then(function (texture) {
- if (isObjectURL === true) {
- // URL.revokeObjectURL(sourceURI)
- }
- texture.flipY = false
- if (textureDef.name !== undefined) texture.name = textureDef.name
- if (source.mimeType in MIME_TYPE_FORMATS) {
- texture.format = MIME_TYPE_FORMATS[source.mimeType]
- }
- const samplers = json.samplers || {}
- const sampler = samplers[textureDef.sampler] || {}
- texture.magFilter = WEBGL_FILTERS[sampler.magFilter] || THREE.LinearFilter
- texture.minFilter = WEBGL_FILTERS[sampler.minFilter] || THREE.LinearMipmapLinearFilter
- texture.wrapS = WEBGL_WRAPPINGS[sampler.wrapS] || THREE.RepeatWrapping
- texture.wrapT = WEBGL_WRAPPINGS[sampler.wrapT] || THREE.RepeatWrapping
- return texture
- })
- }
- GLTFParser.prototype.assignTexture = function (materialParams, mapName, mapDef) {
- const parser = this
- return this.getDependency('texture', mapDef.index).then(function (texture) {
- if (!texture.isCompressedTexture) {
- switch (mapName) {
- case 'aoMap':
- case 'emissiveMap':
- case 'metalnessMap':
- case 'normalMap':
- case 'roughnessMap':
- texture.format = THREE.RGBFormat
- break
- }
- }
- if (parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]) {
- const transform = mapDef.extensions !== undefined ? mapDef.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM] : undefined
- if (transform) {
- texture = parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(texture, transform)
- }
- }
- materialParams[mapName] = texture
- })
- }
- GLTFParser.prototype.assignFinalMaterial = function (mesh) {
- const geometry = mesh.geometry
- let material = mesh.material
- const extensions = this.extensions
- const useVertexTangents = geometry.attributes.tangent !== undefined
- const useVertexColors = geometry.attributes.color !== undefined
- const useFlatShading = geometry.attributes.normal === undefined
- const useSkinning = mesh.isSkinnedMesh === true
- const useMorphTargets = Object.keys(geometry.morphAttributes).length > 0
- const useMorphNormals = useMorphTargets && geometry.morphAttributes.normal !== undefined
- if (mesh.isPoints) {
- var cacheKey = 'PointsMaterial:' + material.uuid
- let pointsMaterial = this.cache.get(cacheKey)
- if (!pointsMaterial) {
- pointsMaterial = new THREE.PointsMaterial()
- THREE.Material.prototype.copy.call(pointsMaterial, material)
- pointsMaterial.color.copy(material.color)
- pointsMaterial.map = material.map
- pointsMaterial.lights = false
- pointsMaterial.sizeAttenuation = false
- this.cache.add(cacheKey, pointsMaterial)
- }
- material = pointsMaterial
- } else if (mesh.isLine) {
- var cacheKey = 'LineBasicMaterial:' + material.uuid
- let lineMaterial = this.cache.get(cacheKey)
- if (!lineMaterial) {
- lineMaterial = new THREE.LineBasicMaterial()
- THREE.Material.prototype.copy.call(lineMaterial, material)
- lineMaterial.color.copy(material.color)
- lineMaterial.lights = false
- this.cache.add(cacheKey, lineMaterial)
- }
- material = lineMaterial
- }
- if (useVertexTangents || useVertexColors || useFlatShading || useSkinning || useMorphTargets) {
- var cacheKey = 'ClonedMaterial:' + material.uuid + ':'
- if (material.isGLTFSpecularGlossinessMaterial) cacheKey += 'specular-glossiness:'
- if (useSkinning) cacheKey += 'skinning:'
- if (useVertexTangents) cacheKey += 'vertex-tangents:'
- if (useVertexColors) cacheKey += 'vertex-colors:'
- if (useFlatShading) cacheKey += 'flat-shading:'
- if (useMorphTargets) cacheKey += 'morph-targets:'
- if (useMorphNormals) cacheKey += 'morph-normals:'
- let cachedMaterial = this.cache.get(cacheKey)
- if (!cachedMaterial) {
- cachedMaterial = material.isGLTFSpecularGlossinessMaterial ? extensions[EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].cloneMaterial(material) : material.clone()
- if (useSkinning) cachedMaterial.skinning = true
- if (useVertexTangents) cachedMaterial.vertexTangents = true
- if (useVertexColors) cachedMaterial.vertexColors = THREE.VertexColors
- if (useFlatShading) cachedMaterial.flatShading = true
- if (useMorphTargets) cachedMaterial.morphTargets = true
- if (useMorphNormals) cachedMaterial.morphNormals = true
- this.cache.add(cacheKey, cachedMaterial)
- }
- material = cachedMaterial
- }
- if (material.aoMap && geometry.attributes.uv2 === undefined && geometry.attributes.uv !== undefined) {
- console.log('THREE.GLTFLoader: Duplicating UVs to support aoMap.')
- geometry.addAttribute('uv2', new THREE.BufferAttribute(geometry.attributes.uv.array, 2))
- }
- if (material.isGLTFSpecularGlossinessMaterial) {
- mesh.onBeforeRender = extensions[EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].refreshUniforms
- }
- mesh.material = material
- }
- GLTFParser.prototype.loadMaterial = function (materialIndex) {
- const parser = this
- const json = this.json
- const extensions = this.extensions
- const materialDef = json.materials[materialIndex]
- let materialType
- const materialParams = {}
- const materialExtensions = materialDef.extensions || {}
- const pending = []
- if (materialExtensions[EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]) {
- const sgExtension = extensions[EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]
- materialType = sgExtension.getMaterialType()
- pending.push(sgExtension.extendParams(materialParams, materialDef, parser))
- } else if (materialExtensions[EXTENSIONS.KHR_MATERIALS_UNLIT]) {
- const kmuExtension = extensions[EXTENSIONS.KHR_MATERIALS_UNLIT]
- materialType = kmuExtension.getMaterialType()
- pending.push(kmuExtension.extendParams(materialParams, materialDef, parser))
- } else {
- materialType = THREE.MeshStandardMaterial
- const metallicRoughness = materialDef.pbrMetallicRoughness || {}
- materialParams.color = new THREE.Color(1.0, 1.0, 1.0)
- materialParams.opacity = 1.0
- if (Array.isArray(metallicRoughness.baseColorFactor)) {
- const array = metallicRoughness.baseColorFactor
- materialParams.color.fromArray(array)
- materialParams.opacity = array[3]
- }
- if (metallicRoughness.baseColorTexture !== undefined) {
- pending.push(parser.assignTexture(materialParams, 'map', metallicRoughness.baseColorTexture))
- }
- materialParams.metalness = metallicRoughness.metallicFactor !== undefined ? metallicRoughness.metallicFactor : 1.0
- materialParams.roughness = metallicRoughness.roughnessFactor !== undefined ? metallicRoughness.roughnessFactor : 1.0
- if (metallicRoughness.metallicRoughnessTexture !== undefined) {
- pending.push(parser.assignTexture(materialParams, 'metalnessMap', metallicRoughness.metallicRoughnessTexture))
- pending.push(parser.assignTexture(materialParams, 'roughnessMap', metallicRoughness.metallicRoughnessTexture))
- }
- }
- if (materialDef.doubleSided === true) {
- materialParams.side = THREE.DoubleSide
- }
- const alphaMode = materialDef.alphaMode || ALPHA_MODES.OPAQUE
- if (alphaMode === ALPHA_MODES.BLEND) {
- materialParams.transparent = true
- } else {
- materialParams.transparent = false
- if (alphaMode === ALPHA_MODES.MASK) {
- materialParams.alphaTest = materialDef.alphaCutoff !== undefined ? materialDef.alphaCutoff : 0.5
- }
- }
- if (materialDef.normalTexture !== undefined && materialType !== THREE.MeshBasicMaterial) {
- pending.push(parser.assignTexture(materialParams, 'normalMap', materialDef.normalTexture))
- materialParams.normalScale = new THREE.Vector2(1, 1)
- if (materialDef.normalTexture.scale !== undefined) {
- materialParams.normalScale.set(materialDef.normalTexture.scale, materialDef.normalTexture.scale)
- }
- }
- if (materialDef.occlusionTexture !== undefined && materialType !== THREE.MeshBasicMaterial) {
- pending.push(parser.assignTexture(materialParams, 'aoMap', materialDef.occlusionTexture))
- if (materialDef.occlusionTexture.strength !== undefined) {
- materialParams.aoMapIntensity = materialDef.occlusionTexture.strength
- }
- }
- if (materialDef.emissiveFactor !== undefined && materialType !== THREE.MeshBasicMaterial) {
- materialParams.emissive = new THREE.Color().fromArray(materialDef.emissiveFactor)
- }
- if (materialDef.emissiveTexture !== undefined && materialType !== THREE.MeshBasicMaterial) {
- pending.push(parser.assignTexture(materialParams, 'emissiveMap', materialDef.emissiveTexture))
- }
- return Promise.all(pending).then(function () {
- let material
- if (materialType === THREE.ShaderMaterial) {
- material = extensions[EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(materialParams)
- } else {
- material = new materialType(materialParams)
- }
- if (materialDef.name !== undefined) material.name = materialDef.name
- if (material.map) material.map.encoding = THREE.sRGBEncoding
- if (material.emissiveMap) material.emissiveMap.encoding = THREE.sRGBEncoding
- if (material.specularMap) material.specularMap.encoding = THREE.sRGBEncoding
- assignExtrasToUserData(material, materialDef)
- if (materialDef.extensions) addUnknownExtensionsToUserData(extensions, material, materialDef)
- return material
- })
- }
- function addPrimitiveAttributes(geometry, primitiveDef, parser) {
- const attributes = primitiveDef.attributes
- const pending = []
- function assignAttributeAccessor(accessorIndex, attributeName) {
- return parser.getDependency('accessor', accessorIndex).then(function (accessor) {
- geometry.addAttribute(attributeName, accessor)
- })
- }
- for (const gltfAttributeName in attributes) {
- const threeAttributeName = ATTRIBUTES[gltfAttributeName] || gltfAttributeName.toLowerCase()
- if (threeAttributeName in geometry.attributes) continue
- pending.push(assignAttributeAccessor(attributes[gltfAttributeName], threeAttributeName))
- }
- if (primitiveDef.indices !== undefined && !geometry.index) {
- const accessor = parser.getDependency('accessor', primitiveDef.indices).then(function (accessor) {
- geometry.setIndex(accessor)
- })
- pending.push(accessor)
- }
- assignExtrasToUserData(geometry, primitiveDef)
- return Promise.all(pending).then(function () {
- return primitiveDef.targets !== undefined ? addMorphTargets(geometry, primitiveDef.targets, parser) : geometry
- })
- }
- GLTFParser.prototype.loadGeometries = function (primitives) {
- const parser = this
- const extensions = this.extensions
- const cache = this.primitiveCache
- function createDracoPrimitive(primitive) {
- return extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(primitive, parser).then(function (geometry) {
- return addPrimitiveAttributes(geometry, primitive, parser)
- })
- }
- const pending = []
- for (let i = 0,
- il = primitives.length; i < il; i++) {
- const primitive = primitives[i]
- const cacheKey = createPrimitiveKey(primitive)
- const cached = cache[cacheKey]
- if (cached) {
- pending.push(cached.promise)
- } else {
- var geometryPromise
- if (primitive.extensions && primitive.extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION]) {
- geometryPromise = createDracoPrimitive(primitive)
- } else {
- geometryPromise = addPrimitiveAttributes(new THREE.BufferGeometry(), primitive, parser)
- }
- cache[cacheKey] = {
- primitive,
- promise: geometryPromise
- }
- pending.push(geometryPromise)
- }
- }
- return Promise.all(pending)
- }
- GLTFParser.prototype.loadMesh = function (meshIndex) {
- const parser = this
- const json = this.json
- const meshDef = json.meshes[meshIndex]
- const primitives = meshDef.primitives
- const pending = []
- for (let i = 0,
- il = primitives.length; i < il; i++) {
- const material = primitives[i].material === undefined ? createDefaultMaterial() : this.getDependency('material', primitives[i].material)
- pending.push(material)
- }
- return Promise.all(pending).then(function (originalMaterials) {
- return parser.loadGeometries(primitives).then(function (geometries) {
- const meshes = []
- for (var i = 0,
- il = geometries.length; i < il; i++) {
- const geometry = geometries[i]
- const primitive = primitives[i]
- var mesh
- const material = originalMaterials[i]
- if (primitive.mode === WEBGL_CONSTANTS.TRIANGLES || primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP || primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN || primitive.mode === undefined) {
- mesh = meshDef.isSkinnedMesh === true ? new THREE.SkinnedMesh(geometry, material) : new THREE.Mesh(geometry, material)
- if (mesh.isSkinnedMesh === true && !mesh.geometry.attributes.skinWeight.normalized) {
- mesh.normalizeSkinWeights()
- }
- if (primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP) {
- mesh.drawMode = THREE.TriangleStripDrawMode
- } else if (primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN) {
- mesh.drawMode = THREE.TriangleFanDrawMode
- }
- } else if (primitive.mode === WEBGL_CONSTANTS.LINES) {
- mesh = new THREE.LineSegments(geometry, material)
- } else if (primitive.mode === WEBGL_CONSTANTS.LINE_STRIP) {
- mesh = new THREE.Line(geometry, material)
- } else if (primitive.mode === WEBGL_CONSTANTS.LINE_LOOP) {
- mesh = new THREE.LineLoop(geometry, material)
- } else if (primitive.mode === WEBGL_CONSTANTS.POINTS) {
- mesh = new THREE.Points(geometry, material)
- } else {
- throw new Error('THREE.GLTFLoader: Primitive mode unsupported: ' + primitive.mode)
- }
- if (Object.keys(mesh.geometry.morphAttributes).length > 0) {
- updateMorphTargets(mesh, meshDef)
- }
- mesh.name = meshDef.name || ('mesh_' + meshIndex)
- if (geometries.length > 1) mesh.name += '_' + i
- assignExtrasToUserData(mesh, meshDef)
- parser.assignFinalMaterial(mesh)
- meshes.push(mesh)
- }
- if (meshes.length === 1) {
- return meshes[0]
- }
- const group = new THREE.Group()
- for (var i = 0,
- il = meshes.length; i < il; i++) {
- group.add(meshes[i])
- }
- return group
- })
- })
- }
- GLTFParser.prototype.loadCamera = function (cameraIndex) {
- let camera
- const cameraDef = this.json.cameras[cameraIndex]
- const params = cameraDef[cameraDef.type]
- if (!params) {
- console.warn('THREE.GLTFLoader: Missing camera parameters.')
- return
- }
- if (cameraDef.type === 'perspective') {
- camera = new THREE.PerspectiveCamera(THREE.Math.radToDeg(params.yfov), params.aspectRatio || 1, params.znear || 1, params.zfar || 2e6)
- } else if (cameraDef.type === 'orthographic') {
- camera = new THREE.OrthographicCamera(params.xmag / -2, params.xmag / 2, params.ymag / 2, params.ymag / -2, params.znear, params.zfar)
- }
- if (cameraDef.name !== undefined) camera.name = cameraDef.name
- assignExtrasToUserData(camera, cameraDef)
- return Promise.resolve(camera)
- }
- GLTFParser.prototype.loadSkin = function (skinIndex) {
- const skinDef = this.json.skins[skinIndex]
- const skinEntry = {
- joints: skinDef.joints
- }
- if (skinDef.inverseBindMatrices === undefined) {
- return Promise.resolve(skinEntry)
- }
- return this.getDependency('accessor', skinDef.inverseBindMatrices).then(function (accessor) {
- skinEntry.inverseBindMatrices = accessor
- return skinEntry
- })
- }
- GLTFParser.prototype.loadAnimation = function (animationIndex) {
- const json = this.json
- const animationDef = json.animations[animationIndex]
- const pendingNodes = []
- const pendingInputAccessors = []
- const pendingOutputAccessors = []
- const pendingSamplers = []
- const pendingTargets = []
- for (let i = 0,
- il = animationDef.channels.length; i < il; i++) {
- const channel = animationDef.channels[i]
- const sampler = animationDef.samplers[channel.sampler]
- const target = channel.target
- const name = target.node !== undefined ? target.node : target.id
- const input = animationDef.parameters !== undefined ? animationDef.parameters[sampler.input] : sampler.input
- const output = animationDef.parameters !== undefined ? animationDef.parameters[sampler.output] : sampler.output
- pendingNodes.push(this.getDependency('node', name))
- pendingInputAccessors.push(this.getDependency('accessor', input))
- pendingOutputAccessors.push(this.getDependency('accessor', output))
- pendingSamplers.push(sampler)
- pendingTargets.push(target)
- }
- return Promise.all([Promise.all(pendingNodes), Promise.all(pendingInputAccessors), Promise.all(pendingOutputAccessors), Promise.all(pendingSamplers), Promise.all(pendingTargets)]).then(function (dependencies) {
- const nodes = dependencies[0]
- const inputAccessors = dependencies[1]
- const outputAccessors = dependencies[2]
- const samplers = dependencies[3]
- const targets = dependencies[4]
- const tracks = []
- for (let i = 0,
- il = nodes.length; i < il; i++) {
- const node = nodes[i]
- const inputAccessor = inputAccessors[i]
- const outputAccessor = outputAccessors[i]
- const sampler = samplers[i]
- const target = targets[i]
- if (node === undefined) continue
- node.updateMatrix()
- node.matrixAutoUpdate = true
- var TypedKeyframeTrack
- switch (PATH_PROPERTIES[target.path]) {
- case PATH_PROPERTIES.weights:
- TypedKeyframeTrack = THREE.NumberKeyframeTrack
- break
- case PATH_PROPERTIES.rotation:
- TypedKeyframeTrack = THREE.QuaternionKeyframeTrack
- break
- case PATH_PROPERTIES.position:
- case PATH_PROPERTIES.scale:
- default:
- TypedKeyframeTrack = THREE.VectorKeyframeTrack
- break
- }
- const targetName = node.name ? node.name : node.uuid
- const interpolation = sampler.interpolation !== undefined ? INTERPOLATION[sampler.interpolation] : THREE.InterpolateLinear
- var targetNames = []
- if (PATH_PROPERTIES[target.path] === PATH_PROPERTIES.weights) {
- node.traverse(function (object) {
- if (object.isMesh === true && object.morphTargetInfluences) {
- targetNames.push(object.name ? object.name : object.uuid)
- }
- })
- } else {
- targetNames.push(targetName)
- }
- let outputArray = outputAccessor.array
- if (outputAccessor.normalized) {
- var scale
- if (outputArray.constructor === Int8Array) {
- scale = 1 / 127
- } else if (outputArray.constructor === Uint8Array) {
- scale = 1 / 255
- } else if (outputArray.constructor == Int16Array) {
- scale = 1 / 32767
- } else if (outputArray.constructor === Uint16Array) {
- scale = 1 / 65535
- } else {
- throw new Error('THREE.GLTFLoader: Unsupported output accessor component type.')
- }
- const scaled = new Float32Array(outputArray.length)
- for (var j = 0,
- jl = outputArray.length; j < jl; j++) {
- scaled[j] = outputArray[j] * scale
- }
- outputArray = scaled
- }
- for (var j = 0,
- jl = targetNames.length; j < jl; j++) {
- const track = new TypedKeyframeTrack(targetNames[j] + '.' + PATH_PROPERTIES[target.path], inputAccessor.array, outputArray, interpolation)
- if (sampler.interpolation === 'CUBICSPLINE') {
- track.createInterpolant = function InterpolantFactoryMethodGLTFCubicSpline(result) {
- return new GLTFCubicSplineInterpolant(this.times, this.values, this.getValueSize() / 3, result)
- }
- track.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = true
- }
- tracks.push(track)
- }
- }
- const name = animationDef.name !== undefined ? animationDef.name : 'animation_' + animationIndex
- return new THREE.AnimationClip(name, undefined, tracks)
- })
- }
- GLTFParser.prototype.loadNode = function (nodeIndex) {
- const json = this.json
- const extensions = this.extensions
- const parser = this
- const meshReferences = json.meshReferences
- const meshUses = json.meshUses
- const nodeDef = json.nodes[nodeIndex]
- return (function () {
- const pending = []
- if (nodeDef.mesh !== undefined) {
- pending.push(parser.getDependency('mesh', nodeDef.mesh).then(function (mesh) {
- let node
- if (meshReferences[nodeDef.mesh] > 1) {
- const instanceNum = meshUses[nodeDef.mesh]++
- node = mesh.clone()
- node.name += '_instance_' + instanceNum
- node.onBeforeRender = mesh.onBeforeRender
- for (let i = 0,
- il = node.children.length; i < il; i++) {
- node.children[i].name += '_instance_' + instanceNum
- node.children[i].onBeforeRender = mesh.children[i].onBeforeRender
- }
- } else {
- node = mesh
- }
- if (nodeDef.weights !== undefined) {
- node.traverse(function (o) {
- if (!o.isMesh) return
- for (let i = 0,
- il = nodeDef.weights.length; i < il; i++) {
- o.morphTargetInfluences[i] = nodeDef.weights[i]
- }
- })
- }
- return node
- }))
- }
- if (nodeDef.camera !== undefined) {
- pending.push(parser.getDependency('camera', nodeDef.camera))
- }
- if (nodeDef.extensions && nodeDef.extensions[EXTENSIONS.KHR_LIGHTS_PUNCTUAL] && nodeDef.extensions[EXTENSIONS.KHR_LIGHTS_PUNCTUAL].light !== undefined) {
- pending.push(parser.getDependency('light', nodeDef.extensions[EXTENSIONS.KHR_LIGHTS_PUNCTUAL].light))
- }
- return Promise.all(pending)
- }()).then(function (objects) {
- let node
- if (nodeDef.isBone === true) {
- node = new THREE.Bone()
- } else if (objects.length > 1) {
- node = new THREE.Group()
- } else if (objects.length === 1) {
- node = objects[0]
- } else {
- node = new THREE.Object3D()
- }
- if (node !== objects[0]) {
- for (let i = 0,
- il = objects.length; i < il; i++) {
- node.add(objects[i])
- }
- }
- if (nodeDef.name !== undefined) {
- node.userData.name = nodeDef.name
- node.name = THREE.PropertyBinding.sanitizeNodeName(nodeDef.name)
- }
- assignExtrasToUserData(node, nodeDef)
- if (nodeDef.extensions) addUnknownExtensionsToUserData(extensions, node, nodeDef)
- if (nodeDef.matrix !== undefined) {
- const matrix = new THREE.Matrix4()
- matrix.fromArray(nodeDef.matrix)
- node.applyMatrix(matrix)
- } else {
- if (nodeDef.translation !== undefined) {
- node.position.fromArray(nodeDef.translation)
- }
- if (nodeDef.rotation !== undefined) {
- node.quaternion.fromArray(nodeDef.rotation)
- }
- if (nodeDef.scale !== undefined) {
- node.scale.fromArray(nodeDef.scale)
- }
- }
- return node
- })
- }
- GLTFParser.prototype.loadScene = (function () {
- function buildNodeHierachy(nodeId, parentObject, json, parser) {
- const nodeDef = json.nodes[nodeId]
- return parser.getDependency('node', nodeId).then(function (node) {
- if (nodeDef.skin === undefined) return node
- let skinEntry
- return parser.getDependency('skin', nodeDef.skin).then(function (skin) {
- skinEntry = skin
- const pendingJoints = []
- for (let i = 0,
- il = skinEntry.joints.length; i < il; i++) {
- pendingJoints.push(parser.getDependency('node', skinEntry.joints[i]))
- }
- return Promise.all(pendingJoints)
- }).then(function (jointNodes) {
- node.traverse(function (mesh) {
- if (!mesh.isMesh) return
- const bones = []
- const boneInverses = []
- for (let j = 0,
- jl = jointNodes.length; j < jl; j++) {
- const jointNode = jointNodes[j]
- if (jointNode) {
- bones.push(jointNode)
- const mat = new THREE.Matrix4()
- if (skinEntry.inverseBindMatrices !== undefined) {
- mat.fromArray(skinEntry.inverseBindMatrices.array, j * 16)
- }
- boneInverses.push(mat)
- } else {
- console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', skinEntry.joints[j])
- }
- }
- mesh.bind(new THREE.Skeleton(bones, boneInverses), mesh.matrixWorld)
- })
- return node
- })
- }).then(function (node) {
- parentObject.add(node)
- const pending = []
- if (nodeDef.children) {
- const children = nodeDef.children
- for (let i = 0,
- il = children.length; i < il; i++) {
- const child = children[i]
- pending.push(buildNodeHierachy(child, node, json, parser))
- }
- }
- return Promise.all(pending)
- })
- }
- return function loadScene(sceneIndex) {
- const json = this.json
- const extensions = this.extensions
- const sceneDef = this.json.scenes[sceneIndex]
- const parser = this
- const scene = new THREE.Scene()
- if (sceneDef.name !== undefined) scene.name = sceneDef.name
- assignExtrasToUserData(scene, sceneDef)
- if (sceneDef.extensions) addUnknownExtensionsToUserData(extensions, scene, sceneDef)
- const nodeIds = sceneDef.nodes || []
- const pending = []
- for (let i = 0,
- il = nodeIds.length; i < il; i++) {
- pending.push(buildNodeHierachy(nodeIds[i], scene, json, parser))
- }
- return Promise.all(pending).then(function () {
- return scene
- })
- }
- }())
- return GLTFLoader
- }())
-}
diff --git a/miniprogram/packageAPI/pages/ar/ocr-detect/behavior.js b/miniprogram/packageAPI/pages/ar/ocr-detect/behavior.js
deleted file mode 100644
index 867744d8..00000000
--- a/miniprogram/packageAPI/pages/ar/ocr-detect/behavior.js
+++ /dev/null
@@ -1,202 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio / 2
- this.canvas.height = height * pixelRatio / 2
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.textContentList) this.textContentList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- OCR: {
- mode: 1
- }
- },
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio / 2
- this.canvas.height = height * pixelRatio / 2
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- session.on('addAnchors', anchors => {
- console.log('anchor add')
- })
- session.on('updateAnchors', anchors => {
- this.data.textContentList = []
-
- // 摄像头实时检测人脸的时候 updateAnchors 会在每帧触发,所以性能要求更高,用 gl 画
- this.data.textContentList = this.data.textContentList.concat(anchors.map(anchor => ({
- text: anchor.text,
- subtext: anchor.subtext,
- box: anchor.box
- })))
-
- let wholeText
- if (this.data.textContentList.length != 0) {
- wholeText = this.data.textContentList[0].text
- }
-
- this.setData({
- textContentList: this.data.textContentList,
- wholeText
- })
- })
- session.on('removeAnchors', anchors => {
- console.log('anchor remove')
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/ocr-detect/ocr-detect.js b/miniprogram/packageAPI/pages/ar/ocr-detect/ocr-detect.js
deleted file mode 100644
index 8b4d313f..00000000
--- a/miniprogram/packageAPI/pages/ar/ocr-detect/ocr-detect.js
+++ /dev/null
@@ -1,232 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-// 初始化着色器函数
-let initShadersDone = false
-
-function initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE) {
- // 创建顶点着色器对象
- const vertexShader = loadShader(gl, gl.VERTEX_SHADER, VSHADER_SOURCE)
- // 创建片元着色器对象
- const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, FSHADER_SOURCE)
-
- if (!vertexShader || !fragmentShader) {
- return null
- }
-
- // 创建程序对象program
- const program = gl.createProgram()
- if (!gl.createProgram()) {
- return null
- }
- // 分配顶点着色器和片元着色器到program
- gl.attachShader(program, vertexShader)
- gl.attachShader(program, fragmentShader)
- // 链接program
- gl.linkProgram(program)
-
- // 检查程序对象是否连接成功
- const linked = gl.getProgramParameter(program, gl.LINK_STATUS)
- if (!linked) {
- const error = gl.getProgramInfoLog(program)
- console.log('程序对象连接失败: ' + error)
- gl.deleteProgram(program)
- gl.deleteShader(fragmentShader)
- gl.deleteShader(vertexShader)
- return null
- }
- // 返回程序program对象
- initShadersDone = true
- return program
-}
-
-function loadShader(gl, type, source) {
- // 创建顶点着色器对象
- const shader = gl.createShader(type)
- if (shader == null) {
- console.log('创建着色器失败')
- return null
- }
-
- // 引入着色器源代码
- gl.shaderSource(shader, source)
-
- // 编译着色器
- gl.compileShader(shader)
-
- // 检查顶是否编译成功
- const compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS)
- if (!compiled) {
- const error = gl.getShaderInfoLog(shader)
- console.log('编译着色器失败: ' + error)
- gl.deleteShader(shader)
- return null
- }
-
- return shader
-}
-
-const EDGE_VSHADER_SOURCE =
- `
- attribute vec4 aPosition;
- void main(void) {
- gl_Position = aPosition;
- }
-`
-
-const EDGE_FSHADER_SOURCE =
- `
- precision highp float;
- void main() {
- gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
- }
-`
-
-function initEdgeBuffer(gl, lt, lr, rb, lb) {
- const shaderProgram = gl.program
- const vertices = [
- lt.x, lt.y, 0.0,
- lr.x, lr.y, 0.0,
- rb.x, rb.y, 0.0,
- lb.x, lb.y, 0.0,
- ]
-
- const vertexBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW)
- const aPosition = gl.getAttribLocation(shaderProgram, 'aPosition')
- gl.enableVertexAttribArray(aPosition)
- gl.vertexAttribPointer(aPosition, 3, gl.FLOAT, false, 0, 0)
- const length = vertices.length / 3
- return length
-}
-
-function onDrawEdge(gl, lt, lr, rb, lb) {
- const n = initEdgeBuffer(gl, lt, lr, rb, lb)
- gl.drawArrays(gl.LINE_LOOP, 0, n)
-}
-
-function convert(obj) {
- obj.x = obj.x * 2 - 1
- obj.y = (1 - obj.y) * 2 - 1
- return obj
-}
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- initShadersDone = false
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({
- theme
- }) => {
- this.setData({
- theme
- })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
-
- // //逐帧渲染 debug
- // const onFrame1 = timestamp => {
- // this.renderer.autoClearColor = false
- // this.renderer.render(this.scene, this.camera)
- // this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- // this.canvas.requestAnimationFrame(onFrame1)
- // }
- // this.canvas.requestAnimationFrame(onFrame1)
- },
-
- render(frame) {
- const gl = this.gl
-
- this.renderGL(frame)
-
- const camera = frame.camera
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
-
- const textContentList = this.data.textContentList
-
- if (!textContentList || textContentList.length <= 0) {
- return
- } else {
- if (!initShadersDone) {
- this.edgeProgram = initShaders(gl, EDGE_VSHADER_SOURCE, EDGE_FSHADER_SOURCE)
- if (!this.edgeProgram) {
- console.log('初始化着色器失败')
- return
- }
- console.log('初始化着色器成功')
- }
-
- if (textContentList[0].box == undefined) {
- return
- }
-
- gl.useProgram(this.edgeProgram)
- gl.program = this.edgeProgram
-
- let lt; let lr; let rb; let lb
- for (let i = 0; i < textContentList.length; i++) {
- lt = textContentList[i].box[0]
- lr = textContentList[i].box[1]
- rb = textContentList[i].box[2]
- lb = textContentList[i].box[3]
- const avgX = (lt.x + lr.x + rb.x + lb.x) / 4
- const avgY = (lt.y + lr.y + rb.y + lb.y) / 4
- textContentList[i].centerX = avgX * this.data.width
- textContentList[i].centerY = avgY * this.data.height
-
- lt = convert(lt)
- lr = convert(lr)
- rb = convert(rb)
- lb = convert(lb)
- onDrawEdge(gl, lt, lr, rb, lb)
- }
- }
-
- this.setData({
- textContentList
- })
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/ocr-detect/ocr-detect.json b/miniprogram/packageAPI/pages/ar/ocr-detect/ocr-detect.json
deleted file mode 100644
index efc07789..00000000
--- a/miniprogram/packageAPI/pages/ar/ocr-detect/ocr-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "实时OCR检测"
-}
diff --git a/miniprogram/packageAPI/pages/ar/ocr-detect/ocr-detect.wxml b/miniprogram/packageAPI/pages/ar/ocr-detect/ocr-detect.wxml
deleted file mode 100644
index b02129eb..00000000
--- a/miniprogram/packageAPI/pages/ar/ocr-detect/ocr-detect.wxml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
- {{item.subtext}}
-
-
-
- 提示:将摄像头对准图片的文字, 下方显示检测到的文字
- {{wholeText}}
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/ocr-detect/ocr-detect.wxss b/miniprogram/packageAPI/pages/ar/ocr-detect/ocr-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/ocr-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/ocr-detect/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/ocr-detect/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/osd-ar/behavior.js b/miniprogram/packageAPI/pages/ar/osd-ar/behavior.js
deleted file mode 100644
index 68c69ff9..00000000
--- a/miniprogram/packageAPI/pages/ar/osd-ar/behavior.js
+++ /dev/null
@@ -1,181 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.6)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
- const THREE = this.THREE
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 3
- },
- OSD: true,
- },
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.6, info.pixelRatio)
- })
-
- if (this.afterVKSessionCreated) {
- this.afterVKSessionCreated()
- }
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/osd-ar/choose.png b/miniprogram/packageAPI/pages/ar/osd-ar/choose.png
deleted file mode 100644
index 2874a9bd..00000000
Binary files a/miniprogram/packageAPI/pages/ar/osd-ar/choose.png and /dev/null differ
diff --git a/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.js b/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.js
deleted file mode 100644
index aea30f80..00000000
--- a/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.js
+++ /dev/null
@@ -1,196 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- theme: 'light',
- frameShow: false,
- frameX: 0,
- frameY: 0,
- frameWidth: 0,
- frameHeight: 0,
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- },
- afterVKSessionCreated() {
- this.session.on('addAnchors', anchors => {
- const anchor = anchors[0]
- const {
- width,
- height
- } = this.data
- if (anchor && this.markerId) {
- this.setData({
- frameShow: true,
- frameX: anchor.origin.x * width,
- frameY: anchor.origin.y * height,
- frameWidth: anchor.size.width * width,
- frameHeight: anchor.size.height * height,
- })
- }
- })
- this.session.on('updateAnchors', anchors => {
- const anchor = anchors[0]
- const {
- width,
- height
- } = this.data
- if (anchor) {
- this.setData({
- frameX: anchor.origin.x * width,
- frameY: anchor.origin.y * height,
- frameWidth: anchor.size.width * width,
- frameHeight: anchor.size.height * height,
- })
- }
- })
- this.session.on('removeAnchors', anchors => {
- this.setData({
- frameShow: false,
- })
- })
- },
- chooseMedia() {
- wx.chooseMedia({
- count: 1,
- mediaType: ['image'],
- success: res => {
- console.log('chooseMedia res', res)
- const imgUrl = res.tempFiles[0].tempFilePath
- wx.getImageInfo({
- src: imgUrl,
- success: res => {
- const {
- width,
- height
- } = res
- console.log('getImageInfo res', res)
- this.setData({
- imgUrl,
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- render(frame) {
- this.renderGL(frame)
-
- const camera = frame.camera
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- addOSDMarker() {
- if (this.markerId) return
- const fs = wx.getFileSystemManager()
- const filePath = `${wx.env.USER_DATA_PATH}/osd-ar.jpg`
-
- // const download = callback => wx.downloadFile({
- // // 此处设置为osd识别对象的地址
- // url: 'https://res.wx.qq.com/op_res/h7DtLCbw1wzG7mzwlyfmmTDYUjq6pwCAHN5Ep0xA9PDvSa_knfz1Vg5E6vSKxxWG2mnHVzl2qBC789tQwNl_pw',
- // success(res) {
- // fs.saveFile({
- // filePath,
- // tempFilePath: res.tempFilePath,
- // success: callback,
- // })
- // }
- // })
-
- const download = callback => {
- fs.saveFile({
- filePath,
- tempFilePath: this.data.imgUrl,
- success: callback,
- fail: res => {
- console.error(res)
- }
- })
- }
- const add = () => {
- console.log('[addMarker] --> ', filePath)
- this.markerId = this.session.addOSDMarker(filePath)
- this.setData({
- filePathNow: filePath
- })
- }
-
- const getFilePathNow = () => this.data.filePathNow
- fs.stat({
- path: filePath,
- success(res) {
- const path = getFilePathNow()
- if (path != filePath) {
- if (res.stats.isFile() && path) {
- fs.unlinkSync(path)
- }
- download(add)
- } else {
- add()
- }
- },
- fail: (res) => {
- console.error(res)
- download(add)
- }
- })
- },
- removeOSDMarker() {
- if (this.markerId) {
- this.session.removeOSDMarker(this.markerId)
- this.markerId = null
- }
- },
- getAllOSDMarker() {
- console.log(this.session.getAllOSDMarker())
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.json b/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.json
deleted file mode 100644
index 175252fd..00000000
--- a/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "单样本检测(OSD)"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.wxml b/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.wxml
deleted file mode 100644
index 3b5f6158..00000000
--- a/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.wxml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
- 提示:选择图片作为OSD对象, 点击添加OSD marker, 然后手机摄像头对准下方所选图片
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.wxss b/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.wxss
deleted file mode 100644
index 56145687..00000000
--- a/miniprogram/packageAPI/pages/ar/osd-ar/osd-ar.wxss
+++ /dev/null
@@ -1,15 +0,0 @@
-.btn-cnt {
- display: flex;
-}
-
-.photo-cnt {
- position: absolute;
- margin-top: 60vh;
-}
-
-.btn-choose {
- flex: 0 50%;
- display: flex;
- height: 5vh;
- margin-bottom: 5vh;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/osd-ar/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/osd-ar/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/osd-ar/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/photo-body-detect/behavior.js b/miniprogram/packageAPI/pages/ar/photo-body-detect/behavior.js
deleted file mode 100644
index 3cbc9a57..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-body-detect/behavior.js
+++ /dev/null
@@ -1,205 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 3
- },
- body: {
- mode: 2
- }
- },
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- session.on('addAnchors', anchors => {
- this.setData({
- anchor2DList: anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size
- })),
- })
- })
- session.on('updateAnchors', anchors => {
- this.data.anchor2DList = []
- // 手动传入图像的时候用dom画点和框就行
- this.setData({
- anchor2DList: anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size
- })),
- })
- })
- session.on('removeAnchors', anchors => {
- this.setData({
- anchor2DList: [],
- })
- this.data.anchor2DList = []
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-body-detect/photo-body-detect.js b/miniprogram/packageAPI/pages/ar/photo-body-detect/photo-body-detect.js
deleted file mode 100644
index 3d90861d..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-body-detect/photo-body-detect.js
+++ /dev/null
@@ -1,132 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- bodyImgUrl: '',
- bodyImgWidth: 0,
- bodyImgHeight: 0,
- bodyImgOriginWidth: 0,
- bodyImgOriginHeight: 0,
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- chooseMedia() {
- wx.chooseMedia({
- count: 1,
- mediaType: ['image'],
- success: res => {
- console.log('chooseMedia res', res)
- const imgUrl = res.tempFiles[0].tempFilePath
- wx.getImageInfo({
- src: imgUrl,
- success: res => {
- const fixWidth = 300
- const {
- width,
- height
- } = res
- console.log('getImageInfo res', res)
- this.setData({
- bodyImgUrl: imgUrl,
- bodyImgWidth: fixWidth,
- bodyImgHeight: (fixWidth / width) * height,
- bodyImgOriginWidth: width,
- bodyImgOriginHeight: height
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- init() {
- this.initGL()
- },
- render(frame) {
- return
- this.renderGL(frame)
-
- const camera = frame.camera
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullbody(this.THREE.CullbodyNone)
- },
- async detectbody() {
- if (this.data.bodyImgUrl) {
- const canvas = wx.createOffscreenCanvas({
- type: '2d',
- width: this.data.bodyImgOriginWidth,
- height: this.data.bodyImgOriginHeight,
- })
- const context = canvas.getContext('2d')
- const img = canvas.createImage()
- await new Promise(resolve => {
- img.onload = resolve
- img.src = this.data.bodyImgUrl
- })
-
- context.clearRect(0, 0, this.data.bodyImgOriginWidth, this.data.bodyImgOriginHeight)
- context.drawImage(img, 0, 0, this.data.bodyImgOriginWidth, this.data.bodyImgOriginHeight)
-
- this.imgData = context.getImageData(0, 0, this.data.bodyImgOriginWidth, this.data.bodyImgOriginHeight)
-
- console.log('[frameBuffer] --> ', this.imgData.data.buffer)
- console.log('this.session.detectbody', this.session.detectbody)
- console.log('width', this.data.bodyImgOriginWidth)
- console.log('height', this.data.bodyImgOriginHeight)
- this.session.detectBody({
- frameBuffer: this.imgData.data.buffer,
- width: this.data.bodyImgOriginWidth,
- height: this.data.bodyImgOriginHeight,
- scoreThreshold: 0.5, // 评分阈值
- sourceType: 1
- })
- }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/photo-body-detect/photo-body-detect.json b/miniprogram/packageAPI/pages/ar/photo-body-detect/photo-body-detect.json
deleted file mode 100644
index 5dccf811..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-body-detect/photo-body-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "照片人体检测"
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-body-detect/photo-body-detect.wxml b/miniprogram/packageAPI/pages/ar/photo-body-detect/photo-body-detect.wxml
deleted file mode 100644
index b5e324ac..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-body-detect/photo-body-detect.wxml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- 原图:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-提示:点击选择图片,上传本地人体照片,然后开始检测,对应人体将会显示识别框和人体标记点
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/photo-body-detect/photo-body-detect.wxss b/miniprogram/packageAPI/pages/ar/photo-body-detect/photo-body-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/photo-body-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/photo-body-detect/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-body-detect/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/photo-depth-detect/behavior.js b/miniprogram/packageAPI/pages/ar/photo-depth-detect/behavior.js
deleted file mode 100644
index f4aa1f91..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-depth-detect/behavior.js
+++ /dev/null
@@ -1,181 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- depth: {
- mode: 2
- }
- },
- cameraPosition: 0,
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- session.on('addAnchors', anchors => {
- })
- session.on('updateAnchors', anchors => {
- const depthArray = []
- // 手动传入图像的时候用dom画点和框就行
- const anchor2DList = anchors.map(anchor => ({
- value: anchor.depthArray,
- size: anchor.size
- }))
- wx.hideLoading()
- if (anchor2DList.length > 0) {
- let width = 80
- let height = 80
- anchor2DList.forEach(anchor => {
- width = anchor.size[0]
- height = anchor.size[1]
- anchor.value.forEach(item => {
- depthArray.push(item.value)
- })
- this.renderDepthGL(depthArray, width, height)
- })
- }
- })
- session.on('removeAnchors', anchors => {
- })
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-depth-detect/depthBehavior.js b/miniprogram/packageAPI/pages/ar/photo-depth-detect/depthBehavior.js
deleted file mode 100644
index 5836beb6..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-depth-detect/depthBehavior.js
+++ /dev/null
@@ -1,145 +0,0 @@
-const depthBehavior = Behavior({
- methods: {
- initDepthShader() {
- const gl = this.gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_texture_float')
- if (!ext) console.warn('OES_texture_float not support')
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- precision highp float;
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- varying vec2 v_texCoord;
- void main() {
- gl_Position = vec4(a_position, 0, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
- uniform sampler2D depth_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 depth_color = texture2D(depth_texture, v_texCoord);
- gl_FragColor = vec4(depth_color.rgb , 1.0);
- }
- `
- 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 program = this._depthProgram = gl.createProgram()
- this._depthProgram.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformTexture = gl.getUniformLocation(program, 'depth_texture')
- gl.uniform1i(uniformTexture, 5)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initDepthVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._depthProgram, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._depthProgram, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 0, 0, 0, 1, 1, 0, 1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._depthVao = vao
- },
- initDepthGL() {
- this.initDepthShader()
- this.initDepthVAO()
- },
- renderDepthGL(depthBuffer, width, height) {
- const gl = this.renderer.getContext()
-
- gl.disable(gl.DEPTH_TEST) // 缺少这句安卓端可能绘制不出图像
-
- const depthTexture = gl.createTexture()
- gl.bindTexture(gl.TEXTURE_2D, depthTexture)
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
- 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)
-
- const ext = gl.getExtension('OES_texture_float')
- if (ext) {
- const data = new Float32Array(width * height * 4)
- for (let i = 0; i < depthBuffer.length; i++) {
- data[i * 4] = depthBuffer[i]
- data[i * 4 + 1] = depthBuffer[i]
- data[i * 4 + 2] = depthBuffer[i]
- data[i * 4 + 3] = depthBuffer[i]
- }
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.FLOAT, data)
- } else {
- const data = new Uint8Array(width * height * 4)
- for (let i = 0; i < depthBuffer.length; i++) {
- const num = parseInt(depthBuffer[i] * 255)
- data[i * 4] = num
- data[i * 4 + 1] = num
- data[i * 4 + 2] = num
- data[i * 4 + 3] = num
- }
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, data)
- }
-
- depthTexture._gl = gl
- gl.bindTexture(gl.TEXTURE_2D, null)
-
- if (depthTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._depthProgram)
- this.ext.bindVertexArrayOES(this._depthVao)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, depthTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default depthBehavior
diff --git a/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.js b/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.js
deleted file mode 100644
index 3f533123..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-import depthBehavior from './depthBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-Component({
- behaviors: [getBehavior(), yuvBehavior, depthBehavior],
- data: {
- depthImgUrl: '',
- depthImgWidth: 0,
- depthImgHeight: 0,
- depthImgOriginWidth: 0,
- depthImgOriginHeight: 0,
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- chooseMedia() {
- wx.chooseMedia({
- count: 1,
- mediaType: ['image'],
- success: res => {
- console.log('chooseMedia res', res)
- const imgUrl = res.tempFiles[0].tempFilePath
- wx.getImageInfo({
- src: imgUrl,
- success: res => {
- const fixWidth = 300
- const {
- width,
- height
- } = res
- console.log('getImageInfo res', res)
-
- let depthImgWidth
- let depthImgHeight
- if (width > height) {
- depthImgWidth = fixWidth
- depthImgHeight = fixWidth * height / width
- } else {
- depthImgWidth = fixWidth * width / height
- depthImgHeight = fixWidth
- }
- this.setData({
- depthImgUrl: imgUrl,
- depthImgWidth,
- depthImgHeight,
- depthImgOriginWidth: width,
- depthImgOriginHeight: height
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- init() {
- this.initGL()
- this.initDepthGL()
- console.log('init finish')
- },
- async detectDepth() {
- if (this.data.depthImgUrl) {
- const canvas = wx.createOffscreenCanvas({
- type: '2d',
- width: this.data.depthImgOriginWidth,
- height: this.data.depthImgOriginHeight,
- })
- const context = canvas.getContext('2d')
- const img = canvas.createImage()
- await new Promise(resolve => {
- img.onload = resolve
- img.src = this.data.depthImgUrl
- })
-
- context.clearRect(0, 0, this.data.depthImgOriginWidth, this.data.depthImgOriginHeight)
- context.drawImage(img, 0, 0, this.data.depthImgOriginWidth, this.data.depthImgOriginHeight)
-
- this.imgData = context.getImageData(0, 0, this.data.depthImgOriginWidth, this.data.depthImgOriginHeight)
-
- console.log('[frameBuffer] --> ', this.imgData.data.buffer)
- console.log('this.session.detectDepth', this.session.detectDepth)
- console.log('width', this.data.depthImgOriginWidth)
- console.log('height', this.data.depthImgOriginHeight)
- wx.showLoading({ title: '深度图生成中...' })
- this.session.detectDepth({
- frameBuffer: this.imgData.data.buffer,
- width: this.data.depthImgOriginWidth,
- height: this.data.depthImgOriginHeight,
- })
- }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.json b/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.json
deleted file mode 100644
index 235f8221..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "照片深度图检测"
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.less b/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.less
deleted file mode 100644
index 3ae1a481..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.less
+++ /dev/null
@@ -1 +0,0 @@
-/* packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.wxml b/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.wxml
deleted file mode 100644
index 7ce7ba0a..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.wxml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- 原图:
-
-
-
-
-
-
-
-
-
-提示:点击选择图片,上传本地深度图照片,然后开始检测,将会显示深度图信息
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.wxss b/miniprogram/packageAPI/pages/ar/photo-depth-detect/photo-depth-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/photo-depth-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/photo-depth-detect/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-depth-detect/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/photo-face-detect/behavior.js b/miniprogram/packageAPI/pages/ar/photo-face-detect/behavior.js
deleted file mode 100644
index a3951281..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-face-detect/behavior.js
+++ /dev/null
@@ -1,202 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- face: {
- mode: 2
- }
- },
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- session.on('addAnchors', anchors => {
- this.setData({
- anchor2DList: anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size
- })),
- })
- })
- session.on('updateAnchors', anchors => {
- this.data.anchor2DList = []
- // 手动传入图像的时候用dom画点和框就行
- this.setData({
- anchor2DList: anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size
- })),
- })
- })
- session.on('removeAnchors', anchors => {
- this.setData({
- anchor2DList: [],
- })
- this.data.anchor2DList = []
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-face-detect/photo-face-detect.js b/miniprogram/packageAPI/pages/ar/photo-face-detect/photo-face-detect.js
deleted file mode 100644
index d7ab5212..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-face-detect/photo-face-detect.js
+++ /dev/null
@@ -1,134 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- faceImgUrl: '',
- faceImgWidth: 0,
- faceImgHeight: 0,
- faceImgOriginWidth: 0,
- faceImgOriginHeight: 0,
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- chooseMedia() {
- wx.chooseMedia({
- count: 1,
- mediaType: ['image'],
- success: res => {
- console.log('chooseMedia res', res)
- const imgUrl = res.tempFiles[0].tempFilePath
- wx.getImageInfo({
- src: imgUrl,
- success: res => {
- const fixWidth = 300
- const {
- width,
- height
- } = res
- console.log('getImageInfo res', res)
- this.setData({
- faceImgUrl: imgUrl,
- faceImgWidth: fixWidth,
- faceImgHeight: (fixWidth / width) * height,
- faceImgOriginWidth: width,
- faceImgOriginHeight: height
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- init() {
- // this.initGL()
- },
- render(frame) {
- return
- this.renderGL(frame)
-
- const camera = frame.camera
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- async detectFace() {
- if (this.data.faceImgUrl) {
- const canvas = wx.createOffscreenCanvas({
- type: '2d',
- width: this.data.faceImgOriginWidth,
- height: this.data.faceImgOriginHeight,
- })
- const context = canvas.getContext('2d')
- const img = canvas.createImage()
- await new Promise(resolve => {
- img.onload = resolve
- img.src = this.data.faceImgUrl
- })
-
- context.clearRect(0, 0, this.data.faceImgOriginWidth, this.data.faceImgOriginHeight)
- context.drawImage(img, 0, 0, this.data.faceImgOriginWidth, this.data.faceImgOriginHeight)
-
- this.imgData = context.getImageData(0, 0, this.data.faceImgOriginWidth, this.data.faceImgOriginHeight)
-
- console.log('[frameBuffer] --> ', this.imgData.data.buffer)
- console.log('this.session.detectFace', this.session.detectFace)
- console.log('width', this.data.faceImgOriginWidth)
- console.log('height', this.data.faceImgOriginHeight)
-
- this.session.detectFace({
- frameBuffer: this.imgData.data.buffer,
- width: this.data.faceImgOriginWidth,
- height: this.data.faceImgOriginHeight,
- scoreThreshold: 0.5, // 评分阈值
- sourceType: 1,
- modelMode: 1,
- })
- }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/photo-face-detect/photo-face-detect.json b/miniprogram/packageAPI/pages/ar/photo-face-detect/photo-face-detect.json
deleted file mode 100644
index 7349c856..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-face-detect/photo-face-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "照片人脸检测"
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-face-detect/photo-face-detect.wxml b/miniprogram/packageAPI/pages/ar/photo-face-detect/photo-face-detect.wxml
deleted file mode 100644
index 58463aa3..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-face-detect/photo-face-detect.wxml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- 原图:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-提示:点击选择图片,上传本地人脸照片,然后开始检测,对应人脸将会显示识别框和人脸标记点
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/photo-face-detect/photo-face-detect.wxss b/miniprogram/packageAPI/pages/ar/photo-face-detect/photo-face-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/photo-face-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/photo-face-detect/yuvBehavior.js
deleted file mode 100644
index 08ffb7fa..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-face-detect/yuvBehavior.js
+++ /dev/null
@@ -1,140 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- console.log('初始化shader完成')
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/photo-hand-detect/behavior.js b/miniprogram/packageAPI/pages/ar/photo-hand-detect/behavior.js
deleted file mode 100644
index 2334d272..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-hand-detect/behavior.js
+++ /dev/null
@@ -1,209 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 3
- },
- hand: {
- mode: 2
- }
- },
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- session.on('addAnchors', anchors => {
- this.setData({
- anchor2DList: anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size,
- gesture: anchor.gesture
- })),
- })
- })
-
- session.on('updateAnchors', anchors => {
- this.data.anchor2DList = []
- // 手动传入图像的时候用dom画点和框就行
- this.setData({
- anchor2DList: anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size,
- gesture: anchor.gesture
- })),
- })
- })
-
- session.on('removeAnchors', anchors => {
- this.setData({
- anchor2DList: [],
- })
- this.data.anchor2DList = []
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-hand-detect/photo-hand-detect.js b/miniprogram/packageAPI/pages/ar/photo-hand-detect/photo-hand-detect.js
deleted file mode 100644
index e543d90f..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-hand-detect/photo-hand-detect.js
+++ /dev/null
@@ -1,132 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- handImgUrl: '',
- handImgWidth: 0,
- handImgHeight: 0,
- handImgOriginWidth: 0,
- handImgOriginHeight: 0,
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- chooseMedia() {
- wx.chooseMedia({
- count: 1,
- mediaType: ['image'],
- success: res => {
- console.log('chooseMedia res', res)
- const imgUrl = res.tempFiles[0].tempFilePath
- wx.getImageInfo({
- src: imgUrl,
- success: res => {
- const fixWidth = 300
- const {
- width,
- height
- } = res
- console.log('getImageInfo res', res)
- this.setData({
- handImgUrl: imgUrl,
- handImgWidth: fixWidth,
- handImgHeight: (fixWidth / width) * height,
- handImgOriginWidth: width,
- handImgOriginHeight: height
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- init() {
- this.initGL()
- },
- render(frame) {
- return
- this.renderGL(frame)
-
- const camera = frame.camera
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullhand(this.THREE.CullhandNone)
- },
- async detectHand() {
- if (this.data.handImgUrl) {
- const canvas = wx.createOffscreenCanvas({
- type: '2d',
- width: this.data.handImgOriginWidth,
- height: this.data.handImgOriginHeight,
- })
- const context = canvas.getContext('2d')
- const img = canvas.createImage()
- await new Promise(resolve => {
- img.onload = resolve
- img.src = this.data.handImgUrl
- })
-
- context.clearRect(0, 0, this.data.handImgOriginWidth, this.data.handImgOriginHeight)
- context.drawImage(img, 0, 0, this.data.handImgOriginWidth, this.data.handImgOriginHeight)
-
- this.imgData = context.getImageData(0, 0, this.data.handImgOriginWidth, this.data.handImgOriginHeight)
-
- console.log('[frameBuffer] --> ', this.imgData.data.buffer)
- console.log('this.session.detectHand', this.session.detectHand)
- console.log('width', this.data.handImgOriginWidth)
- console.log('height', this.data.handImgOriginHeight)
- this.session.detectHand({
- frameBuffer: this.imgData.data.buffer,
- width: this.data.handImgOriginWidth,
- height: this.data.handImgOriginHeight,
- scoreThreshold: 0.5, // 评分阈值
- algoMode: 2
- })
- }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/photo-hand-detect/photo-hand-detect.json b/miniprogram/packageAPI/pages/ar/photo-hand-detect/photo-hand-detect.json
deleted file mode 100644
index bb2c079c..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-hand-detect/photo-hand-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "照片手势检测"
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-hand-detect/photo-hand-detect.wxml b/miniprogram/packageAPI/pages/ar/photo-hand-detect/photo-hand-detect.wxml
deleted file mode 100644
index 281a8030..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-hand-detect/photo-hand-detect.wxml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- 原图:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-提示:点击选择图片,上传本地手部照片,然后开始检测,对应手部将会显示识别框和手部标记点
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/photo-hand-detect/photo-hand-detect.wxss b/miniprogram/packageAPI/pages/ar/photo-hand-detect/photo-hand-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/photo-hand-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/photo-hand-detect/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-hand-detect/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.js b/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.js
deleted file mode 100644
index a3a1a0b3..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.js
+++ /dev/null
@@ -1,223 +0,0 @@
-Component({
- behaviors: [],
- data: {
- // 主题相关逻辑
- theme: 'light',
- // 上传识别相关逻辑
- imgUrl: '',
- imgWidth: 0,
- imgHeight: 0,
- imgOriginWidth: 0,
- imgOriginHeight: 0,
- // 显示身份证识别结果
- detected: false,
- detectSuccess: false,
- isComplete: false,
- label: '',
- orientation: 0,
- box: [],
- cropImg: null,
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- onReady() {
- this.initVK()
- },
- // VK 初始化逻辑
- initVK() {
- // VKSession 配置
- const session = this.session = wx.createVKSession({
- track: {
- IDCard: {
- mode: 2 // 照片模式
- }
- },
- version: 'v1',
- gl: this.gl
- })
-
- // VKSession start
- session.start(err => {
- session.on('updateAnchors', anchors => {
- console.log('updateAnchors')
-
- // 处理返回的身份证信息
- if (anchors && anchors[0]) {
- // 存在数组,证明存在身份证信息
- const anchor = anchors[0]
-
- // console.log(anchor.isComplete, anchor.label, anchor.orientation, anchor.box);
-
- this.setData({
- detected: true,
- detectSuccess: true,
- isComplete: anchor.isComplete,
- label: anchor.label,
- orientation: anchor.orientation,
- box: anchor.box,
- })
-
- // 裁剪信息
- const affineImgWidth = anchor.affineImgWidth
- const affineImgHeight = anchor.affineImgHeight
- const affineMat = anchor.affineMat
-
- // 存在裁剪信息,进行身份证裁剪处理
- if (affineImgWidth && affineImgHeight && affineMat) {
- console.log(affineImgWidth, affineImgHeight, affineMat)
-
- const cropIDcardImg = this.getCropIDcard(affineImgWidth, affineImgHeight, affineMat)
-
- this.setData({
- cropImg: cropIDcardImg
- })
- }
- }
- })
- session.on('removeAnchors', anchors => {
- console.log('anchor remove')
-
- // 图片没有识别到身份证
- this.setData({
- detected: true,
- detectSuccess: false,
- })
- })
- })
- },
- // 裁剪身份证图片
- getCropIDcard(affineImgWidth, affineImgHeight, affineMat) {
- const canvas = wx.createOffscreenCanvas({
- type: '2d',
- width: affineImgWidth,
- height: affineImgHeight,
- })
- const context = canvas.getContext('2d')
-
- context.clearRect(0, 0, affineImgWidth, affineImgHeight)
- /*
- * affineMat 3x3仿射变换矩阵,行主序
- * [0 1 2
- * 3 4 5
- * 6 7 8]
- */
- /*
- * canvas 2d setTransform
- * setTransform(a, b, c, d, e, f)
- * [a c e
- * b d f
- * 0 0 1]
- */
- context.setTransform(
- Number(affineMat[0]),
- Number(affineMat[3]),
- Number(affineMat[1]),
- Number(affineMat[4]),
- Number(affineMat[2]),
- Number(affineMat[5])
- )
- console.log(this.img, this.data.imgOriginWidth, this.data.imgOriginHeight)
- context.drawImage(this.img, 0, 0, this.data.imgOriginWidth, this.data.imgOriginHeight)
- const imgUrl = canvas.toDataURL()
-
- // console.log(imgUrl);
-
- return imgUrl
- },
- // 上传识别图片
- chooseMedia() {
- wx.chooseMedia({
- count: 1,
- mediaType: ['image'],
- success: res => {
- console.log('chooseMedia res', res)
- const imgUrl = res.tempFiles[0].tempFilePath
- wx.getImageInfo({
- src: imgUrl,
- success: res => {
- const fixWidth = 300
- const {
- width,
- height
- } = res
- console.log('getImageInfo res', res)
- this.setData({
- imgUrl,
- imgWidth: fixWidth,
- imgHeight: (fixWidth / width) * height,
- imgOriginWidth: width,
- imgOriginHeight: height
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- // 识别身份证逻辑
- async detectIDCard() {
- console.log('detectIDCard')
- if (this.data.imgUrl) {
- const canvas = wx.createOffscreenCanvas({
- type: '2d',
- width: this.data.imgOriginWidth,
- height: this.data.imgOriginHeight,
- })
- const context = canvas.getContext('2d')
- const img = canvas.createImage()
- // 使用中的 图片对象
- this.img = img
- await new Promise(resolve => {
- img.onload = resolve
- img.src = this.data.imgUrl
- })
-
- context.clearRect(0, 0, this.data.imgOriginWidth, this.data.imgOriginHeight)
- context.drawImage(img, 0, 0, this.data.imgOriginWidth, this.data.imgOriginHeight)
-
- // 使用中的 image ArrayBuffer
- this.imgData = context.getImageData(0, 0, this.data.imgOriginWidth, this.data.imgOriginHeight)
-
- console.log('[frameBuffer] --> ', this.imgData.data.buffer)
- console.log('this.session.detectIDCard', this.session.detectIDCard)
- console.log('width', this.data.imgOriginWidth)
- console.log('height', this.data.imgOriginHeight)
- this.session.detectIDCard({
- // 识别身份证图片的信息
- frameBuffer: this.imgData.data.buffer,
- width: this.data.imgOriginWidth,
- height: this.data.imgOriginHeight,
- // 是否获取裁剪图片信息
- getAffineImg: true,
- })
- }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.json b/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.json
deleted file mode 100644
index abe57697..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "照片身份证检测"
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.wxml b/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.wxml
deleted file mode 100644
index a2201a5d..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.wxml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- 识别图片:
-
-
-
-
-
-
-
-
-
-
-
-
-
- 识别身份证信息
- {{isComplete === 0 ? '不完整' : '完整'}}
- {{label === 0 ? '照片面' : '国徽面'}}
- {{orientation === 0 ? '朝上' : ''}}{{orientation === 1 ? '朝右' : ''}}{{orientation === 2 ? '朝下' : ''}}{{orientation === 3 ? '朝左' : ''}}
- 坐标框: 左上({{box[0].x}}, {{box[0].y}}) 右上({{box[1].x}}, {{box[1].y}}) 右下({{box[2].x}}, {{box[2].y}}) 左下({{box[3].x}}, {{box[3].y}})
-
-
-
- 未识别到身份证
-
-
-
-
-
- 提示:点击选择图片,上传本地照片或使用小程序相机拍摄,然后开始身份证检测,将会显示检测到的身份证信息(需基础库版本3.3.0)
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.wxss b/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.wxss
deleted file mode 100644
index 3f0fe46c..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect.wxss
+++ /dev/null
@@ -1,85 +0,0 @@
-.img-wrap {
- display: flex;
- justify-content: center;
- margin: 20px 20px;
-}
-
-.preview-title {
- flex: 1;
- font-weight: bold;
- line-height: 160px;
- text-align: center;
-}
-
-.preview-img {
- flex: 2;
- height: 160px;
- border: 1px solid black;
- border-radius: 3px;
- background-color: rgb(220, 220, 220);
-}
-
-.btn-cnt {
- margin: 10px 20px;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-
-.btn-cnt .flex-row {
- display: flex;
- flex-direction: row;
-}
-
-.btn-cnt button {
- margin: 5px;
- width: 160px;
- font-size: 16px;
-}
-
-.btn-cnt .btn-sub {
- width: 200px;
- height: 50px;
-}
-
-.info-wrap {
- margin: 0 30px;
-}
-
-.info-list {
- border: 1px solid black;
- border-radius: 6px;
- padding: 10px 0;
- text-align: center;
-}
-
-.info-list .info-title {
- text-align: center;
- font-size: 18px;
- line-height: 40px;
-}
-
-.info-list p {
- display: inline-block;
- font-size: 14px;
- margin: 3px 5px;
- padding: 0px 5px;
-}
-
-.crop-img {
- margin-top: 10px;
- width: 240px;
- height: 160px;
-}
-
-.hint-bottom {
- position: absolute;
- left: 20px;
- right: 20px;
- bottom: 20px;
- padding: 5px 20px;
- font-size: 12px;
- color: #fff;
- background-color: rgba(0, 0, 0, 0.5);
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/photo-ocr-detect/behavior.js b/miniprogram/packageAPI/pages/ar/photo-ocr-detect/behavior.js
deleted file mode 100644
index a7b5af80..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-ocr-detect/behavior.js
+++ /dev/null
@@ -1,227 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.textContentList) this.textContentList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- OCR: {
- mode: 2
- }
- },
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- session.on('addAnchors', anchors => {
- console.log('anchor add')
- })
- session.on('updateAnchors', anchors => {
- this.data.textContentList = []
- console.log(anchors)
- this.data.textContentList = this.data.textContentList.concat(anchors.map(anchor => {
- let result = {}
- result = {
- text: anchor.text,
- subtext: anchor.subtext,
- box: anchor.box,
- centerX: anchor.centerX,
- centerY: anchor.centerY,
- }
- if (anchor.box) {
- const lt = anchor.box[0]
- const lr = anchor.box[1]
- const rb = anchor.box[2]
- const lb = anchor.box[3]
- const width = lr.x - lt.x
- const height = lb.y - lt.y
- const avgX = (lt.x + lr.x + rb.x + lb.x) / 4
- const avgY = (lt.y + lr.y + rb.y + lb.y) / 4
- anchor.centerX = avgX * this.data.faceImgWidth
- anchor.centerY = avgY * this.data.faceImgHeight
- result.origin = {
- x: lt.x,
- y: lt.y,
- }
- result.size = {
- width,
- height,
- }
- }
- return result
- }))
-
- let wholeText
- if (this.data.textContentList.length != 0) {
- wholeText = this.data.textContentList[0].text
- }
-
- this.setData({
- textContentList: this.data.textContentList,
- wholeText
- })
- })
- session.on('removeAnchors', anchors => {
- console.log('anchor remove')
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-ocr-detect/photo-ocr-detect.js b/miniprogram/packageAPI/pages/ar/photo-ocr-detect/photo-ocr-detect.js
deleted file mode 100644
index 568b636f..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-ocr-detect/photo-ocr-detect.js
+++ /dev/null
@@ -1,130 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- faceImgUrl: '',
- faceImgWidth: 0,
- faceImgHeight: 0,
- faceImgOriginWidth: 0,
- faceImgOriginHeight: 0,
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- chooseMedia() {
- wx.chooseMedia({
- count: 1,
- mediaType: ['image'],
- success: res => {
- console.log('chooseMedia res', res)
- const imgUrl = res.tempFiles[0].tempFilePath
- wx.getImageInfo({
- src: imgUrl,
- success: res => {
- const fixWidth = 300
- const {
- width,
- height
- } = res
- console.log('getImageInfo res', res)
- this.setData({
- faceImgUrl: imgUrl,
- faceImgWidth: fixWidth,
- faceImgHeight: (fixWidth / width) * height,
- faceImgOriginWidth: width,
- faceImgOriginHeight: height
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- init() {
- this.initGL()
- },
- render(frame) {
- return
- this.renderGL(frame)
-
- const camera = frame.camera
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- async runOCR() {
- if (this.data.faceImgUrl) {
- const canvas = wx.createOffscreenCanvas({
- type: '2d',
- width: this.data.faceImgOriginWidth,
- height: this.data.faceImgOriginHeight,
- })
- const context = canvas.getContext('2d')
- const img = canvas.createImage()
- await new Promise(resolve => {
- img.onload = resolve
- img.src = this.data.faceImgUrl
- })
-
- context.clearRect(0, 0, this.data.faceImgOriginWidth, this.data.faceImgOriginHeight)
- context.drawImage(img, 0, 0, this.data.faceImgOriginWidth, this.data.faceImgOriginHeight)
-
- this.imgData = context.getImageData(0, 0, this.data.faceImgOriginWidth, this.data.faceImgOriginHeight)
-
- console.log('[frameBuffer] --> ', this.imgData.data.buffer)
- console.log('this.session.runOCR', this.session.runOCR)
- console.log('width', this.data.faceImgOriginWidth)
- console.log('height', this.data.faceImgOriginHeight)
- this.session.runOCR({
- frameBuffer: this.imgData.data.buffer,
- width: this.data.faceImgOriginWidth,
- height: this.data.faceImgOriginHeight,
- })
- }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/photo-ocr-detect/photo-ocr-detect.json b/miniprogram/packageAPI/pages/ar/photo-ocr-detect/photo-ocr-detect.json
deleted file mode 100644
index b7470398..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-ocr-detect/photo-ocr-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "照片OCR检测"
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-ocr-detect/photo-ocr-detect.wxml b/miniprogram/packageAPI/pages/ar/photo-ocr-detect/photo-ocr-detect.wxml
deleted file mode 100644
index 68abf969..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-ocr-detect/photo-ocr-detect.wxml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- 原图:
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.subtext}}
-
-
-
-
-提示:点击选择图片,上传本地照片,然后开始文字检测,将会显示检测到的文字
-{{wholeText}}
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/photo-ocr-detect/photo-ocr-detect.wxss b/miniprogram/packageAPI/pages/ar/photo-ocr-detect/photo-ocr-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/photo-ocr-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/photo-ocr-detect/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-ocr-detect/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/behavior.js b/miniprogram/packageAPI/pages/ar/photo-shoe-detect/behavior.js
deleted file mode 100644
index 1cdfcde5..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/behavior.js
+++ /dev/null
@@ -1,194 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.textContentList) this.textContentList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- shoe: {
- mode: 2
- }
- },
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- session.on('addAnchors', anchors => {
- console.log('anchor add')
- })
- session.on('updateAnchors', anchors => {
- console.log(anchors)
- this.data.anchor2DList = []
- // 手动传入图像的时候用dom画点和框就行
- this.setData({
- anchor2DList: anchors.map(anchor => ({
- points: anchor.points,
- origin: anchor.origin,
- size: anchor.size
- })),
- })
- })
- session.on('removeAnchors', anchors => {
- console.log('anchor remove')
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.js b/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.js
deleted file mode 100644
index 8e7051c5..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.js
+++ /dev/null
@@ -1,112 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- shoeImgUrl: '',
- shoeImgWidth: 0,
- shoeImgHeight: 0,
- shoeImgOriginWidth: 0,
- shoeImgOriginHeight: 0,
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- chooseMedia() {
- wx.chooseMedia({
- count: 1,
- mediaType: ['image'],
- success: res => {
- console.log('chooseMedia res', res)
- const imgUrl = res.tempFiles[0].tempFilePath
- wx.getImageInfo({
- src: imgUrl,
- success: res => {
- const fixWidth = 300
- const {
- width,
- height
- } = res
- console.log('getImageInfo res', res)
- this.setData({
- shoeImgUrl: imgUrl,
- shoeImgWidth: fixWidth,
- shoeImgHeight: (fixWidth / width) * height,
- shoeImgOriginWidth: width,
- shoeImgOriginHeight: height
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- init() {
- this.initGL()
- },
- render(frame) {
-
- },
- async detectShoe() {
- if (this.data.shoeImgUrl) {
- const canvas = wx.createOffscreenCanvas({
- type: '2d',
- width: this.data.shoeImgOriginWidth,
- height: this.data.shoeImgOriginHeight,
- })
- const context = canvas.getContext('2d')
- const img = canvas.createImage()
- await new Promise(resolve => {
- img.onload = resolve
- img.src = this.data.shoeImgUrl
- })
-
- context.clearRect(0, 0, this.data.shoeImgOriginWidth, this.data.shoeImgOriginHeight)
- context.drawImage(img, 0, 0, this.data.shoeImgOriginWidth, this.data.shoeImgOriginHeight)
-
- this.imgData = context.getImageData(0, 0, this.data.shoeImgOriginWidth, this.data.shoeImgOriginHeight)
-
- console.log('[frameBuffer] --> ', this.imgData.data.buffer)
- console.log('this.session.detectShoe', this.session.detectShoe)
- console.log('width', this.data.shoeImgOriginWidth)
- console.log('height', this.data.shoeImgOriginHeight)
- this.session.detectShoe({
- frameBuffer: this.imgData.data.buffer,
- width: this.data.shoeImgOriginWidth,
- height: this.data.shoeImgOriginHeight,
- })
- }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.json b/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.json
deleted file mode 100644
index 41f95d8c..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "照片鞋部检测"
-}
diff --git a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.less b/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.less
deleted file mode 100644
index f28f65b8..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.less
+++ /dev/null
@@ -1 +0,0 @@
-/* packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.wxml b/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.wxml
deleted file mode 100644
index 883ddef0..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.wxml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
- 原图:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-提示:点击选择图片,上传本地鞋部照片,然后开始检测,对应鞋部将会显示识别框和鞋部标记点
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.wxss b/miniprogram/packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/photo-shoe-detect/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/photo-shoe-detect/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/behavior.js b/miniprogram/packageAPI/pages/ar/plane-ar-3dof/behavior.js
deleted file mode 100644
index 74994ab4..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/behavior.js
+++ /dev/null
@@ -1,253 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-import cloneGltf from '../loaders/gltf-clone'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
- const THREE = this.THREE
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 3
- },
- threeDof: true,
- },
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- const loader = new THREE.GLTFLoader()
- loader.load('https://dldir1.qq.com/weixin/miniprogram/RobotExpressive_aa2603d917384b68bb4a086f32dabe83.glb', gltf => {
- this.model = {
- scene: gltf.scene,
- animations: gltf.animations,
- }
- })
-
- this.clock = new THREE.Clock()
-
- loader.load('https://dldir1.qq.com/weixin/miniprogram/reticle_4b6cc19698ca4a08b31fd3c95ce412ec.glb', gltf => {
- const reticle = this.reticle = gltf.scene
-
- reticle.visible = false
- this.scene.add(reticle)
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- updateAnimation() {
- const dt = this.clock.getDelta()
- if (this.mixers) this.mixers.forEach(mixer => mixer.update(dt))
- },
- copyRobot() {
- const THREE = this.THREE
- const {
- scene,
- animations
- } = cloneGltf(this.model, THREE)
- scene.scale.set(0.05, 0.05, 0.05)
-
- // 动画混合器
- const mixer = new THREE.AnimationMixer(scene)
- for (let i = 0; i < animations.length; i++) {
- const clip = animations[i]
- if (clip.name === 'Dance') {
- const action = mixer.clipAction(clip)
- action.play()
- }
- }
-
- this.mixers = this.mixers || []
- this.mixers.push(mixer)
-
- scene._mixer = mixer
- return scene
- },
- getRobot() {
- const THREE = this.THREE
-
- const model = new THREE.Object3D()
- model.add(this.copyRobot())
-
- this._insertModels = this._insertModels || []
- this._insertModels.push(model)
-
- if (this._insertModels.length > 5) {
- const needRemove = this._insertModels.splice(0, this._insertModels.length - 5)
- needRemove.forEach(item => {
- if (item._mixer) {
- const mixer = item._mixer
- this.mixers.splice(this.mixers.indexOf(mixer), 1)
- mixer.uncacheRoot(mixer.getRoot())
- }
- if (item.parent) item.parent.remove(item)
- })
- }
- return model
- },
- onTouchEnd(evt) {
- if (this.scene && this.model && this.reticle) {
- const model = this.getRobot()
- model.position.copy(this.reticle.position)
- model.rotation.copy(this.reticle.rotation)
- this.scene.add(model)
- }
- }
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.js b/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.js
deleted file mode 100644
index baa31187..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.js
+++ /dev/null
@@ -1,77 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- },
- render(frame) {
- this.renderGL(frame)
-
- const camera = frame.camera
-
- // 修改光标位置
- const reticle = this.reticle
- if (reticle) {
- const hitTestRes = this.session.hitTest(0.5, 0.5)
- if (hitTestRes.length) {
- reticle.matrixAutoUpdate = false
- reticle.matrix.fromArray(hitTestRes[0].transform)
- reticle.matrix.decompose(reticle.position, reticle.quaternion, reticle.scale)
- reticle.visible = true
- } else {
- reticle.visible = false
- }
- }
-
- // 更新动画
- this.updateAnimation()
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.json b/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.json
deleted file mode 100644
index c9640e44..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "水平面旋转AR"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.less b/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.less
deleted file mode 100644
index e91a65e0..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.less
+++ /dev/null
@@ -1 +0,0 @@
-/* packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.wxml b/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.wxml
deleted file mode 100644
index f78f70d5..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.wxml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-提示:触碰屏幕任意点, 可在对应位置生成示例的机器小人, 其中光标标记指示的是水平面
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.wxss b/miniprogram/packageAPI/pages/ar/plane-ar-3dof/plane-ar-3dof.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/plane-ar-3dof/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-3dof/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/behavior.js b/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/behavior.js
deleted file mode 100644
index c3f72e94..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/behavior.js
+++ /dev/null
@@ -1,363 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-import cloneGltf from '../loaders/gltf-clone'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.scene2) {
- this.scene2.dispose()
- this.scene2 = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.robotBox) this.robotBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
- const THREE = this.THREE
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 1
- },
- depth: {
- mode: 1
- },
- },
- version: 'v2',
- gl: this.gl,
- })
- const session = this.session
- session.start(err => {
- if (err) {
- this.setData({
- errMsg: 'VK error: ' + err
- })
- return console.error('VK error: ', err)
- }
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- const loader = new THREE.GLTFLoader()
- loader.load('https://dldir1.qq.com/weixin/miniprogram/RobotExpressive_aa2603d917384b68bb4a086f32dabe83.glb', gltf => {
- this.model = {
- scene: gltf.scene,
- animations: gltf.animations,
- }
- })
-
- this.clock = new THREE.Clock()
-
- loader.load('https://dldir1.qq.com/weixin/miniprogram/reticle_4b6cc19698ca4a08b31fd3c95ce412ec.glb', gltf => {
- const reticle = this.reticle = gltf.scene
-
- reticle.visible = false
- this.planeBox.add(reticle)
- })
-
- // anchor 检测
- const createPlane = size => {
- const geometry = new THREE.PlaneGeometry(size.width, size.height)
- const material = new THREE.MeshBasicMaterial({
- color: 0xffffff,
- side: THREE.DoubleSide,
- transparent: true,
- opacity: 0.5
- })
- const mesh = new THREE.Mesh(geometry, material)
- mesh.rotateX(Math.PI / 2)
- const cnt = new THREE.Object3D()
- cnt.add(mesh)
- this.plane = cnt
- this.plane.width = size.width
- this.plane.height = size.height
- return cnt
- }
- const updateMatrix = (object, m) => {
- object.matrixAutoUpdate = false
- object.matrix.fromArray(m)
- }
- session.on('addAnchors', anchors => {
- anchors.forEach(anchor => {
- const size = anchor.size
- let object
- if (size) {
- // object = createPlane(size)
- this.planeBox.add(object)
- } else {
- if (!this.model) {
- console.warn('this.model 还没加载完成 !!!!!')
- return
- }
- object = new THREE.Object3D()
- const model = this.getRobot()
- model.rotateX(-Math.PI / 2)
- object.add(model)
- this.robotBox.add(object)
- }
-
- if (object) {
- object._id = anchor.id
- object._size = size
- updateMatrix(object, anchor.transform)
- }
- })
- })
- session.on('updateAnchors', anchors => {
- const map = anchors.reduce((temp, item) => {
- temp[item.id] = item
- return temp
- }, {})
- this.planeBox.children.forEach(object => {
- if (object._id && map[object._id]) {
- const anchor = map[object._id]
- const size = anchor.size
- if (size && object._size && (size.width !== object._size.width || size.height !== object._size.height)) {
- this.planeBox.remove(object)
- // object = createPlane(size)
- this.plane = object
- this.planeBox.add(object)
- }
- object._id = anchor.id
- object._size = size
- updateMatrix(object, anchor.transform)
- }
- })
- })
- session.on('removeAnchors', anchors => {
- const map = anchors.reduce((temp, item) => {
- temp[item.id] = item
- return temp
- }, {})
- this.planeBox.children.forEach(object => {
- if (object._id && map[object._id]) this.planeBox.remove(object)
- })
- this.robotBox.children.forEach(object => {
- if (object._id && map[object._id]) this.robotBox.remove(object)
- })
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- try {
- this.render(frame)
- } catch (e) {
- console.log(e)
- }
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
- // 平面集合
- this.robotBox = new THREE.Object3D()
- this.planeBox = new THREE.Object3D()
- scene.add(this.robotBox)
-
- this.scene2 = new THREE.Scene()
- this.scene2.add(this.planeBox)
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- updateAnimation() {
- const dt = this.clock.getDelta()
- if (this.mixers) this.mixers.forEach(mixer => mixer.update(dt))
- },
- copyRobot() {
- const THREE = this.THREE
- const {
- scene,
- animations
- } = cloneGltf(this.model, THREE)
- scene.scale.set(0.1, 0.1, 0.1)
-
- // 动画混合器
- const mixer = new THREE.AnimationMixer(scene)
- for (let i = 0; i < animations.length; i++) {
- const clip = animations[i]
- if (clip.name === 'Dance') {
- const action = mixer.clipAction(clip)
- action.play()
- }
- }
-
- this.mixers = this.mixers || []
- this.mixers.push(mixer)
-
- scene._mixer = mixer
- return scene
- },
- getRobot() {
- const THREE = this.THREE
-
- const model = new THREE.Object3D()
- model.add(this.copyRobot())
-
- this._insertModels = this._insertModels || []
- this._insertModels.push(model)
-
- if (this._insertModels.length > 5) {
- const needRemove = this._insertModels.splice(0, this._insertModels.length - 5)
- needRemove.forEach(item => {
- if (item._mixer) {
- const mixer = item._mixer
- this.mixers.splice(this.mixers.indexOf(mixer), 1)
- mixer.uncacheRoot(mixer.getRoot())
- }
- if (item.parent) item.parent.remove(item)
- })
- }
- return model
- },
- onTouchEnd(evt) {
- if (this.reticle.visible) {
- // 0.05 -0.47 -0.14
- this.hitPosition = this.reticle.position.clone()
- console.log(this.hitPosition)
-
- const model = this.getRobot()
- model.position.copy(this.hitPosition)
- model.rotation.copy(this.reticle.rotation)
- this.robotBox.add(model)
- }
- }
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/depthBehavior.js b/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/depthBehavior.js
deleted file mode 100644
index a18cdcad..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/depthBehavior.js
+++ /dev/null
@@ -1,143 +0,0 @@
-const depthBehavior = Behavior({
- methods: {
- initDepthShader() {
- const gl = this.gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_texture_float')
- if (!ext) console.warn('OES_texture_float not support')
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- precision highp float;
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
- uniform sampler2D depth_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 depth_color = texture2D(depth_texture, v_texCoord);
- gl_FragColor = vec4(depth_color.rgb, 1.0);
- }
- `
-
- 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 program = this._depthProgram = gl.createProgram()
- this._depthProgram.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformTexture = gl.getUniformLocation(program, 'depth_texture')
- gl.uniform1i(uniformTexture, 5)
-
- this._depthDt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initDepthVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._depthProgram, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0.3, 0.3, 1, 0.3, 0.3, 1, 1, 1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._depthProgram, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._depthVao = vao
- },
- initDepthGL() {
- this.initDepthShader()
- this.initDepthVAO()
- },
- renderDepthGL(frame) {
- const gl = this.renderer.getContext()
- const displayTransform = frame.getDisplayTransform()
-
- // DepthBuffer
- const depthBufferRes = frame.getDepthBuffer()
- const depthBuffer = new Float32Array(depthBufferRes.DepthAddress)
-
- const texture = gl.createTexture()
- gl.bindTexture(gl.TEXTURE_2D, texture)
- 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.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
-
- const width = depthBufferRes.width
- const height = depthBufferRes.height
-
- // const ext = gl.getExtension("OES_texture_float");
- // if (ext) {
- // gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.FLOAT, depthBuffer);
- // } else {
- // }
-
- // 先直接采用 uint8 写入深度纹理,使用浮点写入的方法会存在锯齿
- const data = new Uint8Array(width * height * 4)
- for (let i = 0; i < depthBuffer.length; i++) {
- const num = parseInt(depthBuffer[i] * 255)
- data[i] = num
- }
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, data)
-
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._depthProgram)
- this.ext.bindVertexArrayOES(this._depthVao)
-
- gl.uniformMatrix3fv(this._depthDt, false, displayTransform)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, texture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- },
- },
-})
-
-export default depthBehavior
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth.js b/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth.js
deleted file mode 100644
index c28dbb50..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth.js
+++ /dev/null
@@ -1,201 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-import depthBehavior from './depthBehavior'
-
-const NEAR = 0.1
-const FAR = 100
-let cubeVao = null
-const countNumber = 20
-let count = 0
-let time = 0
-
-const CUBE_VSHADER_SOURCE =
- `
- #version 300 es
- in vec3 aPosition;
- uniform vec3 basePosition;
- uniform mat4 viewMatrix;
- uniform mat4 projMatrix;
-
- void main(void) {
- vec3 pos = vec3(aPosition.x * 0.05, aPosition.y * 0.05, aPosition.z * 0.05);
- gl_Position = projMatrix * viewMatrix * vec4(basePosition + pos, 1.0);
- }
-`
-
-const CUBE_FSHADER_SOURCE =
- `
- #version 300 es
- precision highp float;
- out vec4 FragColor;
-
- void main() {
- FragColor = vec4(1.0, 0.0, 0.0, 1.0);
- }
-`
-
-function createCubeVAO(gl, program) {
- const ext = gl.getExtension('OES_vertex_array_object')
- const vao = ext.createVertexArrayOES()
- ext.bindVertexArrayOES(vao)
-
- const vertices = [
- -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0,
- 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0,
- 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, 1.0, -1.0,
- 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0,
- 1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0,
- -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
- -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0,
- -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0,
- -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0,
- 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0,
- -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0,
- 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0
- ]
- const vertexBuffer = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW)
- const aPosition = gl.getAttribLocation(program, 'aPosition')
- gl.enableVertexAttribArray(aPosition)
- gl.vertexAttribPointer(aPosition, 3, gl.FLOAT, false, 0, 0)
- vao.posBuffer = vertexBuffer
- return vao
-}
-
-function onDrawCube(gl, program, hitPosition, vm, pm) {
- const ext = gl.getExtension('OES_vertex_array_object')
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const bindingTexture = gl.getParameter(gl.TEXTURE_BINDING_2D)
-
- if (!cubeVao) {
- cubeVao = createCubeVAO(gl, program)
- } else {
- ext.bindVertexArrayOES(cubeVao)
- }
- gl.useProgram(program)
-
- const basePos = gl.getUniformLocation(program, 'basePosition')
- gl.uniform3fv(basePos, [hitPosition.x, hitPosition.y, hitPosition.z])
-
- const viewLoc = gl.getUniformLocation(program, 'viewMatrix')
- gl.uniformMatrix4fv(viewLoc, false, vm)
-
- const projLoc = gl.getUniformLocation(program, 'projMatrix')
- gl.uniformMatrix4fv(projLoc, false, pm)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 36)
-
- gl.useProgram(currentProgram)
- ext.bindVertexArrayOES(currentVAO)
- gl.activeTexture(currentActiveTexture)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture)
-}
-
-Component({
- behaviors: [getBehavior(), yuvBehavior, depthBehavior],
- data: {
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({
- theme
- }) => {
- this.setData({
- theme
- })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- this.initDepthGL()
- },
- render(frame) {
- this.session.setDepthOccRange(NEAR, FAR)
-
- const start = Date.now()
-
- const gl = this.renderer.getContext()
- gl.clear()
- this.renderGL(frame)
- const camera = frame.camera
- // 修改光标位置
- const reticle = this.reticle
- if (reticle) {
- const hitTestRes = this.session.hitTest(0.5, 0.5)
- if (hitTestRes.length) {
- reticle.matrixAutoUpdate = false
- reticle.matrix.fromArray(hitTestRes[0].transform)
- reticle.matrix.decompose(reticle.position, reticle.quaternion, reticle.scale)
- reticle.visible = true
- } else {
- reticle.visible = false
- }
- }
-
- // 更新动画
- this.updateAnimation()
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.autoClearDepth = false
-
- this.renderer.render(this.scene2, this.camera)
- this.renderDepthGL(frame)
-
- gl.depthFunc(gl.LESS)
- this.renderer.render(this.scene, this.camera)
-
- // if (!this.cubeProgram) {
- // this.cubeProgram = this.compileShader(gl, CUBE_VSHADER_SOURCE, CUBE_FSHADER_SOURCE)
- // }
-
- // if (this.hitPosition) {
- // onDrawCube(gl, this.cubeProgram, this.hitPosition, this.camera.matrixWorldInverse.elements, this.camera.projectionMatrix.elements)
- // }
-
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
-
- const end = Date.now()
-
- time += end - start
- count++
- if (count >= countNumber) {
- // console.log(`${count}次平均耗时统计为${time/count}ms`)
- count = 0
- time = 0
- }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth.json b/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth.json
deleted file mode 100644
index ad91e7b6..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "水平面AR-v2-虚实遮挡"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth.wxml b/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth.wxml
deleted file mode 100644
index 064c7b4d..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth.wxml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-提示:触碰屏幕任意点, 可在真实水平位置生成示例的机器小人, 其中光标标记指示的是真实水平面, 通过场景深度信息可遮挡小人
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth.wxss b/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/yuvBehavior.js
deleted file mode 100644
index 4da93380..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-depth/yuvBehavior.js
+++ /dev/null
@@ -1,346 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- compileShader(gl, vs, fs) {
- const vertShader = gl.createShader(gl.VERTEX_SHADER)
- gl.shaderSource(vertShader, vs)
- gl.compileShader(vertShader)
-
- const program = gl.createProgram()
- program.gl = gl
- gl.attachShader(program, vertShader)
- gl.deleteShader(vertShader)
-
- if (fs) {
- const fragShader = gl.createShader(gl.FRAGMENT_SHADER)
- gl.shaderSource(fragShader, fs)
- gl.compileShader(fragShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(fragShader)
- }
-
- gl.linkProgram(program)
-
- if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
- const info = gl.getProgramInfoLog(program)
- console.log(info)
- throw new Error(`Could not compile WebGL program. \n\n${info}`)
- }
-
- gl.useProgram(program)
-
- return program
- },
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- v_texCoord = a_texCoord;
- gl_Position = vec4(p.x, p.y, p.z, 1);
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
-
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- const program = this._program = this.compileShader(gl, vs, fs)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
- this._dt = gl.getUniformLocation(program, 'displayTransform')
-
- const dvs = `#version 300 es
- precision highp float;
- in vec2 a_position;
- in vec2 a_texCoord;
- uniform mat3 displayTransform;
- uniform sampler2D depth_texture;
- out vec2 v_texCoord;
-
- void main() {
- vec3 p = displayTransform * vec3(a_position, 1);
- v_texCoord = a_texCoord;
- vec4 depth_color = texture(depth_texture, v_texCoord);
- gl_Position = vec4(p.x, p.y, p.z, 1);
- }
- `
-
- const dfs = `#version 300 es
- precision highp float;
- uniform sampler2D depth_texture;
- out vec4 FragColor;
- in vec2 v_texCoord;
-
- void main() {
- vec4 depth_color = texture(depth_texture, v_texCoord);
- gl_FragDepth = depth_color.r;
- // FragColor = vec4(depth_color.rgb, 1.0);
- }
- `
-
- const depthOutputProgram = this._depthOutputProgram = this.compileShader(gl, dvs, dfs)
- const uniformDepthTexture = gl.getUniformLocation(depthOutputProgram, 'depth_texture')
- gl.uniform1i(uniformDepthTexture, 5)
- this._deptht = gl.getUniformLocation(depthOutputProgram, 'displayTransform')
-
- gl.useProgram(currentProgram)
- },
- buildPlane(
- vertices,
- indices,
- width,
- height,
- widthSegments,
- heightSegments
- ) {
- const width_half = width / 2
- const height_half = height / 2
-
- const gridX = Math.floor(widthSegments)
- const gridY = Math.floor(heightSegments)
-
- const gridX1 = gridX + 1
- const gridY1 = gridY + 1
-
- const segment_width = width / gridX
- const segment_height = height / gridY
-
- for (let iy = 0; iy < gridY1; iy++) {
- const y = iy * segment_height - height_half
-
- for (let ix = 0; ix < gridX1; ix++) {
- const x = ix * segment_width - width_half
-
- vertices.push(
- // a_position
- x,
- -y,
- 0,
- // a_texCoord
- ix / gridX,
- 1 - (iy / gridY)
- )
- }
- }
- for (let iy = 0; iy < gridY; iy++) {
- for (let ix = 0; ix < gridX; ix++) {
- const a = ix + gridX1 * iy
- const b = ix + gridX1 * (iy + 1)
- const c = (ix + 1) + gridX1 * (iy + 1)
- const d = (ix + 1) + gridX1 * iy
- indices.push(a, b, d)
- indices.push(b, c, d)
- }
- }
- },
- initVAO(program) {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- if (!this.ext) this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- return vao
- },
- initDepthOutputVAO(program, width, height) {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
-
- if (!this.ext) {
- this.ext = ext
- }
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const vertices = []
- const indices = []
-
- this.buildPlane(vertices, indices, 1, 1, width, height)
-
- const posAttr = gl.getAttribLocation(program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(indices), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- return vao
- },
- initGL() {
- this.initShader()
- this._vao = this.initVAO(this._program)
- },
- drawDepth(frame) {
- const gl = this.renderer.getContext()
- const displayTransform = frame.getDisplayTransform()
-
- // DepthBuffer
- const depthBufferRes = frame.getDepthBuffer()
- const depthBuffer = new Float32Array(depthBufferRes.DepthAddress)
-
- const texture = gl.createTexture()
- gl.bindTexture(gl.TEXTURE_2D, texture)
- 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.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
-
- const width = depthBufferRes.width
- const height = depthBufferRes.height
-
- // const ext = gl.getExtension("OES_texture_float");
- // if (ext) {
- // gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.FLOAT, depthBuffer);
- // } else {
- // }
-
- // 先直接采用 uint8 写入深度纹理,使用浮点写入的方法会存在锯齿
- const data = new Uint8Array(width * height * 4)
- for (let i = 0; i < depthBuffer.length; i++) {
- const num = parseInt(depthBuffer[i] * 255)
- data[i] = num
- }
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, data)
-
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const bindingTexture = gl.getParameter(gl.TEXTURE_BINDING_2D)
-
- if (!this._vao2) {
- // this._vao2 = this.initDepthOutputVAO(this._depthOutputProgram, width, height)
- this._vao2 = this.initVAO(this._depthOutputProgram)
- }
-
- this.ext.bindVertexArrayOES(this._vao2)
- gl.useProgram(this._depthOutputProgram)
-
- gl.uniformMatrix3fv(this._depthDt, false, displayTransform)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, texture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture)
-
- this.ext.bindVertexArrayOES(currentVAO)
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
-
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const bindingTexture = gl.getParameter(gl.TEXTURE_BINDING_2D)
-
- gl.enable(gl.DEPTH_TEST)
- gl.depthMask(true)
- gl.depthFunc(gl.ALWAYS)
-
- this.drawDepth(frame)
-
- gl.depthMask(false)
-
- this.ext.bindVertexArrayOES(this._vao)
- gl.useProgram(this._program)
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture)
-
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/add.png b/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/add.png
deleted file mode 100644
index a99a794e..00000000
Binary files a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/add.png and /dev/null differ
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/behavior.js b/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/behavior.js
deleted file mode 100644
index 8ab8877a..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/behavior.js
+++ /dev/null
@@ -1,525 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-import cloneGltf from '../loaders/gltf-clone'
-
-const info = wx.getSystemInfoSync()
-// 此处如果为jpeg,则后缀名也需要改成对应后缀
-// const filePath = `${wx.env.USER_DATA_PATH}/marker-ar1.jpg`
-// const mapfilePath = `${wx.env.USER_DATA_PATH}/marker-ar.jpg`
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- markerId: [],
- imgList: [],
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.6)
-
- // this.downloadFile()
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- chooseMedia() {
- wx.chooseMedia({
- count: 1,
- mediaType: ['image'],
- success: res => {
- console.log('chooseMedia res', res)
- const imgUrl = res.tempFiles[0].tempFilePath
- wx.getImageInfo({
- src: imgUrl,
- success: res => {
- const {
- width,
- height
- } = res
- console.log('getImageInfo res', res)
-
- this.addMarker(imgUrl)
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- errImg(e) {
- console.log('err img', e)
- },
- loadImg() {
- console.log('load img')
- },
- add3DMarker() {
- const mapfilePath = `${wx.env.USER_DATA_PATH}/marker-ar1.map`
-
- console.log('now download....')
-
- const fs = wx.getFileSystemManager()
-
- const download = callback => wx.downloadFile({
- // 此处设置为识别的2d对象的jpg地址
- url: 'http://dldir1.qq.com/weixin/checkresupdate/ncov_7bf1a739c43f4f80b3fb3488b592f355.map',
- success(res) {
- console.log('downloadFile success:', res)
- fs.saveFile({
- mapfilePath,
- tempFilePath: res.tempFilePath,
- success: callback,
- })
- },
- fail(e) {
- console.log('downloadFile fail:', e)
- }
- })
-
- const add = () => {
- console.log('[add3DMarker] --> ', mapfilePath)
-
- fs.access({
- path: mapfilePath,
- success(res) {
- // 文件存在
- console.log('文件存在')
- console.log(res)
- },
- fail(res) {
- // 文件不存在或其他错误
- console.log('文件不存在')
- console.error(res)
- }
- })
- this.session.addMarker(mapfilePath)
- }
- download(add)
- },
- add3DMarker2() {
- const mapfilePath = `${wx.env.USER_DATA_PATH}/marker-ar.map`
-
- console.log('now download....')
-
- const fs = wx.getFileSystemManager()
-
- const download = callback => wx.downloadFile({
- // 此处设置为识别的2d对象的jpg地址
- url: 'http://dldir1.qq.com/weixin/checkresupdate/ncov_7bf1a739c43f4f80b3fb3488b592f355.map',
- success(res) {
- console.log('downloadFile success:', res)
- fs.saveFile({
- mapfilePath,
- tempFilePath: res.tempFilePath,
- success: callback,
- })
- },
- fail(e) {
- console.log('downloadFile fail:', e)
- }
- })
-
- const add = () => {
- console.log('[add3DMarker] --> ', mapfilePath)
- this.session.addMarker(mapfilePath)
- }
- download(add)
- },
- addMarker(url) {
- // if (this.data.markerId) return
- const fs = wx.getFileSystemManager()
- // 此处如果为jpeg,则后缀名也需要改成对应后缀
- // const filePath = `${wx.env.USER_DATA_PATH}/marker-ar.map`
- const filePath = `${wx.env.USER_DATA_PATH}/marker-ar` + this.data.markerId.length + '.jpeg'
-
- const download = callback => {
- fs.saveFile({
- filePath,
- tempFilePath: url,
- success: callback,
- fail: res => {
- console.error(res)
- }
- })
- }
- const add = () => {
- console.log('[addMarker' + this.data.markerId.length + '] --> ', filePath)
- const id = this.session.addMarker(filePath)
- this.data.markerId.push(id)
- this.data.imgList.push(filePath)
-
- this.setData({
- markerId: this.data.markerId,
- imgList: this.data.imgList
- })
- }
- download(add)
- },
-
- removeAllMarker() {
- if (this.data.markerId.length != 0) {
- for (let i = 0; i < this.data.markerId.length; i++) {
- this.session.removeMarker(this.data.markerId[i])
- }
- this.data.markerId = []
- this.data.imgList = []
- this.setData({
- markerId: this.data.markerId,
- imgList: this.data.imgList
- })
- this.removeRobot()
- }
- },
- getAllMarker() {
- console.log(this.session.getAllMarker())
- },
-
- initVK() {
- // 初始化 threejs
- this.initTHREE()
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 1
- },
- marker: true,
- },
- version: 'v2',
- gl: this.gl,
- })
-
- const THREE = this.THREE
-
- const session = this.session
- session.start(err => {
- if (err) {
- this.setData({
- errMsg: 'VK error: ' + err
- })
- return console.error('VK error: ', err)
- }
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.6, info.pixelRatio)
- })
-
- const loader = new THREE.GLTFLoader()
- loader.load('https://dldir1.qq.com/weixin/miniprogram/RobotExpressive_aa2603d917384b68bb4a086f32dabe83.glb', gltf => {
- this.model = {
- scene: gltf.scene,
- animations: gltf.animations,
- }
-
- console.log('model加载完成')
- })
-
- this.clock = new THREE.Clock()
-
- loader.load('https://dldir1.qq.com/weixin/miniprogram/reticle_4b6cc19698ca4a08b31fd3c95ce412ec.glb', gltf => {
- const reticle = this.reticle = gltf.scene
-
- reticle.visible = false
- this.scene.add(reticle)
- })
-
- this.setData({
- showTip: true
- })
- setTimeout(() => {
- this.setData({
- showTip: false
- })
- }, 10000)
-
- // anchor 检测
- const createPlane = size => {
- const geometry = new THREE.PlaneGeometry(size.width, size.height)
- const material = new THREE.MeshBasicMaterial({
- color: 0xffffff,
- side: THREE.DoubleSide,
- transparent: true,
- opacity: 0.5
- })
- const mesh = new THREE.Mesh(geometry, material)
- mesh.rotateX(Math.PI / 2)
- const cnt = new THREE.Object3D()
- cnt.add(mesh)
- return cnt
- }
- const updateMatrix = (object, m) => {
- object.matrixAutoUpdate = false
- object.matrix.fromArray(m)
- }
- session.on('addAnchors', anchors => {
- console.log('add anchor')
- anchors.forEach(anchor => {
- console.log('type: ', anchor.type)
- const size = anchor.size
- let object
- if (anchor.type == 0) {
- object = createPlane(size)
- this.setData({
- showTip: false
- })
- } else {
- if (!this.model) {
- console.warn('this.model 还没加载完成 !!!!!')
- return
- }
- object = new THREE.Object3D()
- const model = this.getRobot()
- model.rotateX(-Math.PI / 2)
- object.add(model)
- }
-
- object._id = anchor.id
- object._size = size
- updateMatrix(object, anchor.transform)
- this.planeBox.add(object)
- })
- })
- session.on('updateAnchors', anchors => {
- console.log('update')
- const map = anchors.reduce((temp, item) => {
- temp[item.id] = item
- console.log(item.id, item)
- return temp
- }, {})
- this.planeBox.children.forEach(object => {
- if (object._id && map[object._id]) {
- const anchor = map[object._id]
- const size = anchor.size
- if (size && object._size && (size.width !== object._size.width || size.height !== object._size.height)) {
- this.planeBox.remove(object)
- object = createPlane(size)
- this.planeBox.add(object)
- }
-
- object._id = anchor.id
- object._size = size
- updateMatrix(object, anchor.transform)
- }
- })
- })
- session.on('removeAnchors', anchors => {
- console.log('remove anchor')
- const map = anchors.reduce((temp, item) => {
- console.log('type:', item.type)
- temp[item.id] = item
- return temp
- }, {})
- this.planeBox.children.forEach(object => {
- if (object._id && map[object._id]) this.planeBox.remove(object)
- })
- })
-
- // 平面集合
- const planeBox = this.planeBox = new THREE.Object3D()
- this.scene.add(planeBox)
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- removeRobot() {
- this.planeBox.children.forEach(object => {
- this.planeBox.remove(object)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- updateAnimation() {
- const dt = this.clock.getDelta()
- if (this.mixers) this.mixers.forEach(mixer => mixer.update(dt))
- },
- copyRobot() {
- const THREE = this.THREE
- const {
- scene,
- animations
- } = cloneGltf(this.model, THREE)
- scene.scale.set(0.05, 0.05, 0.05)
-
- // 动画混合器
- const mixer = new THREE.AnimationMixer(scene)
- for (let i = 0; i < animations.length; i++) {
- const clip = animations[i]
- if (clip.name === 'Dance') {
- const action = mixer.clipAction(clip)
- action.play()
- }
- }
-
- this.mixers = this.mixers || []
- this.mixers.push(mixer)
-
- scene._mixer = mixer
- return scene
- },
- getRobot() {
- const THREE = this.THREE
-
- const model = new THREE.Object3D()
- model.add(this.copyRobot())
-
- this._insertModels = this._insertModels || []
- this._insertModels.push(model)
-
- if (this._insertModels.length > 5) {
- const needRemove = this._insertModels.splice(0, this._insertModels.length - 5)
- needRemove.forEach(item => {
- if (item._mixer) {
- const mixer = item._mixer
- this.mixers.splice(this.mixers.indexOf(mixer), 1)
- mixer.uncacheRoot(mixer.getRoot())
- }
- if (item.parent) item.parent.remove(item)
- })
- }
- return model
- },
- onTouchEnd(evt) {
- if (this.scene && this.model && this.reticle) {
- const model = this.getRobot()
- model.position.copy(this.reticle.position)
- model.rotation.copy(this.reticle.rotation)
- this.scene.add(model)
- }
- }
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/move.gif b/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/move.gif
deleted file mode 100644
index 7b7d5ec6..00000000
Binary files a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/move.gif and /dev/null differ
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.js b/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.js
deleted file mode 100644
index 0808c873..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.js
+++ /dev/null
@@ -1,92 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-let time = 0
-const countNumber = 20
-let count = 0
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- },
- render(frame) {
- const start = Date.now()
-
- this.renderGL(frame)
- const camera = frame.camera
-
- // 修改光标位置
- const reticle = this.reticle
- if (reticle) {
- const hitTestRes = this.session.hitTest(0.5, 0.5)
- if (hitTestRes.length) {
- reticle.matrixAutoUpdate = false
- reticle.matrix.fromArray(hitTestRes[0].transform)
- reticle.matrix.decompose(reticle.position, reticle.quaternion, reticle.scale)
- if (reticle.position.z != 0) reticle.visible = true
- } else {
- reticle.visible = false
- }
- }
-
- // 更新动画
- this.updateAnimation()
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
-
- const end = Date.now()
-
- time += end - start
- count++
- // if(count >= countNumber){
- // console.log(`${count}次平均耗时统计为${time/count}ms`)
- // count = 0
- // time = 0
- // }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.json b/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.json
deleted file mode 100644
index 181d2fe5..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "水平面AR-v2-marker识别"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.wxml b/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.wxml
deleted file mode 100644
index 9b3273cf..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.wxml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 提示:触碰屏幕任意点, 光标标记指示的是真实水平面,触碰平面可以生成机器人,通过点击加号添加多张图片,进行marker识别
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.wxss b/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.wxss
deleted file mode 100644
index 3b85f6eb..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/plane-ar-v2-marker.wxss
+++ /dev/null
@@ -1,19 +0,0 @@
-.btn-cnt {
- display: flex;
-}
-
-.photo-cnt {
-position: absolute;
-margin-top: 60vh;
-}
-
-.btn-choose {
-flex:0 50%;
-display: flex;
-height: 5vh;
-margin-bottom: 5vh;
-}
-
-.scroll-view_H {
- white-space: nowrap;
- }
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.js b/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.js
deleted file mode 100644
index 92528fe2..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.js
+++ /dev/null
@@ -1,502 +0,0 @@
-import arBehavior from '../behavior/behavior-ar'
-import threeBehavior from '../behavior/behavior-three'
-
-// VK 投影矩阵参数定义
-const NEAR = 0.01
-const FAR = 1000
-
-Component({
- behaviors: [arBehavior, threeBehavior],
- data: {
- theme: 'light',
- widthScale: 1, // canvas宽度缩放值
- heightScale: 0.6, // canvas高度缩放值
- markerImgList: [], // 使用的 marker 列表
- chooseImgList: [], // 使用的 图片 列表
- },
- markerIndex: 0, // 使用的 marker 索引
- showBoxList: [], // 提示盒子列表,
- hintCenter: null, // 红色提示点
- useDepthBuffer: false, // 开启深度buffer
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
-
- methods: {
- // 对应案例的初始化逻辑,由统一的 behavior 触发
- init() {
- // 初始化 Three.js,用于模型相关的渲染
- this.initTHREE()
- this.initDepthGL()
-
- this.loader.load('https://dldir1.qq.com/weixin/miniprogram/reticle_4b6cc19698ca4a08b31fd3c95ce412ec.glb', gltf => {
- const reticle = this.hintCenter = gltf.scene
-
- reticle.visible = false
- this.scene.add(reticle)
- })
-
- // 初始化 GL,基于 Three.js 的 Context,用于相机YUV渲染
- this.initYUV()
-
- // 初始化VK
- // start完毕后,进行更新渲染循环
- this.initVK()
-
- this.markerIndex = 0
- this.showBoxList = []
- this.useDepthBuffer = false
- },
- initVK() {
- // VKSession 配置
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 1
- },
- marker: true,
- },
- version: 'v2',
- gl: this.gl
- })
-
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- // VKSession EVENT resize
- session.on('resize', () => {
- this.calcCanvasSize()
- })
-
- // VKSession EVENT addAnchors
- session.on('addAnchors', anchors => {
- // console.log("addAnchor", anchors);
-
- anchors.forEach(anchor => {
- const showBox = {
- id: anchor.id,
- size: anchor.size,
- transform: anchor.transform
- }
-
- switch (anchor.type) {
- case 0:
- // plane Anchor
- const boxPlane = this.createBox(0xffffff, anchor.type)
- boxPlane.box.scale.set(showBox.size.width, 0.02, showBox.height)
- console.log('boxPlane.size', showBox.size)
-
- showBox.type = 'Plane'
- showBox.wrap = boxPlane.wrap
- showBox.box = boxPlane.box
- break
- case 1:
- // marker Anchor
- const boxMarker = this.createBox(0x55cc55, anchor.type)
- boxMarker.box.scale.set(1, 0.1, 1)
- console.log('boxMarker.size', showBox.size)
-
- showBox.type = 'Marker'
- showBox.wrap = boxMarker.wrap
- showBox.box = boxMarker.box
- break
- }
-
- this.showBoxList.push(showBox)
- })
-
- console.log('this.showBoxList', this.showBoxList)
- })
-
- // VKSession EVENT updateAnchors
- session.on('updateAnchors', anchors => {
- // plane + marker 模式下,可以有多个识别目标
- // console.log('this.showBoxList', this.showBoxList)
-
- // 仅更新已经添加的Anchor
- this.showBoxList.forEach(showBox => {
- for (let i = 0; i < anchors.length; i++) {
- if (showBox.id === anchors[i].id) {
- // 匹配
- if (showBox.size !== anchors[i].size) {
- switch (showBox.type) {
- case 'Plane':
- showBox.box.scale.set(anchors[i].size.width, 0.02, anchors[i].size.height)
- break
- case 'Marker':
- break
- }
- }
- showBox.size = anchors[i].size
- showBox.transform = anchors[i].transform
- break
- }
- }
- })
- })
-
- // VKSession removeAnchors
- // 识别目标丢失时,会触发一次
- session.on('removeAnchors', anchors => {
- // console.log('removeAnchors', anchors)
-
- // 存在要删除的 Anchor
- if (anchors.length > 0) {
- this.showBoxList = this.showBoxList.filter((showBox) => {
- let flag = true
- for (let i = 0; i < anchors.length; i++) {
- if (showBox.id === anchors[i].id) {
- console.log('remove', showBox.id)
- let scene = this.scene
- if (showBox.type === 'Marker') {
- scene = this.sceneCull
- }
- // 从three里面去掉
- scene.remove(showBox.wrap)
- // 标记删除
- flag = false
- break
- }
- }
- return flag
- })
- }
- })
-
- console.log('ready to initloop')
- // start 初始化完毕后,进行更新渲染循环
- this.initLoop()
- })
- },
- loop() {
- // console.log('loop')
-
- // 获取 VKFrame
- const frame = this.session.getVKFrame(this.canvas.width, this.canvas.height)
-
- // 成功获取 VKFrame 才进行
- if (!frame) { return }
-
- // 更新相机 YUV 数据
- this.renderYUV(frame)
-
- // 获取 VKCamera
- const VKCamera = frame.camera
-
- // 相机
- if (VKCamera) {
- // 接管 ThreeJs 相机矩阵更新,Marker模式下,主要由视图和投影矩阵改变渲染效果
- this.camera.matrixAutoUpdate = false
-
- // 视图矩阵
- this.camera.matrixWorldInverse.fromArray(VKCamera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- // 投影矩阵
- const projectionMatrix = VKCamera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- // 更新提示盒子 位置
- if (this.showBoxList) {
- this.showBoxList.forEach(showBox => {
- showBox.wrap.matrix.fromArray(showBox.transform)
- })
- }
-
- const reticle = this.hintCenter
- if (reticle) {
- const hitTestRes = this.session.hitTest(0.5, 0.5)
- if (hitTestRes.length) {
- reticle.matrixAutoUpdate = false
- reticle.matrix.fromArray(hitTestRes[0].transform)
- reticle.matrix.decompose(reticle.position, reticle.quaternion, reticle.scale)
- reticle.visible = true
- } else {
- reticle.visible = false
- }
- }
-
- this.renderer.autoClearColor = false
- this.renderer.autoClearDepth = false
-
- // 绘制提示的物体
- this.renderer.state.setCullFace(this.THREE.CullFaceBack)
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
-
- if (this.useDepthBuffer) {
- // 1. 在左下角绘制深度提示
- // 2. 写入深度遮挡纹理到深度值
- this.renderDepthGL(frame)
- }
- // 绘制进行深度遮挡的物体
- this.renderer.render(this.sceneCull, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- createBox(color, type) {
- const THREE = this.THREE
- let scene = this.scene
-
- let material
-
- // 根据类型添加不一样的行为
- switch (type) {
- case 0:
- // plane Anchor
- material = new THREE.MeshBasicMaterial({
- metalness: 0.0,
- roughness: 0.1,
- color,
- transparent: true,
- opacity: 0.8
- })
- break
- case 1:
- // marker Anchor
-
- const uniforms = {
- time: { value: Math.random() * 100 }
- }
-
- material = new THREE.ShaderMaterial({
- uniforms,
- vertexShader: `
- varying vec2 vUv;
- void main() {
- vUv = uv;
- vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
- gl_Position = projectionMatrix * mvPosition;
- }
- `,
- fragmentShader: `varying vec2 vUv;
- uniform float time;
- void main() {
- vec2 p = - 1.0 + 2.0 * vUv;
- float a = time * 40.0;
- float d, e, f, g = 1.0 / 40.0 ,h ,i ,r ,q;
-
- e = 400.0 * ( p.x * 0.5 + 0.5 );
- f = 400.0 * ( p.y * 0.5 + 0.5 );
- i = 200.0 + sin( e * g + a / 150.0 ) * 20.0;
- d = 200.0 + cos( f * g / 2.0 ) * 18.0 + cos( e * g ) * 7.0;
- r = sqrt( pow( abs( i - e ), 2.0 ) + pow( abs( d - f ), 2.0 ) );
- q = f / r;
- e = ( r * cos( q ) ) - a / 2.0;
- f = ( r * sin( q ) ) - a / 2.0;
- d = sin( e * g ) * 176.0 + sin( e * g ) * 164.0 + r;
- h = ( ( f + d ) + a / 2.0 ) * g;
- i = cos( h + r * p.x / 1.3 ) * ( e + e + a ) + cos( q * g * 6.0 ) * ( r + h / 3.0 );
- h = sin( f * g ) * 144.0 - sin( e * g ) * 212.0 * p.x;
- h = ( h + ( f - e ) * q + sin( r - ( a + h ) / 7.0 ) * 10.0 + i / 4.0 ) * g;
- i += cos( h * 2.3 * sin( a / 350.0 - q ) ) * 184.0 * sin( q - ( r * 4.3 + a / 12.0 ) * g ) + tan( r * g + h ) * 184.0 * cos( r * g + h );
- i = mod( i / 5.6, 256.0 ) / 64.0;
- if ( i < 0.0 ) i += 4.0;
- if ( i >= 2.0 ) i = 4.0 - i;
- d = r / 350.0;
- d += sin( d * d * 8.0 ) * 0.52;
- f = ( sin( a * g ) + 1.0 ) / 2.0;
- gl_FragColor = vec4( vec3( f * i / 1.6, i / 2.0 + d / 13.0, i ) * d * p.x + vec3( i / 1.3 + d / 8.0, i / 2.0 + d / 18.0, i ) * d * ( 1.0 - p.x ), 1.0 );
- }`,
- })
-
- scene = this.sceneCull
-
- break
- }
-
- const geometry = new THREE.BoxGeometry(1, 1, 1)
-
- const wrap = new THREE.Object3D()
- // 禁止矩阵自动更新,只能手动写入信息
- wrap.matrixAutoUpdate = false
-
- // 绘制区域的box
- const box = new THREE.Mesh(geometry, material)
- wrap.add(box)
-
- scene.add(wrap)
-
- box.visible = true
-
- return {
- wrap,
- box,
- }
- },
- chooseMedia() {
- // marker图片上传逻辑
- wx.chooseMedia({
- count: 9,
- mediaType: ['image'],
- sizeType: ['original'],
- success: res => {
- console.log('chooseMedia res', res)
-
- const chooseImgListRes = []
- for (let i = 0; i < res.tempFiles.length; i++) {
- const imgUrl = res.tempFiles[i].tempFilePath
- chooseImgListRes.push(imgUrl)
- }
-
- console.log('set chooseImgList', chooseImgListRes)
- this.setData({
- chooseImgList: chooseImgListRes,
- })
- },
- fail: res => {
- console.error(res)
- }
- })
- },
- async addMarker() {
- console.log('addMarker')
- const fs = wx.getFileSystemManager()
-
- const markerImgListRes = this.data.markerImgList.concat([])
- const preMarkerIndex = this.markerIndex
-
- console.log('pre markerImgList', preMarkerIndex, markerImgListRes)
-
- // 检查与添加 marker 函数
- const chooseImgCount = this.data.chooseImgList.length
- let handledCount = 0
- const checkMarkerAdded = () => {
- if (handledCount === chooseImgCount) {
- this.markerIndex = markerImgListRes.length
-
- console.log('markerImgList set', markerImgListRes, this.markerIndex)
- this.setData({
- chooseImgList: [],
- markerImgList: markerImgListRes
- })
- }
- }
-
- // 准备进行choose的图片保存到fs
- for (let i = 0; i < chooseImgCount; i++) {
- const chooseImgUrl = this.data.chooseImgList[i]
- const fileEnd = chooseImgUrl.split('.').slice(-1)[0]
- const fileIndex = preMarkerIndex + i
- // 算法侧目前只认 map png jpg jpeg 后缀文件
- const filePath = `${wx.env.USER_DATA_PATH}/marker-ar-${fileIndex}.${fileEnd}`
-
- const saveAndAddMarker = () => {
- console.log('saveFileSync start', filePath, chooseImgUrl)
- // 存入文件系统,并添加到marker
- fs.saveFile({
- filePath,
- tempFilePath: chooseImgUrl,
- success: () => {
- console.log('[addMarker] --> ', filePath)
- const markerId = this.session.addMarker(filePath)
- markerImgListRes.push({
- markerId,
- filePath
- })
- handledCount++
- checkMarkerAdded()
- },
- fail: res => {
- console.error(res)
- console.log('文件保存失败', filePath)
- handledCount++
- checkMarkerAdded()
- }
- })
- }
-
- console.log('uploadFile Path', filePath)
- // 确定文件,存在即删除
- fs.stat({
- path: filePath,
- success: (res) => {
- if (res.stats.isFile()) {
- fs.unlinkSync(filePath)
- console.log('fs unlinkSync', filePath)
- }
- saveAndAddMarker()
- },
- fail: (res) => {
- console.error(res)
- console.log('fs中不存在,直接写入', filePath)
-
- saveAndAddMarker()
- }
- })
- }
- },
- removeMarker() {
- if (this.data.markerImgList) {
- for (let i = 0; i < this.data.markerImgList.length; i++) {
- const markerImg = this.data.markerImgList[i]
- this.session.removeMarker(markerImg.markerId)
- }
- this.markerIndex = 0
- this.setData({
- markerImgList: [],
- })
- }
- },
- placeItem() {
- if (this.hintCenter && this.hintCenter.visible) {
- const THREE = this.THREE
- const scene = this.sceneCull
-
- // 加载模型
- this.loader.load('https://dldir1.qq.com/weixin/miniprogram/RobotExpressive_aa2603d917384b68bb4a086f32dabe83.glb', gltf => {
- const wrap = new THREE.Object3D()
-
- wrap.add(gltf.scene)
-
- scene.add(wrap)
-
- const position = new THREE.Vector3()
- const rotation = new THREE.Quaternion()
- const scale = new THREE.Vector3()
- this.hintCenter.matrix.decompose(position, rotation, scale)
- wrap.position.set(position.x, position.y, position.z)
- wrap.rotation.set(rotation.x, rotation.y, rotation.z, rotation.w)
- wrap.scale.set(0.1, 0.1, 0.1)
-
- console.log('model加载完成')
-
- console.log('position', position.x, position.y, position.z)
- // console.log('rotation', rotation.x, rotation.y, rotation.z, rotation.w);
- // boxPlace.box.matrix.FromMatrix4(this.hintCenter.matrix);
- })
- }
- },
- changeDepthFlag() {
- const depthNear = 0.1
- const depthFar = 20
- this.session.setDepthOccRange(depthNear, depthFar)
-
- this.useDepthBuffer = !this.useDepthBuffer
- this.session.setDepthSwitch(this.useDepthBuffer)
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.json b/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.json
deleted file mode 100644
index b997d966..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "平面AR附加能力"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.wxml b/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.wxml
deleted file mode 100644
index a01d9171..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.wxml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
- 识别id: {{hintBox.markerId}}
-
-
-
- 提示:选择用于识别的图片, 点击添加为marker, 然后手机摄像头对准下方所选图片(需要基础库3.3.3)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 上传图片后点击左侧按钮
将图片添加到 Marker 识别列表
-
-
-
-
-
-
-
-
-
-
-
-
- 点击左侧按钮上传图片(允许上传1-9张)
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.wxss b/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.wxss
deleted file mode 100644
index 09d45a58..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options.wxss
+++ /dev/null
@@ -1,151 +0,0 @@
-.canvas-wrap {
- position: relative;
- width: 100%;
- background-color: #000;
-}
-
-.canvas-wrap #canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.hint-box {
- position: absolute;
- left: 0%;
- top: 0%;
- width: 0;
- height: 0;
-}
-.hint-id {
- position: absolute;
- left: -6rpx;
- right: -6rpx;
- bottom: 100%;
- color: #fff;
- font-size: 20rpx;
- line-height: 40rpx;
- text-align: center;
- text-overflow: ellipsis;
- background-color: #07c160;
- border-radius: 8rpx;
-
-}
-
-.wrap-fix {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.hint-words {
- position: absolute;
- left: 20rpx;
- top: 20rpx;
- right: 20rpx;
- padding: 10rpx 20rpx;
- line-height: 40rpx;
- text-align: center;
- border-radius: 6rpx;
- background-color: rgba(0, 0, 0, .3);
- font-size: 26rpx;
- color: #fff;
-}
-
-.wrap-left {
- position: absolute;
- left: 0;
- top: 0;
- bottom: 30rpx;
- width: 160rpx;
-}
-
-button.btn-left {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- padding: 12rpx;
- font-size: 30rpx;
- line-height: 1.2;
-}
-
-.wrap-right {
- position: absolute;
- left: 180rpx;
- right: 20rpx;
- top: 0;
- bottom: 30rpx;
- display: flex;
-}
-
-.img-list {
- display: flex;
- overflow: auto;
-}
-
-.img-list image {
- height: 100%;
-}
-
-.hint-empty {
- position: relative;
- flex: 1;
- border: 4rpx dotted rgba(0, 0, 0, .3);
- border-radius: 6rpx;
-}
-
-.hint-empty p {
- position: absolute;
- left: 20rpx;
- right: 20rpx;
- top: 50%;
- transform: translate(0, -50%);
- text-align: center;
- font-size: 26rpx;
- color: rgba(0, 0, 0, .3);
-}
-
-.wrap-choose {
- position: absolute;
- left: 20rpx;
- right: 20rpx;
- bottom: 0;
- height: 12%;
-}
-
-.wrap-marker {
- position: absolute;
- left: 20rpx;
- right: 20rpx;
- bottom: 12%;
- height: 12%;
-}
-
-.wrap-option {
- position: absolute;
- left: 20rpx;
- right: 0;
- bottom: 24%;
- height: 14%;
- flex-direction: column;
- display: flex;
-}
-
-.wrap-option .row {
- flex: 1;
- display: flex;
- flex-direction: row;
- text-align: center;
-}
-.wrap-option button {
- flex: 1;
- margin: 5rpx 20rpx 20rpx 0;
- font-size: 30rpx;
- line-height: 1.2;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2/behavior.js b/miniprogram/packageAPI/pages/ar/plane-ar-v2/behavior.js
deleted file mode 100644
index d28996f6..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2/behavior.js
+++ /dev/null
@@ -1,407 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-import cloneGltf from '../loaders/gltf-clone'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
- const THREE = this.THREE
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 1
- },
- },
- version: 'v2',
- gl: this.gl,
- })
- const session = this.session
- session.start(err => {
- if (err) {
- this.setData({
- errMsg: 'VK error: ' + err
- })
- return console.error('VK error: ', err)
- }
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- const loader = new THREE.GLTFLoader()
- loader.load('https://dldir1.qq.com/weixin/miniprogram/RobotExpressive_aa2603d917384b68bb4a086f32dabe83.glb', gltf => {
- this.model = {
- scene: gltf.scene,
- animations: gltf.animations,
- }
- })
-
- this.clock = new THREE.Clock()
-
- loader.load('https://dldir1.qq.com/weixin/miniprogram/reticle_4b6cc19698ca4a08b31fd3c95ce412ec.glb', gltf => {
- const reticle = this.reticle = gltf.scene
-
- reticle.visible = false
- this.scene.add(reticle)
- })
-
- this.setData({
- showTip: true
- })
- setTimeout(() => {
- this.setData({
- showTip: false
- })
- }, 10000)
-
- // anchor 检测
- const createPlane = size => {
- const geometry = new THREE.PlaneGeometry(size.width, size.height)
- const material = new THREE.MeshBasicMaterial({
- color: 0xffffff,
- side: THREE.DoubleSide,
- transparent: true,
- opacity: 0.5
- })
- const mesh = new THREE.Mesh(geometry, material)
- mesh.rotateX(Math.PI / 2)
- const cnt = new THREE.Object3D()
- cnt.add(mesh)
- return cnt
- }
- const updateMatrix = (object, m) => {
- object.matrixAutoUpdate = false
- object.matrix.fromArray(m)
- }
- session.on('addAnchors', anchors => {
- anchors.forEach(anchor => {
- const size = anchor.size
- let object
- if (anchor.type == 0) {
- object = createPlane(size)
- this.setData({
- showTip: false
- })
- } else {
- if (!this.model) {
- console.warn('this.model 还没加载完成 !!!!!')
- return
- }
- object = new THREE.Object3D()
- const model = this.getRobot()
- model.rotateX(-Math.PI / 2)
- object.add(model)
- }
-
- object._id = anchor.id
- object._size = size
- updateMatrix(object, anchor.transform)
- this.planeBox.add(object)
- })
- })
- session.on('updateAnchors', anchors => {
- const map = anchors.reduce((temp, item) => {
- temp[item.id] = item
- return temp
- }, {})
- const deletePlaneBoxs = []
- const newPlaneBoxs = []
- this.planeBox.children.forEach(object => {
- if (object._id && map[object._id]) {
- const anchor = map[object._id]
- const size = anchor.size
- if (size && object._size && (size.width !== object._size.width || size.height !== object._size.height)) {
- // this.planeBox.remove(object)
- // object = createPlane(size)
- // this.planeBox.add(object)
- // 塞入删除队列
- deletePlaneBoxs.push(object)
- const newPlane = createPlane(size)
- newPlane._id = anchor.id
- newPlane._size = size
- updateMatrix(newPlane, anchor.transform)
- // 塞入添加队列
- newPlaneBoxs.push(newPlane)
- } else {
- object._id = anchor.id
- object._size = size
- updateMatrix(object, anchor.transform)
- }
- }
- })
- // 延后删除
- for (let i = 0; i < deletePlaneBoxs.length; i++) {
- this.planeBox.remove(deletePlaneBoxs[i])
- }
- // 延后添加
- for (let i = 0; i < newPlaneBoxs.length; i++) {
- this.planeBox.add(newPlaneBoxs[i])
- }
- })
- session.on('removeAnchors', anchors => {
- const map = anchors.reduce((temp, item) => {
- temp[item.id] = item
- return temp
- }, {})
- const deletePlaneBoxs = []
- this.planeBox.children.forEach(object => {
- if (object._id && map[object._id]) {
- // this.planeBox.remove(object)
- // 塞入删除队列
- deletePlaneBoxs.push(object)
- }
- })
- // 延后删除
- for (let i = 0; i < deletePlaneBoxs.length; i++) {
- this.planeBox.remove(deletePlaneBoxs[i])
- }
- })
-
- // 平面集合
- const planeBox = this.planeBox = new THREE.Object3D()
- this.scene.add(planeBox)
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
-
- const geometry = new THREE.BoxGeometry(1, 1, 1)
-
- const scale = 0.1
- const m1 = new THREE.MeshPhysicalMaterial({
- metalness: 0.0,
- roughness: 0.1,
- color: 0xff0000,
- })
- const x = new THREE.Mesh(geometry, m1)
- x.position.set(1.5 * scale, 0, 0)
- x.scale.set(3 * scale, 0.1 * scale, 0.1 * scale)
- scene.add(x)
-
- const m2 = new THREE.MeshPhysicalMaterial({
- metalness: 0.0,
- roughness: 0.1,
- color: 0x00ff00,
- })
- const y = new THREE.Mesh(geometry, m2)
- y.position.set(0, 1.5 * scale, 0)
- y.scale.set(0.1 * scale, 3 * scale, 0.1 * scale)
- scene.add(y)
-
- const m3 = new THREE.MeshPhysicalMaterial({
- metalness: 0.0,
- roughness: 0.1,
- color: 0x0000ff,
- })
- const z = new THREE.Mesh(geometry, m3)
- z.position.set(0, 0, 1.5 * scale)
- z.scale.set(0.1 * scale, 0.1 * scale, 3 * scale)
- scene.add(z)
- },
- updateAnimation() {
- const dt = this.clock.getDelta()
- if (this.mixers) this.mixers.forEach(mixer => mixer.update(dt))
- },
- copyRobot() {
- const THREE = this.THREE
- const {
- scene,
- animations
- } = cloneGltf(this.model, THREE)
- scene.scale.set(0.05, 0.05, 0.05)
-
- // 动画混合器
- const mixer = new THREE.AnimationMixer(scene)
- for (let i = 0; i < animations.length; i++) {
- const clip = animations[i]
- if (clip.name === 'Dance') {
- const action = mixer.clipAction(clip)
- action.play()
- }
- }
-
- this.mixers = this.mixers || []
- this.mixers.push(mixer)
-
- scene._mixer = mixer
- return scene
- },
- getRobot() {
- const THREE = this.THREE
-
- const model = new THREE.Object3D()
- model.add(this.copyRobot())
-
- this._insertModels = this._insertModels || []
- this._insertModels.push(model)
-
- if (this._insertModels.length > 5) {
- const needRemove = this._insertModels.splice(0, this._insertModels.length - 5)
- needRemove.forEach(item => {
- if (item._mixer) {
- const mixer = item._mixer
- this.mixers.splice(this.mixers.indexOf(mixer), 1)
- mixer.uncacheRoot(mixer.getRoot())
- }
- if (item.parent) item.parent.remove(item)
- })
- }
- return model
- },
- onTouchEnd(evt) {
- if (this.scene && this.model && this.reticle) {
- const model = this.getRobot()
- model.position.copy(this.reticle.position)
- model.rotation.copy(this.reticle.rotation)
- this.scene.add(model)
- }
- }
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2/move.gif b/miniprogram/packageAPI/pages/ar/plane-ar-v2/move.gif
deleted file mode 100644
index 7b7d5ec6..00000000
Binary files a/miniprogram/packageAPI/pages/ar/plane-ar-v2/move.gif and /dev/null differ
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2/plane-ar-v2.js b/miniprogram/packageAPI/pages/ar/plane-ar-v2/plane-ar-v2.js
deleted file mode 100644
index 0808c873..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2/plane-ar-v2.js
+++ /dev/null
@@ -1,92 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-let time = 0
-const countNumber = 20
-let count = 0
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- },
- render(frame) {
- const start = Date.now()
-
- this.renderGL(frame)
- const camera = frame.camera
-
- // 修改光标位置
- const reticle = this.reticle
- if (reticle) {
- const hitTestRes = this.session.hitTest(0.5, 0.5)
- if (hitTestRes.length) {
- reticle.matrixAutoUpdate = false
- reticle.matrix.fromArray(hitTestRes[0].transform)
- reticle.matrix.decompose(reticle.position, reticle.quaternion, reticle.scale)
- if (reticle.position.z != 0) reticle.visible = true
- } else {
- reticle.visible = false
- }
- }
-
- // 更新动画
- this.updateAnimation()
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
-
- const end = Date.now()
-
- time += end - start
- count++
- // if(count >= countNumber){
- // console.log(`${count}次平均耗时统计为${time/count}ms`)
- // count = 0
- // time = 0
- // }
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2/plane-ar-v2.json b/miniprogram/packageAPI/pages/ar/plane-ar-v2/plane-ar-v2.json
deleted file mode 100644
index 6f4f8fe2..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2/plane-ar-v2.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "水平面AR-v2"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2/plane-ar-v2.wxml b/miniprogram/packageAPI/pages/ar/plane-ar-v2/plane-ar-v2.wxml
deleted file mode 100644
index c4d1b08b..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2/plane-ar-v2.wxml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-提示:触碰屏幕任意点, 可在真实水平位置生成示例的机器小人, 其中光标标记指示的是真实水平面
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2/plane-ar-v2.wxss b/miniprogram/packageAPI/pages/ar/plane-ar-v2/plane-ar-v2.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar-v2/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/plane-ar-v2/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar-v2/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar/behavior.js b/miniprogram/packageAPI/pages/ar/plane-ar/behavior.js
deleted file mode 100644
index 9cabf6a9..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar/behavior.js
+++ /dev/null
@@ -1,252 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-import cloneGltf from '../loaders/gltf-clone'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
- const THREE = this.THREE
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 3
- },
- },
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- const loader = new THREE.GLTFLoader()
- loader.load('https://dldir1.qq.com/weixin/miniprogram/RobotExpressive_aa2603d917384b68bb4a086f32dabe83.glb', gltf => {
- this.model = {
- scene: gltf.scene,
- animations: gltf.animations,
- }
- })
-
- this.clock = new THREE.Clock()
-
- loader.load('https://dldir1.qq.com/weixin/miniprogram/reticle_4b6cc19698ca4a08b31fd3c95ce412ec.glb', gltf => {
- const reticle = this.reticle = gltf.scene
-
- reticle.visible = false
- this.scene.add(reticle)
- })
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
- updateAnimation() {
- const dt = this.clock.getDelta()
- if (this.mixers) this.mixers.forEach(mixer => mixer.update(dt))
- },
- copyRobot() {
- const THREE = this.THREE
- const {
- scene,
- animations
- } = cloneGltf(this.model, THREE)
- scene.scale.set(0.05, 0.05, 0.05)
-
- // 动画混合器
- const mixer = new THREE.AnimationMixer(scene)
- for (let i = 0; i < animations.length; i++) {
- const clip = animations[i]
- if (clip.name === 'Dance') {
- const action = mixer.clipAction(clip)
- action.play()
- }
- }
-
- this.mixers = this.mixers || []
- this.mixers.push(mixer)
-
- scene._mixer = mixer
- return scene
- },
- getRobot() {
- const THREE = this.THREE
-
- const model = new THREE.Object3D()
- model.add(this.copyRobot())
-
- this._insertModels = this._insertModels || []
- this._insertModels.push(model)
-
- if (this._insertModels.length > 5) {
- const needRemove = this._insertModels.splice(0, this._insertModels.length - 5)
- needRemove.forEach(item => {
- if (item._mixer) {
- const mixer = item._mixer
- this.mixers.splice(this.mixers.indexOf(mixer), 1)
- mixer.uncacheRoot(mixer.getRoot())
- }
- if (item.parent) item.parent.remove(item)
- })
- }
- return model
- },
- onTouchEnd(evt) {
- if (this.scene && this.model && this.reticle) {
- const model = this.getRobot()
- model.position.copy(this.reticle.position)
- model.rotation.copy(this.reticle.rotation)
- this.scene.add(model)
- }
- }
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar/plane-ar.js b/miniprogram/packageAPI/pages/ar/plane-ar/plane-ar.js
deleted file mode 100644
index baa31187..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar/plane-ar.js
+++ /dev/null
@@ -1,77 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- },
- render(frame) {
- this.renderGL(frame)
-
- const camera = frame.camera
-
- // 修改光标位置
- const reticle = this.reticle
- if (reticle) {
- const hitTestRes = this.session.hitTest(0.5, 0.5)
- if (hitTestRes.length) {
- reticle.matrixAutoUpdate = false
- reticle.matrix.fromArray(hitTestRes[0].transform)
- reticle.matrix.decompose(reticle.position, reticle.quaternion, reticle.scale)
- reticle.visible = true
- } else {
- reticle.visible = false
- }
- }
-
- // 更新动画
- this.updateAnimation()
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar/plane-ar.json b/miniprogram/packageAPI/pages/ar/plane-ar/plane-ar.json
deleted file mode 100644
index 33340144..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar/plane-ar.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "水平面AR"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar/plane-ar.wxml b/miniprogram/packageAPI/pages/ar/plane-ar/plane-ar.wxml
deleted file mode 100644
index f78f70d5..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar/plane-ar.wxml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-提示:触碰屏幕任意点, 可在对应位置生成示例的机器小人, 其中光标标记指示的是水平面
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar/plane-ar.wxss b/miniprogram/packageAPI/pages/ar/plane-ar/plane-ar.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/plane-ar/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/plane-ar/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/plane-ar/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.js b/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.js
deleted file mode 100644
index f0586668..00000000
--- a/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.js
+++ /dev/null
@@ -1,656 +0,0 @@
-import arBehavior from '../behavior/behavior-ar'
-import xrFrameBehavior from '../behavior/behavior-xrframe'
-
-// VK 投影矩阵参数定义
-const NEAR = 0.01
-const FAR = 1000
-
-const loggerOnce = false
-
-Component({
- behaviors: [arBehavior, xrFrameBehavior],
- data: {
- theme: 'light',
- cameraPosition: 0,
- heightScale: 0.76,
- buttonDisable: true,
- isIOS: false,
- showHintBox: false,
- showLegMask: false,
- },
- hintBoxList: [], // 提示点集合
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- const systemInfo = wx.getSystemInfoSync()
- this.setData({
- theme: systemInfo.theme || 'light',
- isIOS: systemInfo.platform === 'ios',
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({
- theme
- }) => {
- this.setData({
- theme
- })
- })
- }
- },
- },
- methods: {
- // 对应案例的初始化逻辑,由统一的 behavior 触发
- init() {
- // 初始化VK
- // start完毕后,进行更新渲染循环
- this.initVK()
- },
- initVK() {
- // VKSession 配置
- const session = this.session = wx.createVKSession({
- track: {
- shoe: {
- mode: 1
- }
- },
- cameraPosition: 0,
- version: 'v1',
- gl: this.gl
- })
-
- try {
- // VKSession start
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- if (!this.data.showLegMask) {
- // 初始化设定
- this.session.updateMaskMode({ useMask: false })
- }
-
- // VKSession EVENT resize
- session.on('resize', () => {
- this.calcCanvasSize()
- })
-
- // VKSession EVENT addAnchors
- session.on('addAnchors', anchors => {
- // console.log("addAnchor", anchors)
- })
-
- // VKSession EVENT updateAnchors
- session.on('updateAnchors', anchors => {
- // console.log("updateAnchors")
-
- if (anchors.length === 1) {
- // 只有一双的情况下,可以做一个简单的显示性检测,进行非 remove 事件下的隐藏
- const anchorSingle = anchors[0]
- const shoedirecSingle = anchorSingle.shoedirec
-
- if (shoedirecSingle === 0) {
- // 只有左脚,此时尝试隐藏右脚
- if (this.modelShowRight && this.modelTrsRight) {
- // 右脚
- this.scaleTrs(this.modelTrsRight, 0, 0, 0)
- this.updateHintBoxVisible(this.hintBoxListRight, false)
- this.modelShowRight = false
- }
- } else if (shoedirecSingle === 1) {
- // 只有右脚,此时尝试隐藏左脚
- if (this.modelShowLeft && this.modelTrsLeft) {
- // 左脚
- this.scaleTrs(this.modelTrsLeft, 0, 0, 0)
- this.updateHintBoxVisible(this.hintBoxListLeft, false)
- this.modelShowLeft = false
- }
- }
- }
-
- for (let i = 0; i < anchors.length; i++) {
- const anchor = anchors[i]
- // console.log('transform', anchor.transform);
- // console.log('points3d', anchor.points3d);
- const modelScale = 1
-
- if (anchor.shoedirec === 0) {
- // 左脚
- this.shoeTransformLeft = anchor.transform
- this.points3dLeft = anchor.points3d
-
- if (!this.modelShowLeft && this.modelTrsLeft) {
- this.scaleTrs(this.modelTrsLeft, modelScale, modelScale, modelScale)
- this.updateHintBoxVisible(this.hintBoxListLeft, true)
- this.modelShowLeft = true
- }
- } else if (anchor.shoedirec === 1) {
- // 右脚
- this.shoeTransformRight = anchor.transform
- this.points3dRight = anchor.points3d
-
- if (!this.modelShowRight && this.modelTrsRight) {
- this.scaleTrs(this.modelTrsRight, modelScale, modelScale, modelScale)
- this.updateHintBoxVisible(this.hintBoxListRight, true)
- this.modelShowRight = true
- }
- }
- }
- })
-
- // VKSession removeAnchors
- // 识别目标丢失时,会不断触发
- session.on('removeAnchors', anchors => {
- // console.log("removeAnchors")
-
- // Hide
- if (this.modelShowLeft && this.modelTrsLeft) {
- // 左脚
- this.scaleTrs(this.modelTrsLeft, 0)
- this.updateHintBoxVisible(this.hintBoxListLeft, false)
- this.modelShowLeft = false
- }
- if (this.modelShowRight && this.modelTrsRight) {
- // 右脚
- this.scaleTrs(this.modelTrsRight, 0)
- this.updateHintBoxVisible(this.hintBoxListRight, false)
- this.modelShowRight = false
- }
- })
-
- console.log('ready to initloop')
- // start 初始化完毕后,进行更新渲染循环
- this.initLoop()
- })
- } catch (e) {
- console.error(e)
- }
- },
- // 针对 xr-frame 的初始化逻辑
- async initXRFrame() {
- const xrFrameSystem = wx.getXrFrameSystem()
- const scene = this.xrScene
- const { rootShadow } = scene
-
- // 缓存主相机
- this.xrCameraMain = this.xrCamera
- this.xrCameraMainTrs = this.xrCameraTrs
- // 试鞋案例,使用rt相机作为xrCamera
- const xrCameraEl = scene.getElementById('rtCamera')
- this.xrCamera = xrCameraEl.getComponent(xrFrameSystem.Camera)
- this.xrCameraTrs = xrCameraEl.getComponent(xrFrameSystem.Transform)
-
- // 初始化YUV相机配置
- this.initXRYUVCamera()
-
- // 初始化ShoeMask平面,会用绘制RT中物体
- this.addShoeMaskPlane()
-
- // 左右鞋子分别处理
- const shoeFrontFix = 0.2 // 额外前移,适配鞋后
- const shoeBottomFix = -0.4 // 额外下移,适配鞋底
- // const shoeFrontFix = 0;
- // const shoeBottomFix = 0;
-
- const shoeScaleFactorX = 1.1 // 针对窄鞋缩放,优化效果
-
- // 模型缩放
- let modelScale = 220
- // 针对 3.2.1 版本基础库,iOS 试鞋,返回的投影矩阵,进行的兼容修复
- if (!this.data.isIOS) {
- modelScale *= 1.2
- }
-
- // 遮挡模型
- const occGeometry = scene.assets.getAsset('geometry', 'cylinder')
- const occEffect = scene.assets.getAsset('effect', 'standard')
-
- // === 左边鞋子流程 ===
- // 初始化挂载点
- this.modelWrapLeft = scene.createElement(xrFrameSystem.XRNode)
- this.modelWrapTrsLeft = this.modelWrapLeft.getComponent(xrFrameSystem.Transform)
- rootShadow.addChild(this.modelWrapLeft)
-
- console.log('modelWrapLeft ready')
-
- // 点挂载
- const modelPointLeft = scene.createElement(xrFrameSystem.XRNode, {
- position: '0 0 0',
- scale: '0 0 0',
- })
- this.modelTrsLeft = modelPointLeft.getComponent(xrFrameSystem.Transform)
- this.modelShowLeft = false
- this.modelWrapLeft.addChild(modelPointLeft)
-
- // 加载鞋子模型
- const shoeModelLeft = await scene.assets.loadAsset({
- type: 'gltf',
- assetId: 'gltf-shoe-left',
- src: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/shoe-1-left.glb',
- })
- console.log('shoeModelLeft', shoeModelLeft.value)
- const elLeft = scene.createElement(xrFrameSystem.XRGLTF, {
- model: 'gltf-shoe-left',
- position: `0 ${shoeBottomFix} ${shoeFrontFix}`,
- scale: `${modelScale * shoeScaleFactorX} ${modelScale} ${modelScale}`,
- layer: 2
- })
- this.modelLeft = elLeft
- // this.modelTrsLeft = elLeft.getComponent(xrFrameSystem.Transform);
- // this.modelShowLeft = false;
- // this.modelWrapLeft.addChild(elLeft);
- modelPointLeft.addChild(elLeft)
-
- // 遮挡模型
- const occlusionLeft = scene.createElement(xrFrameSystem.XRNode, {
- position: '0.1 3.5 -2.3',
- rotation: '-20 0 0',
- scale: '1.5 2 1.6',
- layer: 2
- })
- const occMatLeft = scene.createMaterial(occEffect)
- // 遮挡渲染状态
- occMatLeft.renderQueue = 1
- occMatLeft.alphaMode = 'BLEND'
- occMatLeft.setVector('u_baseColorFactor', xrFrameSystem.Vector4.createFromNumber(1.0, 1.0, 1.0, 0.0))
- const occMeshLeft = occlusionLeft.addComponent(xrFrameSystem.Mesh, {
- geometry: occGeometry,
- material: occMatLeft,
- })
- modelPointLeft.addChild(occlusionLeft)
-
- // left done
- console.log('this.modelTrsLeft', this.modelTrsLeft)
- console.log('shoeModelLeft ready')
-
- // 加载提示点
- this.hintBoxListLeft = this.getHintBox(xrFrameSystem, scene, this.modelWrapLeft)
-
- // === 右边鞋子流程 ===
- // 初始化挂载点
- this.modelWrapRight = scene.createElement(xrFrameSystem.XRNode)
- this.modelWrapTrsRight = this.modelWrapRight.getComponent(xrFrameSystem.Transform)
- rootShadow.addChild(this.modelWrapRight)
-
- console.log('modelWrapRight ready')
-
- // 点挂载
- const modelPointRight = scene.createElement(xrFrameSystem.XRNode, {
- position: '0 0 0',
- scale: '0 0 0',
- })
- this.modelTrsRight = modelPointRight.getComponent(xrFrameSystem.Transform)
- this.modelShowRight = false
- this.modelWrapRight.addChild(modelPointRight)
-
- // 加载鞋子模型
- const shoeModelRight = await scene.assets.loadAsset({
- type: 'gltf',
- assetId: 'gltf-shoe-right',
- src: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/shoe-1-right.glb',
- })
- console.log('shoeModelRight', shoeModelRight.value)
- const elRight = scene.createElement(xrFrameSystem.XRGLTF, {
- model: 'gltf-shoe-right',
- position: `0 ${shoeBottomFix} ${shoeFrontFix}`,
- scale: `${modelScale * shoeScaleFactorX} ${modelScale} ${modelScale}`,
- layer: 2
- })
- this.modelRight = elRight
- // this.modelTrsRight = elRight.getComponent(xrFrameSystem.Transform);
- // this.modelShowRight = false;
- // this.modelWrapRight.addChild(elRight);
- modelPointRight.addChild(elRight)
-
- // 遮挡模型
- const occlusionRight = scene.createElement(xrFrameSystem.XRNode, {
- position: '0.1 3.5 -2.3',
- rotation: '-20 0 0',
- scale: '1.5 2 1.6',
- layer: 2
- })
- const occMatRight = scene.createMaterial(occEffect)
- // 遮挡渲染状态
- occMatRight.renderQueue = 1
- occMatRight.alphaMode = 'BLEND'
- occMatRight.setVector('u_baseColorFactor', xrFrameSystem.Vector4.createFromNumber(1.0, 1.0, 1.0, 0.0))
- const occMeshRight = occlusionRight.addComponent(xrFrameSystem.Mesh, {
- geometry: occGeometry,
- material: occMatRight,
- })
- modelPointRight.addChild(occlusionRight)
-
- // right done
- console.log('this.modelTrsRight', this.modelTrsRight)
- console.log('shoeModelRight ready')
-
- // 加载提示点
- this.hintBoxListRight = this.getHintBox(xrFrameSystem, scene, this.modelWrapRight)
- },
- loop() {
- // console.log('loop')
- // 获取 VKFrame
- const frame = this.session.getVKFrame(this.data.domWidth, this.data.domHeight)
-
- // 成功获取 VKFrame 才进行
- if (!frame) { return }
-
- // 更新腿部分割纹理
- if (this.data.showLegMask) {
- this.updateShoeMask(frame)
- // console.log(getLegSegmentBuffer);
- }
-
- // 更新相机 YUV 数据
- this.updataXRYUV(frame)
-
- // 获取 VKCamera
- const VKCamera = frame.camera
-
- // 更新 xrFrame 相机矩阵
- this.updataXRCameraMatrix(VKCamera, NEAR, FAR)
-
- // 存在model,更新矩阵
- // 左边鞋子流程
- if (this.modelWrapLeft && this.modelTrsLeft && this.points3dLeft && this.shoeTransformLeft) {
- const xrFrameSystem = wx.getXrFrameSystem()
-
- if (!this.DT) { this.DT = new xrFrameSystem.Matrix4() }
- if (!this.DT2) { this.DT2 = new xrFrameSystem.Matrix4() }
-
- // 目前VK返回的是行主序矩阵
- // xrframe 矩阵存储为列主序
- this.DT.setArray(this.shoeTransformLeft)
- this.DT.transpose(this.DT2)
- this.modelWrapTrsLeft.setLocalMatrix(this.DT2)
-
- // 放置鞋子
- this.modelTrsLeft.position.x = (this.points3dLeft[3].x + this.points3dLeft[4].x) / 2
- this.modelTrsLeft.position.y = (this.points3dLeft[3].y + this.points3dLeft[4].y) / 2
- this.modelTrsLeft.position.z = (this.points3dLeft[0].z + this.points3dLeft[1].z) / 2
-
- this.updateHintBoxPosition(this.hintBoxListLeft, this.points3dLeft)
- }
- // 右边鞋子流程
- if (this.modelWrapRight && this.modelTrsRight && this.points3dRight && this.shoeTransformRight) {
- const xrFrameSystem = wx.getXrFrameSystem()
-
- if (!this.DT) { this.DT = new xrFrameSystem.Matrix4() }
- if (!this.DT2) { this.DT2 = new xrFrameSystem.Matrix4() }
-
- // 目前VK返回的是行主序矩阵
- // xrframe 矩阵存储为列主序
- this.DT.setArray(this.shoeTransformRight)
- this.DT.transpose(this.DT2)
- this.modelWrapTrsRight.setLocalMatrix(this.DT2)
-
- // 放置鞋子
- this.modelTrsRight.position.x = (this.points3dRight[3].x + this.points3dRight[4].x) / 2
- this.modelTrsRight.position.y = (this.points3dRight[3].y + this.points3dRight[4].y) / 2
- this.modelTrsRight.position.z = (this.points3dRight[0].z + this.points3dRight[1].z) / 2
-
- this.updateHintBoxPosition(this.hintBoxListRight, this.points3dRight)
- }
- },
- // 缩放 xr-frame TRS
- scaleTrs(trs, scaleX, scaleY, scaleZ) {
- trs.scale.x = scaleX
- trs.scale.y = scaleY
- trs.scale.z = scaleZ
- },
- getHintBox(xrFrameSystem, scene, wrap) {
- // 初始化提示点
- const geometryCube = scene.assets.getAsset('geometry', 'cube')
- const effectCube = scene.assets.getAsset('effect', 'standard')
- const boxScale = 0.2
- const hintBoxList = []
- for (let i = 0; i < 8; i++) {
- const colorFloat = i / 16
- const el = scene.createElement(xrFrameSystem.XRNode, {
- position: '0 0 0',
- scale: `${boxScale} ${boxScale} ${boxScale}`,
- layer: 2
- })
- const elTrs = el.getComponent(xrFrameSystem.Transform)
- const mat = scene.createMaterial(effectCube)
- mat.setVector('u_baseColorFactor', xrFrameSystem.Vector4.createFromNumber(colorFloat + 0.3, 0.2, 0.2, 1.0))
- mat.renderQueue = 9990
- mat.setRenderState('depthTestOn', false)
-
- const mesh = el.addComponent(xrFrameSystem.Mesh, {
- geometry: geometryCube,
- material: mat,
- })
-
- wrap.addChild(el)
- elTrs.visible = false
-
- hintBoxList.push(elTrs)
- }
-
- return hintBoxList
- },
- updateHintBoxVisible(hintBoxList, visible) {
- if (hintBoxList && hintBoxList.length > 0) {
- // 存在提示列表,则更新点信息
- for (let i = 0; i < hintBoxList.length; i++) {
- const hintBox = hintBoxList[i]
- const visibleFlag = this.data.showHintBox && visible
- if (hintBox.visible !== visibleFlag) {
- hintBox.visible = visibleFlag
- }
- }
- }
- },
- updateHintBoxPosition(hintBoxList, points3d) {
- if (hintBoxList && hintBoxList.length > 0) {
- // console.log('ready to set', hintBoxList);
- // 存在提示列表,则更新点信息
- for (let i = 0; i < hintBoxList.length; i++) {
- const hintBox = hintBoxList[i]
- hintBox.position.x = points3d[i].x
- hintBox.position.y = points3d[i].y
- hintBox.position.z = points3d[i].z
- }
- }
- },
- addShoeMaskPlane() {
- const scene = this.xrScene
- const { rootShadow } = scene
-
- const xrFrameSystem = wx.getXrFrameSystem()
-
- const el = scene.createElement(xrFrameSystem.XRNode, {
- layer: 1
- })
-
- const shoeMaskGeometry = scene.assets.getAsset('geometry', 'ar-camera-plane')
- let shoeMaskEffect = scene.assets.getAsset('effect', 'ar-shoe-mask')
-
- if (!shoeMaskEffect) {
- xrFrameSystem.registerEffect('ar-shoe-mask', scene => scene.createEffect({
- properties: [
- { key: 'u_baseColorFactor', type: xrFrameSystem.EUniformType.FLOAT4, default: [1, 1, 1, 1] },
- ],
- images: [
- {
- key: 'u_shoeMask',
- default: 'black',
- macro: 'WX_AR_SHOEMASk'
- },
- {
- key: 'u_renderTexture',
- default: 'black',
- macro: 'WX_AR_RENDERTEXTURE'
- },
- ],
- defaultRenderQueue: 2,
- passes: [{
- renderStates: {
- blendOn: true,
- depthWrite: false,
- // Default FrontFace is CW
- cullOn: true,
- cullFace: xrFrameSystem.ECullMode.BACK,
- },
- lightMode: 'ForwardBase',
- useMaterialRenderStates: true,
- shaders: [0, 1]
- }],
- shaders:
- [
- `#version 100
- attribute vec3 a_position;
- attribute vec2 a_texCoord;
-
- precision highp float;
-
- varying highp vec2 v_texCoord;
-
- void main() {
- v_texCoord = a_texCoord;
- vec4 pos = vec4(a_position.xy, 1., 1.);
- gl_Position = pos;
- }
- `,
- `#version 100
- precision mediump float;
- precision highp int;
-
- uniform sampler2D u_shoeMask;
- uniform sampler2D u_renderTexture;
-
- varying highp vec2 v_texCoord;
-
- void main()
- {
- vec2 uv = vec2(v_texCoord.x, v_texCoord.y);
- vec4 renderTexture = texture2D(u_renderTexture, uv);
-
- #ifdef WX_USE_SHOEMASK
- // 透明度混合
- vec2 uvFlip = vec2(v_texCoord.x, 1.0 - v_texCoord.y);
- vec4 shoeMask = texture2D(u_shoeMask, uvFlip);
-
- if (shoeMask.r > 0.0) {
- float alpha = renderTexture.w * (1.0 - shoeMask.r);
- gl_FragData[0] = vec4(renderTexture.x, renderTexture.y, renderTexture.z, alpha);
- } else {
- gl_FragData[0] = vec4(renderTexture.x, renderTexture.y, renderTexture.z, renderTexture.w);
- }
- #else
- gl_FragData[0] = vec4(renderTexture.x, renderTexture.y, renderTexture.z, renderTexture.w);
-
- #endif
- }
- `
- ]
- }))
- shoeMaskEffect = scene.assets.getAsset('effect', 'ar-shoe-mask')
- }
-
- const shoeMaskMat = scene.createMaterial(shoeMaskEffect)
-
- // 获取屏幕renderTexture
- this.renderTexture = scene.assets.getAsset('render-texture', 'rt')
- shoeMaskMat.setTexture('u_renderTexture', this.renderTexture.texture)
-
- shoeMaskMat.renderQueue = 2 // 第二个绘制
- const mesh = el.addComponent(xrFrameSystem.Mesh, {
- geometry: shoeMaskGeometry,
- material: shoeMaskMat
- })
-
- // ShoeMask纹理
- this.shoeMaskMat = shoeMaskMat
- this.shoeMaskMatInit = false
-
- // 不进入正常的剔除
- rootShadow.addChild(el)
- },
- updateShoeMask(frame) {
- const scene = this.xrScene
- const xrFrameSystem = wx.getXrFrameSystem()
-
- // 腿部分割
- const legSegmentBuffer = frame.getLegSegmentBuffer()
- // 存在数据才进行rt初始化
- if (legSegmentBuffer && legSegmentBuffer.width > 0 && legSegmentBuffer.height > 0) {
- // 存在数据,开启宏
- this.shoeMaskMat.setMacro('WX_USE_SHOEMASK', true)
-
- // 未创建贴图缓存,先创建
- if (!this.shoeMaskTexure) {
- this.shoeMaskTexure = scene.createTexture({
- width: legSegmentBuffer.width,
- height: legSegmentBuffer.height,
- source: [legSegmentBuffer.MaskAddress],
- magFilter: xrFrameSystem.EFilterMode.LINEAR,
- minFilter: xrFrameSystem.EFilterMode.LINEAR,
- pixelFormat: xrFrameSystem.ETextureFormat.R8
- })
- }
-
- const shoeMaskMat = this.shoeMaskMat
- // 未绑定贴图的情况下,绑定贴图
- if (!this.shoeMaskMatInit) {
- shoeMaskMat.setTexture('u_shoeMask', this.shoeMaskTexure)
- this.shoeMaskMatInit = true
- }
-
- this.shoeMaskTexure.update({ buffer: legSegmentBuffer.MaskAddress })
- } else {
- console.error('getLegSegmentBuffer is empty', legSegmentBuffer, legSegmentBuffer.width, legSegmentBuffer.height)
- }
- },
- // 点击腿Mask切换
- onTapMask() {
- const maskFlag = !this.data.showLegMask
-
- if (this.session && this.session.updateMaskMode) {
- // 开启关闭 shoeMask
- this.session.updateMaskMode({ useMask: maskFlag })
-
- if (!maskFlag) {
- this.shoeMaskMat.setMacro('WX_USE_SHOEMASK', false)
- }
-
- this.setData({
- showLegMask: maskFlag
- })
- } else {
- console.error('请初始化vk后,再点击切换按钮')
- }
- },
- // 点击提示点切换
- onTapHint() {
- const hintFlag = !this.data.showHintBox
-
- this.setData({
- showHintBox: hintFlag
- })
-
- // nextTick 保证 setData
- setTimeout(() => {
- if (this.modelShowLeft && this.modelTrsLeft) {
- // 左脚
- this.updateHintBoxVisible(this.hintBoxListLeft, hintFlag)
- }
- if (this.modelShowRight && this.modelTrsRight) {
- // 右脚
- this.updateHintBoxVisible(this.hintBoxListRight, hintFlag)
- }
- }, 33)
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.json b/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.json
deleted file mode 100644
index 248b9689..00000000
--- a/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "usingComponents": {
- "xr-frame-canvas": "../components/xr-frame/index"
- },
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "实时鞋部检测-试鞋案例"
-}
diff --git a/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.wxml b/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.wxml
deleted file mode 100644
index ffdeca3d..00000000
--- a/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.wxml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 提示:将摄像头对准鞋部, 检测到的鞋部将会被标记出识别框和鞋部标记点(基础库 3.2.1 起支持)
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.wxss b/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.wxss
deleted file mode 100644
index 074b8d0e..00000000
--- a/miniprogram/packageAPI/pages/ar/shoe-detect/shoe-detect.wxss
+++ /dev/null
@@ -1,43 +0,0 @@
-.canvas-wrap {
- position: relative;
- width: 100%;
- background-color: #000;
-}
-
-.canvas-wrap canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.canvas-wrap #canvas {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
-}
-
-.hint-bottom {
- position: absolute;
- left: 20px;
- right: 20px;
- bottom: 20px;
- padding: 5px 10px;
- font-size: 14px;
- color: #fff;
- background-color: rgba(0, 0, 0, 0.4);
- border-radius: 6px;
-}
-
-.hint-bottom .btn-wrap {
- display: flex;
-}
-
-.hint-bottom .btn{
- margin: 10px 5px;
- font-size: 14px;
- line-height: 18px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/behavior.js b/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/behavior.js
deleted file mode 100644
index e2e3eb19..00000000
--- a/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/behavior.js
+++ /dev/null
@@ -1,252 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-import cloneGltf from '../loaders/gltf-clone'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
- const THREE = this.THREE
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 1
- },
- },
- version: 'v2',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- const loader = new THREE.GLTFLoader()
- loader.load('https://dldir1.qq.com/weixin/miniprogram/RobotExpressive_aa2603d917384b68bb4a086f32dabe83.glb', gltf => {
- this.model = {
- scene: gltf.scene,
- animations: gltf.animations,
- }
- })
-
- this.clock = new THREE.Clock()
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
-
- copyRobot() {
- const THREE = this.THREE
- const {
- scene,
- animations
- } = cloneGltf(this.model, THREE)
- scene.scale.set(0.05, 0.05, 0.05)
-
- // 动画混合器
- const mixer = new THREE.AnimationMixer(scene)
- for (let i = 0; i < animations.length; i++) {
- const clip = animations[i]
- if (clip.name === 'Dance') {
- const action = mixer.clipAction(clip)
- action.play()
- }
- }
-
- this.mixers = this.mixers || []
- this.mixers.push(mixer)
-
- scene._mixer = mixer
- return scene
- },
- getRobot() {
- const THREE = this.THREE
-
- const model = new THREE.Object3D()
- model.add(this.copyRobot())
-
- this._insertModels = this._insertModels || []
- this._insertModels.push(model)
-
- if (this._insertModels.length > 5) {
- const needRemove = this._insertModels.splice(0, this._insertModels.length - 5)
- needRemove.forEach(item => {
- if (item._mixer) {
- const mixer = item._mixer
- this.mixers.splice(this.mixers.indexOf(mixer), 1)
- mixer.uncacheRoot(mixer.getRoot())
- }
- if (item.parent) item.parent.remove(item)
- })
- }
-
- return model
- },
- onTouchEnd(evt) {
- // 点击位置放一个机器人
- const touches = evt.changedTouches.length ? evt.changedTouches : evt.touches
- if (touches.length === 1) {
- const touch = touches[0]
- if (this.session && this.scene && this.model) {
- const hitTestRes = this.session.hitTest(touch.x / this.data.width, touch.y / this.data.height, this.resetPanel)
- this.resetPanel = false
- if (hitTestRes.length) {
- const model = this.getRobot()
- model.matrixAutoUpdate = false
- model.matrix.fromArray(hitTestRes[0].transform)
- this.scene.add(model)
- }
- }
- }
- }
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/visionkit-basic-v2.js b/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/visionkit-basic-v2.js
deleted file mode 100644
index 95ce730c..00000000
--- a/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/visionkit-basic-v2.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- },
- render(frame) {
- this.renderGL(frame)
-
- const camera = frame.camera
-
- const dt = this.clock.getDelta()
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.update(dt))
- }
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/visionkit-basic-v2.json b/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/visionkit-basic-v2.json
deleted file mode 100644
index 9b52f5f1..00000000
--- a/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/visionkit-basic-v2.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "VisionKit基础-v2"
-}
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/visionkit-basic-v2.wxml b/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/visionkit-basic-v2.wxml
deleted file mode 100644
index 307f032d..00000000
--- a/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/visionkit-basic-v2.wxml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-提示:v2版本识别平面, 触碰屏幕任意点, 在平面位置会生成示例的机器小人
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/visionkit-basic-v2.wxss b/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/visionkit-basic-v2.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/visionkit-basic-v2/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic/behavior.js b/miniprogram/packageAPI/pages/ar/visionkit-basic/behavior.js
deleted file mode 100644
index a39b11b6..00000000
--- a/miniprogram/packageAPI/pages/ar/visionkit-basic/behavior.js
+++ /dev/null
@@ -1,252 +0,0 @@
-import {
- createScopedThreejs
-} from './threejs-miniprogram'
-import {
- registerGLTFLoader
-} from '../loaders/gltf-loader'
-import cloneGltf from '../loaders/gltf-clone'
-
-const info = wx.getSystemInfoSync()
-
-export default function getBehavior() {
- return Behavior({
- data: {
- width: 1,
- height: 1,
- fps: 0,
- memory: 0,
- cpu: 0,
- },
- methods: {
- onReady() {
- wx.createSelectorQuery()
- .select('#webgl')
- .node()
- .exec(res => {
- this.canvas = res[0].node
-
- const info = wx.getSystemInfoSync()
- const pixelRatio = info.pixelRatio
- const calcSize = (width, height) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
- calcSize(info.windowWidth, info.windowHeight * 0.8)
-
- this.initVK()
- })
- },
- onUnload() {
- if (this._texture) {
- this._texture.dispose()
- this._texture = null
- }
- if (this.renderer) {
- this.renderer.dispose()
- this.renderer = null
- }
- if (this.scene) {
- this.scene.dispose()
- this.scene = null
- }
- if (this.camera) this.camera = null
- if (this.model) this.model = null
- if (this._insertModel) this._insertModel = null
- if (this._insertModels) this._insertModels = null
- if (this.planeBox) this.planeBox = null
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.uncacheRoot(mixer.getRoot()))
- this.mixers = null
- }
- if (this.clock) this.clock = null
-
- if (this.THREE) this.THREE = null
- if (this._tempTexture && this._tempTexture.gl) {
- this._tempTexture.gl.deleteTexture(this._tempTexture)
- this._tempTexture = null
- }
- if (this._fb && this._fb.gl) {
- this._fb.gl.deleteFramebuffer(this._fb)
- this._fb = null
- }
- if (this._program && this._program.gl) {
- this._program.gl.deleteProgram(this._program)
- this._program = null
- }
- if (this.canvas) this.canvas = null
- if (this.gl) this.gl = null
- if (this.session) this.session = null
- if (this.anchor2DList) this.anchor2DList = []
- },
- initVK() {
- // 初始化 threejs
- this.initTHREE()
- const THREE = this.THREE
-
- // 自定义初始化
- if (this.init) this.init()
-
- console.log('this.gl', this.gl)
-
- const session = this.session = wx.createVKSession({
- track: {
- plane: {
- mode: 3
- },
- },
- version: 'v1',
- gl: this.gl
- })
- session.start(err => {
- if (err) return console.error('VK error: ', err)
-
- console.log('@@@@@@@@ VKSession.version', session.version)
-
- const canvas = this.canvas
-
- const calcSize = (width, height, pixelRatio) => {
- console.log(`canvas size: width = ${width} , height = ${height}`)
- this.canvas.width = width * pixelRatio
- this.canvas.height = height * pixelRatio
- this.setData({
- width,
- height,
- })
- }
-
- session.on('resize', () => {
- const info = wx.getSystemInfoSync()
- calcSize(info.windowWidth, info.windowHeight * 0.8, info.pixelRatio)
- })
-
- const loader = new THREE.GLTFLoader()
- loader.load('https://dldir1.qq.com/weixin/miniprogram/RobotExpressive_aa2603d917384b68bb4a086f32dabe83.glb', gltf => {
- this.model = {
- scene: gltf.scene,
- animations: gltf.animations,
- }
- })
-
- this.clock = new THREE.Clock()
-
- // 限制调用帧率
- const fps = 30
- const fpsInterval = 1000 / fps
- let last = Date.now()
-
- // 逐帧渲染
- const onFrame = timestamp => {
- const now = Date.now()
- const mill = now - last
- // 经过了足够的时间
- if (mill > fpsInterval) {
- last = now - (mill % fpsInterval) // 校正当前时间
- const frame = session.getVKFrame(canvas.width, canvas.height)
- if (frame) {
- this.render(frame)
- }
- }
- session.requestAnimationFrame(onFrame)
- }
- session.requestAnimationFrame(onFrame)
- })
- },
- initTHREE() {
- const THREE = this.THREE = createScopedThreejs(this.canvas)
- registerGLTFLoader(THREE)
-
- // 相机
- this.camera = new THREE.Camera()
-
- // 场景
- const scene = this.scene = new THREE.Scene()
-
- // 光源
- const light1 = new THREE.HemisphereLight(0xffffff, 0x444444) // 半球光
- light1.position.set(0, 0.2, 0)
- scene.add(light1)
- const light2 = new THREE.DirectionalLight(0xffffff) // 平行光
- light2.position.set(0, 0.2, 0.1)
- scene.add(light2)
-
- // 渲染层
- const renderer = this.renderer = new THREE.WebGLRenderer({
- antialias: true,
- alpha: true
- })
- renderer.gammaOutput = true
- renderer.gammaFactor = 2.2
- },
-
- copyRobot() {
- const THREE = this.THREE
- const {
- scene,
- animations
- } = cloneGltf(this.model, THREE)
- scene.scale.set(0.05, 0.05, 0.05)
-
- // 动画混合器
- const mixer = new THREE.AnimationMixer(scene)
- for (let i = 0; i < animations.length; i++) {
- const clip = animations[i]
- if (clip.name === 'Dance') {
- const action = mixer.clipAction(clip)
- action.play()
- }
- }
-
- this.mixers = this.mixers || []
- this.mixers.push(mixer)
-
- scene._mixer = mixer
- return scene
- },
- getRobot() {
- const THREE = this.THREE
-
- const model = new THREE.Object3D()
- model.add(this.copyRobot())
-
- this._insertModels = this._insertModels || []
- this._insertModels.push(model)
-
- if (this._insertModels.length > 5) {
- const needRemove = this._insertModels.splice(0, this._insertModels.length - 5)
- needRemove.forEach(item => {
- if (item._mixer) {
- const mixer = item._mixer
- this.mixers.splice(this.mixers.indexOf(mixer), 1)
- mixer.uncacheRoot(mixer.getRoot())
- }
- if (item.parent) item.parent.remove(item)
- })
- }
-
- return model
- },
- onTouchEnd(evt) {
- // 点击位置放一个机器人
- const touches = evt.changedTouches.length ? evt.changedTouches : evt.touches
- if (touches.length === 1) {
- const touch = touches[0]
- if (this.session && this.scene && this.model) {
- const hitTestRes = this.session.hitTest(touch.x / this.data.width, touch.y / this.data.height, this.resetPanel)
- this.resetPanel = false
- if (hitTestRes.length) {
- const model = this.getRobot()
- model.matrixAutoUpdate = false
- model.matrix.fromArray(hitTestRes[0].transform)
- this.scene.add(model)
- }
- }
- }
- }
- },
- })
-}
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic/visionkit-basic.js b/miniprogram/packageAPI/pages/ar/visionkit-basic/visionkit-basic.js
deleted file mode 100644
index 95ce730c..00000000
--- a/miniprogram/packageAPI/pages/ar/visionkit-basic/visionkit-basic.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import getBehavior from './behavior'
-import yuvBehavior from './yuvBehavior'
-
-const NEAR = 0.001
-const FAR = 1000
-
-Component({
- behaviors: [getBehavior(), yuvBehavior],
- data: {
- theme: 'light',
- },
- lifetimes: {
- /**
- * 生命周期函数--监听页面加载
- */
- detached() {
- console.log('页面detached')
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- ready() {
- console.log('页面准备完全')
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
- },
- methods: {
- init() {
- this.initGL()
- },
- render(frame) {
- this.renderGL(frame)
-
- const camera = frame.camera
-
- const dt = this.clock.getDelta()
- if (this.mixers) {
- this.mixers.forEach(mixer => mixer.update(dt))
- }
-
- // 相机
- if (camera) {
- this.camera.matrixAutoUpdate = false
- this.camera.matrixWorldInverse.fromArray(camera.viewMatrix)
- this.camera.matrixWorld.getInverse(this.camera.matrixWorldInverse)
-
- const projectionMatrix = camera.getProjectionMatrix(NEAR, FAR)
- this.camera.projectionMatrix.fromArray(projectionMatrix)
- this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix)
- }
-
- this.renderer.autoClearColor = false
- this.renderer.render(this.scene, this.camera)
- this.renderer.state.setCullFace(this.THREE.CullFaceNone)
- },
- },
-})
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic/visionkit-basic.json b/miniprogram/packageAPI/pages/ar/visionkit-basic/visionkit-basic.json
deleted file mode 100644
index fd59d4a1..00000000
--- a/miniprogram/packageAPI/pages/ar/visionkit-basic/visionkit-basic.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "disableScroll": true,
- "renderer": "webview",
-"navigationBarTitleText": "VisionKit基础"
-}
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic/visionkit-basic.wxml b/miniprogram/packageAPI/pages/ar/visionkit-basic/visionkit-basic.wxml
deleted file mode 100644
index c6f51d5c..00000000
--- a/miniprogram/packageAPI/pages/ar/visionkit-basic/visionkit-basic.wxml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-提示:触碰屏幕任意点, 可在对应位置生成示例的机器小人
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic/visionkit-basic.wxss b/miniprogram/packageAPI/pages/ar/visionkit-basic/visionkit-basic.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/ar/visionkit-basic/yuvBehavior.js b/miniprogram/packageAPI/pages/ar/visionkit-basic/yuvBehavior.js
deleted file mode 100644
index 1c7cb263..00000000
--- a/miniprogram/packageAPI/pages/ar/visionkit-basic/yuvBehavior.js
+++ /dev/null
@@ -1,139 +0,0 @@
-const yuvBehavior = Behavior({
- methods: {
- initShader() {
- const gl = this.gl = this.renderer.getContext()
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const vs = `
- attribute vec2 a_position;
- attribute vec2 a_texCoord;
- uniform mat3 displayTransform;
- varying vec2 v_texCoord;
- void main() {
- vec3 p = displayTransform * vec3(a_position, 0);
- gl_Position = vec4(p, 1);
- v_texCoord = a_texCoord;
- }
- `
- const fs = `
- precision highp float;
-
- uniform sampler2D y_texture;
- uniform sampler2D uv_texture;
- varying vec2 v_texCoord;
- void main() {
- vec4 y_color = texture2D(y_texture, v_texCoord);
- vec4 uv_color = texture2D(uv_texture, v_texCoord);
-
- float Y, U, V;
- float R ,G, B;
- Y = y_color.r;
- U = uv_color.r - 0.5;
- V = uv_color.a - 0.5;
-
- R = Y + 1.402 * V;
- G = Y - 0.344 * U - 0.714 * V;
- B = Y + 1.772 * U;
-
- gl_FragColor = vec4(R, G, B, 1.0);
- }
- `
- 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 program = this._program = gl.createProgram()
- this._program.gl = gl
- gl.attachShader(program, vertShader)
- gl.attachShader(program, fragShader)
- gl.deleteShader(vertShader)
- gl.deleteShader(fragShader)
- gl.linkProgram(program)
- gl.useProgram(program)
-
- const uniformYTexture = gl.getUniformLocation(program, 'y_texture')
- gl.uniform1i(uniformYTexture, 5)
- const uniformUVTexture = gl.getUniformLocation(program, 'uv_texture')
- gl.uniform1i(uniformUVTexture, 6)
-
- this._dt = gl.getUniformLocation(program, 'displayTransform')
- gl.useProgram(currentProgram)
- },
- initVAO() {
- const gl = this.renderer.getContext()
- const ext = gl.getExtension('OES_vertex_array_object')
- this.ext = ext
-
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
- const vao = ext.createVertexArrayOES()
-
- ext.bindVertexArrayOES(vao)
-
- const posAttr = gl.getAttribLocation(this._program, 'a_position')
- const pos = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, pos)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(posAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(posAttr)
- vao.posBuffer = pos
-
- const texcoordAttr = gl.getAttribLocation(this._program, 'a_texCoord')
- const texcoord = gl.createBuffer()
- gl.bindBuffer(gl.ARRAY_BUFFER, texcoord)
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 0, 1, 1, 0, 0, 0]), gl.STATIC_DRAW)
- gl.vertexAttribPointer(texcoordAttr, 2, gl.FLOAT, false, 0, 0)
- gl.enableVertexAttribArray(texcoordAttr)
- vao.texcoordBuffer = texcoord
-
- ext.bindVertexArrayOES(currentVAO)
- this._vao = vao
- },
- initGL() {
- this.initShader()
- this.initVAO()
- },
- renderGL(frame) {
- const gl = this.renderer.getContext()
- gl.disable(gl.DEPTH_TEST)
- const {
- yTexture,
- uvTexture
- } = frame.getCameraTexture(gl, 'yuv')
- const displayTransform = frame.getDisplayTransform()
- if (yTexture && uvTexture) {
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM)
- const currentActiveTexture = gl.getParameter(gl.ACTIVE_TEXTURE)
- const currentVAO = gl.getParameter(gl.VERTEX_ARRAY_BINDING)
-
- gl.useProgram(this._program)
- this.ext.bindVertexArrayOES(this._vao)
-
- gl.uniformMatrix3fv(this._dt, false, displayTransform)
- gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1)
-
- gl.activeTexture(gl.TEXTURE0 + 5)
- const bindingTexture5 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, yTexture)
-
- gl.activeTexture(gl.TEXTURE0 + 6)
- const bindingTexture6 = gl.getParameter(gl.TEXTURE_BINDING_2D)
- gl.bindTexture(gl.TEXTURE_2D, uvTexture)
-
- gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)
-
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture6)
- gl.activeTexture(gl.TEXTURE0 + 5)
- gl.bindTexture(gl.TEXTURE_2D, bindingTexture5)
-
- gl.useProgram(currentProgram)
- gl.activeTexture(currentActiveTexture)
- this.ext.bindVertexArrayOES(currentVAO)
- }
- },
- },
-})
-
-export default yuvBehavior
diff --git a/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.js b/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.js
deleted file mode 100644
index b4d87e33..00000000
--- a/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.js
+++ /dev/null
@@ -1,88 +0,0 @@
-const config = require('../../../../config')
-const util = require('../../../../util/util')
-
-const systemInfo = getApp().globalData
-Page({
- data: {
- activityList: [],
- },
-
- onShareAppMessage() {
- return {
- title: '群签到助手',
- path: 'packageAPI/pages/chattool/activity_assist/activity_assist'
- }
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
-
- onLoad() {
- if (util.compareVersion(systemInfo.SDKVersion, '3.7.8') < 0) {
- wx.showModal({
- title: '需升级微信到新版本体验',
- showCancel: false,
- content: '',
- })
- return
- }
-
- wx.cloud.init({
- env: config.envId,
- traceUser: true,
- })
-
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
-
- onShow() {
- this.refresh()
- },
-
- refresh() {
- this.fetchActivityList()
- },
-
- fetchActivityList() {
- wx.cloud.callFunction({
- name: 'quickstartFunctions',
- data: {
- type: 'fetchActivityList',
- }
- }).then(resp => {
- console.info('fetchActivityList: ', resp)
- if (resp.result) {
- const activityList = resp.result.dataList
- this.setData({ activityList })
- }
- }).catch(err => {
- console.error('fetchActivityList fail: ', err)
- })
- },
-
- create() {
- wx.openChatTool({
- url: '/packageChatTool/pages/activity_create/index',
- })
- },
-
- goDetail(e) {
- const { id, roomid, singlechat } = e.currentTarget.dataset
- wx.openChatTool({
- roomid,
- isSingleChat: Boolean(singlechat),
- url: `/packageChatTool/pages/activity_detail/index?activityId=${id}`,
- })
- },
-})
diff --git a/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.json b/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.json
deleted file mode 100644
index dd511e77..00000000
--- a/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "navigationBarTitleText": "聊天工具",
- "renderer": "webview",
- "componentFramework": "glass-easel",
- "usingComponents": {
- "t-collapse": "../../../components/tdesign-miniprogram/collapse/collapse",
- "t-collapse-panel": "../../../components/tdesign-miniprogram/collapse-panel/collapse-panel",
- "t-cell": "../../../components/tdesign-miniprogram/cell/cell",
- "t-cell-group": "../../../components/tdesign-miniprogram/cell-group/cell-group",
- "t-icon": "../../../components/tdesign-miniprogram/icon/icon"
- }
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.less b/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.less
deleted file mode 100644
index 7d4ef4f9..00000000
--- a/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.less
+++ /dev/null
@@ -1,36 +0,0 @@
-/**app.wxss**/
-page {
- background: rgb(237, 237, 237);
- height: 100vh;
- --td-navbar-bg-color: rgb(237, 237, 237);
-}
-
-.center {
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.page-container {
- height: 100%;
- width: 100%;
- box-sizing: border-box;
-}
-
-.container {
- display: flex;
- flex-direction: column;
- align-items: center;
- box-sizing: border-box;
-}
-
-.card {
- margin: 0 32rpx;
- margin-bottom: 32rpx;
-}
-
-.card-title {
- padding: 32rpx 0;
- padding-top: 0;
- color: rgb(112, 107, 107);
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.wxml b/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.wxml
deleted file mode 100644
index 93d3684a..00000000
--- a/miniprogram/packageAPI/pages/chattool/activity_assist/activity_assist.wxml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/chattool/material_open/material_open.js b/miniprogram/packageAPI/pages/chattool/material_open/material_open.js
deleted file mode 100644
index 8ae28e84..00000000
--- a/miniprogram/packageAPI/pages/chattool/material_open/material_open.js
+++ /dev/null
@@ -1,263 +0,0 @@
-import { getGroupEnterInfo } from '../util'
-
-const config = require('../../../../config')
-
-let needShowEntrance = true
-const entrancePath = 'packageAPI/pages/chattool/material_open/material_open'
-const templateId = '4A68CBB88A92B0A9311848DBA1E94A199B166463' // 完成
-// let templateId = '2A84254B945674A2F88CE4970782C402795EB607' // 参与
-
-const fileUrl = 'https://res.wx.qq.com/open/js/jweixin-1.6.0.js'
-const videoUrl = 'https://res.wx.qq.com/op_res/o3RWIC_o--wNf_qA3B4ghHbL_qKRRwsUM39dGTzltCR2__61DnEANInj5AJJmVXsHvx9FyHlDftU3KhcGCukDA'
-
-const { envVersion } = wx.getAccountInfoSync().miniProgram
-
-const getVersionType = () => {
- if (envVersion === 'release') {
- return 0
- } else if (envVersion === 'develop') {
- return 1
- } else if (envVersion === 'trial') {
- return 2
- }
-
- return 0
-}
-
-Page({
- data: {
- members: [],
- needShowEntrance,
- entrancePath,
- shareText: `「团建目的地选择」统计结果:
- - 清远 5 票
- - 南沙 3 票
- - 惠州 2 票`,
- isTemplateComplete: true
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
-
- onLoad(options) {
- this._activityId = options.activityId
-
- wx.cloud.init({
- env: config.envId,
- traceUser: true,
- })
-
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
-
- async signIn() {
- const activityId = this._activityId
- if (!activityId) {
- wx.showToast({
- title: '需从动态消息卡片',
- icon: 'none'
- })
- return
- }
-
- await getGroupEnterInfo()
- .then(groupInfo => {
- const { groupOpenID } = groupInfo
- this.updateChatToolMsg(activityId, {
- targetState: 1,
- parameterList: [{
- groupOpenID,
- state: 1,
- }]
- })
- wx.showToast({
- title: '签到成功',
- icon: 'none'
- })
- }).catch(err => {
- console.error('getGroupEnterInfo fail: ', err)
- })
- },
-
- remindExpiration() {
- const activityId = this._activityId
- if (!activityId) {
- wx.showToast({
- title: '需从动态消息卡片',
- icon: 'none'
- })
- return
- }
- this.updateChatToolMsg(activityId, {
- targetState: 2,
- })
- wx.showToast({
- title: '已触发',
- icon: 'none'
- })
- },
-
- earlyTerminate() {
- const activityId = this._activityId
- if (!activityId) {
- wx.showToast({
- title: '需从动态消息卡片',
- icon: 'none'
- })
- return
- }
- this.updateChatToolMsg(activityId, {
- targetState: 3,
- })
- wx.showToast({
- title: '已触发',
- icon: 'none'
- })
- },
-
- updateChatToolMsg(activityId, params = {}) {
- const { targetState, parameterList } = params
- wx.cloud.callFunction({
- name: 'openapi',
- data: {
- action: 'updateChatToolMsg',
- activityId,
- templateId,
- targetState: targetState || 1,
- parameterList: parameterList || [],
- versionType: getVersionType()
- }
- }).then(resp => {
- console.info('updateChatToolMsg: ', resp)
- }).catch(err => {
- console.info('updateChatToolMsg Fail: ', err)
- })
- },
-
- viewChatMaterials() {
- wx.navigateTo({
- url: '../material_view/material_view',
- })
- },
-
- changeNeedShowEntrance() {
- needShowEntrance = !needShowEntrance
- this.setData({
- needShowEntrance
- })
- },
-
- shareUpdatableMessage() {
- const that = this
- wx.cloud.callFunction({
- name: 'openapi',
- data: {
- action: 'createActivityId',
- }
- }).then(resp => {
- const activityId = resp.result.activityId
- wx.updateShareMenu({
- withShareTicket: true,
- isUpdatableMessage: true,
- useForChatTool: true,
- chooseType: 2,
- activityId,
- templateInfo: {
- templateId,
- },
- success(res) {
- wx.shareAppMessageToGroup({
- title: '动态消息卡片',
- path: `${entrancePath}?activityId=${activityId}`,
- complete(res) {
- that._activityId = activityId
- console.info('shareAppMessageToGroup: ', res)
- }
- })
- },
- complete(res) {
- console.info('updateShareMenu: ', res)
- }
- })
- })
- },
-
- shareImage() {
- wx.downloadFile({
- url: 'https://cdc-opendesign-1258344706.cos.ap-guangzhou.myqcloud.com/image/emywrxo77wrzaj3kn3exgk81c1e5x6767l/k689zkwkdmj9ngm/2024/11/06/vlnycdv60lakegvyup38kfh2wbhuzgha2ua6xfdfxxcdoaf6/xj812q7y2n3obyq/abe09549-8469-4e6d-a4f2-7c7e20cdad54.png?imageMogr2/thumbnail/600x340%3E',
- success: (res) => {
- wx.shareImageToGroup({
- imagePath: res.tempFilePath, // 本地路径或临时路径
- needShowEntrance,
- entrancePath,
- complete(res) {
- console.info('shareImageToGroup: ', res)
- }
- })
- }
- })
- },
-
- shareEmoji() {
- wx.downloadFile({
- url: 'https://mmbiz.qpic.cn/mmbiz_gif/EXAZAY4U1KCcdEB1gicNwIL4lUrpVQ5H5jOSfiaVHJ5n4EQyPrLqgRtbb6X1hRIiaZqMIibVME51FYRf7p2kC4OdLA/0/132',
- success: (res) => {
- wx.shareEmojiToGroup({
- imagePath: res.tempFilePath, // 本地路径或临时路径
- needShowEntrance,
- entrancePath,
- complete(res) {
- console.info('shareEmojiToGroup: ', res)
- }
- })
- }
- })
- },
-
- shareVideo() {
- wx.downloadFile({
- url: videoUrl,
- success(res) {
- wx.shareVideoToGroup({
- videoPath: res.tempFilePath,
- thumbPath: '',
- needShowEntrance,
- entrancePath,
- complete(res) {
- console.info('shareVideoToGroup: ', res)
- }
- })
- },
- fail: console.error,
- })
- },
-
- shareFile() {
- wx.downloadFile({
- url: fileUrl,
- success(res) {
- wx.shareFileToGroup({
- filePath: res.tempFilePath,
- fileName: '',
- needShowEntrance,
- entrancePath,
- complete(res) {
- console.info('shareFileToGroup: ', res)
- }
- })
- },
- fail: console.error,
- })
- },
-})
diff --git a/miniprogram/packageAPI/pages/chattool/material_open/material_open.json b/miniprogram/packageAPI/pages/chattool/material_open/material_open.json
deleted file mode 100644
index dd511e77..00000000
--- a/miniprogram/packageAPI/pages/chattool/material_open/material_open.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "navigationBarTitleText": "聊天工具",
- "renderer": "webview",
- "componentFramework": "glass-easel",
- "usingComponents": {
- "t-collapse": "../../../components/tdesign-miniprogram/collapse/collapse",
- "t-collapse-panel": "../../../components/tdesign-miniprogram/collapse-panel/collapse-panel",
- "t-cell": "../../../components/tdesign-miniprogram/cell/cell",
- "t-cell-group": "../../../components/tdesign-miniprogram/cell-group/cell-group",
- "t-icon": "../../../components/tdesign-miniprogram/icon/icon"
- }
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/chattool/material_open/material_open.less b/miniprogram/packageAPI/pages/chattool/material_open/material_open.less
deleted file mode 100644
index 3fb3ed8f..00000000
--- a/miniprogram/packageAPI/pages/chattool/material_open/material_open.less
+++ /dev/null
@@ -1,39 +0,0 @@
-/**app.wxss**/
-page {
- background: rgb(237, 237, 237);
- height: 100vh;
- --td-navbar-bg-color: rgb(237, 237, 237);
-}
-
-.center {
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.page-container {
- height: 100%;
- width: 100%;
- box-sizing: border-box;
-}
-
-.container {
- display: flex;
- flex-direction: column;
- align-items: center;
- box-sizing: border-box;
- padding: 0 24rpx;
-}
-
-.form-textarea {
- box-sizing: border-box;
- width: 100%;
- padding: 20px;
- background-color: rgb(233, 233, 182);
- border-radius: 10px;
-}
-
-.btn {
- width: 100% !important;
- margin: 10px 0;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/chattool/material_open/material_open.wxml b/miniprogram/packageAPI/pages/chattool/material_open/material_open.wxml
deleted file mode 100644
index 8677b0d9..00000000
--- a/miniprogram/packageAPI/pages/chattool/material_open/material_open.wxml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/chattool/material_view/material_view.js b/miniprogram/packageAPI/pages/chattool/material_view/material_view.js
deleted file mode 100644
index 2d042b82..00000000
--- a/miniprogram/packageAPI/pages/chattool/material_view/material_view.js
+++ /dev/null
@@ -1,290 +0,0 @@
-const chatRecordTypes = ['text', 'image', 'video', 'other']
-
-const mockData = {
- materials: [
- {
- groupOpenID: '',
- type: 'text/message',
- content: '大家想要中秋去哪玩呀',
- },
- {
- groupOpenID: '',
- type: 'text/message',
- content: '没想好呢,要不要去内蒙古',
- },
- {
- groupOpenID: '',
- type: 'text/message',
- content: '内蒙古有啥好玩的呀',
- },
- {
- groupOpenID: '',
- type: 'image/png',
- name: '图片名称',
- path: 'https://gips2.baidu.com/it/u=1651586290,17201034&fm=3028&app=3028&f=JPEG&fmt=auto&q=100&size=f600_800',
- size: '图片大小'
- },
- {
- groupOpenID: '',
- type: 'text/message',
- content: 'https://mp.weixin.qq.com/s/ZnR0kBKrC4el9aiYpitxHA',
- },
- {
- groupOpenID: '',
- type: 'text/message',
- content: '@欢乐马 的哥哥是不是去过呀',
- },
- {
- groupOpenID: '',
- type: 'text/message',
- content: '对的对的,他去年去过,我去要一下他去年的图片',
- },
- {
- groupOpenID: '',
- type: 'image/png',
- name: '图片名称',
- path: 'https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg',
- size: '图片大小'
- },
- {
- groupOpenID: '',
- type: 'text/message',
- content: '哇看起来真不错',
- },
- {
- groupOpenID: '',
- type: 'video/mp4',
- name: '视频名称',
- path: '视频路径',
- size: '视频大小'
- },
- {
- groupOpenID: '',
- type: 'text/message',
- content: '视频看起来也很震撼',
- },
- {
- groupOpenID: '',
- type: 'text/message',
- content: '要不再问问行程规划!',
- },
- {
- groupOpenID: '',
- type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
- name: '23中秋 阿尔山行程.xlsx',
- path: '文件路径',
- size: '文件大小',
- },
- {
- groupOpenID: '',
- type: 'application/pdf',
- name: '23中秋 阿尔山行程.pdf',
- path: '文件路径',
- size: '文件大小',
- },
- ]
-}
-
-Page({
- data: {
- materials: [],
- canvasWidth: 0,
- canvasHeight: 0
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
-
- onLoad() {
- this._forwardMaterials = []
- this.getMaterials()
- // this.formatMaterials(mockData.materials)
-
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
-
- getMaterials() {
- const that = this
- wx.getChatForwardMaterials({
- needGroupOpenID: true,
- success(res) {
- if (res.materials) {
- that.formatMaterials(res.materials)
- }
- }
- })
- },
-
- formatMaterials(forwardMaterials = []) {
- this._forwardMaterials = forwardMaterials
- this.triggerMergedImage()
-
- const materials = []
- for (const item of forwardMaterials) {
- let recordType = ''
- if (item.type === 'text/message') {
- recordType = chatRecordTypes[0]
- } else if (item.type.startsWith('image/')) {
- recordType = chatRecordTypes[1]
- } else if (item.type.startsWith('video/')) {
- recordType = chatRecordTypes[2]
- } else {
- recordType = chatRecordTypes[3]
- }
- materials.push({
- ...item,
- recordType,
- })
- }
- this.setData({
- materials
- })
- },
-
- async triggerMergedImage() {
- try {
- const tempFilePaths = this._forwardMaterials
- .filter(item => item.type.startsWith('image'))
- .map(item => item.path)
- console.info('tempFilePaths: ', tempFilePaths)
- const shareImagePath = await this.mergeImages(tempFilePaths)
- this.setData({
- shareImagePath,
- })
- console.info('shareImagePath: ', shareImagePath)
- } catch (error) {
- console.error('mergeImages fail: ', error)
- }
- },
-
- shareMergedImage() {
- if (!this.data.shareImagePath) {
- wx.showToast({
- title: '拼图失败',
- icon: 'none'
- })
- this.triggerMergedImage()
- return
- }
- wx.shareImageToGroup({
- imagePath: this.data.shareImagePath,
- needShowEntrance: false,
- complete(res) {
- console.info('shareImageToGroup: ', res)
- }
- })
- },
-
- async mergeImages(tempFilePaths) {
- try {
- // 获取 canvas 节点
- const { node: canvas, width: cw, height: ch } = await this.getCanvasNode()
-
- // 获取 2D 上下文
- const ctx = canvas.getContext('2d')
-
- // 预加载所有图片
- const images = await this.loadAllImages(canvas, tempFilePaths)
-
- // 绘制图片
- this.drawImages(ctx, images, 400)
-
- // 生成临时文件
- return await this.canvasToTempFile(canvas)
- } catch (err) {
- console.error('合并失败:', err)
- return null
- }
- },
-
- // 获取 Canvas 节点(Promise 封装)
- getCanvasNode() {
- return new Promise((resolve, reject) => {
- wx.createSelectorQuery()
- .select('#myCanvas')
- .fields({ node: true, size: true })
- .exec(res => {
- if (res[0]) resolve(res[0])
- else reject(new Error('Canvas 节点获取失败'))
- })
- })
- },
-
- // 计算画布尺寸
- calculateLayout(paths) {
- const imgSize = 100
- const spacing = 10
- const perLine = 3
-
- const rows = Math.ceil(paths.length / perLine)
- return {
- canvasWidth: perLine * imgSize + (perLine - 1) * spacing,
- canvasHeight: rows * imgSize + (rows - 1) * spacing
- }
- },
-
- // 加载所有图片(Web Image 对象)
- loadAllImages(canvas, paths) {
- return Promise.all(paths.map(url => new Promise((resolve, reject) => {
- const image = canvas.createImage()
- image.onload = () => resolve(image)
- image.onerror = reject
- image.src = url // 支持本地路径和网络图片
- })))
- },
-
- // 执行图片绘制
- drawImages(ctx, images, canvasWidth) {
- const imgSize = 100
- const spacing = 10
- const perLine = 3
-
- images.forEach((image, index) => {
- const row = Math.floor(index / perLine)
- const col = index % perLine
-
- const x = col * (imgSize + spacing)
- const y = row * (imgSize + spacing)
-
- // 绘制图像(支持缩放裁剪)
- ctx.drawImage(
- image,
- 0,
- 0,
- image.width,
- image.height, // 源图裁剪区域
- x,
- y,
- imgSize,
- imgSize // 画布绘制区域
- )
- })
- },
-
- // Canvas 转临时文件
- canvasToTempFile(canvas) {
- return new Promise((resolve, reject) => {
- wx.canvasToTempFilePath({
- canvas,
- fileType: 'png',
- width: 400,
- height: 500,
- quality: 1,
- success: res => resolve(res.tempFilePath),
- fail: reject
- })
- })
- }
-
-})
diff --git a/miniprogram/packageAPI/pages/chattool/material_view/material_view.json b/miniprogram/packageAPI/pages/chattool/material_view/material_view.json
deleted file mode 100644
index dd511e77..00000000
--- a/miniprogram/packageAPI/pages/chattool/material_view/material_view.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "navigationBarTitleText": "聊天工具",
- "renderer": "webview",
- "componentFramework": "glass-easel",
- "usingComponents": {
- "t-collapse": "../../../components/tdesign-miniprogram/collapse/collapse",
- "t-collapse-panel": "../../../components/tdesign-miniprogram/collapse-panel/collapse-panel",
- "t-cell": "../../../components/tdesign-miniprogram/cell/cell",
- "t-cell-group": "../../../components/tdesign-miniprogram/cell-group/cell-group",
- "t-icon": "../../../components/tdesign-miniprogram/icon/icon"
- }
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/chattool/material_view/material_view.less b/miniprogram/packageAPI/pages/chattool/material_view/material_view.less
deleted file mode 100644
index 6dfc65be..00000000
--- a/miniprogram/packageAPI/pages/chattool/material_view/material_view.less
+++ /dev/null
@@ -1,39 +0,0 @@
-/**app.wxss**/
-page {
- background: rgb(237, 237, 237);
- height: 100vh;
- --td-navbar-bg-color: rgb(237, 237, 237);
-}
-
-.center {
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.page-container {
- height: 100%;
- width: 100%;
- box-sizing: border-box;
-}
-
-.container {
- display: flex;
- flex-direction: column;
- align-items: center;
- box-sizing: border-box;
- padding: 0 24rpx;
-}
-
-.chat-img {
- width: 300px;
- height: 200px;
-}
-
-.chat-item {
- margin: 10px 0;
- padding: 10px 5px;
- background-color: #FFF;
- border: 1px solid #ccc;
- overflow: hidden;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/chattool/material_view/material_view.wxml b/miniprogram/packageAPI/pages/chattool/material_view/material_view.wxml
deleted file mode 100644
index a4f2d177..00000000
--- a/miniprogram/packageAPI/pages/chattool/material_view/material_view.wxml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 消息 id: {{item.messageId}}
- 消息类型: {{item.type}}
-
- 消息内容: {{item.content}}
-
-
-
-
-
- 文件路径: {{item.path}}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/chattool/util.js b/miniprogram/packageAPI/pages/chattool/util.js
deleted file mode 100644
index 81a52ae7..00000000
--- a/miniprogram/packageAPI/pages/chattool/util.js
+++ /dev/null
@@ -1,43 +0,0 @@
-export function getGroupEnterInfo() {
- return new Promise((resolve, reject) => {
- wx.getGroupEnterInfo({
- allowSingleChat: true,
- needGroupOpenID: true,
- success(res) {
- const cloudID = res.cloudID
- wx.cloud.callFunction({
- name: 'quickstartFunctions',
- data: {
- type: 'getGroupEnterInfo',
- groupInfo: wx.cloud.CloudID(cloudID)
- }
- }).then(resp => {
- const groupInfo = resp.result.groupInfo
- if (groupInfo && groupInfo.data) {
- const openid = resp.result.openid
- const opengid = groupInfo.data.opengid
- const openSingleRoomID = groupInfo.data.open_single_roomid
- const groupOpenID = groupInfo.data.group_openid
- const data = {
- openid,
- groupOpenID,
- roomid: opengid || openSingleRoomID,
- chatType: groupInfo.data.chat_type
- }
- resolve(data)
- } else {
- reject()
- }
- }).catch(err => {
- reject(err)
- })
- },
- fail(res) {
- reject(res)
- },
- complete(res) {
- console.info('getGroupEnterInfo complete: ', res)
- }
- })
- })
-}
diff --git a/miniprogram/packageAPI/pages/device/add-contact/add-contact.js b/miniprogram/packageAPI/pages/device/add-contact/add-contact.js
deleted file mode 100644
index 9618da9c..00000000
--- a/miniprogram/packageAPI/pages/device/add-contact/add-contact.js
+++ /dev/null
@@ -1,41 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '新增联系人',
- path: 'packageAPI/pages/device/add-contact/add-contact'
- }
- },
-
- submit(e) {
- const formData = e.detail.value
- wx.addPhoneContact({
- ...formData,
- success() {
- wx.showToast({
- title: '联系人创建成功'
- })
- },
- fail() {
- wx.showToast({
- title: '联系人创建失败'
- })
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/add-contact/add-contact.json b/miniprogram/packageAPI/pages/device/add-contact/add-contact.json
deleted file mode 100644
index ec58bb84..00000000
--- a/miniprogram/packageAPI/pages/device/add-contact/add-contact.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "新增联系人"
-}
diff --git a/miniprogram/packageAPI/pages/device/add-contact/add-contact.wxml b/miniprogram/packageAPI/pages/device/add-contact/add-contact.wxml
deleted file mode 100644
index bbae59ae..00000000
--- a/miniprogram/packageAPI/pages/device/add-contact/add-contact.wxml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/add-contact/add-contact.wxss b/miniprogram/packageAPI/pages/device/add-contact/add-contact.wxss
deleted file mode 100644
index cba438fd..00000000
--- a/miniprogram/packageAPI/pages/device/add-contact/add-contact.wxss
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-input {
- width: 100%;
-}
diff --git a/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.js b/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.js
deleted file mode 100644
index d22c288d..00000000
--- a/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.js
+++ /dev/null
@@ -1,265 +0,0 @@
-function inArray(arr, key, val) {
- for (let i = 0; i < arr.length; i++) {
- if (arr[i][key] === val) {
- return i
- }
- }
- return -1
-}
-
-// ArrayBuffer转16进度字符串示例
-function ab2hex(buffer) {
- const hexArr = Array.prototype.map.call(
- new Uint8Array(buffer),
- function (bit) {
- return (`00${bit.toString(16)}`).slice(-2)
- }
- )
- return hexArr.join('')
-}
-
-Page({
- onShareAppMessage() {
- return {
- title: '蓝牙',
- path: 'packageAPI/pages/device/bluetooth/bluetooth'
- }
- },
-
- data: {
- theme: 'light',
- devices: [],
- connected: false,
- chs: [],
- },
- openBluetoothAdapter() {
- const that = this
- wx.openBluetoothAdapter({
- success: (res) => {
- console.log('openBluetoothAdapter success', res)
- that.startBluetoothDevicesDiscovery()
- },
- fail: (res) => {
- if (res.errCode === 10001) {
- wx.showModal({
- title: '错误',
- content: '未找到蓝牙设备, 请打开蓝牙后重试。',
- showCancel: false
- })
- wx.onBluetoothAdapterStateChange(function (res) {
- if (res && res.available) {
- that.startBluetoothDevicesDiscovery()
- }
- })
- }
- }
- })
- },
- getBluetoothAdapterState() {
- wx.getBluetoothAdapterState({
- success: (res) => {
- console.log('getBluetoothAdapterState', res)
- if (res.discovering) {
- this.onBluetoothDeviceFound()
- } else if (res.available) {
- this.startBluetoothDevicesDiscovery()
- }
- }
- })
- },
- startBluetoothDevicesDiscovery() {
- if (this._discoveryStarted) {
- return
- }
- this._discoveryStarted = true
- wx.startBluetoothDevicesDiscovery({
- allowDuplicatesKey: true,
- success: (res) => {
- console.log('startBluetoothDevicesDiscovery success', res)
- this.onBluetoothDeviceFound()
- },
- })
- },
- stopBluetoothDevicesDiscovery() {
- wx.stopBluetoothDevicesDiscovery({
- complete: () => {
- this._discoveryStarted = false
- }
- })
- },
- onBluetoothDeviceFound() {
- wx.onBluetoothDeviceFound((res) => {
- res.devices.forEach(device => {
- if (!device.name && !device.localName) {
- return
- }
- const foundDevices = this.data.devices
- const idx = inArray(foundDevices, 'deviceId', device.deviceId)
- const data = {}
- if (idx === -1) {
- data[`devices[${foundDevices.length}]`] = device
- } else {
- data[`devices[${idx}]`] = device
- }
- this.setData(data)
- })
- })
- },
- createBLEConnection(e) {
- const ds = e.currentTarget.dataset
- const deviceId = ds.deviceId
- const name = ds.name
- wx.showLoading()
- wx.createBLEConnection({
- deviceId,
- success: () => {
- this.setData({
- connected: true,
- name,
- deviceId,
- })
- this.getBLEDeviceServices(deviceId)
- },
- complete() {
- wx.hideLoading()
- }
- })
- this.stopBluetoothDevicesDiscovery()
- },
- closeBLEConnection() {
- wx.closeBLEConnection({
- deviceId: this.data.deviceId
- })
- this.setData({
- connected: false,
- chs: [],
- canWrite: false,
- })
- },
- changeMode() {
- wx.navigateTo({
- url: './slave/slave',
- })
- },
- getBLEDeviceServices(deviceId) {
- wx.getBLEDeviceServices({
- deviceId,
- success: (res) => {
- for (let i = 0; i < res.services.length; i++) {
- if (res.services[i].isPrimary) {
- this.getBLEDeviceCharacteristics(deviceId, res.services[i].uuid)
- return
- }
- }
- }
- })
- },
- getBLEDeviceCharacteristics(deviceId, serviceId) {
- wx.getBLEDeviceCharacteristics({
- deviceId,
- 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) {
- wx.readBLECharacteristicValue({
- deviceId,
- serviceId,
- characteristicId: item.uuid,
- })
- }
- if (item.properties.write) {
- this.setData({
- canWrite: true
- })
- this._deviceId = deviceId
- this._serviceId = serviceId
- this._characteristicId = item.uuid
- console.log('write')
- this.writeBLECharacteristicValue()
- }
- if (item.properties.notify || item.properties.indicate) {
- wx.notifyBLECharacteristicValueChange({
- deviceId,
- serviceId,
- characteristicId: item.uuid,
- state: true,
- })
- }
- }
- },
- fail(res) {
- console.error('getBLEDeviceCharacteristics', res)
- }
- })
- // 操作之前先监听,保证第一时间获取数据
- wx.onBLECharacteristicValueChange((characteristic) => {
- const idx = inArray(this.data.chs, 'uuid', characteristic.characteristicId)
- const data = {}
- if (idx === -1) {
- data[`chs[${this.data.chs.length}]`] = {
- uuid: characteristic.characteristicId,
- value: ab2hex(characteristic.value)
- }
- } else {
- data[`chs[${idx}]`] = {
- uuid: characteristic.characteristicId,
- value: ab2hex(characteristic.value)
- }
- }
- wx.showToast({
- title: '收到从机数据',
- })
- // data[`chs[${this.data.chs.length}]`] = {
- // uuid: characteristic.characteristicId,
- // value: ab2hex(characteristic.value)
- // }
- this.setData(data)
- })
- },
- writeBLECharacteristicValue() {
- // 向蓝牙设备发送一个0x00的16进制数据
- const buffer = new ArrayBuffer(1)
- const dataView = new DataView(buffer)
- // eslint-disable-next-line
- dataView.setUint8(0, Math.random() * 19| 0)
- wx.writeBLECharacteristicValue({
- deviceId: this._deviceId,
- serviceId: this._serviceId,
- characteristicId: this._characteristicId,
- value: buffer,
- success() {
- console.log('writeBLECharacteristicValue: 成功')
- },
- fail() {
- console.log('writeBLECharacteristicValue: 失败')
- },
- complete() {
- console.log('writeBLECharacteristicValue: 结束')
- }
- })
- },
- closeBluetoothAdapter() {
- wx.closeBluetoothAdapter()
- this._discoveryStarted = false
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- this.closeBluetoothAdapter()
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.json b/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.json
deleted file mode 100644
index 1ff06de6..00000000
--- a/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "蓝牙"
-}
diff --git a/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.wxml b/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.wxml
deleted file mode 100644
index a1e33154..00000000
--- a/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.wxml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-module.exports.max = function(n1, n2) {
- return Math.max(n1, n2)
-}
-module.exports.len = function(arr) {
- arr = arr || []
- return arr.length
-}
-
-
-
-
-
-
- 已发现 {{devices.length}} 个外围设备:
-
-
- {{item.name}}
- 信号强度: {{item.RSSI}}dBm ({{utils.max(0, item.RSSI + 100)}}%)
- UUID: {{item.deviceId}}
- Service数量: {{utils.len(item.advertisServiceUUIDs)}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 已连接到 {{name}}
-
-
-
-
-
-
- 特性UUID: {{item.uuid}}
- 特性值: {{item.value}}
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.wxss b/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.wxss
deleted file mode 100644
index f0a93f05..00000000
--- a/miniprogram/packageAPI/pages/device/bluetooth/bluetooth.wxss
+++ /dev/null
@@ -1,39 +0,0 @@
-
-.devices_summary {
- padding: 5px;
- font-size: 15px;
-}
-.device_list {
- height: 150px;
- border-radius: 3px;
- flex: 1;
-}
-.device_item {
- border-bottom: 1px solid var(--weui-FG-3);
- padding: 5px;
- color: var(--weui-FG-HALF);
-}
-.device_item_hover {
- background-color: rgba(0, 0, 0, .1);
-}
-.connected_info {
- position: fixed;
- bottom: 0;
- width: 100%;
- background-color: var(--weui-BG-4);
- padding: 5px;
- padding-bottom: 10px;
- margin-bottom: env(safe-area-inset-bottom);
- font-size: 14px;
- min-height: 50px;
- box-shadow: 0px 0px 2px 0px;
-}
-.connected_info .operation {
- position: absolute;
- display: inline-block;
- right: 15px;
-}
-.page-body-info {
- padding: 15px;
- box-sizing: border-box;
-}
diff --git a/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.js b/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.js
deleted file mode 100644
index 8674f8b2..00000000
--- a/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.js
+++ /dev/null
@@ -1,307 +0,0 @@
-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) {
-// const 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/device/slave/slave'
- }
- },
- data: {
- theme: 'light',
- connects: [],
- servers: []
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- this.data.servers.forEach(() => {
- // server.close()
- })
- },
-
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- 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
- })
- })
- return res
- }).catch(() => {})
- },
- closeServer() {
- if (this.server) {
- 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)
- if (!this.server) {
- wx.showModal({
- title: '请先创建server',
- })
- return
- }
- this.server.writeCharacteristicValue({
- serviceId,
- 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
- }]
- }]
- }
- if (!this.server) {
- wx.showModal({
- title: '请先创建server',
- })
- return
- }
- this.server.addService({
- service
- }).then(res => {
- console.log('add Service', res)
- wx.showToast({
- title: '创建服务',
- })
- return res
- }, (rej) => {
- console.log(rej)
- if (rej.errCode === 10001) {
- wx.showToast({
- title: '请打开蓝牙',
- })
- } else {
- wx.showModal({
- title: '创建失败',
- content: `错误码: ${rej.errCode}`
- })
- }
- }).catch(() => {})
- },
- removeService() {
- if (!this.server) return
- this.server.removeService({
- serviceId
- }).then(res => {
- wx.showToast({
- title: '关闭服务',
- })
- console.log('removeService', res)
- return res
- }).catch(() => {})
- },
- startAdvertising() {
- if (!this.server) {
- wx.showModal({
- title: '请先创建server',
- })
- return
- }
- 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: '开启广播',
- })
- return res
- }).catch(() => {})
- },
-
- stopAdvertising() {
- if (!this.server) {
- wx.showModal({
- title: '请先创建server',
- })
- return
- }
- this.server.stopAdvertising()
- wx.showToast({
- title: '关闭广播',
- })
- },
-
- closeBluetoothAdapter() {
- wx.showToast({
- title: '结束流程',
- })
- wx.closeBluetoothAdapter()
- },
-})
diff --git a/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.json b/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.json
deleted file mode 100644
index 8835af06..00000000
--- a/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "usingComponents": {}
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.wxml b/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.wxml
deleted file mode 100644
index 4f4d89ea..00000000
--- a/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.wxml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
- 当前 serverId {{serverId}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.deviceId}} : {{item.serverId}}
- {{item.connected ? "已连接" : "断开"}}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.wxss b/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.wxss
deleted file mode 100644
index 5fd03564..00000000
--- a/miniprogram/packageAPI/pages/device/bluetooth/slave/slave.wxss
+++ /dev/null
@@ -1,5 +0,0 @@
-.action-area {
- display: flex;
- flex-direction: row;
- justify-content: space-around;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.js b/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.js
deleted file mode 100644
index a31b90fb..00000000
--- a/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.js
+++ /dev/null
@@ -1,34 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '用户截屏事件',
- path: 'packageAPI/pages/device/capture-screen/capture-screen'
- }
- },
-
- data: {
- theme: 'light',
- captured: false,
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- wx.onUserCaptureScreen(() => {
- this.setData({
- captured: true
- })
- })
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.json b/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.json
deleted file mode 100644
index 113901e7..00000000
--- a/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "用户截屏事件"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.wxml b/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.wxml
deleted file mode 100644
index fa1c8471..00000000
--- a/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.wxml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
- 请进行屏幕截屏
- 截屏事件{{ captured ? "已" : "未" }}触发
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.wxss b/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.wxss
deleted file mode 100644
index bd73f2ea..00000000
--- a/miniprogram/packageAPI/pages/device/capture-screen/capture-screen.wxss
+++ /dev/null
@@ -1,4 +0,0 @@
-.page-body-text {
- font-size: 20px;
- font-family: -apple-system-font, Helvetica Neue,Helvetica,sans-serif;
-}
diff --git a/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.js b/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.js
deleted file mode 100644
index 19fee164..00000000
--- a/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.js
+++ /dev/null
@@ -1,70 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '剪切板',
- path: 'packageAPI/pages/device/clipboard-data/clipboard-data'
- }
- },
- onShareTimeline() {
- return {
- title: '剪切板'
- }
- },
-
- data: {
- theme: 'light',
- value: 'edit and copy me',
- pasted: '',
- },
-
- valueChanged(e) {
- this.setData({
- value: e.detail.value
- })
- },
-
- copy() {
- wx.setClipboardData({
- data: this.data.value,
- success() {
- wx.showToast({
- title: '复制成功',
- icon: 'success',
- duration: 1000
- })
- }
- })
- },
-
- paste() {
- const self = this
- wx.getClipboardData({
- success(res) {
- self.setData({
- pasted: res.data
- })
- wx.showToast({
- title: '粘贴成功',
- icon: 'success',
- duration: 1000
- })
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.json b/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.json
deleted file mode 100644
index 98f05315..00000000
--- a/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "剪切板"
-}
diff --git a/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.wxml b/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.wxml
deleted file mode 100644
index 22bac4aa..00000000
--- a/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.wxml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- Copy
-
-
-
-
-
-
-
- Paste
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.wxss b/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.wxss
deleted file mode 100644
index fd9b2b8c..00000000
--- a/miniprogram/packageAPI/pages/device/clipboard-data/clipboard-data.wxss
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-.page-body-info {
- padding: 5px;
- height: 100px;
- overflow: scroll-y;
- text-align: left;
-}
diff --git a/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.js b/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.js
deleted file mode 100644
index 87022900..00000000
--- a/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// miniprogram/page/API/pages/get-battery-info/get-battery-info.js
-Page({
- onShareAppMessage() {
- return {
- title: '获取电池信息',
- path: 'packageAPI/pages/device/get-battery-info/get-battery-info'
- }
- },
- data: {
- theme: 'light',
-
- },
-
- getBatteryInfo() {
- wx.getBatteryInfo({
- complete: (res) => {
- const msg = res.isCharging ? '充电中' : '使用电池中'
- this.setData({
- level: res.level,
- isCharging: msg,
- })
- },
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.json b/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.json
deleted file mode 100644
index 29eddff2..00000000
--- a/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "获取手机设备电量"
-
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.wxml b/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.wxml
deleted file mode 100644
index 70d75f58..00000000
--- a/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.wxml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 当前电量
-
-
-
-
-
-
-
- 电池模式
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.wxss b/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.wxss
deleted file mode 100644
index 139597f9..00000000
--- a/miniprogram/packageAPI/pages/device/get-battery-info/get-battery-info.wxss
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.js b/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.js
deleted file mode 100644
index fccc5093..00000000
--- a/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.js
+++ /dev/null
@@ -1,47 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '获取手机网络状态',
- path: 'packageAPI/pages/device/get-network-type/get-network-type'
- }
- },
-
- data: {
- theme: 'light',
- hasNetworkType: false
- },
- getNetworkType() {
- const that = this
- wx.getNetworkType({
- success(res) {
- console.log(res)
- that.setData({
- hasNetworkType: true,
- networkType: res.subtype || res.networkType
- })
- }
- })
- },
- clear() {
- this.setData({
- hasNetworkType: false,
- networkType: ''
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.json b/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.json
deleted file mode 100644
index 726fa587..00000000
--- a/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "获取手机网络状态"
-}
diff --git a/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.wxml b/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.wxml
deleted file mode 100644
index c25814cb..00000000
--- a/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.wxml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
- 网络状态
-
- 未获取
- 点击绿色按钮可获取网络状态
-
-
- {{networkType}}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.wxss b/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.wxss
deleted file mode 100644
index 75bd3fdf..00000000
--- a/miniprogram/packageAPI/pages/device/get-network-type/get-network-type.wxss
+++ /dev/null
@@ -1,7 +0,0 @@
-.page-body-info {
- height: 100px;
-}
-.page-body-text-network-type {
- font-size: 40px;
- font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
-}
diff --git a/miniprogram/packageAPI/pages/device/get-system-info/get-system-info.js b/miniprogram/packageAPI/pages/device/get-system-info/get-system-info.js
deleted file mode 100644
index e0678162..00000000
--- a/miniprogram/packageAPI/pages/device/get-system-info/get-system-info.js
+++ /dev/null
@@ -1,39 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '获取手机系统信息',
- path: 'packageAPI/pages/device/get-system-info/get-system-info'
- }
- },
-
- data: {
- theme: 'light',
- systemInfo: {}
- },
- getSystemInfo() {
- const that = this
- wx.getSystemInfo({
- success(res) {
- that.setData({
- systemInfo: res
- })
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/get-system-info/get-system-info.json b/miniprogram/packageAPI/pages/device/get-system-info/get-system-info.json
deleted file mode 100644
index b423ee92..00000000
--- a/miniprogram/packageAPI/pages/device/get-system-info/get-system-info.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "获取手机系统信息"
-}
diff --git a/miniprogram/packageAPI/pages/device/get-system-info/get-system-info.wxml b/miniprogram/packageAPI/pages/device/get-system-info/get-system-info.wxml
deleted file mode 100644
index 124a695a..00000000
--- a/miniprogram/packageAPI/pages/device/get-system-info/get-system-info.wxml
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 手机品牌
-
-
-
-
-
-
-
- 手机型号
-
-
-
-
-
-
-
- 微信语言
-
-
-
-
-
-
-
- 微信版本
-
-
-
-
-
-
-
- 屏幕宽度
-
-
-
-
-
-
-
- 屏幕高度
-
-
-
-
-
-
-
- DPR
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/get-system-info/get-system-info.wxss b/miniprogram/packageAPI/pages/device/get-system-info/get-system-info.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.js b/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.js
deleted file mode 100644
index 78c86ec1..00000000
--- a/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.js
+++ /dev/null
@@ -1,61 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'iBeacon',
- path: 'packageAPI/pages/device/ibeacon/ibeacon'
- }
- },
-
- data: {
- theme: 'light',
- uuid: '',
- beacons: []
- },
-
- enterUuid(e) {
- this.setData({
- uuid: e.detail.value
- })
- },
-
- startSearch() {
- if (this._searching) return
- this._searching = true
- wx.startBeaconDiscovery({
- uuids: [this.data.uuid],
- success: (res) => {
- console.log(res)
- wx.onBeaconUpdate(({ beacons }) => {
- this.setData({
- beacons
- })
- })
- },
- fail: (err) => {
- console.error(err)
- }
- })
- },
-
- stopSearch() {
- this._searching = false
- wx.stopBeaconDiscovery()
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- this.stopSearch()
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.json b/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.json
deleted file mode 100644
index 16889234..00000000
--- a/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "iBeacon"
-}
diff --git a/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.wxml b/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.wxml
deleted file mode 100644
index cc5b95ba..00000000
--- a/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.wxml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
- 输入iBeacon设备广播的UUID
-
-
-
-
-
-
-
-
-
-
-
- 已发现 {{beacons.length}} 个外围设备:
-
-
- 主ID: {{item.major}} 次ID: {{item.minor}}
- 信号强度: {{item.rssi}}dBm
- UUID: {{item.uuid}}
- Proximity: {{item.proximity}} Accuracy: {{item.accuracy}}
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.wxss b/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.wxss
deleted file mode 100644
index bab037ac..00000000
--- a/miniprogram/packageAPI/pages/device/ibeacon/ibeacon.wxss
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-.page-body-info {
- margin-top: 25px;
- padding: 15px 30px;
- width: auto;
-}
-
-.devices_summary {
- padding: 5px;
- font-size: 15px;
-}
-.device_list {
- height: 150px;
- border-radius: 3px;
- flex: 1;
-}
-.device_item {
- border-bottom: 1px solid var(--weui-FG-3);
- padding: 5px;
- color: var(--weui-FG-HALF);
-}
-.device_item_hover {
- background-color: rgba(0, 0, 0, .1);
-}
diff --git a/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.js b/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.js
deleted file mode 100644
index 2766f8b4..00000000
--- a/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.js
+++ /dev/null
@@ -1,50 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '打电话',
- path: 'packageAPI/pages/device/make-phone-call/make-phone-call'
- }
- },
-
- data: {
- theme: 'light',
- disabled: true
- },
- bindInput(e) {
- this.inputValue = e.detail.value
-
- if (this.inputValue.length > 0) {
- this.setData({
- disabled: false
- })
- } else {
- this.setData({
- disabled: true
- })
- }
- },
- makePhoneCall() {
- wx.makePhoneCall({
- phoneNumber: this.inputValue,
- success() {
- console.log('成功拨打电话')
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.json b/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.json
deleted file mode 100644
index 1c243121..00000000
--- a/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "打电话"
-}
diff --git a/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.wxml b/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.wxml
deleted file mode 100644
index 217c1358..00000000
--- a/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.wxml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
- 请在下方输入电话号码
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.wxss b/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.wxss
deleted file mode 100644
index e4f1c5b6..00000000
--- a/miniprogram/packageAPI/pages/device/make-phone-call/make-phone-call.wxss
+++ /dev/null
@@ -1,19 +0,0 @@
-.page-section{
- width: auto;
- margin: 15px;
- padding: 42px 30px 30px;
- background-color: var(--weui-BG-2);
- font-size: 14px;
-}
-.desc{
- margin-bottom: 10px;
-}
-.input{
- height: 60px;
- line-height: 60px;
- font-size: 39px;
- border-bottom: 1px solid var(--weui-FG-3);
-}
-.btn-area{
- padding: 0;
-}
diff --git a/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.js b/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.js
deleted file mode 100644
index 90f649f9..00000000
--- a/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.js
+++ /dev/null
@@ -1,137 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '监听重力感应数据',
- path: 'packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change'
- }
- },
-
- data: {
- theme: 'light',
- x: 0,
- y: 0,
- z: 0,
- enabled: true
- },
- onReady() {
- this.drawBigBall()
- const that = this
-
- this.position = {
- x: 151,
- y: 151,
- vx: 0,
- vy: 0,
- ax: 0,
- ay: 0
- }
- wx.onAccelerometerChange(function (res) {
- that.setData({
- x: res.x.toFixed(2),
- y: res.y.toFixed(2),
- z: res.z.toFixed(2)
- })
- that.position.ax = Math.sin((res.x * Math.PI) / 2)
- that.position.ay = -Math.sin((res.y * Math.PI) / 2)
- // that.drawSmallBall()
- })
-
- this.interval = setInterval(function () {
- that.drawSmallBall()
- }, 17)
- },
- drawBigBall() {
- const context = wx.createContext()
- context.beginPath(0)
- context.arc(151, 151, 140, 0, Math.PI * 2)
- context.setFillStyle('#ffffff')
- context.setStrokeStyle('#aaaaaa')
- context.fill()
- // context.stroke()
- wx.drawCanvas({
- canvasId: 'big-ball',
- actions: context.getActions()
- })
- },
- drawSmallBall() {
- const p = this.position
- let strokeStyle = 'rgba(1,1,1,0)'
-
- p.x += p.vx
- p.y += p.vy
- p.vx += p.ax
- p.vy += p.ay
-
- // eslint-disable-next-line
- if (Math.sqrt(Math.pow(Math.abs(p.x) - 151, 2) + Math.pow(Math.abs(p.y) - 151, 2)) >= 115) {
- if (p.x > 151 && p.vx > 0) {
- p.vx = 0
- }
- if (p.x < 151 && p.vx < 0) {
- p.vx = 0
- }
- if (p.y > 151 && p.vy > 0) {
- p.vy = 0
- }
- if (p.y < 151 && p.vy < 0) {
- p.vy = 0
- }
- strokeStyle = '#ff0000'
- }
-
- const context = wx.createContext()
- context.beginPath(0)
- context.arc(p.x, p.y, 15, 0, Math.PI * 2)
- context.setFillStyle('#1aad19')
- context.setStrokeStyle(strokeStyle)
- context.fill()
- // context.stroke()
- wx.drawCanvas({
- canvasId: 'small-ball',
- actions: context.getActions()
- })
- },
- startAccelerometer() {
- if (this.data.enabled) {
- return
- }
- const that = this
- wx.startAccelerometer({
- success() {
- that.setData({
- enabled: true
- })
- }
- })
- },
- stopAccelerometer() {
- if (!this.data.enabled) {
- return
- }
- const that = this
- wx.stopAccelerometer({
- success() {
- that.setData({
- enabled: false
- })
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- clearInterval(this.interval)
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.json b/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.json
deleted file mode 100644
index c58e80d6..00000000
--- a/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "监听重力感应数据"
-}
diff --git a/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.wxml b/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.wxml
deleted file mode 100644
index 49e946f5..00000000
--- a/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.wxml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
- 倾斜手机即可移动下方小球
-
-
-
-
-
- X: {{x}}
- Y: {{y}}
- Z: {{z}}
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.wxss b/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.wxss
deleted file mode 100644
index 6087506a..00000000
--- a/miniprogram/packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.wxss
+++ /dev/null
@@ -1,33 +0,0 @@
-.page-body-xyz {
- display: flex;
- justify-content: space-between;
- width: 350px;
- margin-top: 45px;
- box-sizing: border-box;
- text-align: center;
-}
-.page-body-canvas {
- margin-top: 15px;
- width: 302px;
- height: 302px;
- position: relative;
-}
-.page-body-ball {
- position: absolute;
- top: 0;
- left: 0;
- width: 302px;
- height: 302px;
-}
-.page-body-title {
- margin-bottom: 0;
- font-size: 16px;
- width: 225px;
-}
-.page-body-controls {
- margin-top: 15px;
-}
-.page-body-controls button {
- margin-left: 10px;
- float: left;
-}
diff --git a/miniprogram/packageAPI/pages/device/on-compass-change/compass.png b/miniprogram/packageAPI/pages/device/on-compass-change/compass.png
deleted file mode 100644
index fba87a58..00000000
Binary files a/miniprogram/packageAPI/pages/device/on-compass-change/compass.png and /dev/null differ
diff --git a/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.js b/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.js
deleted file mode 100644
index c77670e1..00000000
--- a/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.js
+++ /dev/null
@@ -1,64 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '监听罗盘数据',
- path: 'packageAPI/pages/device/on-compass-change/on-compass-change'
- }
- },
-
- data: {
- theme: 'light',
- enabled: true,
- direction: 0
- },
- onReady() {
- const that = this
- wx.onCompassChange(function (res) {
- that.setData({
- direction: parseInt(res.direction, 10)
- })
- })
- },
- startCompass() {
- if (this.data.enabled) {
- return
- }
- const that = this
- wx.startCompass({
- success() {
- that.setData({
- enabled: true
- })
- }
- })
- },
- stopCompass() {
- if (!this.data.enabled) {
- return
- }
- const that = this
- wx.stopCompass({
- success() {
- that.setData({
- enabled: false
- })
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.json b/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.json
deleted file mode 100644
index fb167ef4..00000000
--- a/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "监听罗盘数据"
-}
diff --git a/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.wxml b/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.wxml
deleted file mode 100644
index 7c33bc43..00000000
--- a/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.wxml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
- 旋转手机即可获取方位信息
-
-
-
-
- {{direction}}
- o
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.wxss b/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.wxss
deleted file mode 100644
index c6673c23..00000000
--- a/miniprogram/packageAPI/pages/device/on-compass-change/on-compass-change.wxss
+++ /dev/null
@@ -1,47 +0,0 @@
-.direction {
- position: relative;
- margin-top: 35px;
- display: flex;
- width: 520px;
- height: 520px;
- align-items: center;
- justify-content: center;
-}
-.direction-value {
- position: relative;
- font-size: 100px;
- color: #353535;
- line-height: 1;
- z-index: 1;
-}
-.direction-degree {
- position: absolute;
- top: 0;
- right: -20px;
- font-size: 30px;
-}
-.bg-compass{
- position: absolute;
- top: 0;
- left: 0;
- width: 520px;
- height: 520px;
- transition: .1s;
-}
-.bg-compass-line{
- position: absolute;
- left: 134px;
- top: -5px;
- width: 3px;
- height: 28px;
- background-color: #1AAD19;
- border-radius: 500px;
- z-index: 1;
-}
-.controls{
- margin-top: 35px;
-}
-.controls button{
- margin-left: 10px;
- float: left;
-}
diff --git a/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.js b/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.js
deleted file mode 100644
index d2f34ab2..00000000
--- a/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.js
+++ /dev/null
@@ -1,47 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '监听手机网络变化',
- path: 'packageAPI/pages/device/on-network-status-change/on-network-status-change'
- }
- },
-
- data: {
- theme: 'light',
- isConnected: false,
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- const that = this
- wx.onNetworkStatusChange(function (res) {
- that.setData({
- isConnected: res.isConnected,
- networkType: res.networkType
- })
- })
- },
- onShow() {
- const that = this
- wx.getNetworkType({
- success(res) {
- that.setData({
- isConnected: res.networkType !== 'none',
- networkType: res.networkType
- })
- }
- })
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.json b/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.json
deleted file mode 100644
index 101cd026..00000000
--- a/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "监听手机网络变化"
-}
diff --git a/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.wxml b/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.wxml
deleted file mode 100644
index 64ea90e0..00000000
--- a/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.wxml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
- 网络状态
-
- 没有网络连接
-
-
- {{networkType}}
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.wxss b/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.wxss
deleted file mode 100644
index 75bd3fdf..00000000
--- a/miniprogram/packageAPI/pages/device/on-network-status-change/on-network-status-change.wxss
+++ /dev/null
@@ -1,7 +0,0 @@
-.page-body-info {
- height: 100px;
-}
-.page-body-text-network-type {
- font-size: 40px;
- font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
-}
diff --git a/miniprogram/packageAPI/pages/device/scan-code/scan-code.js b/miniprogram/packageAPI/pages/device/scan-code/scan-code.js
deleted file mode 100644
index f16ce851..00000000
--- a/miniprogram/packageAPI/pages/device/scan-code/scan-code.js
+++ /dev/null
@@ -1,44 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '扫码',
- path: 'packageAPI/pages/device/scan-code/scan-code'
- }
- },
-
- data: {
- theme: 'light',
- result: ''
- },
-
- scanCode() {
- const that = this
- wx.scanCode({
- scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
- success(res) {
- that.setData({
- result: res.result
- })
- },
- fail(err) {
- console.log('scanCode fail: ', err)
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/scan-code/scan-code.json b/miniprogram/packageAPI/pages/device/scan-code/scan-code.json
deleted file mode 100644
index cf4dc81f..00000000
--- a/miniprogram/packageAPI/pages/device/scan-code/scan-code.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "扫码"
-}
diff --git a/miniprogram/packageAPI/pages/device/scan-code/scan-code.wxml b/miniprogram/packageAPI/pages/device/scan-code/scan-code.wxml
deleted file mode 100644
index 1ebae8d8..00000000
--- a/miniprogram/packageAPI/pages/device/scan-code/scan-code.wxml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
- 扫码结果
-
-
- {{result}}
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/scan-code/scan-code.wxss b/miniprogram/packageAPI/pages/device/scan-code/scan-code.wxss
deleted file mode 100644
index 23be79c3..00000000
--- a/miniprogram/packageAPI/pages/device/scan-code/scan-code.wxss
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-.weui-cell__bd{
- min-height: 24px;
- word-break: break-all;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.js b/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.js
deleted file mode 100644
index f9ca2268..00000000
--- a/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.js
+++ /dev/null
@@ -1,62 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '屏幕亮度',
- path: 'packageAPI/pages/device/screen-brightness/screen-brightness'
- }
- },
-
- data: {
- theme: 'light',
- screenBrightness: 0
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- this._updateScreenBrightness()
- },
-
- changeBrightness(e) {
- const value = Number.parseFloat(
- (e.detail.value).toFixed(1)
- )
- this.setData({
- screenBrightness: Number.parseFloat(
- e.detail.value.toFixed(1)
- )
- })
- wx.setScreenBrightness({
- value,
-
- })
- },
-
- _updateScreenBrightness() {
- wx.getScreenBrightness({
- success: (res) => {
- console.log(res)
- this.setData({
- screenBrightness: Number.parseFloat(
- res.value.toFixed(1)
- )
- })
- },
- fail(err) {
- console.error(err)
- }
- })
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.json b/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.json
deleted file mode 100644
index 0d23d3a7..00000000
--- a/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "屏幕亮度"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.wxml b/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.wxml
deleted file mode 100644
index 4178c177..00000000
--- a/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.wxml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
- 当前屏幕亮度
- {{screenBrightness}}
-
-
- 设置屏幕亮度
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.wxss b/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.wxss
deleted file mode 100644
index c0755f0d..00000000
--- a/miniprogram/packageAPI/pages/device/screen-brightness/screen-brightness.wxss
+++ /dev/null
@@ -1,8 +0,0 @@
-.page-body-text-screen-brightness {
- font-size: 40px;
- font-family: -apple-system-font, Helvetica Neue,Helvetica,sans-serif;
-}
-
-.page-section-gap {
- padding: 15px;
-}
diff --git a/miniprogram/packageAPI/pages/device/vibrate/vibrate.js b/miniprogram/packageAPI/pages/device/vibrate/vibrate.js
deleted file mode 100644
index ea956160..00000000
--- a/miniprogram/packageAPI/pages/device/vibrate/vibrate.js
+++ /dev/null
@@ -1,52 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '振动',
- path: 'packageAPI/pages/device/vibrate/vibrate'
- }
- },
-
- vibrateShort() {
- wx.vibrateShort({
- success(res) {
- console.log(res)
- },
- fail(err) {
- console.error(err)
- },
- complete() {
- console.log('completed')
- }
- })
- },
-
- vibrateLong() {
- wx.vibrateLong({
- success(res) {
- console.log(res)
- },
- fail(err) {
- console.error(err)
- },
- complete() {
- console.log('completed')
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/vibrate/vibrate.json b/miniprogram/packageAPI/pages/device/vibrate/vibrate.json
deleted file mode 100644
index 5a9a6c88..00000000
--- a/miniprogram/packageAPI/pages/device/vibrate/vibrate.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "振动"
-}
diff --git a/miniprogram/packageAPI/pages/device/vibrate/vibrate.wxml b/miniprogram/packageAPI/pages/device/vibrate/vibrate.wxml
deleted file mode 100644
index fe580503..00000000
--- a/miniprogram/packageAPI/pages/device/vibrate/vibrate.wxml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/vibrate/vibrate.wxss b/miniprogram/packageAPI/pages/device/vibrate/vibrate.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/device/wifi/wifi.js b/miniprogram/packageAPI/pages/device/wifi/wifi.js
deleted file mode 100644
index 0bc99255..00000000
--- a/miniprogram/packageAPI/pages/device/wifi/wifi.js
+++ /dev/null
@@ -1,91 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'Wi-Fi',
- path: 'packageAPI/pages/device/wifi/wifi'
- }
- },
-
- data: {
- theme: 'light',
- wifiList: []
- },
-
- startSearch() {
- const getWifiList = () => {
- wx.getWifiList({
- success: () => {
- wx.onGetWifiList((res) => {
- const wifiList = res.wifiList
- .sort((a, b) => b.signalStrength - a.signalStrength)
- .map(wifi => {
- const strength = Math.ceil(wifi.signalStrength * 4)
- return Object.assign(wifi, { strength })
- })
- this.setData({
- wifiList
- })
- })
- },
- fail(err) {
- console.error(err)
- }
- })
- }
-
- const startWifi = () => {
- wx.startWifi({
- success: getWifiList,
- fail(err) {
- console.error(err)
- }
- })
- }
-
- wx.getSystemInfo({
- success(res) {
- const isIOS = res.platform === 'ios'
- if (isIOS) {
- wx.showModal({
- title: '提示',
- content: '由于系统限制,iOS用户请手动进入系统WiFi页面,然后返回小程序。',
- showCancel: false,
- success() {
- startWifi()
- }
- })
- return
- }
- startWifi()
- }
- })
- },
-
- stopSearch() {
- wx.stopWifi({
- success(res) {
- console.log(res)
- },
- fail(err) {
- console.error(err)
- }
- })
- },
- onUnload() {
- this.stopSearch()
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/device/wifi/wifi.json b/miniprogram/packageAPI/pages/device/wifi/wifi.json
deleted file mode 100644
index 228a1e63..00000000
--- a/miniprogram/packageAPI/pages/device/wifi/wifi.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "Wi-Fi"
-}
diff --git a/miniprogram/packageAPI/pages/device/wifi/wifi.wxml b/miniprogram/packageAPI/pages/device/wifi/wifi.wxml
deleted file mode 100644
index 7a4fa678..00000000
--- a/miniprogram/packageAPI/pages/device/wifi/wifi.wxml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- {{ item.SSID }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/device/wifi/wifi.wxss b/miniprogram/packageAPI/pages/device/wifi/wifi.wxss
deleted file mode 100644
index 7b135f32..00000000
--- a/miniprogram/packageAPI/pages/device/wifi/wifi.wxss
+++ /dev/null
@@ -1,104 +0,0 @@
-.page-body-info {
- padding: 15px 30px;
- width: auto;
-}
-
-.device-list {
- height: 150px;
- text-align: center;
-}
-
-.item {
- width: 100%;
- margin-bottom: 10px;
-}
-
-.list {
- width: 100%;
- text-align: left;
- display:flex;
- flex-direction:row;
- align-items:center;
- justify-content:space-between;
- font-size: 15px;
-}
-
-.list text {
- display: inline-block;
- max-width: 80%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.strength-ready { color: #26a69a; }
-.strength-no { color: #37474f; }
-.wifi-icon{
- width: 20px;
- height:20px;
- display: inline-block;
- position: relative;
- overflow: hidden;
- margin: 0 10px;
- float: right;
-}
-.wifi-icon span{
- display: block;
- position: absolute;
- border-radius: 50%;
-}
-.wifi-icon .wifi-1{
- width: 4px;
- height: 4px;
- left: 8px;
- bottom: 3px;
- background: currentcolor;
-}
-.wifi-icon .wifi-2,.wifi-icon .wifi-3,.wifi-icon .wifi-4{
- border: 2px solid;
- border-color: currentcolor transparent transparent;
- }
-.wifi-icon .wifi-2{
- width: 12px;
- height: 12px;
- left: 2px;
- bottom: -4px;
-}
-.wifi-icon .wifi-3{
- width: 20px;
- height: 20px;
- left: -2px;
- bottom: -8px;
- }
-.wifi-icon .wifi-4{
- width: 28px;
- height: 28px;
- left: -6px;
- bottom: -12px;
-}
-.wifi-icon span:after{
- content: "";
- display: block;
- position: absolute;
-}
-.wifi-icon .lock{
- width: 6px;
- height: 5px;
- background: currentcolor;
- display: block;
- right: 1px;
- bottom: 2px;
- border-radius: 0;
-}
-.wifi-icon .lock:after{
- width: 4px;
- height: 3px;
- border: 1px solid;
- border-radius: 100px 100px 0 0;
- border-bottom: none;
- left: 0px;
- bottom: 100%;
-}
-.off {
- border-color: #b0bec5 transparent transparent !important;
-}
diff --git a/miniprogram/packageAPI/pages/framework/resizable/resizable.js b/miniprogram/packageAPI/pages/framework/resizable/resizable.js
deleted file mode 100644
index 3585a590..00000000
--- a/miniprogram/packageAPI/pages/framework/resizable/resizable.js
+++ /dev/null
@@ -1,34 +0,0 @@
-// miniprogram/packageAPI/pages/framework/resizable/resizable.js
-Page({
- onShareAppMessage() {
- return {
- title: '屏幕旋转',
- path: 'packageAPI/pages/framework/resizable/resizable'
- }
- },
- data: {
- theme: 'light',
- status: 'lock',
- },
- handleStatusChange(e) {
- this.setData({
- status: e.currentTarget.dataset.status,
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/framework/resizable/resizable.json b/miniprogram/packageAPI/pages/framework/resizable/resizable.json
deleted file mode 100644
index 1e283bfb..00000000
--- a/miniprogram/packageAPI/pages/framework/resizable/resizable.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "屏幕旋转",
- "pageOrientation": "auto"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/resizable/resizable.wxml b/miniprogram/packageAPI/pages/framework/resizable/resizable.wxml
deleted file mode 100644
index ce8f98fb..00000000
--- a/miniprogram/packageAPI/pages/framework/resizable/resizable.wxml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- 旋转屏幕
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/framework/resizable/resizable.wxs b/miniprogram/packageAPI/pages/framework/resizable/resizable.wxs
deleted file mode 100644
index bead2ff8..00000000
--- a/miniprogram/packageAPI/pages/framework/resizable/resizable.wxs
+++ /dev/null
@@ -1,13 +0,0 @@
-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/framework/resizable/resizable.wxss b/miniprogram/packageAPI/pages/framework/resizable/resizable.wxss
deleted file mode 100644
index abb7830c..00000000
--- a/miniprogram/packageAPI/pages/framework/resizable/resizable.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* miniprogram/packageAPI/pages/framework/resizable/resizable.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.js b/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.js
deleted file mode 100644
index f285414a..00000000
--- a/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.js
+++ /dev/null
@@ -1,80 +0,0 @@
-// miniprogram/page/API/pages/two-way-bindings/two-way-bindings.js
-Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- theme: 'light',
- value: '',
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- return {
- title: '双向绑定',
- path: 'packageAPI/pages/framework/make-phone-call/make-phone-call'
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.json b/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.json
deleted file mode 100644
index a260c07f..00000000
--- a/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "two-way-bindings"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.wxml b/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.wxml
deleted file mode 100644
index fbfda188..00000000
--- a/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.wxml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
- 这是你输入的数据:{{value}}
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.wxss b/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.wxss
deleted file mode 100644
index 30ff74f6..00000000
--- a/miniprogram/packageAPI/pages/framework/two-way-bindings/two-way-bindings.wxss
+++ /dev/null
@@ -1,9 +0,0 @@
-.input {
- margin: 15px auto;
- width: 80%;
- /* border-bottom: 1px solid black; */
-}
-.text {
- margin: 15px auto;
- width: 80%;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/wxs/image/1.jpeg b/miniprogram/packageAPI/pages/framework/wxs/image/1.jpeg
deleted file mode 100644
index 80c325d2..00000000
Binary files a/miniprogram/packageAPI/pages/framework/wxs/image/1.jpeg and /dev/null differ
diff --git a/miniprogram/packageAPI/pages/framework/wxs/image/2.jpg b/miniprogram/packageAPI/pages/framework/wxs/image/2.jpg
deleted file mode 100644
index 8c7e0d1a..00000000
Binary files a/miniprogram/packageAPI/pages/framework/wxs/image/2.jpg and /dev/null differ
diff --git a/miniprogram/packageAPI/pages/framework/wxs/image/3.jpg b/miniprogram/packageAPI/pages/framework/wxs/image/3.jpg
deleted file mode 100644
index ed4074c6..00000000
Binary files a/miniprogram/packageAPI/pages/framework/wxs/image/3.jpg and /dev/null differ
diff --git a/miniprogram/packageAPI/pages/framework/wxs/image/4.jpg b/miniprogram/packageAPI/pages/framework/wxs/image/4.jpg
deleted file mode 100644
index 27cb15b2..00000000
Binary files a/miniprogram/packageAPI/pages/framework/wxs/image/4.jpg and /dev/null differ
diff --git a/miniprogram/packageAPI/pages/framework/wxs/image/btn.png b/miniprogram/packageAPI/pages/framework/wxs/image/btn.png
deleted file mode 100644
index c6536be6..00000000
Binary files a/miniprogram/packageAPI/pages/framework/wxs/image/btn.png and /dev/null differ
diff --git a/miniprogram/packageAPI/pages/framework/wxs/movable.js b/miniprogram/packageAPI/pages/framework/wxs/movable.js
deleted file mode 100644
index d6e86550..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/movable.js
+++ /dev/null
@@ -1,58 +0,0 @@
-// pages/movable/movable.js
-Page({
- onShareAppMessage() {
- return {
- title: 'movable',
- path: 'packageAPI/pages/framework/wxs/movable'
- }
- },
- /**
- * 页面的初始数据
- */
- data: {
- theme: 'light',
- left: 50,
- top: 50,
- taptest: 'taptest',
- show: true,
- dataObj: {
- obj: 1
- }
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- setTimeout(() => {
- this.setData({
- // show: false,
- })
- }, 3000)
- },
- taptest() {
- this.setData({
- show: false,
- })
- }
-})
diff --git a/miniprogram/packageAPI/pages/framework/wxs/movable.json b/miniprogram/packageAPI/pages/framework/wxs/movable.json
deleted file mode 100644
index 8aca076b..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/movable.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "movable"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/wxs/movable.wxml b/miniprogram/packageAPI/pages/framework/wxs/movable.wxml
deleted file mode 100644
index edbc6c4f..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/movable.wxml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/wxs/movable.wxs b/miniprogram/packageAPI/pages/framework/wxs/movable.wxs
deleted file mode 100644
index b1622fa0..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/movable.wxs
+++ /dev/null
@@ -1,36 +0,0 @@
-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/framework/wxs/movable.wxss b/miniprogram/packageAPI/pages/framework/wxs/movable.wxss
deleted file mode 100644
index c9f71e10..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/movable.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* miniprogram/page/API/pages/wxs/movable.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/wxs/nearby.js b/miniprogram/packageAPI/pages/framework/wxs/nearby.js
deleted file mode 100644
index f2138af5..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/nearby.js
+++ /dev/null
@@ -1,77 +0,0 @@
-const windowWidth = wx.getSystemInfoSync().windowWidth
-Page({
- onShareAppMessage() {
- return {
- title: 'nearby',
- path: 'packageAPI/pages/framework/wxs/nearby'
- }
- },
- data: {
- theme: 'light',
- 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
- },
- changeIndicatorDots() {
- this.setData({
- indicatorDots: !this.data.indicatorDots
- })
- },
- swiperTransition1(e) {
- console.log('e.transition', e)
- this.setData({
- left: (e.detail.x) / 4
- })
- },
- onReady() {
- },
- changeAutoplay() {
- this.setData({
- autoplay: !this.data.autoplay
- })
- },
- intervalChange(e) {
- this.setData({
- interval: e.detail.value
- })
- },
- durationChange(e) {
- this.setData({
- duration: e.detail.value
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/framework/wxs/nearby.json b/miniprogram/packageAPI/pages/framework/wxs/nearby.json
deleted file mode 100644
index 838b6f44..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/nearby.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "nearby"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/wxs/nearby.wxml b/miniprogram/packageAPI/pages/framework/wxs/nearby.wxml
deleted file mode 100644
index 1c633b28..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/nearby.wxml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/wxs/nearby.wxs b/miniprogram/packageAPI/pages/framework/wxs/nearby.wxs
deleted file mode 100644
index 03390278..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/nearby.wxs
+++ /dev/null
@@ -1,61 +0,0 @@
-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/framework/wxs/nearby.wxss b/miniprogram/packageAPI/pages/framework/wxs/nearby.wxss
deleted file mode 100644
index 76a4454c..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/nearby.wxss
+++ /dev/null
@@ -1,5 +0,0 @@
-/* pages/nearby/nearby.wxss */
-.swiper {
- width: 100%;
- max-width: 600px;
-}
diff --git a/miniprogram/packageAPI/pages/framework/wxs/sidebar.js b/miniprogram/packageAPI/pages/framework/wxs/sidebar.js
deleted file mode 100644
index d3245ed6..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/sidebar.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// page/one/index.js
-Page({
- data: {
- theme: 'light',
- tabs: [],
- open: false,
- mark: 0,
- newmark: 0,
- startmark: 0,
- endmark: 0,
- windowWidth: wx.getSystemInfoSync().windowWidth,
- staus: 1,
- translate: ''
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- 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)
- }
-})
diff --git a/miniprogram/packageAPI/pages/framework/wxs/sidebar.json b/miniprogram/packageAPI/pages/framework/wxs/sidebar.json
deleted file mode 100644
index ab84b01d..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/sidebar.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "sidebar"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/wxs/sidebar.wxml b/miniprogram/packageAPI/pages/framework/wxs/sidebar.wxml
deleted file mode 100644
index 4124674c..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/sidebar.wxml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
- 技术开发
-
-
- 产品解析
-
-
- 运营规范
-
-
- 高校大赛
-
-
-
-
- >>> 右滑出现侧边菜单
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/framework/wxs/sidebar.wxs b/miniprogram/packageAPI/pages/framework/wxs/sidebar.wxs
deleted file mode 100644
index af3f6065..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/sidebar.wxs
+++ /dev/null
@@ -1,61 +0,0 @@
-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/framework/wxs/sidebar.wxss b/miniprogram/packageAPI/pages/framework/wxs/sidebar.wxss
deleted file mode 100644
index 689aaca0..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/sidebar.wxss
+++ /dev/null
@@ -1,56 +0,0 @@
-.container {
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: space-between;
- padding: 100px 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: 725px;
- position: fixed;
- background-color: #07c160;
- z-index: 0;
-}
-.wc{
- color: white;
- padding: 15px 0 15px 20px;
-}
-.page-content{
- padding-top: 150px;
-}
-.page-top{
- height: 100%;
- position: fixed;
- width: 725px;
- 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: 10px 10px 5px;
- font-size: 18px;
- width: 100%;
-}
-.item-desc {
- margin: 5px 10px 0;
- width: 100%;
- color: #00000080
-}
diff --git a/miniprogram/packageAPI/pages/framework/wxs/stick-top.js b/miniprogram/packageAPI/pages/framework/wxs/stick-top.js
deleted file mode 100644
index 52fc4e40..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/stick-top.js
+++ /dev/null
@@ -1,70 +0,0 @@
-const height = wx.getSystemInfoSync().windowHeight
-const app = getApp()
-Page({
- data: {
- theme: 'light',
- sticky: false,
- opacity: 0,
- height,
- tabs: [],
- theme: app.globalData.theme,
- },
- // 滚动条监听
- onPageScroll() {
- // console.log('page scroll')
- },
- onShow() {
-
- },
- onReady() {
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- 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 })
- }
-})
diff --git a/miniprogram/packageAPI/pages/framework/wxs/stick-top.json b/miniprogram/packageAPI/pages/framework/wxs/stick-top.json
deleted file mode 100644
index 17c9e250..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/stick-top.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "stick-top"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/wxs/stick-top.wxml b/miniprogram/packageAPI/pages/framework/wxs/stick-top.wxml
deleted file mode 100644
index 4942f8ce..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/stick-top.wxml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
- 抗疫专区
- 技术开发
- 运营专区
- 我的
-
-
-
-
-
- {{item.title2}}
-
-
- {{item.desc}}
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/wxs/stick-top.wxs b/miniprogram/packageAPI/pages/framework/wxs/stick-top.wxs
deleted file mode 100644
index f069376a..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/stick-top.wxs
+++ /dev/null
@@ -1,57 +0,0 @@
-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/framework/wxs/stick-top.wxss b/miniprogram/packageAPI/pages/framework/wxs/stick-top.wxss
deleted file mode 100644
index 8aeaf725..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/stick-top.wxss
+++ /dev/null
@@ -1,41 +0,0 @@
-.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:15px 0 ;
- display: table-cell;
- text-align: center;
- color: #07c160;
-}
-.goods-list{
- height: 300px;
- background-color: var(--weui-BG-2);
- padding: 10px;
- display: flex;
- flex-direction: column;
- align-items: center;
-}
-.item-title {
- margin: 10px 10px 5px;
- font-size: 18px;
- width: 100%;
-}
-.item-desc {
- margin: 5px 10px 0;
- width: 100%;
- color: var(--weui-FG-2)
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/wxs/wxs.js b/miniprogram/packageAPI/pages/framework/wxs/wxs.js
deleted file mode 100644
index fc1f38cc..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/wxs.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// miniprogram/page/API/pages/wxs/wxs.js
-Page({
- onShareAppMessage() {
- return {
- title: 'wxs',
- path: 'packageAPI/pages/framework/wxs/wxs'
- }
- },
- handleNavChange(e) {
- console.log(e)
- wx.navigateTo({
- url: `/packageAPI/pages/framework/framework/wxs/${e.currentTarget.dataset.nav}`,
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/framework/wxs/wxs.json b/miniprogram/packageAPI/pages/framework/wxs/wxs.json
deleted file mode 100644
index c2044df7..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/wxs.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "WXS"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/framework/wxs/wxs.wxml b/miniprogram/packageAPI/pages/framework/wxs/wxs.wxml
deleted file mode 100644
index 16e2971a..00000000
--- a/miniprogram/packageAPI/pages/framework/wxs/wxs.wxml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/framework/wxs/wxs.wxss b/miniprogram/packageAPI/pages/framework/wxs/wxs.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/location/choose-location/choose-location.js b/miniprogram/packageAPI/pages/location/choose-location/choose-location.js
deleted file mode 100644
index 3cd0259f..00000000
--- a/miniprogram/packageAPI/pages/location/choose-location/choose-location.js
+++ /dev/null
@@ -1,51 +0,0 @@
-const util = require('../../../../util/util.js')
-
-const formatLocation = util.formatLocation
-
-Page({
- onShareAppMessage() {
- return {
- title: '使用原生地图选择位置',
- path: 'packageAPI/pages/location/choose-location/choose-location'
- }
- },
-
- data: {
- theme: 'light',
- hasLocation: false,
- },
- chooseLocation() {
- const that = this
- wx.chooseLocation({
- success(res) {
- console.log(res)
- that.setData({
- hasLocation: true,
- location: formatLocation(res.longitude, res.latitude),
- locationAddress: res.address
- })
- }
- })
- },
- clear() {
- this.setData({
- hasLocation: false
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/location/choose-location/choose-location.json b/miniprogram/packageAPI/pages/location/choose-location/choose-location.json
deleted file mode 100644
index 9c3112d3..00000000
--- a/miniprogram/packageAPI/pages/location/choose-location/choose-location.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "使用原生地图选择位置"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/location/choose-location/choose-location.wxml b/miniprogram/packageAPI/pages/location/choose-location/choose-location.wxml
deleted file mode 100644
index 8d0c95a9..00000000
--- a/miniprogram/packageAPI/pages/location/choose-location/choose-location.wxml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
- 当前位置信息
-
- 未选择位置
-
-
- {{locationAddress}}
-
- E: {{location.longitude[0]}}°{{location.longitude[1]}}′
- N: {{location.latitude[0]}}°{{location.latitude[1]}}′
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/location/choose-location/choose-location.wxss b/miniprogram/packageAPI/pages/location/choose-location/choose-location.wxss
deleted file mode 100644
index 0febcd69..00000000
--- a/miniprogram/packageAPI/pages/location/choose-location/choose-location.wxss
+++ /dev/null
@@ -1,4 +0,0 @@
-.page-body-info{
- padding-bottom: 0;
- height: 420px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/location/get-location/get-location.js b/miniprogram/packageAPI/pages/location/get-location/get-location.js
deleted file mode 100644
index 0e287be1..00000000
--- a/miniprogram/packageAPI/pages/location/get-location/get-location.js
+++ /dev/null
@@ -1,53 +0,0 @@
-const util = require('../../../../util/util.js')
-
-const formatLocation = util.formatLocation
-
-Page({
- onShareAppMessage() {
- return {
- title: '获取位置',
- path: 'packageAPI/pages/location/get-location/get-location'
- }
- },
-
- data: {
- theme: 'light',
- hasLocation: false,
- },
- getLocation() {
- const that = this
- wx.getLocation({
- success(res) {
- console.log(res)
- that.setData({
- hasLocation: true,
- location: formatLocation(res.longitude, res.latitude)
- })
- },
- complete(res) {
- console.log('getLocation: ', res)
- }
- })
- },
- clear() {
- this.setData({
- hasLocation: false
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/location/get-location/get-location.json b/miniprogram/packageAPI/pages/location/get-location/get-location.json
deleted file mode 100644
index f11a9db5..00000000
--- a/miniprogram/packageAPI/pages/location/get-location/get-location.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "获取位置"
-}
diff --git a/miniprogram/packageAPI/pages/location/get-location/get-location.wxml b/miniprogram/packageAPI/pages/location/get-location/get-location.wxml
deleted file mode 100644
index 8a4c5424..00000000
--- a/miniprogram/packageAPI/pages/location/get-location/get-location.wxml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
- 当前位置经纬度
-
- 未获取
-
-
-
- E: {{location.longitude[0]}}°{{location.longitude[1]}}′
- N: {{location.latitude[0]}}°{{location.latitude[1]}}′
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/location/get-location/get-location.wxss b/miniprogram/packageAPI/pages/location/get-location/get-location.wxss
deleted file mode 100644
index 0b64b812..00000000
--- a/miniprogram/packageAPI/pages/location/get-location/get-location.wxss
+++ /dev/null
@@ -1,15 +0,0 @@
-.page-body-info {
- height: 225px;
-}
-.page-body-text-small {
- font-size: 12px;
- color: var(--weui-FG-0);
- margin-bottom: 50px;
-}
-.page-body-text-location {
- display: flex;
- font-size: 25px;
-}
-.page-body-text-location text {
- margin: 5px;
-}
diff --git a/miniprogram/packageAPI/pages/location/open-location/open-location.js b/miniprogram/packageAPI/pages/location/open-location/open-location.js
deleted file mode 100644
index f5c3ef64..00000000
--- a/miniprogram/packageAPI/pages/location/open-location/open-location.js
+++ /dev/null
@@ -1,36 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '查看位置',
- path: 'packageAPI/pages/location/open-location/open-location'
- }
- },
-
- openLocation(e) {
- console.log(e)
- const value = e.detail.value
- console.log(value)
- wx.openLocation({
- longitude: Number(value.longitude),
- latitude: Number(value.latitude),
- name: value.name,
- address: value.address
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/location/open-location/open-location.json b/miniprogram/packageAPI/pages/location/open-location/open-location.json
deleted file mode 100644
index aca8d161..00000000
--- a/miniprogram/packageAPI/pages/location/open-location/open-location.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "查看位置"
-}
diff --git a/miniprogram/packageAPI/pages/location/open-location/open-location.wxml b/miniprogram/packageAPI/pages/location/open-location/open-location.wxml
deleted file mode 100644
index c987a266..00000000
--- a/miniprogram/packageAPI/pages/location/open-location/open-location.wxml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/location/open-location/open-location.wxss b/miniprogram/packageAPI/pages/location/open-location/open-location.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/media/audio/audio.js b/miniprogram/packageAPI/pages/media/audio/audio.js
deleted file mode 100644
index fc2e0e5f..00000000
--- a/miniprogram/packageAPI/pages/media/audio/audio.js
+++ /dev/null
@@ -1,46 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'Audio',
- path: 'packageAPI/pages/media/audio/audio'
- }
- },
- onReady() {
- // 使用 wx.createAudioContext 获取 audio 上下文 context
- this.audioCtx = wx.createInnerAudioContext()
- this.audioCtx.src = 'https://dldir1.qq.com/music/release/upload/t_mm_file_publish/2339610.m4a'
- this.audioCtx.play()
- },
- data: {
- theme: 'light',
- src: ''
- },
- audioPlay() {
- this.audioCtx.play()
- },
- audioPause() {
- this.audioCtx.pause()
- },
- audio14() {
- this.audioCtx.seek(14)
- },
- audioStart() {
- this.audioCtx.seek(0)
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/media/audio/audio.json b/miniprogram/packageAPI/pages/media/audio/audio.json
deleted file mode 100644
index ca94bb56..00000000
--- a/miniprogram/packageAPI/pages/media/audio/audio.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "音频"
-
-}
diff --git a/miniprogram/packageAPI/pages/media/audio/audio.wxml b/miniprogram/packageAPI/pages/media/audio/audio.wxml
deleted file mode 100644
index 095e8867..00000000
--- a/miniprogram/packageAPI/pages/media/audio/audio.wxml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/media/audio/audio.wxss b/miniprogram/packageAPI/pages/media/audio/audio.wxss
deleted file mode 100644
index d91c242b..00000000
--- a/miniprogram/packageAPI/pages/media/audio/audio.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* miniprogram/packageAPI/pages/media/audio/audio.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/media/background-audio/background-audio.js b/miniprogram/packageAPI/pages/media/background-audio/background-audio.js
deleted file mode 100644
index baa13d2f..00000000
--- a/miniprogram/packageAPI/pages/media/background-audio/background-audio.js
+++ /dev/null
@@ -1,144 +0,0 @@
-// const app = getApp()
-const util = require('../../../../util/util.js')
-
-const backgroundAudioManager = wx.getBackgroundAudioManager()
-let updateInterval
-let draging
-
-Page({
- onShareAppMessage() {
- return {
- title: '背景音乐',
- path: 'packageAPI/pages/media/background-audio/background-audio'
- }
- },
- onShow() {
- if (!backgroundAudioManager.paused && backgroundAudioManager.paused !== undefined) {
- this._enableInterval()
- this.setData({
- playing: true
- })
- }
- },
-
- data: {
- theme: 'light',
- 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'
- })
- }
- },
-
- drag(e) {
- draging = true
- },
-
- seek(e) {
- backgroundAudioManager.seek(e.detail.value)
- },
-
- pause() {
- clearInterval(updateInterval)
- backgroundAudioManager.pause()
- },
-
- stop() {
- clearInterval(updateInterval)
- backgroundAudioManager.stop()
- },
-
- _enableInterval() {
- const that = this
- function update() {
- if (!draging) {
- that.setData({
- playTime: backgroundAudioManager.currentTime + 1,
- formatedPlayTime: util.formatTime(backgroundAudioManager.currentTime + 1)
- })
- }
- }
- updateInterval = setInterval(update, 1000)
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- clearInterval(updateInterval)
- },
-
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- const that = this
- // 监听播放事件
- backgroundAudioManager.onPlay(() => {
- // 刷新播放时间
- that._enableInterval()
- that.setData({
- pause: false,
- })
- })
-
- // 监听暂停事件
- backgroundAudioManager.onPause(() => {
- clearInterval(updateInterval)
- that.setData({
- playing: false,
- pause: true,
- })
- })
-
- // 拖动到指定位置结束,恢复slider滚动
- backgroundAudioManager.onSeeked((res) => {
- draging = false
- })
-
- 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)
- })
- })
- },
-})
diff --git a/miniprogram/packageAPI/pages/media/background-audio/background-audio.json b/miniprogram/packageAPI/pages/media/background-audio/background-audio.json
deleted file mode 100644
index 2fc0d44a..00000000
--- a/miniprogram/packageAPI/pages/media/background-audio/background-audio.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "背景音频"
-}
diff --git a/miniprogram/packageAPI/pages/media/background-audio/background-audio.wxml b/miniprogram/packageAPI/pages/media/background-audio/background-audio.wxml
deleted file mode 100644
index 353af771..00000000
--- a/miniprogram/packageAPI/pages/media/background-audio/background-audio.wxml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
- {{formatedPlayTime}}
-
-
- 00:00
- 04:29
-
-
- 注意:离开当前页面后背景音乐将保持播放,但退出小程序将停止
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/media/background-audio/background-audio.wxss b/miniprogram/packageAPI/pages/media/background-audio/background-audio.wxss
deleted file mode 100644
index 3a23dd19..00000000
--- a/miniprogram/packageAPI/pages/media/background-audio/background-audio.wxss
+++ /dev/null
@@ -1,35 +0,0 @@
-image {
- width: 75px;
- height: 75px;
-}
-
-.page-body-wrapper {
- margin-top: 0;
-}
-.page-body-info {
- padding-bottom: 25px;
-}
-.time-big {
- font-size: 30px;
- margin: 10px;
-}
-.slider {
- width: 90%;
-}
-.play-time {
- font-size: 14px;
- width: 350px;
- padding: 10px 0;
- display: flex;
- justify-content: space-between;
- box-sizing: border-box;
-}
-.page-body-buttons {
- display: flex;
- justify-content: space-around;
- margin-top: 50px;
-}
-.page-body-button {
- width: 225px;
- text-align: center;
-}
diff --git a/miniprogram/packageAPI/pages/media/file/file.js b/miniprogram/packageAPI/pages/media/file/file.js
deleted file mode 100644
index 162c4a2c..00000000
--- a/miniprogram/packageAPI/pages/media/file/file.js
+++ /dev/null
@@ -1,75 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '文件',
- path: 'packageAPI/pages/media/file/file'
- }
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- this.setData({
- savedFilePath: wx.getStorageSync('savedFilePath')
- })
- },
- data: {
- theme: 'light',
- tempFilePath: '',
- savedFilePath: ''
- },
- chooseImage() {
- const that = this
- wx.chooseImage({
- count: 1,
- success(res) {
- that.setData({
- tempFilePath: res.tempFilePaths[0]
- })
- }
- })
- },
- saveFile() {
- if (this.data.tempFilePath.length > 0) {
- const that = this
- wx.saveFile({
- tempFilePath: this.data.tempFilePath,
- success(res) {
- that.setData({
- savedFilePath: res.savedFilePath
- })
- wx.setStorageSync('savedFilePath', res.savedFilePath)
- wx.showModal({
- title: '保存成功',
- content: '下次进入应用时,此文件仍可用',
- })
- },
- fail() {
- wx.showModal({
- title: '保存失败',
- content: '应该是有 bug 吧',
- })
- }
- })
- }
- },
- clear() {
- wx.setStorageSync('savedFilePath', '')
- this.setData({
- tempFilePath: '',
- savedFilePath: ''
- })
- }
-})
diff --git a/miniprogram/packageAPI/pages/media/file/file.json b/miniprogram/packageAPI/pages/media/file/file.json
deleted file mode 100644
index d9451c1f..00000000
--- a/miniprogram/packageAPI/pages/media/file/file.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "文件"
-}
diff --git a/miniprogram/packageAPI/pages/media/file/file.wxml b/miniprogram/packageAPI/pages/media/file/file.wxml
deleted file mode 100644
index d53d8a05..00000000
--- a/miniprogram/packageAPI/pages/media/file/file.wxml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 请选择文件
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/media/file/file.wxss b/miniprogram/packageAPI/pages/media/file/file.wxss
deleted file mode 100644
index 94958cb4..00000000
--- a/miniprogram/packageAPI/pages/media/file/file.wxss
+++ /dev/null
@@ -1,14 +0,0 @@
-.image {
- width: 100%;
- height: 330px;
-}
-.page-body-info {
- display: flex;
- box-sizing: border-box;
- padding: 15px;
- height: 410px;
- border-top: 1px solid var(--weui-FG-3);
- border-bottom: 1px solid var(--weui-FG-3);
- align-items: center;
- justify-content: center;
-}
diff --git a/miniprogram/packageAPI/pages/media/image/image.js b/miniprogram/packageAPI/pages/media/image/image.js
deleted file mode 100644
index 8abae70a..00000000
--- a/miniprogram/packageAPI/pages/media/image/image.js
+++ /dev/null
@@ -1,77 +0,0 @@
-const sourceType = [['camera'], ['album'], ['camera', 'album']]
-const sizeType = [['compressed'], ['original'], ['compressed', 'original']]
-
-Page({
- onShareAppMessage() {
- return {
- title: '图片',
- path: 'packageAPI/pages/media/image/image'
- }
- },
-
- data: {
- theme: 'light',
- imageList: [],
- sourceTypeIndex: 2,
- sourceType: ['拍照', '相册', '拍照或相册'],
-
- sizeTypeIndex: 2,
- sizeType: ['压缩', '原图', '压缩或原图'],
-
- countIndex: 8,
- count: [1, 2, 3, 4, 5, 6, 7, 8, 9]
- },
- sourceTypeChange(e) {
- this.setData({
- sourceTypeIndex: e.detail.value
- })
- },
- sizeTypeChange(e) {
- this.setData({
- sizeTypeIndex: e.detail.value
- })
- },
- countChange(e) {
- this.setData({
- countIndex: e.detail.value
- })
- },
- chooseImage() {
- const that = this
- wx.chooseImage({
- sourceType: sourceType[this.data.sourceTypeIndex],
- sizeType: sizeType[this.data.sizeTypeIndex],
- count: this.data.count[this.data.countIndex],
- success(res) {
- console.log(res)
- that.setData({
- imageList: res.tempFilePaths
- })
- }
- })
- },
- previewImage(e) {
- const current = e.target.dataset.src
-
- wx.previewImage({
- current,
- urls: this.data.imageList
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/media/image/image.json b/miniprogram/packageAPI/pages/media/image/image.json
deleted file mode 100644
index daddc06c..00000000
--- a/miniprogram/packageAPI/pages/media/image/image.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "图片"
-}
diff --git a/miniprogram/packageAPI/pages/media/image/image.wxml b/miniprogram/packageAPI/pages/media/image/image.wxml
deleted file mode 100644
index 4f93f8d6..00000000
--- a/miniprogram/packageAPI/pages/media/image/image.wxml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/media/image/image.wxss b/miniprogram/packageAPI/pages/media/image/image.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.js b/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.js
deleted file mode 100644
index c0d11c90..00000000
--- a/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.js
+++ /dev/null
@@ -1,56 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '动态加载字体',
- path: 'packageAPI/pages/media/load-font-face/load-font-face'
- }
- },
-
- data: {
- theme: 'light',
- fontFamily: 'Bitstream Vera Serif Bold',
- loaded: false,
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- this.setData({
- loaded: false
- })
- },
-
- loadFontFace() {
- const self = this
- wx.loadFontFace({
- family: this.data.fontFamily,
- source: 'url("https://sungd.github.io/Pacifico.ttf")',
- success(res) {
- console.log(res.status)
- self.setData({ loaded: true })
- },
- fail(res) {
- console.log(res.status)
- },
- complete(res) {
- console.log(res.status)
- }
- })
- },
-
- clear() {
- this.setData({ loaded: false })
- }
-})
diff --git a/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.json b/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.json
deleted file mode 100644
index 60e30e2c..00000000
--- a/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "动态加载字体"
-}
diff --git a/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.wxml b/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.wxml
deleted file mode 100644
index 217e3f7f..00000000
--- a/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.wxml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
- Load {{ fontFamily }}
- {{ fontFamily }} is loaded
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.wxss b/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.wxss
deleted file mode 100644
index 58bc00f4..00000000
--- a/miniprogram/packageAPI/pages/media/load-font-face/load-font-face.wxss
+++ /dev/null
@@ -1,12 +0,0 @@
-.page-body-info {
- align-items: center;
- padding: 100px 0;
-}
-
-.font-loaded {
- font-family: "Bitstream Vera Serif Bold";
-}
-
-.display-area {
- font-size: 20px;
-}
diff --git a/miniprogram/packageAPI/pages/media/media-container/media-container.js b/miniprogram/packageAPI/pages/media/media-container/media-container.js
deleted file mode 100644
index 6982e0ad..00000000
--- a/miniprogram/packageAPI/pages/media/media-container/media-container.js
+++ /dev/null
@@ -1,100 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '音视频合成',
- path: 'packageAPI/pages/media/media-container/media-container'
- }
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- const canIUse = wx.canIUse('wx.createMediaContainer()')
- if (canIUse) {
- this.mediaContainer = wx.createMediaContainer()
- } else {
- this.setData({
- canIUse: false,
- })
- wx.showModal({
- title: '微信版本过低,暂不支持本功能',
- })
- }
- },
- data: {
- theme: 'light',
- 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
- })
- }
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/media/media-container/media-container.json b/miniprogram/packageAPI/pages/media/media-container/media-container.json
deleted file mode 100644
index 9c8b2fad..00000000
--- a/miniprogram/packageAPI/pages/media/media-container/media-container.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "音视频合成"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/media/media-container/media-container.wxml b/miniprogram/packageAPI/pages/media/media-container/media-container.wxml
deleted file mode 100644
index 43b62750..00000000
--- a/miniprogram/packageAPI/pages/media/media-container/media-container.wxml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
- 源视频
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 合成视频
-
-
- 合成视频轨道为:源视频1视频轨道 + 源视频2音频轨道
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/media/media-container/media-container.wxss b/miniprogram/packageAPI/pages/media/media-container/media-container.wxss
deleted file mode 100644
index 94f2ddba..00000000
--- a/miniprogram/packageAPI/pages/media/media-container/media-container.wxss
+++ /dev/null
@@ -1,5 +0,0 @@
-.page-section {
- display: flex;
- flex-direction: column;
- align-items: center;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/media/video/video.js b/miniprogram/packageAPI/pages/media/video/video.js
deleted file mode 100644
index c289d1fd..00000000
--- a/miniprogram/packageAPI/pages/media/video/video.js
+++ /dev/null
@@ -1,74 +0,0 @@
-const sourceType = [['camera'], ['album'], ['camera', 'album']]
-const camera = [['front'], ['back'], ['front', 'back']]
-
-// eslint-disable-next-line
-const duration = Array.apply(null, {length: 60}).map(function (n, i) {
- return i + 1
-})
-
-Page({
- onShareAppMessage() {
- return {
- title: '拍摄/选择视频',
- path: 'packageAPI/pages/media/video/video'
- }
- },
-
- data: {
- theme: 'light',
- sourceTypeIndex: 2,
- sourceType: ['拍摄', '相册', '拍摄或相册'],
-
- cameraIndex: 2,
- camera: ['前置', '后置', '前置或后置'],
-
- durationIndex: 59,
- duration: duration.map((t) => `${t}秒`),
-
- src: ''
- },
- sourceTypeChange(e) {
- this.setData({
- sourceTypeIndex: e.detail.value
- })
- },
- cameraChange(e) {
- this.setData({
- cameraIndex: e.detail.value
- })
- },
- durationChange(e) {
- this.setData({
- durationIndex: e.detail.value
- })
- },
- chooseVideo() {
- const that = this
- wx.chooseVideo({
- sourceType: sourceType[this.data.sourceTypeIndex],
- camera: camera[this.data.cameraIndex],
- maxDuration: duration[this.data.durationIndex],
- success(res) {
- that.setData({
- src: res.tempFilePath
- })
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/media/video/video.json b/miniprogram/packageAPI/pages/media/video/video.json
deleted file mode 100644
index a1dcb7ad..00000000
--- a/miniprogram/packageAPI/pages/media/video/video.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "拍摄/选择视频"
-}
diff --git a/miniprogram/packageAPI/pages/media/video/video.wxml b/miniprogram/packageAPI/pages/media/video/video.wxml
deleted file mode 100644
index 36368a06..00000000
--- a/miniprogram/packageAPI/pages/media/video/video.wxml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 视频来源
-
-
-
- {{sourceType[sourceTypeIndex]}}
-
-
-
-
-
- 摄像头
-
-
-
- {{camera[cameraIndex]}}
-
-
-
-
-
- 拍摄长度
-
-
-
- {{duration[durationIndex]}}
-
-
-
-
-
-
-
-
-
-
-
- 添加视频
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/media/video/video.wxss b/miniprogram/packageAPI/pages/media/video/video.wxss
deleted file mode 100644
index 715c2f4f..00000000
--- a/miniprogram/packageAPI/pages/media/video/video.wxss
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-.page-body-info {
- display: flex;
- margin-top: 20px;
- padding: 0;
- height: 330px;
- border-top: 1px solid var(--weui-FG-3);
- border-bottom: 1px solid var(--weui-FG-3);
- align-items: center;
- justify-content: center;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/media/voice/voice.js b/miniprogram/packageAPI/pages/media/voice/voice.js
deleted file mode 100644
index 6ed6c45f..00000000
--- a/miniprogram/packageAPI/pages/media/voice/voice.js
+++ /dev/null
@@ -1,174 +0,0 @@
-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/media/voice/voice'
- }
- },
- data: {
- theme: 'light',
- 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()
- }
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- const that = this
- // 监听录音开始事件
- recorderManager.onStart(() => {
- console.log('recorderManage: onStart')
- // 录音时长记录 每秒刷新
- recordTimeInterval = setInterval(() => {
- that.data.recordTime += 1
- const recordTime = that.data.recordTime
- 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/packageAPI/pages/media/voice/voice.json b/miniprogram/packageAPI/pages/media/voice/voice.json
deleted file mode 100644
index 1b43cd0d..00000000
--- a/miniprogram/packageAPI/pages/media/voice/voice.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "录音"
-}
diff --git a/miniprogram/packageAPI/pages/media/voice/voice.wxml b/miniprogram/packageAPI/pages/media/voice/voice.wxml
deleted file mode 100644
index fc2bd063..00000000
--- a/miniprogram/packageAPI/pages/media/voice/voice.wxml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- {{formatedRecordTime}}
-
-
-
-
-
-
-
-
-
-
-
-
- {{formatedRecordTime}}
-
-
-
-
-
-
-
-
-
-
-
-
- {{formatedPlayTime}}
- {{formatedRecordTime}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{formatedPlayTime}}
- {{formatedRecordTime}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/media/voice/voice.wxss b/miniprogram/packageAPI/pages/media/voice/voice.wxss
deleted file mode 100644
index 7ff6b337..00000000
--- a/miniprogram/packageAPI/pages/media/voice/voice.wxss
+++ /dev/null
@@ -1,40 +0,0 @@
-image {
- width: 75px;
- height: 75px;
-}
-
-.page-body-wrapper {
- justify-content: space-between;
- flex-grow: 1;
- margin-bottom: 150px;
-}
-.page-body-time {
- display: flex;
- flex-direction: column;
- align-items: center;
-}
-.time-big {
- font-size: 30px;
- margin: 10px;
-}
-.time-small {
- font-size: 15px;
-}
-
-.page-body-buttons {
- margin-top: 30px;
- display: flex;
- justify-content: space-around;
-}
-.page-body-button {
- width: 225px;
- text-align: center;
-}
-.button-stop-record {
- width: 15px;
- height: 15px;
- border: 10px solid #fff;
- background-color: #f55c23;
- border-radius: 115px;
- margin: 0 auto;
-}
diff --git a/miniprogram/packageAPI/pages/network/download-file/download-file.js b/miniprogram/packageAPI/pages/network/download-file/download-file.js
deleted file mode 100644
index 5eecd142..00000000
--- a/miniprogram/packageAPI/pages/network/download-file/download-file.js
+++ /dev/null
@@ -1,42 +0,0 @@
-const demoImageFileId = require('../../../../config').demoImageFileId
-
-Page({
- onShareAppMessage() {
- return {
- title: '下载文件',
- path: 'packageAPI/pages/network/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
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/network/download-file/download-file.json b/miniprogram/packageAPI/pages/network/download-file/download-file.json
deleted file mode 100644
index 09ae91ff..00000000
--- a/miniprogram/packageAPI/pages/network/download-file/download-file.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "下载文件"
-}
diff --git a/miniprogram/packageAPI/pages/network/download-file/download-file.wxml b/miniprogram/packageAPI/pages/network/download-file/download-file.wxml
deleted file mode 100644
index fadc8aec..00000000
--- a/miniprogram/packageAPI/pages/network/download-file/download-file.wxml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 点击按钮下载服务端示例图片
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/network/download-file/download-file.wxss b/miniprogram/packageAPI/pages/network/download-file/download-file.wxss
deleted file mode 100644
index 2f1d16f3..00000000
--- a/miniprogram/packageAPI/pages/network/download-file/download-file.wxss
+++ /dev/null
@@ -1,6 +0,0 @@
-.page-body image {
- width: 300px;
- height: 300px;
-
- margin: 0 38px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/network/mdns/mdns.js b/miniprogram/packageAPI/pages/network/mdns/mdns.js
deleted file mode 100644
index b85061c3..00000000
--- a/miniprogram/packageAPI/pages/network/mdns/mdns.js
+++ /dev/null
@@ -1,146 +0,0 @@
-// miniprogram/page/API/pages/mdns/mdns.js
-let serviceList = []
-let resolveFailList = []
-Page({
- onShareAppMessage() {
- return {
- title: 'mdns',
- path: 'packageAPI/pages/network/mdns/mdns'
- }
- },
- daga: {
- serviceList: [],
- resolveFailList: [],
- },
- onShow() {
- this.onLocalService()
- },
-
- startDiscovery() {
- wx.startLocalServiceDiscovery({
- serviceType: '_http._tcp.',
- success(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: () => {
- 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() {
- const that = this
-
- // 监听服务发现事件
- wx.onLocalServiceFound(function (obj) {
- console.log(obj)
- serviceList.push(obj)
-
- that.setData({
- serviceList,
- })
- })
-
- // 监听服务解析失败事件
- wx.onLocalServiceResolveFail(function (obj) {
- console.log(obj)
- resolveFailList.push(obj)
- that.setData({
- resolveFailList
- })
- })
-
- // 监听服务离开
- wx.onLocalServiceLost(function (obj) {
- console.log(obj)
- })
-
- // 监听搜索停止
- wx.onLocalServiceDiscoveryStop(function () {
- 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 服务停止搜索的事件 成功')
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/network/mdns/mdns.json b/miniprogram/packageAPI/pages/network/mdns/mdns.json
deleted file mode 100644
index 886614ab..00000000
--- a/miniprogram/packageAPI/pages/network/mdns/mdns.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "mDNS"
-
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/network/mdns/mdns.wxml b/miniprogram/packageAPI/pages/network/mdns/mdns.wxml
deleted file mode 100644
index c4873043..00000000
--- a/miniprogram/packageAPI/pages/network/mdns/mdns.wxml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 设备服务名:{{item.serviceName}}
- ip地址:{{item.ip}}:{{item.port}}
- 当前服务类型:{{item.serviceType}}
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/network/mdns/mdns.wxss b/miniprogram/packageAPI/pages/network/mdns/mdns.wxss
deleted file mode 100644
index 46004371..00000000
--- a/miniprogram/packageAPI/pages/network/mdns/mdns.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* miniprogram/page/API/pages/mdns/mdns.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/network/request/request.js b/miniprogram/packageAPI/pages/network/request/request.js
deleted file mode 100644
index 5c228338..00000000
--- a/miniprogram/packageAPI/pages/network/request/request.js
+++ /dev/null
@@ -1,63 +0,0 @@
-const requestUrl = require('../../../../config').requestUrl
-
-const duration = 2000
-
-Page({
- onShareAppMessage() {
- return {
- title: '网络请求',
- path: 'packageAPI/pages/network/request/request'
- }
- },
-
- makeRequest() {
- const self = this
-
- self.setData({
- loading: true
- })
-
- wx.request({
- url: requestUrl,
- data: {
- theme: 'light',
- noncestr: Date.now()
- },
- success(result) {
- wx.showToast({
- title: '请求成功',
- icon: 'success',
- mask: true,
- duration,
- })
- self.setData({
- loading: false
- })
- console.log('request success', result)
- },
-
- fail({ errMsg }) {
- console.log('request fail', errMsg)
- self.setData({
- loading: false
- })
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/network/request/request.json b/miniprogram/packageAPI/pages/network/request/request.json
deleted file mode 100644
index 8868d3d5..00000000
--- a/miniprogram/packageAPI/pages/network/request/request.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "网络请求"
-}
diff --git a/miniprogram/packageAPI/pages/network/request/request.wxml b/miniprogram/packageAPI/pages/network/request/request.wxml
deleted file mode 100644
index 9b409e9a..00000000
--- a/miniprogram/packageAPI/pages/network/request/request.wxml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
- 点击向服务器发起请求
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/network/request/request.wxss b/miniprogram/packageAPI/pages/network/request/request.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/network/udp-socket/udp-socket.js b/miniprogram/packageAPI/pages/network/udp-socket/udp-socket.js
deleted file mode 100644
index df518b85..00000000
--- a/miniprogram/packageAPI/pages/network/udp-socket/udp-socket.js
+++ /dev/null
@@ -1,103 +0,0 @@
-const AB2String = (arrayBuffer) => {
- const unit8Arr = new Uint8Array(arrayBuffer)
- const encodedString = String.fromCharCode.apply(null, unit8Arr)
- const decodedString = decodeURIComponent(escape((encodedString)))// 没有这一步中文会乱码
- return decodedString
-}
-
-Page({
- onShareAppMessage() {
- return {
- title: 'UDPSocket',
- path: 'packageAPI/pages/network/udp-socket/udp-socket'
- }
- },
- data: {
- theme: 'light',
- port: undefined,
- remote_port: undefined,
- startUDP: false,
- mode: 'local',
- address: 'localhost',
- canIUse: true,
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- 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!`,
- })
- },
-
-})
diff --git a/miniprogram/packageAPI/pages/network/udp-socket/udp-socket.json b/miniprogram/packageAPI/pages/network/udp-socket/udp-socket.json
deleted file mode 100644
index 085b5f7d..00000000
--- a/miniprogram/packageAPI/pages/network/udp-socket/udp-socket.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "UDPSocket"
-
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/network/udp-socket/udp-socket.wxml b/miniprogram/packageAPI/pages/network/udp-socket/udp-socket.wxml
deleted file mode 100644
index 0be02687..00000000
--- a/miniprogram/packageAPI/pages/network/udp-socket/udp-socket.wxml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-
- 本机port: {{port}} 模拟远程port: {{remote_port}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/network/udp-socket/udp-socket.wxss b/miniprogram/packageAPI/pages/network/udp-socket/udp-socket.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/network/upload-file/upload-file.js b/miniprogram/packageAPI/pages/network/upload-file/upload-file.js
deleted file mode 100644
index 4f7f401f..00000000
--- a/miniprogram/packageAPI/pages/network/upload-file/upload-file.js
+++ /dev/null
@@ -1,84 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '上传文件',
- path: 'packageAPI/pages/network/upload-file/upload-file'
- }
- },
-
- chooseImage() {
- const self = this
-
- wx.chooseImage({
- count: 1,
- sizeType: ['compressed'],
- sourceType: ['album'],
- async success(res) {
- const imageSrc = res.tempFilePaths[0]
- const r = await wx.cloud.callFunction({
- name: 'login',
- data: {
- action: 'openid'
- },
- })
- const openId = r.result.openid
- const cloudPath = `upload/${openId}.png`
- wx.cloud.uploadFile({
- cloudPath, // 上传至云端的路径
- filePath: imageSrc, // 小程序临时文件路径
- config: {
- env: 'release-b86096'
- },
- success: res => {
- // 返回文件 ID
- console.log(res.fileID)
- console.log('uploadImage success, res is:', res)
- wx.showToast({
- title: '上传成功',
- icon: 'success',
- duration: 1000
- })
-
- self.setData({
- imageSrc,
- fileID: res.fileID,
- })
- },
- fail({ errMsg }) {
- console.log('uploadImage fail, errMsg 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]
- })
- }
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/network/upload-file/upload-file.json b/miniprogram/packageAPI/pages/network/upload-file/upload-file.json
deleted file mode 100644
index ce5fd519..00000000
--- a/miniprogram/packageAPI/pages/network/upload-file/upload-file.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "上传文件"
-}
diff --git a/miniprogram/packageAPI/pages/network/upload-file/upload-file.wxml b/miniprogram/packageAPI/pages/network/upload-file/upload-file.wxml
deleted file mode 100644
index 5f651c49..00000000
--- a/miniprogram/packageAPI/pages/network/upload-file/upload-file.wxml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 选择图片
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/network/upload-file/upload-file.wxss b/miniprogram/packageAPI/pages/network/upload-file/upload-file.wxss
deleted file mode 100644
index 94958cb4..00000000
--- a/miniprogram/packageAPI/pages/network/upload-file/upload-file.wxss
+++ /dev/null
@@ -1,14 +0,0 @@
-.image {
- width: 100%;
- height: 330px;
-}
-.page-body-info {
- display: flex;
- box-sizing: border-box;
- padding: 15px;
- height: 410px;
- border-top: 1px solid var(--weui-FG-3);
- border-bottom: 1px solid var(--weui-FG-3);
- align-items: center;
- justify-content: center;
-}
diff --git a/miniprogram/packageAPI/pages/network/web-socket/web-socket.js b/miniprogram/packageAPI/pages/network/web-socket/web-socket.js
deleted file mode 100644
index e40a991a..00000000
--- a/miniprogram/packageAPI/pages/network/web-socket/web-socket.js
+++ /dev/null
@@ -1,134 +0,0 @@
-function showModal(title, content) {
- wx.showModal({
- title,
- content,
- showCancel: false
- })
-}
-
-function showSuccess(title) {
- wx.showToast({
- title,
- icon: 'success',
- duration: 1000
- })
-}
-
-Page({
- onShareAppMessage() {
- return {
- title: 'Web Socket',
- path: 'packageAPI/pages/network/web-socket/web-socket'
- }
- },
-
- data: {
- theme: 'light',
- socketStatus: 'closed'
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- this.closeSocket()
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- const self = this
- self.setData({
- hasLogin: true
- })
- // qcloud.setLoginUrl(loginUrl)
-
- // qcloud.login({
- // success: function(result) {
- // console.log('登录成功', result)
- // self.setData({
- // hasLogin: true
- // })
- // },
-
- // fail: function(error) {
- // console.log('登录失败', error)
- // }
- // })
- },
-
- toggleSocket(e) {
- const turnedOn = e.detail.value
-
- if (turnedOn && this.data.socketStatus === 'closed') {
- this.openSocket()
- } else if (!turnedOn && this.data.socketStatus === 'connected') {
- const showSuccess = true
- this.closeSocket(showSuccess)
- }
- },
-
- openSocket() {
- // var socket = this.socket = new qcloud.Tunnel(tunnelUrl)
-
- wx.onSocketOpen(() => {
- console.log('WebSocket 已连接')
- showSuccess('Socket已连接')
- this.setData({
- socketStatus: 'connected'
- })
- })
-
- wx.onSocketClose(() => {
- console.log('WebSocket 已断开')
- this.setData({ socketStatus: 'closed' })
- })
-
- wx.onSocketError(error => {
- showModal('发生错误', JSON.stringify(error))
- console.error('socket error:', error)
- this.setData({
- loading: false
- })
- })
-
- // 监听服务器推送消息
- wx.onSocketMessage(message => {
- showSuccess('收到信道消息')
- console.log('socket message:', message)
- this.setData({
- loading: false
- })
- })
-
- // 打开信道
- wx.connectSocket({
- url: 'wss://echo.websocket.org',
- })
- },
-
- closeSocket() {
- if (this.data.socketStatus === 'connected') {
- wx.closeSocket({
- success: () => {
- showSuccess('Socket已断开')
- this.setData({ socketStatus: 'closed' })
- }
- })
- }
- },
-
- sendMessage() {
- if (this.data.socketStatus === 'connected') {
- wx.sendSocketMessage({
- data: 'Hello, Miniprogram!'
- })
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/network/web-socket/web-socket.json b/miniprogram/packageAPI/pages/network/web-socket/web-socket.json
deleted file mode 100644
index a1fd2d4f..00000000
--- a/miniprogram/packageAPI/pages/network/web-socket/web-socket.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "Web Socket"
-}
diff --git a/miniprogram/packageAPI/pages/network/web-socket/web-socket.wxml b/miniprogram/packageAPI/pages/network/web-socket/web-socket.wxml
deleted file mode 100644
index eb7bb690..00000000
--- a/miniprogram/packageAPI/pages/network/web-socket/web-socket.wxml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- Socket状态
-
-
-
-
-
- 消息
-
- Hello, 小程序!
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/network/web-socket/web-socket.wxss b/miniprogram/packageAPI/pages/network/web-socket/web-socket.wxss
deleted file mode 100644
index 8b137891..00000000
--- a/miniprogram/packageAPI/pages/network/web-socket/web-socket.wxss
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/miniprogram/packageAPI/pages/nouse/custom-service/custom-service.js b/miniprogram/packageAPI/pages/nouse/custom-service/custom-service.js
deleted file mode 100644
index 39d6da7c..00000000
--- a/miniprogram/packageAPI/pages/nouse/custom-service/custom-service.js
+++ /dev/null
@@ -1,8 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '联系客服',
- path: 'packageAPI/pages/custom-service/custom-service'
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/nouse/custom-service/custom-service.json b/miniprogram/packageAPI/pages/nouse/custom-service/custom-service.json
deleted file mode 100644
index 1ada9491..00000000
--- a/miniprogram/packageAPI/pages/nouse/custom-service/custom-service.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "navigationBarTitleText": "客服消息"
-}
diff --git a/miniprogram/packageAPI/pages/nouse/custom-service/custom-service.wxml b/miniprogram/packageAPI/pages/nouse/custom-service/custom-service.wxml
deleted file mode 100644
index 7aa99a22..00000000
--- a/miniprogram/packageAPI/pages/nouse/custom-service/custom-service.wxml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/nouse/custom-service/custom-service.wxss b/miniprogram/packageAPI/pages/nouse/custom-service/custom-service.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.js b/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.js
deleted file mode 100644
index 67a2a8ce..00000000
--- a/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.js
+++ /dev/null
@@ -1,8 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '小程序接口文档',
- path: 'packageAPI/pages/doc-web-view/doc-web-view'
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.json b/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.json
deleted file mode 100644
index d093eedb..00000000
--- a/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "navigationBarTitleText": "小程序接口文档"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.wxml b/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.wxml
deleted file mode 100644
index cbc5a5c5..00000000
--- a/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.wxml
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.wxss b/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.wxss
deleted file mode 100644
index 7f40b79e..00000000
--- a/miniprogram/packageAPI/pages/nouse/doc-web-view/doc-web-view.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* miniprogram/page/API/pages/doc-web-view/doc-web-view.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/nouse/sendMessage/sendMessage.js b/miniprogram/packageAPI/pages/nouse/sendMessage/sendMessage.js
deleted file mode 100644
index 1d492d07..00000000
--- a/miniprogram/packageAPI/pages/nouse/sendMessage/sendMessage.js
+++ /dev/null
@@ -1,8 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'sendMessage',
- path: 'packageAPI/pages/sendMessage/sendMessage'
- }
- },
-})
diff --git a/miniprogram/packageAPI/pages/nouse/sendMessage/sendMessage.json b/miniprogram/packageAPI/pages/nouse/sendMessage/sendMessage.json
deleted file mode 100644
index 62ba68a1..00000000
--- a/miniprogram/packageAPI/pages/nouse/sendMessage/sendMessage.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "navigationBarTitleText": "发送模板消息"
-}
diff --git a/miniprogram/packageAPI/pages/nouse/sendMessage/sendMessage.wxml b/miniprogram/packageAPI/pages/nouse/sendMessage/sendMessage.wxml
deleted file mode 100644
index 1b85dd50..00000000
--- a/miniprogram/packageAPI/pages/nouse/sendMessage/sendMessage.wxml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
- 发送内容(以下字段可自由适配)
-
-
-
- 实例字段
-
-
-
-
-
-
-
- 实例字段
-
-
-
-
-
-
-
-
-
-
- 跳转链接
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/nouse/sendMessage/sendMessage.wxss b/miniprogram/packageAPI/pages/nouse/sendMessage/sendMessage.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.js b/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.js
deleted file mode 100644
index 0d85ba4d..00000000
--- a/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.js
+++ /dev/null
@@ -1,33 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '操作菜单',
- path: 'packageAPI/pages/page/action-sheet/action-sheet'
- }
- },
-
- actionSheetTap() {
- wx.showActionSheet({
- itemList: ['item1', 'item2', 'item3', 'item4'],
- success(e) {
- console.log(e.tapIndex)
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.json b/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.json
deleted file mode 100644
index 31e2d89e..00000000
--- a/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "操作菜单"
-}
diff --git a/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.wxml b/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.wxml
deleted file mode 100644
index 33aacc3b..00000000
--- a/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.wxml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.wxss b/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.wxss
deleted file mode 100644
index 7298bb3f..00000000
--- a/miniprogram/packageAPI/pages/page/action-sheet/action-sheet.wxss
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
-.cancel {
- color: white;
- background: #303F9F;
-}
-.item {
- color: black;
- background: #C5CAE9;
-}*/
diff --git a/miniprogram/packageAPI/pages/page/animation/animation.js b/miniprogram/packageAPI/pages/page/animation/animation.js
deleted file mode 100644
index 19615dae..00000000
--- a/miniprogram/packageAPI/pages/page/animation/animation.js
+++ /dev/null
@@ -1,64 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '动画',
- path: 'packageAPI/pages/page/animation/animation',
- containerStyle1: '',
-
- }
- },
- data: {
- theme: 'light',
- canIUse: true,
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- const canIUse = this.animate !== undefined
- if (!canIUse) {
- wx.showModal({
- title: '微信版本过低,暂不支持本功能',
- })
- this.setData({
- canIUse,
- })
- }
- },
-
- change() {
- 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/packageAPI/pages/page/animation/animation.json b/miniprogram/packageAPI/pages/page/animation/animation.json
deleted file mode 100644
index 4ef1f6aa..00000000
--- a/miniprogram/packageAPI/pages/page/animation/animation.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "动画"
-}
diff --git a/miniprogram/packageAPI/pages/page/animation/animation.wxml b/miniprogram/packageAPI/pages/page/animation/animation.wxml
deleted file mode 100644
index 6c017c04..00000000
--- a/miniprogram/packageAPI/pages/page/animation/animation.wxml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
- 关键帧动画\n\n从小程序基础库 2.9.0 开始支持一种更友好的动画创建方式,用于代替旧的 wx.createAnimation
-
-
-
- 示例超链接
- 示例文本
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/animation/animation.wxss b/miniprogram/packageAPI/pages/page/animation/animation.wxss
deleted file mode 100644
index 1cfc28fa..00000000
--- a/miniprogram/packageAPI/pages/page/animation/animation.wxss
+++ /dev/null
@@ -1,35 +0,0 @@
-.animation-element-wrapper {
- display: flex;
- width: 100%;
- padding-top: 75px;
- padding-bottom: 75px;
- justify-content: center;
- overflow: hidden;
- background-color: #ffffff;
-}
-.animation-element {
- width: 100px;
- height: 100px;
- background-color: #1AAD19;
-}
-.animation-buttons {
- padding: 15px 25px 5px;
- width: 100%;
- height: 330px;
- box-sizing: border-box;
-}
-.animation-button {
- float: left;
- line-height: 2;
- width: 150px;
- margin: 8px 11px;
-}
-
-.animation-button-reset {
- width: 610px;
-}
-
-.btn-row {
- display: flex;
- justify-content: space-between;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/page/canvas/canvas.js b/miniprogram/packageAPI/pages/page/canvas/canvas.js
deleted file mode 100644
index 59c563be..00000000
--- a/miniprogram/packageAPI/pages/page/canvas/canvas.js
+++ /dev/null
@@ -1,59 +0,0 @@
-const example = require('./example.js')
-
-Page({
- onShareAppMessage() {
- return {
- title: '创建画布',
- path: 'packageAPI/pages/page/canvas/canvas'
- }
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- this.context = wx.createContext()
-
- const methods = Object.keys(example)
- this.setData({
- methods
- })
-
- const that = this
- methods.forEach(function (method) {
- that[method] = function () {
- example[method](that.context)
- const actions = that.context.getActions()
-
- wx.drawCanvas({
- canvasId: 'canvas',
- actions
- })
- }
- })
- },
-
- toTempFilePath() {
- wx.canvasToTempFilePath({
- canvasId: 'canvas',
- success(res) {
- console.log(res)
- },
-
- fail(res) {
- console.log(res)
- }
- })
- }
-})
diff --git a/miniprogram/packageAPI/pages/page/canvas/canvas.json b/miniprogram/packageAPI/pages/page/canvas/canvas.json
deleted file mode 100644
index a4ed5897..00000000
--- a/miniprogram/packageAPI/pages/page/canvas/canvas.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "创建画布"
-}
diff --git a/miniprogram/packageAPI/pages/page/canvas/canvas.wxml b/miniprogram/packageAPI/pages/page/canvas/canvas.wxml
deleted file mode 100644
index c5518e00..00000000
--- a/miniprogram/packageAPI/pages/page/canvas/canvas.wxml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/canvas/canvas.wxss b/miniprogram/packageAPI/pages/page/canvas/canvas.wxss
deleted file mode 100644
index a389d5ea..00000000
--- a/miniprogram/packageAPI/pages/page/canvas/canvas.wxss
+++ /dev/null
@@ -1,21 +0,0 @@
-.canvas-element-wrapper {
- display: block;
- margin-bottom: 50px;
-}
-.canvas-element {
- width: 100%;
- height: 250px;
- background-color: #ffffff;
-}
-.canvas-buttons {
- padding: 15px 25px 5px;
- width: 100%;
- height: 330px;
- box-sizing: border-box;
-}
-.canvas-button {
- float: left;
- line-height: 2;
- width: 150px;
- margin: 8px 11px;
-}
diff --git a/miniprogram/packageAPI/pages/page/canvas/example.js b/miniprogram/packageAPI/pages/page/canvas/example.js
deleted file mode 100644
index d6fa27c0..00000000
--- a/miniprogram/packageAPI/pages/page/canvas/example.js
+++ /dev/null
@@ -1,286 +0,0 @@
-const example = {}
-
-example.rotate = function (context) {
- context.beginPath()
- context.rotate((10 * Math.PI) / 180)
- context.rect(225, 75, 20, 10)
- context.fill()
-}
-
-example.scale = function (context) {
- context.beginPath()
- context.rect(25, 25, 50, 50)
- context.stroke()
-
- context.scale(2, 2)
-
- context.beginPath()
- context.rect(25, 25, 50, 50)
- context.stroke()
-}
-
-example.reset = function (context) {
- context.beginPath()
-
- context.setFillStyle('#000000')
- context.setStrokeStyle('#000000')
- context.setFontSize(10)
-
- context.setShadow(0, 0, 0, 'rgba(0, 0, 0, 0)')
-
- context.setLineCap('butt')
- context.setLineJoin('miter')
- context.setLineWidth(1)
- context.setMiterLimit(10)
-}
-
-example.translate = function (context) {
- context.beginPath()
- context.rect(10, 10, 100, 50)
- context.fill()
-
- context.translate(70, 70)
-
- context.beginPath()
- context.fill()
-}
-
-example.save = function (context) {
- context.beginPath()
- context.setStrokeStyle('#00ff00')
- context.save()
-
- context.scale(2, 2)
- context.setStrokeStyle('#ff0000')
- context.rect(0, 0, 100, 100)
- context.stroke()
- context.restore()
-
- context.rect(0, 0, 50, 50)
- context.stroke()
-}
-
-example.restore = function (context) {
- [3, 2, 1].forEach(function (item) {
- context.beginPath()
- context.save()
- context.scale(item, item)
- context.rect(10, 10, 100, 100)
- context.stroke()
- context.restore()
- })
-}
-
-example.drawImage = function (context) {
- context.drawImage('/image/wechat.png', 0, 0)
-}
-
-example.fillText = function (context) {
- context.setStrokeStyle('#ff0000')
-
- context.beginPath()
- context.moveTo(0, 10)
- context.lineTo(300, 10)
- context.stroke()
-
- // context.save()
- // context.scale(1.5, 1.5)
- // context.translate(20, 20)
- context.setFontSize(10)
- context.fillText('Hello World', 0, 30)
- context.setFontSize(20)
- context.fillText('Hello World', 100, 30)
-
- // context.restore()
-
- context.beginPath()
- context.moveTo(0, 30)
- context.lineTo(300, 30)
- context.stroke()
-}
-
-example.fill = function (context) {
- context.beginPath()
- context.rect(20, 20, 150, 100)
- context.setStrokeStyle('#00ff00')
- context.fill()
-}
-
-example.stroke = function (context) {
- context.beginPath()
- context.moveTo(20, 20)
- context.lineTo(20, 100)
- context.lineTo(70, 100)
- context.setStrokeStyle('#00ff00')
- context.stroke()
-}
-
-example.clearRect = function (context) {
- context.setFillStyle('#ff0000')
- context.beginPath()
- context.rect(0, 0, 300, 150)
- context.fill()
- context.clearRect(20, 20, 100, 50)
-}
-
-example.beginPath = function (context) {
- context.beginPath()
- context.setLineWidth(5)
- context.setStrokeStyle('#ff0000')
- context.moveTo(0, 75)
- context.lineTo(250, 75)
- context.stroke()
-
- context.beginPath()
- context.setStrokeStyle('#0000ff')
- context.moveTo(50, 0)
- context.lineTo(150, 130)
- context.stroke()
-}
-
-example.closePath = function (context) {
- context.beginPath()
- context.moveTo(20, 20)
- context.lineTo(20, 100)
- context.lineTo(70, 100)
- context.closePath()
- context.stroke()
-}
-
-example.moveTo = function (context) {
- context.beginPath()
- context.moveTo(0, 0)
- context.lineTo(300, 150)
- context.stroke()
-}
-
-example.lineTo = function (context) {
- context.beginPath()
- context.moveTo(20, 20)
- context.lineTo(20, 100)
- context.lineTo(70, 100)
- context.stroke()
-}
-
-example.rect = function (context) {
- context.beginPath()
- context.rect(20, 20, 150, 100)
- context.stroke()
-}
-
-example.arc = function (context) {
- context.beginPath()
- context.arc(75, 75, 50, 0, Math.PI * 2, true)
- context.moveTo(110, 75)
- context.arc(75, 75, 35, 0, Math.PI, false)
- context.moveTo(65, 65)
- context.arc(60, 65, 5, 0, Math.PI * 2, true)
- context.moveTo(95, 65)
- context.arc(90, 65, 5, 0, Math.PI * 2, true)
- context.stroke()
-}
-
-example.quadraticCurveTo = function (context) {
- context.beginPath()
- context.moveTo(20, 20)
- context.quadraticCurveTo(20, 100, 200, 20)
- context.stroke()
-}
-
-example.bezierCurveTo = function (context) {
- context.beginPath()
- context.moveTo(20, 20)
- context.bezierCurveTo(20, 100, 200, 100, 200, 20)
- context.stroke()
-}
-
-example.setFillStyle = function (context) {
- ['#fef957', 'rgb(242,159,63)', 'rgb(242,117,63)', '#e87e51'].forEach(function (item, index) {
- context.setFillStyle(item)
- context.beginPath()
- context.rect(0 + 75 * index, 0, 50, 50)
- context.fill()
- })
-}
-
-example.setStrokeStyle = function (context) {
- ['#fef957', 'rgb(242,159,63)', 'rgb(242,117,63)', '#e87e51'].forEach(function (item, index) {
- context.setStrokeStyle(item)
- context.beginPath()
- context.rect(0 + 75 * index, 0, 50, 50)
- context.stroke()
- })
-}
-
-example.setGlobalAlpha = function (context) {
- context.setFillStyle('#000000');
- [1, 0.5, 0.1].forEach(function (item, index) {
- context.setGlobalAlpha(item)
- context.beginPath()
- context.rect(0 + 75 * index, 0, 50, 50)
- context.fill()
- })
-}
-
-example.setShadow = function (context) {
- context.beginPath()
- context.setShadow(10, 10, 10, 'rgba(0, 0, 0, 199)')
- context.rect(10, 10, 100, 100)
- context.fill()
-}
-
-example.setFontSize = function (context) {
- [10, 20, 30, 40].forEach(function (item, index) {
- context.setFontSize(item)
- context.fillText('Hello, world', 20, 20 + 40 * index)
- })
-}
-
-example.setLineCap = function (context) {
- context.setLineWidth(10);
- ['butt', 'round', 'square'].forEach(function (item, index) {
- context.beginPath()
- context.setLineCap(item)
- context.moveTo(20, 20 + 20 * index)
- context.lineTo(100, 20 + 20 * index)
- context.stroke()
- })
-}
-
-example.setLineJoin = function (context) {
- context.setLineWidth(10);
- ['bevel', 'round', 'miter'].forEach(function (item, index) {
- context.beginPath()
-
- context.setLineJoin(item)
- context.moveTo(20 + 80 * index, 20)
- context.lineTo(100 + 80 * index, 50)
- context.lineTo(20 + 80 * index, 100)
- context.stroke()
- })
-}
-
-example.setLineWidth = function (context) {
- [2, 4, 6, 8, 10].forEach(function (item, index) {
- context.beginPath()
- context.setLineWidth(item)
- context.moveTo(20, 20 + 20 * index)
- context.lineTo(100, 20 + 20 * index)
- context.stroke()
- })
-}
-
-example.setMiterLimit = function (context) {
- context.setLineWidth(4);
-
- [2, 4, 6, 8, 10].forEach(function (item, index) {
- context.beginPath()
- context.setMiterLimit(item)
- context.moveTo(20 + 80 * index, 20)
- context.lineTo(100 + 80 * index, 50)
- context.lineTo(20 + 80 * index, 100)
- context.stroke()
- })
-}
-
-module.exports = example
diff --git a/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.js b/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.js
deleted file mode 100644
index fa91ac6a..00000000
--- a/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.js
+++ /dev/null
@@ -1,56 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '获取WXML节点信息',
- path: 'packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info'
- }
- },
-
- data: {
- theme: 'light',
- metrics: []
- },
-
- onReady() {
- this.getNodeInfo()
- },
-
- getNodeInfo() {
- const $ = wx.createSelectorQuery()
- const target = $.select('.target')
- target.boundingClientRect()
-
- $.exec((res) => {
- const rect = res[0]
- if (rect) {
- const metrics = []
- // eslint-disable-next-line
- for (const key in rect) {
- if (key !== 'id' && key !== 'dataset') {
- const val = rect[key]
- metrics.push({ key, val })
- }
- }
-
- this.setData({ metrics })
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-
-})
diff --git a/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.json b/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.json
deleted file mode 100644
index 45108618..00000000
--- a/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "获取WXML节点信息"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.wxml b/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.wxml
deleted file mode 100644
index 2d65e847..00000000
--- a/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.wxml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- Drag
-
-
-
-
-
-
-
- {{ item.key }}
- {{ item.val }}
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.wxss b/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.wxss
deleted file mode 100644
index c1f5aad6..00000000
--- a/miniprogram/packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.wxss
+++ /dev/null
@@ -1,46 +0,0 @@
-movable-view {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 50px;
- width: 50px;
- background: #1AAD19;
- color: #fff;
-}
-
-movable-area {
- height: 200px;
- width: 200px;
- background-color: #ccc;
- overflow: hidden;
-}
-
-.page-section {
- display: flex;
- justify-content: center;
-}
-
-.page-body {
- display: flex;
- flex-direction: column;
- align-items: center;
-}
-
-.metric {
- width: 200px;
- display: flex;
- justify-content: center;
- flex-direction:column;
- align-items:center;
-}
-
-.b {
- display: inline-block;
- width: 75px;
- font-weight: bold;
-}
-
-.span {
- display: inline-block;
- width: 50px;
-}
diff --git a/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.js b/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.js
deleted file mode 100644
index b221dc60..00000000
--- a/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.js
+++ /dev/null
@@ -1,39 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'WXML节点布局相交状态',
- path: 'packageAPI/pages/page/intersection-observer/intersection-observer'
- }
- },
-
- data: {
- theme: 'light',
- appear: false
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- if (this._observer) this._observer.disconnect()
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- this._observer = wx.createIntersectionObserver(this)
- this._observer
- .relativeTo('.scroll-view')
- .observe('.ball', (res) => {
- console.log(res)
- this.setData({
- appear: res.intersectionRatio > 0
- })
- })
- }
-})
diff --git a/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.json b/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.json
deleted file mode 100644
index a581cdd9..00000000
--- a/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "WXML节点布局相交状态"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.wxml b/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.wxml
deleted file mode 100644
index edf33f42..00000000
--- a/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.wxml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
- 小球出现
-
-
- 小球消失
-
-
-
-
-
- 向下滚动让小球出现
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.wxss b/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.wxss
deleted file mode 100644
index 41e7ac1a..00000000
--- a/miniprogram/packageAPI/pages/page/intersection-observer/intersection-observer.wxss
+++ /dev/null
@@ -1,38 +0,0 @@
-.scroll-view {
- height: 200px;
- background: var(--weui-BG-2);
-}
-
-.scroll-area {
- height: 1150px;
- display: flex;
- flex-direction: column;
- align-items: center;
- transition: .5s;
-}
-
-.notice {
- margin-top: 75px;
-}
-
-.ball {
- width: 100px;
- height: 100px;
- background: #1AAD19;
- border-radius: 50%;
-}
-
-.filling {
- height: 200px;
-}
-
-.message {
- width: 100%;
- display: flex;
- justify-content: center;
-}
-
-.message text {
- font-size: 20px;
- font-family: -apple-system-font, Helvetica Neue,Helvetica,sans-serif;
-}
diff --git a/miniprogram/packageAPI/pages/page/modal/modal.js b/miniprogram/packageAPI/pages/page/modal/modal.js
deleted file mode 100644
index 96144c77..00000000
--- a/miniprogram/packageAPI/pages/page/modal/modal.js
+++ /dev/null
@@ -1,45 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '模态弹窗',
- path: 'packageAPI/pages/page/modal/modal'
- }
- },
-
- data: {
- theme: 'light',
- modalHidden: true,
- modalHidden2: true
- },
- modalTap() {
- wx.showModal({
- title: '弹窗标题',
- content: '弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内',
- showCancel: false,
- confirmText: '确定'
- })
- },
- noTitlemodalTap() {
- wx.showModal({
- content: '弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内',
- confirmText: '确定',
- cancelText: '取消'
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/page/modal/modal.json b/miniprogram/packageAPI/pages/page/modal/modal.json
deleted file mode 100644
index 5acab026..00000000
--- a/miniprogram/packageAPI/pages/page/modal/modal.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "模态弹窗"
-}
diff --git a/miniprogram/packageAPI/pages/page/modal/modal.wxml b/miniprogram/packageAPI/pages/page/modal/modal.wxml
deleted file mode 100644
index 77d285a6..00000000
--- a/miniprogram/packageAPI/pages/page/modal/modal.wxml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/modal/modal.wxss b/miniprogram/packageAPI/pages/page/modal/modal.wxss
deleted file mode 100644
index 7a5da5a6..00000000
--- a/miniprogram/packageAPI/pages/page/modal/modal.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* page/API/pages/modal/modal.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.js b/miniprogram/packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.js
deleted file mode 100644
index e4f7759e..00000000
--- a/miniprogram/packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.js
+++ /dev/null
@@ -1,31 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '标题栏加载动画',
- path: 'packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading'
- }
- },
-
- showNavigationBarLoading() {
- wx.showNavigationBarLoading()
- },
- hideNavigationBarLoading() {
- wx.hideNavigationBarLoading()
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.json b/miniprogram/packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.json
deleted file mode 100644
index c432f2a6..00000000
--- a/miniprogram/packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "标题栏加载动画"
-}
diff --git a/miniprogram/packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.wxml b/miniprogram/packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.wxml
deleted file mode 100644
index 5a015084..00000000
--- a/miniprogram/packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.wxml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.wxss b/miniprogram/packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/page/navigator/navigator.js b/miniprogram/packageAPI/pages/page/navigator/navigator.js
deleted file mode 100644
index 7aef205e..00000000
--- a/miniprogram/packageAPI/pages/page/navigator/navigator.js
+++ /dev/null
@@ -1,44 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '页面跳转',
- path: 'packageAPI/pages/page/navigator/navigator'
- }
- },
-
- navigateTo() {
- wx.navigateTo({ url: './navigator' })
- },
-
- navigateBack() {
- wx.navigateBack()
- },
-
- redirectTo() {
- wx.redirectTo({ url: './navigator' })
- },
-
- switchTab() {
- wx.switchTab({ url: '/page/component/index' })
- },
-
- reLaunch() {
- wx.reLaunch({ url: '/page/component/index' })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/page/navigator/navigator.json b/miniprogram/packageAPI/pages/page/navigator/navigator.json
deleted file mode 100644
index 7d26c3ad..00000000
--- a/miniprogram/packageAPI/pages/page/navigator/navigator.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "页面跳转"
-}
diff --git a/miniprogram/packageAPI/pages/page/navigator/navigator.wxml b/miniprogram/packageAPI/pages/page/navigator/navigator.wxml
deleted file mode 100644
index fc02bdd1..00000000
--- a/miniprogram/packageAPI/pages/page/navigator/navigator.wxml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/navigator/navigator.wxss b/miniprogram/packageAPI/pages/page/navigator/navigator.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.js b/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.js
deleted file mode 100644
index 4fb36727..00000000
--- a/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.js
+++ /dev/null
@@ -1,38 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '页面滚动',
- path: 'packageAPI/pages/page/page-scroll/page-scroll'
- }
- },
-
- scrollToTop() {
- wx.pageScrollTo({
- scrollTop: 0,
- duration: 300
- })
- },
-
- scrollToBottom() {
- wx.pageScrollTo({
- scrollTop: 3000,
- duration: 300
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.json b/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.json
deleted file mode 100644
index ade758e6..00000000
--- a/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "页面滚动"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.wxml b/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.wxml
deleted file mode 100644
index 579c1311..00000000
--- a/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.wxml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.wxss b/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.wxss
deleted file mode 100644
index 58eca965..00000000
--- a/miniprogram/packageAPI/pages/page/page-scroll/page-scroll.wxss
+++ /dev/null
@@ -1,9 +0,0 @@
-.rect {
- width: 50px;
- height: 50px;
- background-color: #ccc;
-}
-
-.filling-area {
- height: 1250px;
-}
diff --git a/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.js b/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.js
deleted file mode 100644
index 9b88457c..00000000
--- a/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.js
+++ /dev/null
@@ -1,41 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '下拉刷新',
- path: 'packageAPI/pages/page/pull-down-refresh/pull-down-refresh'
- }
- },
-
- onPullDownRefresh() {
- wx.showToast({
- title: 'loading...',
- icon: 'loading'
- })
- console.log('onPullDownRefresh', new Date())
- },
-
- stopPullDownRefresh() {
- wx.stopPullDownRefresh({
- complete(res) {
- wx.hideToast()
- console.log(res, new Date())
- }
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.json b/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.json
deleted file mode 100644
index bfb29738..00000000
--- a/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "下拉刷新",
- "enablePullDownRefresh": true,
- "backgroundTextStyle": "@backgroundTextStyle"
-}
diff --git a/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.wxml b/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.wxml
deleted file mode 100644
index 8dbfb154..00000000
--- a/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.wxml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
- 下滑页面即可刷新
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.wxss b/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.wxss
deleted file mode 100644
index f1caa8fa..00000000
--- a/miniprogram/packageAPI/pages/page/pull-down-refresh/pull-down-refresh.wxss
+++ /dev/null
@@ -1,6 +0,0 @@
-.page-body-info {
- background-color: transparent;
-}
-.btn-area{
- margin-top: 150px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.js b/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.js
deleted file mode 100644
index e2ab22a0..00000000
--- a/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.js
+++ /dev/null
@@ -1,40 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '设置页面标题',
- path: 'packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title'
- }
- },
-
- setNaivgationBarTitle(e) {
- const title = e.detail.value.title
- console.log(title)
- wx.setNavigationBarTitle({
- title,
- success() {
- console.log('setNavigationBarTitle success')
- },
- fail(err) {
- console.log('setNavigationBarTitle fail, err is', err)
- }
- })
-
- return false
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.json b/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.json
deleted file mode 100644
index 9fb04e01..00000000
--- a/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "设置页面标题"
-}
diff --git a/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.wxml b/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.wxml
deleted file mode 100644
index 8b2c5cb7..00000000
--- a/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.wxml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.wxss b/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.wxss
deleted file mode 100644
index fb9b1084..00000000
--- a/miniprogram/packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.wxss
+++ /dev/null
@@ -1,5 +0,0 @@
-/* @import "../../../common/lib/weui.wxss"; */
-
-.weui-label{
- width: 5em;
-}
diff --git a/miniprogram/packageAPI/pages/page/toast/toast.js b/miniprogram/packageAPI/pages/page/toast/toast.js
deleted file mode 100644
index 0bca9545..00000000
--- a/miniprogram/packageAPI/pages/page/toast/toast.js
+++ /dev/null
@@ -1,49 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '消息提示框',
- path: 'packageAPI/pages/page/toast/toast'
- }
- },
-
- toast1Tap() {
- wx.showToast({
- title: '默认'
- })
- },
-
- toast2Tap() {
- wx.showToast({
- title: 'duration 3000',
- duration: 3000
- })
- },
-
- toast3Tap() {
- wx.showToast({
- title: 'loading',
- icon: 'loading',
- duration: 5000
- })
- },
-
- hideToast() {
- wx.hideToast()
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/page/toast/toast.json b/miniprogram/packageAPI/pages/page/toast/toast.json
deleted file mode 100644
index dc7c0cb9..00000000
--- a/miniprogram/packageAPI/pages/page/toast/toast.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "消息提示框"
-}
diff --git a/miniprogram/packageAPI/pages/page/toast/toast.wxml b/miniprogram/packageAPI/pages/page/toast/toast.wxml
deleted file mode 100644
index 6e2a4548..00000000
--- a/miniprogram/packageAPI/pages/page/toast/toast.wxml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/page/toast/toast.wxss b/miniprogram/packageAPI/pages/page/toast/toast.wxss
deleted file mode 100644
index 63731f57..00000000
--- a/miniprogram/packageAPI/pages/page/toast/toast.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* page/API/pages/toast/toast.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/performance/get-performance/get-performance.js b/miniprogram/packageAPI/pages/performance/get-performance/get-performance.js
deleted file mode 100644
index 22ffdfb3..00000000
--- a/miniprogram/packageAPI/pages/performance/get-performance/get-performance.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// 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/performance/get-performance/get-performance'
- }
- },
- data: {
- theme: 'light',
- array: [],
- support: false,
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- 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,
- })
- },
-
- startObserver() {
- // 监听需要的性能指标
- performanceObserver.observe({ entryTypes: ['render', 'script', 'navigation'] })
- },
-
- stopObserver() {
- // 结束监听
- performanceObserver.disconnect()
- }
-})
diff --git a/miniprogram/packageAPI/pages/performance/get-performance/get-performance.json b/miniprogram/packageAPI/pages/performance/get-performance/get-performance.json
deleted file mode 100644
index 068b0650..00000000
--- a/miniprogram/packageAPI/pages/performance/get-performance/get-performance.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "性能数据"
-
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/performance/get-performance/get-performance.wxml b/miniprogram/packageAPI/pages/performance/get-performance/get-performance.wxml
deleted file mode 100644
index 5bc4ce27..00000000
--- a/miniprogram/packageAPI/pages/performance/get-performance/get-performance.wxml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- {{item.entryType}}:{{item.name}}
- 耗时:{{item.duration}}
- 时间:{{item.startTime}}
-
-
-
-
-
- 微信版本过低,暂不支持本功能
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/performance/get-performance/get-performance.wxss b/miniprogram/packageAPI/pages/performance/get-performance/get-performance.wxss
deleted file mode 100644
index f3149b2f..00000000
--- a/miniprogram/packageAPI/pages/performance/get-performance/get-performance.wxss
+++ /dev/null
@@ -1,13 +0,0 @@
-.container {
- display: block;
-}
-.performance-list {
- display: flex;
- flex-direction: column;
- width: 100%;
- align-items: center;
-}
-.performance-item {
- margin: 15px 0;
- width: 80%;
-}
diff --git a/miniprogram/packageAPI/pages/performance/get-performance/util.js b/miniprogram/packageAPI/pages/performance/get-performance/util.js
deleted file mode 100644
index db682c86..00000000
--- a/miniprogram/packageAPI/pages/performance/get-performance/util.js
+++ /dev/null
@@ -1,65 +0,0 @@
-const util = {}
-
-// const { formatDateTime } = require('../../../../util/util')
-Date.prototype.Format = function (fmt) {
- const 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 (const 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) => (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
diff --git a/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.js b/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.js
deleted file mode 100644
index 95fc8e10..00000000
--- a/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.js
+++ /dev/null
@@ -1,72 +0,0 @@
-// 使用周期性数据的时候,需要先调用setBackgroundFetchToken, 可在 app.js 中查看具体例子
-Page({
- onShareAppMessage() {
- return {
- title: '周期性缓存',
- path: 'packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data'
- }
- },
- onShow() {
- // 获取缓存的周期性更新数据
- this.getBackgroundFetchData()
- },
- data: {
- theme: 'light',
- 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: '微信版本过低,暂不支持本功能',
- })
- }
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.json b/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.json
deleted file mode 100644
index 579cca63..00000000
--- a/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "周期性更新数据"
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.wxml b/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.wxml
deleted file mode 100644
index dd73d110..00000000
--- a/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.wxml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- 周期性缓存数据
-
-
- OpenID
- {{openid}}
-
-
- AppID
- {{appid}}
-
-
-
- 微信客户端每隔 12 个小时才会发起一次请求
- 为了方便调试周期性数据,可以在 工具 -> 拉取周期性缓存数据 开启
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.wxss b/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.wxss
deleted file mode 100644
index 822a08f8..00000000
--- a/miniprogram/packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.wxss
+++ /dev/null
@@ -1,14 +0,0 @@
-.page-body-info {
- padding-bottom: 0;
- height: 300px;
-}
-.page-body-text {
- padding: 0 15px;
- text-align: center;
-}
-.page-body-title {
- margin-bottom: 20px;
-}
-.context-value {
- font-size: 19px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.js b/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.js
deleted file mode 100644
index 07a13389..00000000
--- a/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.js
+++ /dev/null
@@ -1,82 +0,0 @@
-const app = getApp()
-// 使用预缓存数据的时候,需要先调用setBackgroundFetchToken, 可在 app.js 中查看具体例子
-
-Date.prototype.Format = function (fmt) {
- const 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().toString()).substr(4 - RegExp.$1.length))
- for (const 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].toString()).length)))
- }
- }
-
- return fmt
-}
-
-Page({
- onShow() {
- // 获取缓存的预拉取数据
- this.getBackgroundFetchData()
- },
- onShareAppMessage() {
- return {
- title: '预拉取',
- path: 'packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data'
- }
- },
- data: {
- theme: 'light',
- 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: '微信版本过低,暂不支持本功能',
- })
- }
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.json b/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.json
deleted file mode 100644
index 5eb4295c..00000000
--- a/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "renderer": "webview",
-"navigationBarTitleText": "数据预拉取"
-
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.wxml b/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.wxml
deleted file mode 100644
index f0dd6cd4..00000000
--- a/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.wxml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
- 数据预拉取
-
-
- OpenID
- {{openid}}
-
-
- AppID
- {{appid}}
-
-
- 数据缓存的时间
- {{getDataTime}}
-
-
-
- 用户启动小程序时,调用 wx.getBackgroundFetchData() 获取已缓存到本地的数据。
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.wxss b/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.wxss
deleted file mode 100644
index 79f3e0bf..00000000
--- a/miniprogram/packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.wxss
+++ /dev/null
@@ -1,14 +0,0 @@
-.page-body-info {
- padding-bottom: 0;
- height: 340px;
-}
-.page-body-title {
- margin-bottom: 20px;
-}
-.page-body-text {
- padding: 0 15px;
- text-align: center;
-}
-.context-value {
- font-size: 19px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/storage/storage/storage.js b/miniprogram/packageAPI/pages/storage/storage/storage.js
deleted file mode 100644
index a77326fe..00000000
--- a/miniprogram/packageAPI/pages/storage/storage/storage.js
+++ /dev/null
@@ -1,116 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: '数据存储',
- path: 'packageAPI/pages/storage/storage/storage'
- }
- },
-
- data: {
- theme: 'light',
- key: '',
- data: '',
- dialog: {
- title: '',
- content: '',
- hidden: true
- }
- },
-
- keyChange(e) {
- this.data.key = e.detail.value
- },
-
- dataChange(e) {
- this.data.data = e.detail.value
- },
-
- getStorage() {
- const { key, data } = this.data
- let storageData
-
- if (key.length === 0) {
- this.setData({
- key,
- data,
- })
- wx.showModal({
- title: '读取数据失败',
- content: 'key 不能为空'
- })
- } else {
- storageData = wx.getStorageSync(key)
- console.log(storageData)
- if (storageData === '') {
- this.setData({
- key,
- data: storageData
- })
- wx.showModal({
- title: '读取数据失败',
- content: '找不到 key 对应的数据'
- })
- } else {
- this.setData({
- key,
- data: storageData
- })
- wx.showModal({
- title: '读取数据成功',
- content: storageData,
- })
- }
- }
- },
-
- setStorage() {
- const { key, data } = this.data
- if (key.length === 0) {
- this.setData({
- key,
- data,
- })
- wx.showModal({
- title: '保存数据失败',
- content: 'key 不能为空'
- })
- } else {
- wx.setStorageSync(key, data)
- this.setData({
- key,
- data,
-
- })
- wx.showModal({
- title: '存储数据成功'
- })
- }
- },
-
- clearStorage() {
- wx.clearStorageSync()
- this.setData({
- key: '',
- data: '',
- })
- wx.showModal({
- title: '清除数据成功'
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageAPI/pages/storage/storage/storage.json b/miniprogram/packageAPI/pages/storage/storage/storage.json
deleted file mode 100644
index 518bb88e..00000000
--- a/miniprogram/packageAPI/pages/storage/storage/storage.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "数据存储"
-}
diff --git a/miniprogram/packageAPI/pages/storage/storage/storage.wxml b/miniprogram/packageAPI/pages/storage/storage/storage.wxml
deleted file mode 100644
index 7c06314b..00000000
--- a/miniprogram/packageAPI/pages/storage/storage/storage.wxml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- key
-
-
-
-
-
-
-
- value
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/storage/storage/storage.wxss b/miniprogram/packageAPI/pages/storage/storage/storage.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageAPI/pages/worker/worker/worker.js b/miniprogram/packageAPI/pages/worker/worker/worker.js
deleted file mode 100644
index 5e1d60d1..00000000
--- a/miniprogram/packageAPI/pages/worker/worker/worker.js
+++ /dev/null
@@ -1,145 +0,0 @@
-const { fib } = require('../../../../util/util.js')
-
-Page({
- onShareAppMessage() {
- return {
- title: '多线程Worker',
- path: 'packageAPI/pages/worker/worker/worker'
- }
- },
-
- data: {
- theme: 'light',
- res: '',
- input: 35,
- },
-
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- clearInterval(this.interval)
- if (this._worker) this._worker.terminate()
- },
-
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- this._worker = wx.createWorker('workers/fib/index.js')
- },
-
- bindInput(e) {
- const val = Number(e.detail.value)
- if (val > 40) return { value: 40 }
- if (Number.isNaN(val)) return { value: 33 }
- this.setData({
- input: val
- })
- return undefined
- },
-
- reset() {
- this.setData({ res: '' })
- },
-
- compute() {
- this.reset()
- wx.showLoading({
- title: '计算中...'
- })
- const t0 = +Date.now()
- const res = fib(this.data.input)
- const t1 = +Date.now()
- wx.hideLoading()
- this.setData({
- res,
- time: t1 - t0
- })
- },
-
- multiThreadCompute() {
- this.reset()
- wx.showLoading({
- title: '计算中...'
- })
-
- const t0 = +Date.now()
- this._worker.postMessage({
- type: 'execFunc_fib',
- params: [this.data.input]
- })
- this._worker.onMessage((res) => {
- if (res.type === 'execFunc_fib') {
- wx.hideLoading()
- const t1 = +Date.now()
- this.setData({
- res: res.result,
- time: t1 - t0
- })
- }
- })
- },
-
- onReady() {
- this.position = {
- x: 150,
- y: 150,
- vx: 2,
- vy: 2
- }
-
- this.drawBall()
- this.interval = setInterval(this.drawBall, 17)
- },
-
- drawBall() {
- const p = this.position
- 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
- }
-
- const context = wx.createContext()
-
- function ball(x, y) {
- context.beginPath(0)
- context.arc(x, y, 5, 0, Math.PI * 2)
- context.setFillStyle('#1aad19')
- context.setStrokeStyle('rgba(1,1,1,0)')
- context.fill()
- context.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)
-
- wx.drawCanvas({
- canvasId: 'canvas',
- actions: context.getActions()
- })
- },
-
-})
diff --git a/miniprogram/packageAPI/pages/worker/worker/worker.json b/miniprogram/packageAPI/pages/worker/worker/worker.json
deleted file mode 100644
index 450596a5..00000000
--- a/miniprogram/packageAPI/pages/worker/worker/worker.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "renderer": "webview",
-"navigationBarTitleText": "多线程Worker"
-}
diff --git a/miniprogram/packageAPI/pages/worker/worker/worker.wxml b/miniprogram/packageAPI/pages/worker/worker/worker.wxml
deleted file mode 100644
index 125b0b6a..00000000
--- a/miniprogram/packageAPI/pages/worker/worker/worker.wxml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- 计算斐波那契数
-
-
-
-
-
- 结果
-
-
- {{res}}
- 耗时:{{time}}
-
-
- 提示:使用单线程进行计算时,动画会出现明显的卡顿现象。使用 Worker 线程进行计算,则可以保证动画的流畅。
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageAPI/pages/worker/worker/worker.wxss b/miniprogram/packageAPI/pages/worker/worker/worker.wxss
deleted file mode 100644
index 7b2620d2..00000000
--- a/miniprogram/packageAPI/pages/worker/worker/worker.wxss
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-.canvas {
- width: 305px;
- height: 305px;
- background-color: #fff;
-}
-
-.page-section-title {
- margin-top: 15px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/worker/worker/worker/worker.js b/miniprogram/packageAPI/pages/worker/worker/worker/worker.js
deleted file mode 100644
index 8f3d260a..00000000
--- a/miniprogram/packageAPI/pages/worker/worker/worker/worker.js
+++ /dev/null
@@ -1,67 +0,0 @@
-// packageAPI/pages/worker/worker/worker/worker.js
-Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- theme: 'light',
-
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
-
- },
-
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
-
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
-
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
-
- }
-})
diff --git a/miniprogram/packageAPI/pages/worker/worker/worker/worker.json b/miniprogram/packageAPI/pages/worker/worker/worker/worker.json
deleted file mode 100644
index 8835af06..00000000
--- a/miniprogram/packageAPI/pages/worker/worker/worker/worker.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "usingComponents": {}
-}
\ No newline at end of file
diff --git a/miniprogram/packageAPI/pages/worker/worker/worker/worker.wxml b/miniprogram/packageAPI/pages/worker/worker/worker/worker.wxml
deleted file mode 100644
index 5825aaca..00000000
--- a/miniprogram/packageAPI/pages/worker/worker/worker/worker.wxml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-packageAPI/pages/worker/worker/worker/worker.wxml
diff --git a/miniprogram/packageAPI/pages/worker/worker/worker/worker.wxss b/miniprogram/packageAPI/pages/worker/worker/worker/worker.wxss
deleted file mode 100644
index 9016dbe3..00000000
--- a/miniprogram/packageAPI/pages/worker/worker/worker/worker.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* packageAPI/pages/worker/worker/worker/worker.wxss */
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/apiCategory/index.js b/miniprogram/packageChatTool/components/apiCategory/index.js
deleted file mode 100644
index d2775c04..00000000
--- a/miniprogram/packageChatTool/components/apiCategory/index.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// components/apiCategory/index.js
-Component({
-
- properties: {
-
- },
-
- /**
- * Component initial data
- */
- data: {
- apiCategory: '',
- },
-
- methods: {
-
- },
-
- pageLifetimes: {
- show() {
- const apiCategory = wx.getApiCategory()
- this.setData({ apiCategory })
- }
- }
-})
diff --git a/miniprogram/packageChatTool/components/apiCategory/index.json b/miniprogram/packageChatTool/components/apiCategory/index.json
deleted file mode 100644
index e8cfaaf8..00000000
--- a/miniprogram/packageChatTool/components/apiCategory/index.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "component": true,
- "usingComponents": {}
-}
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/apiCategory/index.wxml b/miniprogram/packageChatTool/components/apiCategory/index.wxml
deleted file mode 100644
index d73e2643..00000000
--- a/miniprogram/packageChatTool/components/apiCategory/index.wxml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- {{apiCategory === 'chatTool' ? '聊天工具模式' : '普通模式'}}
-
diff --git a/miniprogram/packageChatTool/components/apiCategory/index.wxss b/miniprogram/packageChatTool/components/apiCategory/index.wxss
deleted file mode 100644
index 538cfa0a..00000000
--- a/miniprogram/packageChatTool/components/apiCategory/index.wxss
+++ /dev/null
@@ -1,28 +0,0 @@
-/* components/apiCategory/index.wxss */
-
-.ribbon {
- position: fixed;
- top: 0;
- right: 0;
- z-index: 10000;
- overflow: hidden;
- width: 100px;
- height: 100px;
- transform-origin: center;
- overflow: visible;
-}
-
-.ribbon view {
- display: block;
- width: 200px;
- padding: 7px 0;
- background-color: rgb(90, 171, 110);
- color: #fff;
- font-size: 14px;
- font-weight: bold;
- text-align: center;
- transform: translate(-50%, -50%) rotate(45deg);
- position: relative;
- top: 50%;
- left: 50%;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/.wechatide.ib.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/.wechatide.ib.json
deleted file mode 100644
index 461d4e18..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/.wechatide.ib.json
+++ /dev/null
@@ -1,3895 +0,0 @@
-{
- "key": "TDesign",
- "label": "Tdesign",
- "components": {
- "t-action-sheet": {
- "key": "t-action-sheet",
- "label": "动作面板",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-actionsheet.png",
- "properties": [
- {
- "key": "cancelText",
- "type": ["String"],
- "desc": "设置取消按钮的文本",
- "label": ""
- },
- {
- "key": "count",
- "type": ["Number"],
- "desc": "设置每页展示菜单的数量,仅当 type=grid 时有效",
- "label": ""
- },
- {
- "key": "items",
- "type": ["Array"],
- "desc": "菜单项",
- "label": ""
- },
- {
- "key": "showCancel",
- "type": ["Boolean"],
- "desc": "是否显示取消按钮",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "展示类型,列表和表格形式展示",
- "label": ""
- },
- {
- "key": "visible",
- "type": ["Boolean"],
- "desc": "显示与隐藏",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:cancel",
- "desc": "点击取消按钮时触发",
- "label": ""
- },
- {
- "key": "bind:close",
- "desc": "关闭时触发",
- "label": ""
- },
- {
- "key": "bind:selected",
- "desc": "选择菜单项时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./action-sheet/action-sheet"
- },
- "t-avatar-group": {
- "key": "t-avatar-group",
- "label": "头像组",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-avatar.png",
- "properties": [
- {
- "key": "cascading",
- "type": ["String"],
- "desc": "图片之间的层叠关系,可选值:左侧图片在上和右侧图片在上",
- "label": ""
- },
- {
- "key": "collapseAvatar",
- "type": ["String"],
- "desc": "头像数量超出时,会出现一个头像折叠元素。该元素内容可自定义。默认为 `+N`。示例:`+5`,`...`, `更多`",
- "label": ""
- },
- {
- "key": "max",
- "type": ["Number"],
- "desc": "能够同时显示的最多头像数量",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String"],
- "desc": "尺寸,示例值:small/medium/large/24px/38px 等。优先级低于 Avatar.size",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-image", "t-class-content"],
- "tpl": "",
- "require": {
- "t-avatar": "./avatar/avatar"
- },
- "path": "./avatar/avatar-group"
- },
- "t-avatar": {
- "key": "t-avatar",
- "label": "头像",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-avatar.png",
- "properties": [
- {
- "key": "alt",
- "type": ["String"],
- "desc": "头像替换文本,仅当图片加载失败时有效",
- "label": ""
- },
- {
- "key": "badgeProps",
- "type": ["Object"],
- "desc": "头像右上角提示信息,继承 Badge 组件的全部特性。如:小红点,或者数字",
- "label": ""
- },
- {
- "key": "hideOnLoadFailed",
- "type": ["Boolean"],
- "desc": "加载失败时隐藏图片",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String"],
- "desc": "图标",
- "label": ""
- },
- {
- "key": "image",
- "type": ["String"],
- "desc": "图片地址",
- "label": ""
- },
- {
- "key": "shape",
- "type": ["String"],
- "desc": "形状",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String"],
- "desc": "尺寸,示例值:small/medium/large/24px/38px 等,默认为 large",
- "label": ""
- }
- ],
- "externalClasses": ["t-class"],
- "events": [
- {
- "key": "bind:error",
- "desc": "图片加载失败时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./avatar/avatar"
- },
- "t-back-top": {
- "key": "t-back-top",
- "label": "回到顶部",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-backtop.png",
- "properties": [
- {
- "key": "fixed",
- "type": ["Boolean"],
- "desc": "是否绝对定位固定到屏幕右下方",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String"],
- "desc": "图标",
- "label": ""
- },
- {
- "key": "text",
- "type": ["String"],
- "desc": "文案",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "预设的样式类型",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-icon", "t-class-text"],
- "events": [
- {
- "key": "bind:to-top",
- "desc": "点击触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./back-top/back-top"
- },
- "t-badge": {
- "key": "t-badge",
- "label": "徽标数",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-badge.png",
- "properties": [
- {
- "key": "color",
- "type": ["String"],
- "desc": "颜色",
- "label": ""
- },
- {
- "key": "content",
- "type": ["String"],
- "desc": "徽标内容,示例:`content='自定义内容'`。也可以使用默认插槽定义",
- "label": ""
- },
- {
- "key": "count",
- "type": ["String", "Number"],
- "desc": "徽标右上角内容。可以是数字,也可以是文字。如:'new'/3/99+。特殊:值为空表示使用插槽渲染",
- "label": ""
- },
- {
- "key": "dot",
- "type": ["Boolean"],
- "desc": "是否为红点",
- "label": ""
- },
- {
- "key": "maxCount",
- "type": ["Number"],
- "desc": "封顶的数字值",
- "label": ""
- },
- {
- "key": "offset",
- "type": ["Array"],
- "desc": "设置状态点的位置偏移,示例:[-10, 20] 或 ['10em', '8rem']",
- "label": ""
- },
- {
- "key": "shape",
- "type": ["String"],
- "desc": "形状",
- "label": ""
- },
- {
- "key": "showZero",
- "type": ["Boolean"],
- "desc": "当数值为 0 时,是否展示徽标",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String"],
- "desc": "尺寸",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-content", "t-class-count"],
- "tpl": "",
- "path": "./badge/badge"
- },
- "t-button": {
- "key": "t-button",
- "label": "按钮",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-button.png",
- "properties": [
- {
- "key": "block",
- "type": ["Boolean"],
- "desc": "是否为块级元素",
- "label": ""
- },
- {
- "key": "content",
- "type": ["String"],
- "desc": "按钮内容",
- "label": ""
- },
- {
- "key": "customDataset",
- "type": ["Object"],
- "desc": "自定义 dataset,可通过 event.currentTarget.dataset.custom 获取",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用按钮",
- "label": ""
- },
- {
- "key": "ghost",
- "type": ["Boolean"],
- "desc": "是否为幽灵按钮(镂空按钮)",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String"],
- "desc": "图标名称",
- "label": ""
- },
- {
- "key": "loading",
- "type": ["Boolean"],
- "desc": "是否显示为加载状态",
- "label": ""
- },
- {
- "key": "shape",
- "type": ["String"],
- "desc": "按钮形状,有 4 种:长方形、正方形、圆角长方形、圆形",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String"],
- "desc": "组件尺寸",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "组件风格,依次为品牌色、危险色",
- "label": ""
- },
- {
- "key": "type",
- "type": ["String"],
- "desc": "同小程序的 formType",
- "label": ""
- },
- {
- "key": "variant",
- "type": ["String"],
- "desc": "按钮形式,基础、线框、文字",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-icon"],
- "events": [
- {
- "key": "bind:click",
- "desc": "点击时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./button/button"
- },
- "t-cell-group": {
- "key": "t-cell-group",
- "label": "单元格组",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-cell.png",
- "properties": [
- {
- "key": "bordered",
- "type": ["Boolean"],
- "desc": "是否显示组边框",
- "label": ""
- },
- {
- "key": "title",
- "type": ["String"],
- "desc": "单元格组标题",
- "label": ""
- }
- ],
- "externalClasses": ["t-class"],
- "tpl": "",
- "require": {
- "t-cell": "./cell/cell"
- },
- "path": "./cell-group/cell-group"
- },
- "t-cell": {
- "key": "t-cell",
- "label": "单元格",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-cell.png",
- "properties": [
- {
- "key": "align",
- "type": ["String"],
- "desc": "内容的对齐方式,默认居中对齐",
- "label": ""
- },
- {
- "key": "arrow",
- "type": ["Boolean"],
- "desc": "是否显示右侧箭头",
- "label": ""
- },
- {
- "key": "bordered",
- "type": ["Boolean"],
- "desc": "是否显示下边框",
- "label": ""
- },
- {
- "key": "description",
- "type": ["String"],
- "desc": "下方内容描述",
- "label": ""
- },
- {
- "key": "hover",
- "type": ["Boolean"],
- "desc": "是否开启点击反馈",
- "label": ""
- },
- {
- "key": "image",
- "type": ["String"],
- "desc": "主图",
- "label": ""
- },
- {
- "key": "jumpType",
- "type": ["String"],
- "desc": "链接跳转类型",
- "label": ""
- },
- {
- "key": "leftIcon",
- "type": ["String"],
- "desc": "左侧图标,出现在单元格标题的左侧",
- "label": ""
- },
- {
- "key": "note",
- "type": ["String"],
- "desc": "和标题同行的说明文字",
- "label": ""
- },
- {
- "key": "required",
- "type": ["Boolean"],
- "desc": "是否显示表单必填星号",
- "label": ""
- },
- {
- "key": "rightIcon",
- "type": ["String"],
- "desc": "最右侧图标",
- "label": ""
- },
- {
- "key": "title",
- "type": ["String"],
- "desc": "标题",
- "label": ""
- },
- {
- "key": "url",
- "type": ["String"],
- "desc": "点击后跳转链接地址。如果值为空,则表示不需要跳转",
- "label": ""
- }
- ],
- "externalClasses": [
- "t-class",
- "t-class-title",
- "t-class-note",
- "t-class-description",
- "t-class-thumb",
- "t-class-hover",
- "t-class-left",
- "t-class-right"
- ],
- "events": [
- {
- "key": "bind:click",
- "desc": "右侧内容",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./cell/cell"
- },
- "t-check-tag": {
- "key": "t-check-tag",
- "label": "可选标签",
- "icon": "",
- "properties": [
- {
- "key": "checked",
- "type": ["Boolean"],
- "desc": "标签选中的状态,默认风格(theme=default)才有选中态",
- "label": ""
- },
- {
- "key": "closable",
- "type": ["Boolean"],
- "desc": "标签是否可关闭",
- "label": ""
- },
- {
- "key": "content",
- "type": ["String", "Number"],
- "desc": "组件子元素",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String"],
- "desc": "标签中的图标,可自定义图标呈现",
- "label": ""
- },
- {
- "key": "shape",
- "type": ["String"],
- "desc": "标签类型,有三种:方形、圆角方形、标记型",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String"],
- "desc": "标签尺寸",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:change",
- "desc": "组件子元素",
- "label": ""
- },
- {
- "key": "bind:click",
- "desc": "点击标签时触发",
- "label": ""
- }
- ],
- "tpl": "check tag",
- "path": "./check-tag/check-tag"
- },
- "t-checkbox-group": {
- "key": "t-checkbox-group",
- "label": "多选框组",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-checkbox.png",
- "properties": [
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用组件",
- "label": ""
- },
- {
- "key": "max",
- "type": ["Number"],
- "desc": "支持最多选中的数量",
- "label": ""
- },
- {
- "key": "name",
- "type": ["String"],
- "desc": "统一设置内部复选框 HTML 属性",
- "label": ""
- },
- {
- "key": "options",
- "type": ["Array"],
- "desc": "以配置形式设置子元素。示例1:`['北京', '上海']` ,示例2: `[{ label: '全选', checkAll: true }, { label: '上海', value: 'shanghai' }]`。checkAll 值为 true 表示当前选项为「全选选项」",
- "label": ""
- },
- {
- "key": "value",
- "type": ["Array"],
- "desc": "选中值",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:change",
- "desc": "值变化时触发。`context.current` 表示当前变化的数据项,如果是全选则为空;`context.type` 表示引起选中数据变化的是选中或是取消选中,`context.option` 表示当前变化的数据项",
- "label": ""
- }
- ],
- "tpl": "",
- "require": {
- "t-checkbox": "./checkbox/checkbox"
- },
- "path": "./checkbox-group/checkbox-group"
- },
- "t-checkbox": {
- "key": "t-checkbox",
- "label": "多选框",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-checkbox.png",
- "properties": [
- {
- "key": "align",
- "type": ["String"],
- "desc": "多选框和内容相对位置",
- "label": ""
- },
- {
- "key": "checkAll",
- "type": ["Boolean"],
- "desc": "用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用",
- "label": ""
- },
- {
- "key": "checked",
- "type": ["Boolean"],
- "desc": "是否选中",
- "label": ""
- },
- {
- "key": "color",
- "type": ["String"],
- "desc": "多选框颜色",
- "label": ""
- },
- {
- "key": "content",
- "type": ["String"],
- "desc": "多选框内容",
- "label": ""
- },
- {
- "key": "contentDisabled",
- "type": ["Boolean"],
- "desc": "是否禁用组件内容(content)触发选中",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用组件",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["Array"],
- "desc": "自定义选中图标和非选中图标。示例:[选中态图标地址,非选中态图标地址]",
- "label": ""
- },
- {
- "key": "indeterminate",
- "type": ["Boolean"],
- "desc": "是否为半选",
- "label": ""
- },
- {
- "key": "label",
- "type": ["String"],
- "desc": "主文案",
- "label": ""
- },
- {
- "key": "maxContentRow",
- "type": ["Number"],
- "desc": "内容最大行数限制",
- "label": ""
- },
- {
- "key": "maxLabelRow",
- "type": ["Number"],
- "desc": "主文案最大行数限制",
- "label": ""
- },
- {
- "key": "name",
- "type": ["String"],
- "desc": "HTML 元素原生属性",
- "label": ""
- },
- {
- "key": "readonly",
- "type": ["Boolean"],
- "desc": "只读状态",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number"],
- "desc": "多选框的值",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-icon", "t-class-label", "t-class-content", "t-class-border"],
- "events": [
- {
- "key": "bind:change",
- "desc": "值变化时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./checkbox/checkbox"
- },
- "t-collapse-panel": {
- "key": "t-collapse-panel",
- "label": "折叠面板",
- "icon": "",
- "properties": [
- {
- "key": "content",
- "type": ["String"],
- "desc": "折叠面板内容",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "禁止当前面板展开,优先级大于 Collapse 的同名属性",
- "label": ""
- },
- {
- "key": "expandIcon",
- "type": ["Boolean"],
- "desc": "当前折叠面板展开图标,优先级大于 Collapse 的同名属性",
- "label": ""
- },
- {
- "key": "header",
- "type": ["String"],
- "desc": "面板头内容",
- "label": ""
- },
- {
- "key": "headerRightContent",
- "type": ["String"],
- "desc": "面板头的右侧区域,一般用于呈现面板操作",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number"],
- "desc": "当前面板唯一标识,如果值为空则取当前面下标兜底作为唯一标识",
- "label": ""
- }
- ],
- "tpl": "此处可自定义内容",
- "path": "./collapse/collapse-panel"
- },
- "t-collapse": {
- "key": "t-collapse",
- "label": "折叠",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-collapse.png",
- "properties": [
- {
- "key": "defaultExpandAll",
- "type": ["Boolean"],
- "desc": "默认是否展开全部",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用面板展开/收起操作",
- "label": ""
- },
- {
- "key": "expandIcon",
- "type": ["Boolean"],
- "desc": "展开图标。值为 undefined 或 false 则不显示展开图标;值为 true 显示默认图标;值类型为函数,则表示完全自定义展开图标",
- "label": ""
- },
- {
- "key": "expandMutex",
- "type": ["Boolean"],
- "desc": "每个面板互斥展开,每次只展开一个面板",
- "label": ""
- },
- {
- "key": "value",
- "type": ["Array"],
- "desc": "展开的面板集合",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:change",
- "desc": "切换面板时触发,返回变化的值",
- "label": ""
- }
- ],
- "tpl": "此处可自定义内容",
- "require": {
- "t-collapse-panel": "./collapse/collapse-panel"
- },
- "path": "./collapse/collapse"
- },
- "t-date-time-picker": {
- "key": "t-date-time-picker",
- "label": "日期时间选择器",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-datetimepicker.png",
- "properties": [
- {
- "key": "cancelBtn",
- "type": ["String"],
- "desc": "取消按钮文字",
- "label": ""
- },
- {
- "key": "confirmBtn",
- "type": ["String"],
- "desc": "确定按钮文字",
- "label": ""
- },
- {
- "key": "end",
- "type": ["String", "Number"],
- "desc": "选择器的结束时间",
- "label": ""
- },
- {
- "key": "footer",
- "type": ["String"],
- "desc": "底部内容",
- "label": ""
- },
- {
- "key": "format",
- "type": ["String"],
- "desc": "用于格式化日期,[详细文档](https://day.js.org/docs/en/display/format)",
- "label": ""
- },
- {
- "key": "header",
- "type": ["Boolean"],
- "desc": "头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容",
- "label": ""
- },
- {
- "key": "mode",
- "type": ["String", "Array"],
- "desc": "选择器模式,用于表示可以选择到哪一个层级。【示例一】year 或者 ['year'] 表示纯日期选择器,只能选择到年份,只显示年份。【示例二】'hour' 或 ['hour'] 表示纯时间选择器,只能选择到小时维度。【示例三】['year', 'month', 'date', 'hour', 'minute'] 表示,日期和时间 混合选择器,可以选择到具体哪一分钟,显示全部时间:年/月/日/时/分",
- "label": ""
- },
- {
- "key": "showWeek",
- "type": ["Boolean"],
- "desc": "【开发中】是否在日期旁边显示周几(如周一,周二,周日等)",
- "label": ""
- },
- {
- "key": "start",
- "type": ["String", "Number"],
- "desc": "选择器的开始时间",
- "label": ""
- },
- {
- "key": "title",
- "type": ["String"],
- "desc": "标题",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number"],
- "desc": "选中值",
- "label": ""
- },
- {
- "key": "visible",
- "type": ["Boolean"],
- "desc": "是否显示",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-confirm", "t-class-cancel", "t-class-title"],
- "events": [
- {
- "key": "bind:cancel",
- "desc": "取消按钮点击时触发",
- "label": ""
- },
- {
- "key": "bind:change",
- "desc": "选中值发生变化时触发",
- "label": ""
- },
- {
- "key": "bind:column-change",
- "desc": "每一列选中数据变化时触发",
- "label": ""
- },
- {
- "key": "bind:confirm",
- "desc": "确认按钮点击时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./date-time-picker/date-time-picker"
- },
- "t-dialog": {
- "key": "t-dialog",
- "label": "对话框",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-dialog.png",
- "properties": [
- {
- "key": "actions",
- "type": ["Array"],
- "desc": "操作栏",
- "label": ""
- },
- {
- "key": "buttonLayout",
- "type": ["String"],
- "desc": "多按钮排列方式",
- "label": ""
- },
- {
- "key": "cancelBtn",
- "type": ["String", "Object"],
- "desc": "取消按钮,可自定义。值为 null 则不显示取消按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 TNode 自定义按钮时,需自行控制取消事件",
- "label": ""
- },
- {
- "key": "closeOnOverlayClick",
- "type": ["Boolean"],
- "desc": "点击蒙层时是否触发关闭事件",
- "label": ""
- },
- {
- "key": "confirmBtn",
- "type": ["String", "Object"],
- "desc": "确认按钮。值为 null 则不显示确认按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 TNode 自定义按钮时,需自行控制确认事件",
- "label": ""
- },
- {
- "key": "content",
- "type": ["String"],
- "desc": "内容",
- "label": ""
- },
- {
- "key": "preventScrollThrough",
- "type": ["Boolean"],
- "desc": "防止滚动穿透",
- "label": ""
- },
- {
- "key": "showInAttachedElement",
- "type": ["Boolean"],
- "desc": "【开发中】仅在挂载元素中显示抽屉,默认在浏览器可视区域显示。父元素需要有定位属性,如:position: relative",
- "label": ""
- },
- {
- "key": "showOverlay",
- "type": ["Boolean"],
- "desc": "是否显示遮罩层",
- "label": ""
- },
- {
- "key": "title",
- "type": ["String"],
- "desc": "标题",
- "label": ""
- },
- {
- "key": "visible",
- "type": ["Boolean"],
- "desc": "控制对话框是否显示",
- "label": ""
- },
- {
- "key": "zIndex",
- "type": ["Number"],
- "desc": "对话框层级,Web 侧样式默认为 2500,移动端和小程序样式默认为 1500",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-content", "t-class-confirm", "t-class-cancel"],
- "events": [
- {
- "key": "bind:cancel",
- "desc": "如果“取消”按钮存在,则点击“取消”按钮时触发,同时触发关闭事件",
- "label": ""
- },
- {
- "key": "bind:close",
- "desc": "关闭事件,点击 取消按钮 或 点击蒙层 时触发",
- "label": ""
- },
- {
- "key": "bind:overlay-click",
- "desc": "如果蒙层存在,点击蒙层时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./dialog/dialog"
- },
- "t-divider": {
- "key": "t-divider",
- "label": "分割线",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-divider.png",
- "properties": [
- {
- "key": "align",
- "type": ["String"],
- "desc": "文本位置(仅在水平分割线有效)",
- "label": ""
- },
- {
- "key": "content",
- "type": ["String"],
- "desc": "子元素",
- "label": ""
- },
- {
- "key": "dashed",
- "type": ["Boolean"],
- "desc": "是否虚线(仅在水平分割线有效)",
- "label": ""
- },
- {
- "key": "layout",
- "type": ["String"],
- "desc": "分隔线类型有两种:水平和垂直",
- "label": ""
- },
- {
- "key": "lineColor",
- "type": ["String"],
- "desc": "分隔线颜色",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-line", "t-class-content"],
- "tpl": "",
- "path": "./divider/divider"
- },
- "t-drawer": {
- "key": "t-drawer",
- "label": "模态抽屉",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-drawer.png",
- "properties": [
- {
- "key": "closeOnOverlayClick",
- "type": ["Boolean"],
- "desc": "点击蒙层时是否触发抽屉关闭事件",
- "label": ""
- },
- {
- "key": "destroyOnClose",
- "type": ["Boolean"],
- "desc": "抽屉关闭时是否销毁节点",
- "label": ""
- },
- {
- "key": "items",
- "type": ["Array"],
- "desc": "抽屉里的列表项",
- "label": ""
- },
- {
- "key": "placement",
- "type": ["String"],
- "desc": "抽屉方向",
- "label": ""
- },
- {
- "key": "showOverlay",
- "type": ["Boolean"],
- "desc": "是否显示遮罩层",
- "label": ""
- },
- {
- "key": "visible",
- "type": ["Boolean"],
- "desc": "组件是否可见",
- "label": ""
- },
- {
- "key": "zIndex",
- "type": ["Number"],
- "desc": "抽屉层级,样式默认为 1500",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:close",
- "desc": "关闭事件,取消按钮点击时、关闭按钮点击时、点击蒙层时均会触发",
- "label": ""
- },
- {
- "key": "bind:item-click",
- "desc": "点击抽屉里的列表项",
- "label": ""
- },
- {
- "key": "bind:overlay-click",
- "desc": "如果蒙层存在,点击蒙层时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./drawer/drawer"
- },
- "t-dropdown-item": {
- "key": "t-dropdown-item",
- "label": "下拉菜单子项",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-dropdownmenu.png",
- "properties": [
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用",
- "label": ""
- },
- {
- "key": "label",
- "type": ["String"],
- "desc": "标题",
- "label": ""
- },
- {
- "key": "multiple",
- "type": ["Boolean"],
- "desc": "是否多选",
- "label": ""
- },
- {
- "key": "options",
- "type": ["Array"],
- "desc": "选项数据",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./dropdown-menu/dropdown-item"
- },
- "t-dropdown-menu": {
- "key": "t-dropdown-menu",
- "label": "下拉菜单",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-dropdownmenu.png",
- "properties": [
- {
- "key": "activeColor",
- "type": ["String"],
- "desc": "【讨论中】菜单标题和选项的选中态颜色",
- "label": ""
- },
- {
- "key": "closeOnClickOverlay",
- "type": ["Boolean"],
- "desc": "是否在点击遮罩层后关闭菜单",
- "label": ""
- },
- {
- "key": "duration",
- "type": ["String", "Number"],
- "desc": "动画时长",
- "label": ""
- },
- {
- "key": "showOverlay",
- "type": ["Boolean"],
- "desc": "是否显示遮罩层",
- "label": ""
- },
- {
- "key": "zIndex",
- "type": ["Number"],
- "desc": "菜单栏 z-index 层级",
- "label": ""
- }
- ],
- "tpl": "",
- "require": {
- "t-dropdown-item": "./dropdown-menu/dropdown-item"
- },
- "path": "./dropdown-menu/dropdown-menu"
- },
- "t-empty": {
- "key": "t-empty",
- "label": "空状态",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-empty.png",
- "properties": [
- {
- "key": "action",
- "type": ["String"],
- "desc": "操作按钮",
- "label": ""
- },
- {
- "key": "description",
- "type": ["String"],
- "desc": "描述文字",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String"],
- "desc": "图标名称",
- "label": ""
- },
- {
- "key": "image",
- "type": ["String"],
- "desc": "图片地址",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-description", "t-class-image", "t-class-actions"],
- "tpl": "",
- "path": "./empty/empty"
- },
- "t-fab": {
- "key": "t-fab",
- "label": "悬浮按钮",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-fab.png",
- "properties": [
- {
- "key": "buttonProps",
- "type": ["Object"],
- "desc": "透传至 Button 组件",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String"],
- "desc": "图标",
- "label": ""
- },
- {
- "key": "style",
- "type": ["String"],
- "desc": "悬浮按钮的样式,常用于调整位置",
- "label": ""
- },
- {
- "key": "text",
- "type": ["String"],
- "desc": "文本内容",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:click",
- "desc": "悬浮按钮点击事件",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./fab/fab"
- },
- "t-footer": {
- "key": "t-footer",
- "label": "布局-底部内容",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-footer.png",
- "properties": [
- {
- "key": "copyright",
- "type": ["String"],
- "desc": "版权信息,type 为`text`生效",
- "label": ""
- },
- {
- "key": "logo",
- "type": ["Object"],
- "desc": "图标配置,type 为`logo`生效。`logo.icon` 表示图标链接地址,`logo.title` 表示标题文本,`logo.url` 表示链接跳转地址",
- "label": ""
- },
- {
- "key": "textLinkList",
- "type": ["Array"],
- "desc": "链接列表,type 为`text`生效。name 表示链接名称, url 表示链接 page 路径,目前只支持小程序内部跳转,openType 表示跳转方式",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "页脚展示类型",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./footer/footer"
- },
- "t-grid-item": {
- "key": "t-grid-item",
- "label": "宫格子项",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-grid.png",
- "properties": [
- {
- "key": "badgeProps",
- "type": ["Object"],
- "desc": "头像右上角提示信息,继承 Badge 组件的全部特性。如:小红点,或者数字",
- "label": ""
- },
- {
- "key": "description",
- "type": ["String"],
- "desc": "文本以外的更多描述,辅助信息。可以通过 Props 传入文本,也可以自定义标题节点",
- "label": ""
- },
- {
- "key": "image",
- "type": ["String"],
- "desc": "图片,可以是图片地址,也可以自定义图片节点",
- "label": ""
- },
- {
- "key": "jumpType",
- "type": ["String"],
- "desc": "链接跳转类型",
- "label": ""
- },
- {
- "key": "layout",
- "type": ["String"],
- "desc": "内容布局方式",
- "label": ""
- },
- {
- "key": "text",
- "type": ["String"],
- "desc": "文本,可以通过 Props 传入文本,也可以自定义标题节点",
- "label": ""
- },
- {
- "key": "url",
- "type": ["String"],
- "desc": "点击后的跳转链接",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-image", "t-class-text", "t-class-description"],
- "tpl": "",
- "path": "./grid-item/grid-item"
- },
- "t-grid": {
- "key": "t-grid",
- "label": "栅格",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-grid.png",
- "properties": [
- {
- "key": "align",
- "type": ["String"],
- "desc": "内容对齐方式",
- "label": ""
- },
- {
- "key": "border",
- "type": ["Boolean", "Object"],
- "desc": "边框,默认不显示。值为 true 则显示默认边框,值类型为 object 则表示自定义边框样式",
- "label": ""
- },
- {
- "key": "column",
- "type": ["Number"],
- "desc": "每一行的列数量",
- "label": ""
- },
- {
- "key": "gutter",
- "type": ["Number"],
- "desc": "间隔大小",
- "label": ""
- },
- {
- "key": "hover",
- "type": ["Boolean"],
- "desc": "是否开启点击反馈",
- "label": ""
- }
- ],
- "externalClasses": ["t-class"],
- "tpl": "",
- "require": {
- "t-grid-item": "./grid-item/grid-item"
- },
- "path": "./grid/grid"
- },
- "t-icon": {
- "key": "t-icon",
- "label": "图标",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-icon.png",
- "properties": [
- {
- "key": "classPrefix",
- "type": ["String"],
- "desc": "自定义icon前缀",
- "label": ""
- },
- {
- "key": "color",
- "type": ["String"],
- "desc": "图标颜色",
- "label": ""
- },
- {
- "key": "style",
- "type": ["String"],
- "desc": "自定义样式",
- "label": ""
- },
- {
- "key": "name",
- "type": ["String"],
- "desc": "图标名称",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String", "Number"],
- "desc": "图标名称",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./icon/icon"
- },
- "t-image": {
- "key": "t-image",
- "label": "图片",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-image.png",
- "properties": [
- {
- "key": "error",
- "type": ["String"],
- "desc": "加载失败时显示的内容。值为 `default` 则表示使用默认加载失败风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `error`;值为其他则表示普通文本内容,如“加载失败”",
- "label": ""
- },
- {
- "key": "lazy",
- "type": ["Boolean"],
- "desc": "是否开启图片懒加载",
- "label": ""
- },
- {
- "key": "loading",
- "type": ["String"],
- "desc": "加载态内容。值为 `default` 则表示使用默认加载中风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `loading`;值为其他则表示普通文本内容,如“加载中”",
- "label": ""
- },
- {
- "key": "shape",
- "type": ["String"],
- "desc": "图片圆角类型",
- "label": ""
- },
- {
- "key": "src",
- "type": ["String"],
- "desc": "图片链接",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-load"],
- "events": [
- {
- "key": "bind:error",
- "desc": "图片加载失败时触发",
- "label": ""
- },
- {
- "key": "bind:load",
- "desc": "图片加载完成时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./image/image"
- },
- "t-indexes": {
- "key": "t-indexes",
- "label": "索引",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-indexes.png",
- "properties": [
- {
- "key": "height",
- "type": ["Number"],
- "desc": "列表高度,未设置默认占满设备高度",
- "label": ""
- },
- {
- "key": "list",
- "type": ["Array"],
- "desc": "索引列表的列表数据。每个元素包含三个子元素,index(string):索引值,例如1,2,3,...或A,B,C等;title(string): 索引标题,可不填将默认设为索引值;children(Array<{title: string}>): 子元素列表,title为子元素的展示文案。",
- "label": ""
- },
- {
- "key": "sticky",
- "type": ["Boolean"],
- "desc": "索引是否吸顶,默认为true",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:select",
- "desc": "点击行元素时触发事件",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./indexes/indexes"
- },
- "t-input": {
- "key": "t-input",
- "label": "输入框",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-input.png",
- "properties": [
- {
- "key": "align",
- "type": ["String"],
- "desc": "文本内容位置,居左/居中/居右",
- "label": ""
- },
- {
- "key": "borderless",
- "type": ["Boolean"],
- "desc": "【讨论中】是否开启无边框模式",
- "label": ""
- },
- {
- "key": "clearable",
- "type": ["Boolean"],
- "desc": "是否可清空",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用输入框",
- "label": ""
- },
- {
- "key": "errorMessage",
- "type": ["String"],
- "desc": "错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips)",
- "label": ""
- },
- {
- "key": "format",
- "type": ["String"],
- "desc": "【开发中】指定输入框展示值的格式",
- "label": ""
- },
- {
- "key": "label",
- "type": ["String"],
- "desc": "左侧文本",
- "label": ""
- },
- {
- "key": "maxcharacter",
- "type": ["Number"],
- "desc": "用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用",
- "label": ""
- },
- {
- "key": "maxlength",
- "type": ["Number"],
- "desc": "用户最多可以输入的文本长度,一个中文等于一个计数长度。值小于等于 0 的时候,则表示不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用",
- "label": ""
- },
- {
- "key": "placeholder",
- "type": ["String"],
- "desc": "占位符",
- "label": ""
- },
- {
- "key": "prefixIcon",
- "type": ["String"],
- "desc": "组件前置图标,值为字符串则表示图标名称",
- "label": ""
- },
- {
- "key": "readonly",
- "type": ["Boolean"],
- "desc": "只读状态",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String"],
- "desc": "输入框尺寸",
- "label": ""
- },
- {
- "key": "status",
- "type": ["String"],
- "desc": "输入框状态",
- "label": ""
- },
- {
- "key": "suffix",
- "type": ["String"],
- "desc": "后置图标前的后置内容",
- "label": ""
- },
- {
- "key": "suffixIcon",
- "type": ["String"],
- "desc": "后置文本内容,值为字符串则表示图标名称",
- "label": ""
- },
- {
- "key": "tips",
- "type": ["String"],
- "desc": "输入框下方提示文本,会根据不同的 `status` 呈现不同的样式",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number"],
- "desc": "输入框的值",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-input", "t-class-placeholder", "t-class-error-msg"],
- "events": [
- {
- "key": "bind:blur",
- "desc": "失去焦点时触发",
- "label": ""
- },
- {
- "key": "bind:change",
- "desc": "输入框值发生变化时触发",
- "label": ""
- },
- {
- "key": "bind:clear",
- "desc": "清空按钮点击时触发",
- "label": ""
- },
- {
- "key": "bind:enter",
- "desc": "回车键按下时触发",
- "label": ""
- },
- {
- "key": "bind:focus",
- "desc": "获得焦点时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./input/input"
- },
- "t-loading": {
- "key": "t-loading",
- "label": "加载中",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-loading.png",
- "properties": [
- {
- "key": "delay",
- "type": ["Number"],
- "desc": "延迟显示加载效果的时间,用于防止请求速度过快引起的加载闪烁,单位:毫秒",
- "label": ""
- },
- {
- "key": "duration",
- "type": ["Number"],
- "desc": "加载动画执行完成一次的时间,单位:毫秒",
- "label": ""
- },
- {
- "key": "indicator",
- "type": ["Boolean"],
- "desc": "是否显示加载指示符",
- "label": ""
- },
- {
- "key": "inheritColor",
- "type": ["Boolean"],
- "desc": "是否继承父元素颜色",
- "label": ""
- },
- {
- "key": "layout",
- "type": ["String"],
- "desc": "对齐方式",
- "label": ""
- },
- {
- "key": "loading",
- "type": ["Boolean"],
- "desc": "是否处于加载状态",
- "label": ""
- },
- {
- "key": "pause",
- "type": ["Boolean"],
- "desc": "是否暂停动画",
- "label": ""
- },
- {
- "key": "progress",
- "type": ["Number"],
- "desc": "加载进度",
- "label": ""
- },
- {
- "key": "reverse",
- "type": ["Boolean"],
- "desc": "加载动画是否反向",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String"],
- "desc": "尺寸,示例:40rpx/20px",
- "label": ""
- },
- {
- "key": "text",
- "type": ["String"],
- "desc": "加载提示文案",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "加载组件类型",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-text", "t-class-indicator"],
- "tpl": "",
- "path": "./loading/loading"
- },
- "t-message": {
- "key": "t-message",
- "label": "全局提醒",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-message.png",
- "properties": [
- {
- "key": "action",
- "type": ["String"],
- "desc": "操作",
- "label": ""
- },
- {
- "key": "align",
- "type": ["String"],
- "desc": "文本对齐方式",
- "label": ""
- },
- {
- "key": "closeBtn",
- "type": ["String", "Boolean"],
- "desc": "关闭按钮,可以自定义。值为 true 显示默认关闭按钮,值为 false 不显示关闭按钮。值类型为 string 则直接显示值,如:“关闭”。也可以完全自定义按钮",
- "label": ""
- },
- {
- "key": "content",
- "type": ["String"],
- "desc": "用于自定义消息弹出内容",
- "label": ""
- },
- {
- "key": "duration",
- "type": ["Number"],
- "desc": "消息内置计时器,计时到达时会触发 duration-end 事件。单位:毫秒。值为 0 则表示没有计时器。",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String", "Boolean"],
- "desc": "消息提醒前面的图标。值为 true 则根据 theme 显示对应的图标,值为 false 则不显示图标。值为 'info' 或 'bell' 则显示组件内置图标。也可以完全自定义图标节点",
- "label": ""
- },
- {
- "key": "marquee",
- "type": ["Boolean", "Object"],
- "desc": "跑马灯效果。speed 指速度控制;loop 指循环播放次数,值为 -1 表示循环播放,值为 0 表示不循环播放;delay 表示延迟多久开始播放",
- "label": ""
- },
- {
- "key": "offset",
- "type": ["Array"],
- "desc": "相对于 placement 的偏移量,示例:[-10, 20] 或 ['10rpx', '8rpx']",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "消息组件风格",
- "label": ""
- },
- {
- "key": "visible",
- "type": ["Boolean"],
- "desc": "是否显示,隐藏时默认销毁组件",
- "label": ""
- },
- {
- "key": "zIndex",
- "type": ["Number"],
- "desc": "元素层级,样式默认为 5000",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-content", "t-class-icon", "t-class-action", "t-class-close-btn"],
- "events": [
- {
- "key": "bind:action-btn-click",
- "desc": "当操作按钮存在时,用户点击操作按钮时触发",
- "label": ""
- },
- {
- "key": "bind:close-btn-click",
- "desc": "当关闭按钮存在时,用户点击关闭按钮触发",
- "label": ""
- },
- {
- "key": "bind:duration-end",
- "desc": "计时结束后触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./message/message"
- },
- "t-navbar": {
- "key": "t-navbar",
- "label": "导航条",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-navbar.png",
- "properties": [
- {
- "key": "animation",
- "type": ["Boolean"],
- "desc": "是否添加动画效果",
- "label": ""
- },
- {
- "key": "background",
- "type": ["String"],
- "desc": "背景",
- "label": ""
- },
- {
- "key": "delta",
- "type": ["Number"],
- "desc": "后退按钮后退层数,含义参考 [wx.navigateBack](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html),特殊的,传入 0 不会发生执行 wx.navigateBack,只会触发一个 goback 事件供自行处理。",
- "label": ""
- },
- {
- "key": "fixed",
- "type": ["Boolean"],
- "desc": "是否固定在顶部",
- "label": ""
- },
- {
- "key": "homeIcon",
- "type": ["String"],
- "desc": "首页图标地址。值为 '' 或者 undefiend 则表示不显示返回图标,值为 'circle' 表示显示默认图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址",
- "label": ""
- },
- {
- "key": "leftIcon",
- "type": ["String"],
- "desc": "左侧图标地址,值为 '' 或者 undefiend 则表示不显示返回图标,值为 'arrow-left' 表示显示返回图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址",
- "label": ""
- },
- {
- "key": "title",
- "type": ["String"],
- "desc": "页面标题",
- "label": ""
- },
- {
- "key": "titleMaxLength",
- "type": ["Number"],
- "desc": "标题文字最大长度,超出的范围使用 `...` 表示",
- "label": ""
- },
- {
- "key": "visible",
- "type": ["Boolean"],
- "desc": "是否显示",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-title", "t-class-left-icon", "t-class-home-icon", "t-class-capsule"],
- "events": [
- {
- "key": "bind:complete",
- "desc": "navigateBack 执行完成后触发(失败或成功均会触发)",
- "label": ""
- },
- {
- "key": "bind:fail",
- "desc": "navigateBack 执行失败后触发",
- "label": ""
- },
- {
- "key": "bind:go-back",
- "desc": "delta 值为 0 时,点击返回,触发该事件",
- "label": ""
- },
- {
- "key": "bind:go-home",
- "desc": "点击 Home 触发",
- "label": ""
- },
- {
- "key": "bind:success",
- "desc": "navigateBack 执行成功后触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./navbar/navbar"
- },
- "t-picker-item": {
- "key": "t-picker-item",
- "label": "选择器子项",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-picker.png",
- "properties": [
- {
- "key": "format",
- "type": ["String"],
- "desc": "格式化标签",
- "label": ""
- },
- {
- "key": "options",
- "type": ["Array"],
- "desc": "数据源",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./picker-item/picker-item"
- },
- "t-picker": {
- "key": "t-picker",
- "label": "选择器",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-picker.png",
- "properties": [
- {
- "key": "cancelBtn",
- "type": ["String", "Object"],
- "desc": "取消按钮文字",
- "label": ""
- },
- {
- "key": "confirmBtn",
- "type": ["String", "Object"],
- "desc": "确定按钮文字",
- "label": ""
- },
- {
- "key": "footer",
- "type": ["String"],
- "desc": "底部内容",
- "label": ""
- },
- {
- "key": "header",
- "type": ["Boolean"],
- "desc": "头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容",
- "label": ""
- },
- {
- "key": "title",
- "type": ["String"],
- "desc": "标题",
- "label": ""
- },
- {
- "key": "value",
- "type": ["Array"],
- "desc": "选中值",
- "label": ""
- },
- {
- "key": "visible",
- "type": ["Boolean"],
- "desc": "是否显示",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:cancel",
- "desc": "点击取消按钮时触发",
- "label": ""
- },
- {
- "key": "bind:change",
- "desc": "选中变化时候触发",
- "label": ""
- },
- {
- "key": "bind:pick",
- "desc": "任何一列选中都会触发,不同的列参数不同。`context.column` 表示第几列变化,`context.index` 表示变化那一列的选中项下标",
- "label": ""
- }
- ],
- "tpl": "",
- "require": {
- "t-picker-item": "./picker-item/picker-item"
- },
- "path": "./picker/picker"
- },
- "t-popup": {
- "key": "t-popup",
- "label": "气泡框",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-popup.png",
- "properties": [
- {
- "key": "closeBtn",
- "type": ["Boolean"],
- "desc": "关闭按钮,值类型为 Boolean 时表示是否显示关闭按钮。也可以自定义关闭按钮",
- "label": ""
- },
- {
- "key": "closeOnOverlayClick",
- "type": ["Boolean"],
- "desc": "点击遮罩层是否关闭",
- "label": ""
- },
- {
- "key": "content",
- "type": ["String"],
- "desc": "浮层里面的内容",
- "label": ""
- },
- {
- "key": "placement",
- "type": ["String"],
- "desc": "浮层出现位置",
- "label": ""
- },
- {
- "key": "preventScrollThrough",
- "type": ["Boolean"],
- "desc": "防止滚动穿透",
- "label": ""
- },
- {
- "key": "showOverlay",
- "type": ["Boolean"],
- "desc": "是否显示遮罩层",
- "label": ""
- },
- {
- "key": "transitionProps",
- "type": ["Object"],
- "desc": "动画效果定义",
- "label": ""
- },
- {
- "key": "visible",
- "type": ["Boolean"],
- "desc": "是否显示浮层",
- "label": ""
- },
- {
- "key": "zIndex",
- "type": ["Number"],
- "desc": "组件层级,Web 侧样式默认为 5500,移动端和小程序样式默认为 1500",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-overlay", "t-class-content"],
- "events": [
- {
- "key": "bind:visible-change",
- "desc": "当浮层隐藏或显示时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./popup/popup"
- },
- "t-progress": {
- "key": "t-progress",
- "label": "进度条",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-progress.png",
- "properties": [
- {
- "key": "color",
- "type": ["String", "Object", "Array"],
- "desc": "进度条颜色。示例:'#ED7B2F' 或 'orange' 或 `['#f00', '#0ff', '#f0f']` 或 `{ '0%': '#f00', '100%': '#0ff' }` 或 `{ from: '#000', to: '#000' }` 等",
- "label": ""
- },
- {
- "key": "label",
- "type": ["String", "Boolean"],
- "desc": "进度百分比,可自定义",
- "label": ""
- },
- {
- "key": "percentage",
- "type": ["Number"],
- "desc": "进度条百分比",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String", "Number"],
- "desc": "进度条尺寸,示例:small/medium/large/240。small 值为 72; medium 值为 112;large 值为 160",
- "label": ""
- },
- {
- "key": "status",
- "type": ["String"],
- "desc": "进度条状态",
- "label": ""
- },
- {
- "key": "strokeWidth",
- "type": ["String", "Number"],
- "desc": "进度条线宽。宽度数值不能超过 size 的一半,否则不能输出环形进度",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "进度条风格。值为 line,标签(label)显示在进度条右侧;值为 plump,标签(label)显示在进度条里面;值为 circle,标签(label)显示在进度条正中间",
- "label": ""
- },
- {
- "key": "trackColor",
- "type": ["String"],
- "desc": "进度条未完成部分颜色",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./progress/progress"
- },
- "t-pull-down-refresh": {
- "key": "t-pull-down-refresh",
- "label": "下拉刷新",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-pulldownrefresh.png",
- "properties": [
- {
- "key": "loadingBarHeight",
- "type": ["String", "Number"],
- "desc": "加载中下拉高度,如果值为数字则单位是:'px'",
- "label": ""
- },
- {
- "key": "loadingProps",
- "type": ["Object"],
- "desc": "加载loading样式",
- "label": ""
- },
- {
- "key": "loadingTexts",
- "type": ["Array"],
- "desc": "提示语,组件内部默认值为 ['下拉刷新', '松手刷新', '正在刷新', '刷新完成']",
- "label": ""
- },
- {
- "key": "maxBarHeight",
- "type": ["String", "Number"],
- "desc": "最大下拉高度,如果值为数字则单位是:'px'",
- "label": ""
- },
- {
- "key": "refreshTimeout",
- "type": ["Number"],
- "desc": "刷新超时时间",
- "label": ""
- },
- {
- "key": "value",
- "type": ["Boolean"],
- "desc": "组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-loading", "t-class-text", "t-class-indicator"],
- "events": [
- {
- "key": "bind:change",
- "desc": "下拉或收起时触发,用户手势往下滑动触发下拉状态,手势松开触发收起状态",
- "label": ""
- },
- {
- "key": "bind:refresh",
- "desc": "结束下拉时触发",
- "label": ""
- },
- {
- "key": "bind:timeout",
- "desc": "刷新超时触发",
- "label": ""
- }
- ],
- "tpl": "拖拽该区域演示 中间下拉刷新",
- "path": "./pull-down-refresh/pull-down-refresh"
- },
- "t-radio-group": {
- "key": "t-radio-group",
- "label": "单选框组",
- "icon": "",
- "properties": [
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用全部子单选框",
- "label": ""
- },
- {
- "key": "name",
- "type": ["String"],
- "desc": "HTML 元素原生属性",
- "label": ""
- },
- {
- "key": "options",
- "type": ["Array"],
- "desc": "单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number", "Boolean"],
- "desc": "选中的值",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:change",
- "desc": "选中值发生变化时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "require": {
- "t-radio": "./radio/radio"
- },
- "path": "./radio-group/radio-group"
- },
- "t-radio": {
- "key": "t-radio",
- "label": "单选框",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-radio.png",
- "properties": [
- {
- "key": "align",
- "type": ["String"],
- "desc": "复选框和内容相对位置",
- "label": ""
- },
- {
- "key": "allowUncheck",
- "type": ["Boolean"],
- "desc": "是否允许取消选中",
- "label": ""
- },
- {
- "key": "checked",
- "type": ["Boolean"],
- "desc": "是否选中",
- "label": ""
- },
- {
- "key": "color",
- "type": ["String"],
- "desc": "单选按钮颜色",
- "label": ""
- },
- {
- "key": "content",
- "type": ["String"],
- "desc": "单选内容",
- "label": ""
- },
- {
- "key": "contentDisabled",
- "type": ["Boolean"],
- "desc": "是否禁用组件内容(content)触发选中",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否为禁用态",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String", "Array"],
- "desc": "自定义选中图标和非选中图标。示例:[选中态图标,非选中态图标]。值为 fill-circle 表示图标为填充型图标,值为 stroke-line 表示图标为描边型图标",
- "label": ""
- },
- {
- "key": "label",
- "type": ["String"],
- "desc": "主文案",
- "label": ""
- },
- {
- "key": "maxContentRow",
- "type": ["Number"],
- "desc": "内容最大行数限制",
- "label": ""
- },
- {
- "key": "maxLabelRow",
- "type": ["Number"],
- "desc": "主文案最大行数限制",
- "label": ""
- },
- {
- "key": "name",
- "type": ["String"],
- "desc": "HTML 元素原生属性",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number", "Boolean"],
- "desc": "单选按钮的值",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-icon", "t-class-label", "t-class-content", "t-class-border"],
- "events": [
- {
- "key": "bind:change",
- "desc": "值变化时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./radio/radio"
- },
- "t-rate": {
- "key": "t-rate",
- "label": "评分",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-rate.png",
- "properties": [
- {
- "key": "allowHalf",
- "type": ["Boolean"],
- "desc": "是否允许半选",
- "label": ""
- },
- {
- "key": "color",
- "type": ["String", "Array"],
- "desc": "评分图标的颜色,样式中默认为 #ED7B2F。一个值表示设置选中高亮的五角星颜色,示例:[选中颜色]。数组则表示分别设置 选中高亮的五角星颜色 和 未选中暗灰的五角星颜色,[选中颜色,未选中颜色]。示例:['#ED7B2F', '#E3E6EB']",
- "label": ""
- },
- {
- "key": "count",
- "type": ["Number"],
- "desc": "评分的数量",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用评分",
- "label": ""
- },
- {
- "key": "gap",
- "type": ["Number"],
- "desc": "评分图标的间距",
- "label": ""
- },
- {
- "key": "showText",
- "type": ["Boolean"],
- "desc": "是否显示对应的辅助文字",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String"],
- "desc": "评分图标的大小,示例:`20`",
- "label": ""
- },
- {
- "key": "texts",
- "type": ["Array"],
- "desc": "评分等级对应的辅助文字。组件内置默认值为:['极差', '失望', '一般', '满意', '惊喜']。自定义值示例:['1分', '2分', '3分', '4分', '5分']",
- "label": ""
- },
- {
- "key": "value",
- "type": ["Number"],
- "desc": "选择评分的值",
- "label": ""
- },
- {
- "key": "variant",
- "type": ["String"],
- "desc": "形状类型,有描边类型和填充类型两种",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:change",
- "desc": "评分数改变时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./rate/rate"
- },
- "t-search": {
- "key": "t-search",
- "label": "搜索",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-search.png",
- "properties": [
- {
- "key": "action",
- "type": ["String"],
- "desc": "自定义右侧操作按钮文字",
- "label": ""
- },
- {
- "key": "center",
- "type": ["Boolean"],
- "desc": "是否居中",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用",
- "label": ""
- },
- {
- "key": "focus",
- "type": ["Boolean"],
- "desc": "是否聚焦",
- "label": ""
- },
- {
- "key": "label",
- "type": ["String"],
- "desc": "左侧文本",
- "label": ""
- },
- {
- "key": "leftIcon",
- "type": ["String"],
- "desc": "左侧图标",
- "label": ""
- },
- {
- "key": "placeholder",
- "type": ["String"],
- "desc": "占位符",
- "label": ""
- },
- {
- "key": "rightIcon",
- "type": ["String"],
- "desc": "右侧图标",
- "label": ""
- },
- {
- "key": "shape",
- "type": ["String"],
- "desc": "搜索框形状",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String"],
- "desc": "值",
- "label": ""
- }
- ],
- "externalClasses": [
- "t-class",
- "t-class-input",
- "t-class-input-container",
- "t-class-cancel",
- "t-class-left",
- "t-class-right"
- ],
- "events": [
- {
- "key": "bind:action-click",
- "desc": "点击右侧操作按钮文字时触发",
- "label": ""
- },
- {
- "key": "bind:blur",
- "desc": "失去焦点时触发",
- "label": ""
- },
- {
- "key": "bind:change",
- "desc": "值发生变化时触发",
- "label": ""
- },
- {
- "key": "bind:clear",
- "desc": "点击清除时触发",
- "label": ""
- },
- {
- "key": "bind:focus",
- "desc": "聚焦时触发",
- "label": ""
- },
- {
- "key": "bind:submit",
- "desc": "提交时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./search/search"
- },
- "t-skeleton": {
- "key": "t-skeleton",
- "label": "骨架屏",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-skeleton.png",
- "properties": [
- {
- "key": "animation",
- "type": ["String"],
- "desc": "动画效果,有「渐变加载动画」和「闪烁加载动画」两种。值为 'none' 则表示没有动画",
- "label": ""
- },
- {
- "key": "delay",
- "type": ["Number"],
- "desc": "【开发中】延迟显示加载效果的时间,用于防止请求速度过快引起的加载闪烁,单位:毫秒",
- "label": ""
- },
- {
- "key": "loading",
- "type": ["Boolean"],
- "desc": "是否为加载状态,如果是则显示骨架图,如果不是则显示加载完成的内容",
- "label": ""
- },
- {
- "key": "rowCol",
- "type": ["Array"],
- "desc": "用于设置行列数量、宽度高度、间距等。【示例一】,`[1, 1, 2]` 表示输出三行骨架图,第一行一列,第二行一列,第三行两列。【示例二】,`[1, 1, { width: '100px' }]` 表示自定义第三行的宽度为 `100px`。【示例三】,`[1, 2, [{ width, height }, { width, height, marginLeft }]]` 表示第三行有两列,且自定义宽度、高度和间距",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "骨架图风格,有基础、头像组合等两大类",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-avatar", "t-class-image", "t-class-text"],
- "tpl": "",
- "path": "./skeleton/skeleton"
- },
- "t-slider": {
- "key": "t-slider",
- "label": "滑块",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-slider.png",
- "properties": [
- {
- "key": "colors",
- "type": ["Array"],
- "desc": "颜色,[已选择, 未选择]",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用组件",
- "label": ""
- },
- {
- "key": "disabledColor",
- "type": ["Array"],
- "desc": "禁用状态滑动条的颜色,[已选, 未选]",
- "label": ""
- },
- {
- "key": "label",
- "type": ["String", "Boolean"],
- "desc": "滑块当前值文本。
值为 true 显示默认文案;值为 false 不显示滑块当前值文本;
值为 `${value}%` 则表示组件会根据占位符渲染文案;
值类型为函数时,参数 `value` 标识滑块值,参数 `position=start` 表示范围滑块的起始值,参数 `position=end` 表示范围滑块的终点值",
- "label": ""
- },
- {
- "key": "marks",
- "type": ["Object", "Array"],
- "desc": "刻度标记,示例:`[0, 10, 40, 200]` 或者 `{ 5: '5¥', 10: '10%' }`",
- "label": ""
- },
- {
- "key": "max",
- "type": ["Number"],
- "desc": "滑块范围最大值",
- "label": ""
- },
- {
- "key": "min",
- "type": ["Number"],
- "desc": "滑块范围最小值",
- "label": ""
- },
- {
- "key": "range",
- "type": ["Boolean"],
- "desc": "双游标滑块",
- "label": ""
- },
- {
- "key": "showExtremeValue",
- "type": ["Boolean"],
- "desc": "是否边界值",
- "label": ""
- },
- {
- "key": "step",
- "type": ["Number"],
- "desc": "步长",
- "label": ""
- },
- {
- "key": "value",
- "type": ["Number", "Array"],
- "desc": "滑块值",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-bar", "t-class-bar-active", "t-class-bar-disabled", "t-class-cursor"],
- "events": [
- {
- "key": "bind:change",
- "desc": "滑块值变化时触发",
- "label": ""
- },
- {
- "key": "bind:dragend",
- "desc": "结束拖动时触发",
- "label": ""
- },
- {
- "key": "bind:dragstart",
- "desc": "开始拖动时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./slider/slider"
- },
- "t-step-item": {
- "key": "t-step-item",
- "label": "步骤",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-steps.png",
- "properties": [
- {
- "key": "content",
- "type": ["String"],
- "desc": "步骤描述",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String"],
- "desc": "图标。传入 slot 代表使用插槽,其他字符串代表使用内置图标",
- "label": ""
- },
- {
- "key": "status",
- "type": ["String"],
- "desc": "当前步骤的状态",
- "label": ""
- },
- {
- "key": "subStepItems",
- "type": ["Array"],
- "desc": "子步骤条,仅支持 layout = 'vertical' 时",
- "label": ""
- },
- {
- "key": "title",
- "type": ["String"],
- "desc": "标题",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-content", "t-class-title", "t-class-description", "t-class-extra"],
- "tpl": "",
- "path": "./step-item/step-item"
- },
- "t-stepper": {
- "key": "t-stepper",
- "label": "步进器",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-stepper.png",
- "properties": [
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "禁用全部操作",
- "label": ""
- },
- {
- "key": "disableInput",
- "type": ["Boolean"],
- "desc": "禁用输入框",
- "label": ""
- },
- {
- "key": "inputWidth",
- "type": ["Number"],
- "desc": "输入框宽度",
- "label": ""
- },
- {
- "key": "max",
- "type": ["Number"],
- "desc": "最大值",
- "label": ""
- },
- {
- "key": "min",
- "type": ["Number"],
- "desc": "最小值",
- "label": ""
- },
- {
- "key": "step",
- "type": ["Number"],
- "desc": "步长",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "组件风格",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number"],
- "desc": "值",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-input", "t-class-add", "t-class-minus"],
- "events": [
- {
- "key": "bind:blur",
- "desc": "输入框失去焦点时触发",
- "label": ""
- },
- {
- "key": "bind:change",
- "desc": "数值发生变更时触发",
- "label": ""
- },
- {
- "key": "bind:overlimit",
- "desc": "数值超出限制时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./stepper/stepper"
- },
- "t-steps": {
- "key": "t-steps",
- "label": "步骤条",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-steps.png",
- "properties": [
- {
- "key": "current",
- "type": ["String", "Number"],
- "desc": "当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成",
- "label": ""
- },
- {
- "key": "currentStatus",
- "type": ["String"],
- "desc": "用于控制 current 指向的步骤条的状态",
- "label": ""
- },
- {
- "key": "layout",
- "type": ["String"],
- "desc": "步骤条方向,有两种:横向和纵向",
- "label": ""
- },
- {
- "key": "readonly",
- "type": ["Boolean"],
- "desc": "只读状态",
- "label": ""
- },
- {
- "key": "separator",
- "type": ["String"],
- "desc": "步骤条分割符",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "步骤条风格",
- "label": ""
- }
- ],
- "externalClasses": ["t-class"],
- "events": [
- {
- "key": "bind:change",
- "desc": "当前步骤发生变化时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "require": {
- "t-step-item": "./step-item/step-item"
- },
- "path": "./steps/steps"
- },
- "t-sticky": {
- "key": "t-sticky",
- "label": "吸顶容器",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-sticky.png",
- "properties": [
- {
- "key": "container",
- "type": ["String"],
- "desc": "函数返回容器对应的 NodesRef 节点,将对应节点指定为组件的外部容器,滚动时组件会始终保持在容器范围内,当组件即将超出容器底部时,会返回原位置。",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用组件",
- "label": ""
- },
- {
- "key": "offsetTop",
- "type": ["String", "Number"],
- "desc": "吸顶时与顶部的距离,单位`px`",
- "label": ""
- },
- {
- "key": "zIndex",
- "type": ["Number"],
- "desc": "吸顶时的 z-index",
- "label": ""
- }
- ],
- "externalClasses": ["t-class"],
- "events": [
- {
- "key": "bind:scroll",
- "desc": "滚动时触发,scrollTop: 距离顶部位置,isFixed: 是否吸顶",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./sticky/sticky"
- },
- "t-swipe-cell": {
- "key": "t-swipe-cell",
- "label": "滑动操作",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-swipecell.png",
- "properties": [
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用滑动",
- "label": ""
- },
- {
- "key": "expanded",
- "type": ["String"],
- "desc": "操作项是否呈现为打开态",
- "label": ""
- },
- {
- "key": "left",
- "type": ["Array"],
- "desc": "左侧滑动操作项。所有行为同 `right`",
- "label": ""
- },
- {
- "key": "right",
- "type": ["Array"],
- "desc": "右侧滑动操作项。有两种定义方式,一种是使用数组,二种是使用插槽。`right.text` 表示操作文本,`right.className` 表示操作项类名,`right.style` 表示操作项样式,`right.onClick` 表示点击操作项后执行的回调函数。示例:`[{ text: '删除', style: 'background-color: red', onClick: () => {} }]`",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:click",
- "desc": "操作项点击时触发(插槽写法组件不触发,业务侧自定义内容和事件)",
- "label": ""
- }
- ],
- "tpl": "删除",
- "require": {
- "t-cell": "./cell/cell"
- },
- "path": "./swipe-cell/swipe-cell"
- },
- "t-swiper": {
- "key": "t-swiper",
- "label": "轮播",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-swiper.png",
- "properties": [
- {
- "key": "animation",
- "type": ["String"],
- "desc": "轮播切换动画效果类型",
- "label": ""
- },
- {
- "key": "autoplay",
- "type": ["Boolean"],
- "desc": "是否自动播放",
- "label": ""
- },
- {
- "key": "current",
- "type": ["Number"],
- "desc": "当前轮播在哪一项(下标)",
- "label": ""
- },
- {
- "key": "direction",
- "type": ["String"],
- "desc": "轮播滑动方向,包括横向滑动和纵向滑动两个方向",
- "label": ""
- },
- {
- "key": "duration",
- "type": ["Number"],
- "desc": "滑动动画时长",
- "label": ""
- },
- {
- "key": "height",
- "type": ["Number"],
- "desc": "当使用垂直方向滚动时的高度",
- "label": ""
- },
- {
- "key": "interval",
- "type": ["Number"],
- "desc": "轮播间隔时间",
- "label": ""
- },
- {
- "key": "loop",
- "type": ["Boolean"],
- "desc": "是否循环播放",
- "label": ""
- },
- {
- "key": "navigation",
- "type": ["Object"],
- "desc": "导航器全部配置",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:change",
- "desc": "轮播切换时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "require": {
- "t-swiper-item": "./swiper/swiper-item"
- },
- "path": "./swiper/swiper"
- },
- "t-switch": {
- "key": "t-switch",
- "label": "开关",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-switch.png",
- "properties": [
- {
- "key": "colors",
- "type": ["Array"],
- "desc": "自定义颜色,[打开时的颜色,关闭时的颜色]。组件默认颜色为 ['#0052d9', 'rgba(0, 0, 0, .26']。示例:[blue, gray]",
- "label": ""
- },
- {
- "key": "customValue",
- "type": ["Array"],
- "desc": "开关内容,[打开时的值,关闭时的值]。默认为 [true, false]。示例:[1, 0]",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用组件",
- "label": ""
- },
- {
- "key": "label",
- "type": ["String"],
- "desc": "开关的标签",
- "label": ""
- },
- {
- "key": "loading",
- "type": ["Boolean"],
- "desc": "是否处于加载中状态",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String"],
- "desc": "开关尺寸",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number", "Boolean"],
- "desc": "开关值",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:change",
- "desc": "数据发生变化时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./switch/switch"
- },
- "t-tab-bar-item": {
- "key": "t-tab-bar-item",
- "label": "标签栏选项",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabbar.png",
- "properties": [
- {
- "key": "badgeProps",
- "type": ["Object"],
- "desc": "图标右上角提示信息",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String"],
- "desc": "图标名称",
- "label": ""
- },
- {
- "key": "subTabBar",
- "type": ["Array"],
- "desc": "二级菜单",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number"],
- "desc": "标识符",
- "label": ""
- }
- ],
- "tpl": "{{item.label}}",
- "path": "./tab-bar-item/tab-bar-item"
- },
- "t-tab-bar": {
- "key": "t-tab-bar",
- "label": "标签栏",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabbar.png",
- "properties": [
- {
- "key": "bordered",
- "type": ["Boolean"],
- "desc": "是否显示外边框",
- "label": ""
- },
- {
- "key": "color",
- "type": ["Array"],
- "desc": "标签颜色设置。示例:[选中标签的颜色, 未选中的标签颜色]",
- "label": ""
- },
- {
- "key": "fixed",
- "type": ["Boolean"],
- "desc": "是否固定在底部",
- "label": ""
- },
- {
- "key": "safeAreaInsetBottom",
- "type": ["Boolean"],
- "desc": "是否为 iPhoneX 留出底部安全距离",
- "label": ""
- },
- {
- "key": "split",
- "type": ["Boolean"],
- "desc": "是否需要分割线",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number", "Array"],
- "desc": "当前选中标签的索引",
- "label": ""
- }
- ],
- "externalClasses": ["t-class"],
- "events": [
- {
- "key": "bind:change",
- "desc": "选中标签切换时触发",
- "label": ""
- }
- ],
- "tpl": "{{item.label}}",
- "require": {
- "t-tab-bar-item": "./tab-bar-item/tab-bar-item"
- },
- "path": "./tab-bar/tab-bar"
- },
- "t-tab-panel": {
- "key": "t-tab-panel",
- "label": "选项卡面板",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabs.png",
- "properties": [
- {
- "key": "destroyOnHide",
- "type": ["Boolean"],
- "desc": "选项卡内容隐藏时是否销毁",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用当前选项卡",
- "label": ""
- },
- {
- "key": "label",
- "type": ["String"],
- "desc": "选项卡名称",
- "label": ""
- },
- {
- "key": "panel",
- "type": ["String"],
- "desc": "用于自定义选项卡面板内容",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number"],
- "desc": "选项卡的值,唯一标识",
- "label": ""
- }
- ],
- "tpl": "标签一内容",
- "path": "./tab-panel/tab-panel"
- },
- "t-tabs": {
- "key": "t-tabs",
- "label": "选项卡",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tabs.png",
- "properties": [
- {
- "key": "animation",
- "type": ["Object"],
- "desc": "动画效果设置。其中 duration 表示动画时长",
- "label": ""
- },
- {
- "key": "placement",
- "type": ["String"],
- "desc": "选项卡位置",
- "label": ""
- },
- {
- "key": "showBottomLine",
- "type": ["Boolean"],
- "desc": "是否展示底部激活线条",
- "label": ""
- },
- {
- "key": "stickyProps",
- "type": ["Object"],
- "desc": "是否支持吸顶",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String", "Number"],
- "desc": "激活的选项卡值",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-item", "t-class-active", "t-class-track"],
- "events": [
- {
- "key": "bind:change",
- "desc": "激活的选项卡发生变化时触发",
- "label": ""
- }
- ],
- "tpl": "标签一内容标签二内容",
- "require": {
- "t-tab-panel": "./tab-panel/tab-panel"
- },
- "path": "./tabs/tabs"
- },
- "t-tag": {
- "key": "t-tag",
- "label": "标签",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-tag.png",
- "properties": [
- {
- "key": "closable",
- "type": ["Boolean"],
- "desc": "标签是否可关闭",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "标签禁用态,失效标签不能触发事件。默认风格(theme=default)才有禁用态",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String"],
- "desc": "标签中的图标,可自定义图标呈现",
- "label": ""
- },
- {
- "key": "maxWidth",
- "type": ["String", "Number"],
- "desc": "标签最大宽度,宽度超出后会出现省略号。示例:'50px' / 80",
- "label": ""
- },
- {
- "key": "shape",
- "type": ["String"],
- "desc": "标签类型,有三种:方形、圆角方形、标记型",
- "label": ""
- },
- {
- "key": "size",
- "type": ["String"],
- "desc": "标签尺寸",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "组件风格,用于描述组件不同的应用场景",
- "label": ""
- },
- {
- "key": "variant",
- "type": ["String"],
- "desc": "标签风格变体",
- "label": ""
- }
- ],
- "externalClasses": ["t-class"],
- "events": [
- {
- "key": "bind:click",
- "desc": "点击时触发",
- "label": ""
- },
- {
- "key": "bind:close",
- "desc": "如果关闭按钮存在,点击关闭按钮时触发",
- "label": ""
- }
- ],
- "tpl": "重要",
- "path": "./tag/tag"
- },
- "t-textarea": {
- "key": "t-textarea",
- "label": "文本输入框",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-textarea.png",
- "properties": [
- {
- "key": "adjustPosition",
- "type": ["Boolean"],
- "desc": "键盘弹起时,是否自动上推页面",
- "label": ""
- },
- {
- "key": "autofocus",
- "type": ["Boolean"],
- "desc": "自动聚焦,拉起键盘",
- "label": ""
- },
- {
- "key": "autosize",
- "type": ["Boolean"],
- "desc": "是否自动增高,值为 autosize 时,style.height 不生效",
- "label": ""
- },
- {
- "key": "confirmHold",
- "type": ["Boolean"],
- "desc": "点击键盘右下角按钮时是否保持键盘不收起点",
- "label": ""
- },
- {
- "key": "confirmType",
- "type": ["String"],
- "desc": "设置键盘右下角按钮的文字,仅在 type='text'时生效",
- "label": ""
- },
- {
- "key": "disabled",
- "type": ["Boolean"],
- "desc": "是否禁用文本框",
- "label": ""
- },
- {
- "key": "focus",
- "type": ["Boolean"],
- "desc": "自动聚焦",
- "label": ""
- },
- {
- "key": "label",
- "type": ["String"],
- "desc": "左侧文本",
- "label": ""
- },
- {
- "key": "maxcharacter",
- "type": ["Number"],
- "desc": "用户最多可以输入的字符个数,一个中文汉字表示两个字符长度",
- "label": ""
- },
- {
- "key": "maxlength",
- "type": ["Number"],
- "desc": "用户最多可以输入的字符个数",
- "label": ""
- },
- {
- "key": "placeholder",
- "type": ["String"],
- "desc": "占位符",
- "label": ""
- },
- {
- "key": "value",
- "type": ["String"],
- "desc": "文本框值",
- "label": ""
- }
- ],
- "externalClasses": ["t-class", "t-class-textarea", "t-class-placeholder", "t-class-name"],
- "events": [
- {
- "key": "bind:blur",
- "desc": "失去焦点时触发",
- "label": ""
- },
- {
- "key": "bind:change",
- "desc": "输入内容变化时触发",
- "label": ""
- },
- {
- "key": "bind:enter",
- "desc": "点击完成时触发",
- "label": ""
- },
- {
- "key": "bind:focus",
- "desc": "获得焦点时触发",
- "label": ""
- },
- {
- "key": "bind:line-change",
- "desc": "行高发生变化时触发",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./textarea/textarea"
- },
- "t-toast": {
- "key": "t-toast",
- "label": "轻提示",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-toast.png",
- "properties": [
- {
- "key": "direction",
- "type": ["String"],
- "desc": "图标排列方式",
- "label": ""
- },
- {
- "key": "duration",
- "type": ["Number"],
- "desc": "弹窗显示毫秒数",
- "label": ""
- },
- {
- "key": "icon",
- "type": ["String"],
- "desc": "自定义图标",
- "label": ""
- },
- {
- "key": "message",
- "type": ["String"],
- "desc": "弹窗显示文字",
- "label": ""
- },
- {
- "key": "overlayProps",
- "type": ["Object"],
- "desc": "遮罩层属性,透传至 Overlay",
- "label": ""
- },
- {
- "key": "placement",
- "type": ["String"],
- "desc": "弹窗展示位置",
- "label": ""
- },
- {
- "key": "preventScrollThrough",
- "type": ["Boolean"],
- "desc": "防止滚动穿透,即不允许点击和滚动",
- "label": ""
- },
- {
- "key": "showOverlay",
- "type": ["Boolean"],
- "desc": "是否显示遮罩层",
- "label": ""
- },
- {
- "key": "theme",
- "type": ["String"],
- "desc": "提示类型",
- "label": ""
- }
- ],
- "externalClasses": ["t-class"],
- "tpl": "",
- "path": "./toast/toast"
- },
- "t-transition": {
- "key": "t-transition",
- "label": "动画",
- "icon": "",
- "properties": [
- {
- "key": "appear",
- "type": ["Boolean"],
- "desc": "首次出现是否展示动画",
- "label": ""
- },
- {
- "key": "customClass",
- "type": ["String"],
- "desc": "自定义容器类名",
- "label": ""
- },
- {
- "key": "destoryOnClose",
- "type": ["Boolean"],
- "desc": "隐藏时是否销毁内容",
- "label": ""
- },
- {
- "key": "duration",
- "type": ["Number"],
- "desc": "指定过渡时间",
- "label": ""
- },
- {
- "key": "name",
- "type": ["String"],
- "desc": "过渡类名",
- "label": ""
- },
- {
- "key": "visible",
- "type": ["Boolean"],
- "desc": "是否显示",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./transition/transition"
- },
- "t-upload": {
- "key": "t-upload",
- "label": "上传",
- "icon": "https://tdesign.gtimg.com/site/miniprogram-doc/doc-upload.png",
- "properties": [
- {
- "key": "addContent",
- "type": ["String"],
- "desc": "添加按钮内容。值为空,使用默认图标渲染;值为 slot 则表示使用插槽渲染;其他值无效。",
- "label": ""
- },
- {
- "key": "allowUploadDuplicateFile",
- "type": ["Boolean"],
- "desc": "是否允许重复上传相同文件名的文件",
- "label": ""
- },
- {
- "key": "config",
- "type": ["Object"],
- "desc": "图片上传配置,视频上传配置,文件上传配置等,包含图片尺寸、图片来源、视频来源、视频拍摄最长时间等。更多细节查看小程序官网。[图片上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseImage.html)。[视频上传](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseVideo.html)",
- "label": ""
- },
- {
- "key": "deleteBtn",
- "type": ["String"],
- "desc": "删除图标。值为空,使用默认图标渲染;值为 slot 则表示使用插槽渲染;其他值无效。",
- "label": ""
- },
- {
- "key": "fileListDisplay",
- "type": ["String"],
- "desc": "用于完全自定义文件列表内容",
- "label": ""
- },
- {
- "key": "files",
- "type": ["Array"],
- "desc": "已上传文件列表",
- "label": ""
- },
- {
- "key": "gridConfig",
- "type": ["Object"],
- "desc": "upload组件每行上传图片列数以及图片的宽度和高度",
- "label": ""
- },
- {
- "key": "gutter",
- "type": ["Number"],
- "desc": "预览窗格的 `gutter` 大小,单位 rpx",
- "label": ""
- },
- {
- "key": "imageProps",
- "type": ["Object"],
- "desc": "透传 Image 组件全部属性",
- "label": ""
- },
- {
- "key": "max",
- "type": ["Number"],
- "desc": "用于控制文件上传数量,值为 0 则不限制",
- "label": ""
- },
- {
- "key": "mediaType",
- "type": ["Array"],
- "desc": "支持上传的文件类型,图片或视频",
- "label": ""
- },
- {
- "key": "requestMethod",
- "type": ["String"],
- "desc": "自定义上传方法",
- "label": ""
- },
- {
- "key": "sizeLimit",
- "type": ["Number", "Object"],
- "desc": "图片文件大小限制,单位 KB。可选单位有:`'B' | 'KB' | 'MB' | 'GB'`。示例一:`1000`。示例二:`{ size: 2, unit: 'MB', message: '图片大小不超过 {sizeLimit} MB' }`",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "bind:add",
- "desc": "上传成功后触发,仅包含本次选择的照片;`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述",
- "label": ""
- },
- {
- "key": "bind:complete",
- "desc": "上传成功或失败后触发",
- "label": ""
- },
- {
- "key": "bind:fail",
- "desc": "上传失败后触发",
- "label": ""
- },
- {
- "key": "bind:remove",
- "desc": "移除文件时触发",
- "label": ""
- },
- {
- "key": "bind:select-change",
- "desc": "选择文件或图片之后,上传之前,触发该事件。
`files` 表示之前已经上传完成的文件列表。
`currentSelectedFiles` 表示本次上传选中的文件列表",
- "label": ""
- },
- {
- "key": "bind:success",
- "desc": "上传成功后触发,包含所有上传的文件;`url` 表示选定视频的临时文件路径 (本地路径)。`duration` 表示选定视频的时间长度。`size`选定视频的数据量大小。更多描述参考 wx.chooseMedia 小程序官网描述",
- "label": ""
- }
- ],
- "tpl": "",
- "path": "./upload/upload"
- }
- },
- "common": {
- "properties": {},
- "events": {}
- },
- "menu": [
- {
- "key": "menu-basic",
- "label": "基础",
- "submenu": [
- {
- "key": "subMenu-button",
- "label": "Button 按钮",
- "components": ["t-button"]
- },
- {
- "key": "subMenu-divider",
- "label": "Divider 分割线",
- "components": ["t-divider"]
- },
- {
- "key": "subMenu-fab",
- "label": "Fab 悬浮按钮",
- "components": ["t-fab"]
- },
- {
- "key": "subMenu-icon",
- "label": "Icon 图标",
- "components": ["t-icon"]
- }
- ]
- },
- {
- "key": "menu-nav",
- "label": "导航",
- "submenu": [
- {
- "key": "subMenu-drawer",
- "label": "Drawer 抽屉",
- "components": ["t-drawer"]
- },
- {
- "key": "subMenu-indexes",
- "label": "Indexes 索引",
- "components": ["t-indexes"]
- },
- {
- "key": "subMenu-navbar",
- "label": "Navbar 导航条",
- "components": ["t-navbar"]
- },
- {
- "key": "subMenu-steps",
- "label": "Steps 步骤条",
- "components": ["t-steps"]
- },
- {
- "key": "subMenu-tabbar",
- "label": "TabBar 标签栏",
- "components": ["t-tab-bar"]
- },
- {
- "key": "subMenu-tabs",
- "label": "Tabs 选项卡",
- "components": ["t-tabs"]
- }
- ]
- },
- {
- "key": "menu-input",
- "label": "输入",
- "submenu": [
- {
- "key": "subMenu-checkbox",
- "label": "CheckBox 复选框",
- "components": ["t-checkbox"]
- },
- {
- "key": "subMenu-dateTimePicker",
- "label": "DateTimePicker 时间选择器",
- "components": ["t-date-time-picker"]
- },
- {
- "key": "subMenu-input",
- "label": "Input 输入框",
- "components": ["t-input"]
- },
- {
- "key": "subMenu-picker",
- "label": "Picker 选择器",
- "components": ["t-picker"]
- },
- {
- "key": "subMenu-radio",
- "label": "Radio 单选框",
- "components": ["t-radio"]
- },
- {
- "key": "subMenu-rate",
- "label": "Rate 评分",
- "components": ["t-rate"]
- },
- {
- "key": "subMenu-search",
- "label": "Search 搜索框",
- "components": ["t-search"]
- },
- {
- "key": "subMenu-slider",
- "label": "Slider 滑动选择器",
- "components": ["t-slider"]
- },
- {
- "key": "subMenu-stepper",
- "label": "Stepper 步进器",
- "components": ["t-stepper"]
- },
- {
- "key": "subMenu-switch",
- "label": "Switch 开关",
- "components": ["t-switch"]
- },
- {
- "key": "subMenu-textarea",
- "label": "Textarea 多行文本框",
- "components": ["t-textarea"]
- },
- {
- "key": "subMenu-upload",
- "label": "UpLoad 上传",
- "components": ["t-upload"]
- }
- ]
- },
- {
- "key": "menu-data",
- "label": "数据展示",
- "submenu": [
- {
- "key": "subMenu-avatar",
- "label": "Avatar 头像",
- "components": ["t-avatar"]
- },
- {
- "key": "subMenu-badge",
- "label": "Badge 徽标",
- "components": ["t-badge"]
- },
- {
- "key": "subMenu-cell",
- "label": "Cell 单元格",
- "components": ["t-cell"]
- },
- {
- "key": "subMenu-collapse",
- "label": "Collapse 折叠面板",
- "components": ["t-collapse"]
- },
- {
- "key": "subMenu-dropdown-menu",
- "label": "DropdownMenu 下拉菜单",
- "components": ["t-dropdown-menu"]
- },
- {
- "key": "subMenu-empty",
- "label": "Empty 空状态",
- "components": ["t-empty"]
- },
- {
- "key": "subMenu-footer",
- "label": "Footer 页脚",
- "components": ["t-footer"]
- },
- {
- "key": "subMenu-grid",
- "label": "Grid 宫格",
- "components": ["t-grid"]
- },
- {
- "key": "subMenu-image",
- "label": "Image 图片",
- "components": ["t-image"]
- },
- {
- "key": "subMenu-skeleton",
- "label": "Skeleton 骨架屏",
- "components": ["t-skeleton"]
- },
- {
- "key": "subMenu-sticky",
- "label": "Sticky 吸顶容器",
- "components": ["t-sticky"]
- },
- {
- "key": "subMenu-swiper",
- "label": "Swiper 轮播图",
- "components": ["t-swiper"]
- },
- {
- "key": "subMenu-tag",
- "label": "Tag 标签",
- "components": ["t-tag"]
- }
- ]
- },
- {
- "key": "menu-info",
- "label": "消息提醒",
- "submenu": [
- {
- "key": "subMenu-actionsheet",
- "label": "ActionSheet 动作面板",
- "components": ["t-action-sheet"]
- },
- {
- "key": "subMenu-back-top",
- "label": "BackTop 返回顶部",
- "components": ["t-back-top"]
- },
- {
- "key": "subMenu-dialog",
- "label": "Dialog 弹出框",
- "components": ["t-dialog"]
- },
- {
- "key": "subMenu-loading",
- "label": "Loading 加载",
- "components": ["t-loading"]
- },
- {
- "key": "subMenu-message",
- "label": "Message 消息通知",
- "components": ["t-message"]
- },
- {
- "key": "subMenu-popup",
- "label": "Popup 弹出层",
- "components": ["t-popup"]
- },
- {
- "key": "subMenu-progress",
- "label": "Progress 进度条",
- "components": ["t-progress"]
- },
- {
- "key": "subMenu-pullDownRefresh",
- "label": "PullDownRefresh 下拉刷新",
- "components": ["t-pull-down-refresh"]
- },
- {
- "key": "subMenu-swipeCell",
- "label": "SwipeCell 滑动操作",
- "components": ["t-swipe-cell"]
- },
- {
- "key": "subMenu-toast",
- "label": "Toast 轻提示",
- "components": ["t-toast"]
- }
- ]
- }
- ]
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/README.en-US.md
deleted file mode 100644
index 05103dcf..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/README.en-US.md
+++ /dev/null
@@ -1,45 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Badge Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-color | String | - | \- | N
-content | String | - | \- | N
-count | String / Number / Slot | 0 | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-dot | Boolean | false | \- | N
-max-count | Number | 99 | \- | N
-offset | Array | - | Typescript:`Array` | N
-shape | String | circle | options: circle/square/bubble/ribbon | N
-show-zero | Boolean | false | \- | N
-size | String | medium | options: medium/large | N
-### Badge External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-content | \-
-t-class-count | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-badge-basic-height | 32rpx | -
---td-badge-basic-padding | 8rpx | -
---td-badge-basic-width | 32rpx | -
---td-badge-bg-color | @error-color | -
---td-badge-border-radius | 4rpx | -
---td-badge-bubble-border-radius | 20rpx 20rpx 20rpx 1px | -
---td-badge-dot-size | 16rpx | -
---td-badge-font-size | @font-size-xs | -
---td-badge-font-weight | 600 | -
---td-badge-large-font-size | @font-size-s | -
---td-badge-large-height | 40rpx | -
---td-badge-large-padding | 10rpx | -
---td-badge-text-color | @font-white-1 | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/README.md
deleted file mode 100644
index a253b934..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
----
-title: Badge 徽标
-description: 用于告知用户,该区域的状态变化或者待处理任务的数量。
-spline: data
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-badge": "tdesign-miniprogram/badge/badge"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 组件类型
-
-{{ base }}
-
-### 组件样式
-
-{{ theme }}
-
-### 组件尺寸
-
-{{ size }}
-
-## FAQ
-
-### 如何处理由 ribbon 徽标溢出导致页面出现横向滚动?
-角标溢出问题建议从父容器组件处理。如 #3063 ,可以给父容器 `cell` 组件添加 `overflow: hidden`,处理溢出造成页面出现横向滚动的问题。
-
-## API
-
-### Badge Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-color | String | - | 颜色 | N
-content | String | - | 徽标内容,示例:`content='自定义内容'`。也可以使用默认插槽定义 | N
-count | String / Number / Slot | 0 | 徽标右上角内容。可以是数字,也可以是文字。如:'new'/3/99+。特殊:值为空表示使用插槽渲染。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-dot | Boolean | false | 是否为红点 | N
-max-count | Number | 99 | 封顶的数字值 | N
-offset | Array | - | 设置状态点的位置偏移,示例:[-10, 20] 或 ['10em', '8rem']。TS 类型:`Array` | N
-shape | String | circle | 形状。可选项:circle/square/bubble/ribbon | N
-show-zero | Boolean | false | 当数值为 0 时,是否展示徽标 | N
-size | String | medium | 尺寸。可选项:medium/large | N
-### Badge External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-content | 内容样式类
-t-class-count | 计数样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-badge-basic-height | 32rpx | -
---td-badge-basic-padding | 8rpx | -
---td-badge-basic-width | 32rpx | -
---td-badge-bg-color | @error-color | -
---td-badge-border-radius | 4rpx | -
---td-badge-bubble-border-radius | 20rpx 20rpx 20rpx 1px | -
---td-badge-dot-size | 16rpx | -
---td-badge-font-size | @font-size-xs | -
---td-badge-font-weight | 600 | -
---td-badge-large-font-size | @font-size-s | -
---td-badge-large-height | 40rpx | -
---td-badge-large-padding | 10rpx | -
---td-badge-text-color | @font-white-1 | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.d.ts
deleted file mode 100644
index 2680a17f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-import type { TdBadgeProps } from './type';
-export interface BadgeProps extends TdBadgeProps {
-}
-export default class Badge extends SuperComponent {
- options: {
- multipleSlots: boolean;
- };
- externalClasses: string[];
- properties: TdBadgeProps;
- data: {
- prefix: string;
- classPrefix: string;
- value: string;
- labelID: string;
- descriptionID: string;
- };
- lifetimes: {
- ready(): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.js
deleted file mode 100644
index 370a57e3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.js
+++ /dev/null
@@ -1,43 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { uniqueFactory } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-badge`;
-const getUniqueID = uniqueFactory('badge');
-let Badge = class Badge extends SuperComponent {
- constructor() {
- super(...arguments);
- this.options = {
- multipleSlots: true,
- };
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-count`, `${prefix}-class-content`];
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- value: '',
- labelID: '',
- descriptionID: '',
- };
- this.lifetimes = {
- ready() {
- const uniqueID = getUniqueID();
- this.setData({
- labelID: `${uniqueID}_label`,
- descriptionID: `${uniqueID}_description`,
- });
- },
- };
- }
-};
-Badge = __decorate([
- wxComponent()
-], Badge);
-export default Badge;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.json
deleted file mode 100644
index 4f0a3f08..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {}
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.wxml
deleted file mode 100644
index abc57b79..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.wxml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
- {{content}}
-
-
- {{ this.getBadgeValue({dot, count, maxCount}) }}
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.wxs b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.wxs
deleted file mode 100644
index 613263ca..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.wxs
+++ /dev/null
@@ -1,71 +0,0 @@
-var getBadgeValue = function (props) {
- if (props.dot) {
- return '';
- }
- if (isNaN(props.count) || isNaN(props.maxCount)) {
- return props.count;
- }
- return parseInt(props.count) > props.maxCount ? props.maxCount + '+' : props.count;
-};
-
-var hasUnit = function (unit) {
- return (
- unit.indexOf('px') > 0 ||
- unit.indexOf('rpx') > 0 ||
- unit.indexOf('em') > 0 ||
- unit.indexOf('rem') > 0 ||
- unit.indexOf('%') > 0 ||
- unit.indexOf('vh') > 0 ||
- unit.indexOf('vm') > 0
- );
-};
-
-var getBadgeStyles = function (props) {
- var styleStr = '';
- if (props.color) {
- styleStr += 'background:' + props.color + ';';
- }
- if (props.offset[0]) {
- styleStr +=
- 'left: calc(100% + ' + (hasUnit(props.offset[0].toString()) ? props.offset[0] : props.offset[0] + 'px') + ');';
- }
- if (props.offset[1]) {
- styleStr += 'top:' + (hasUnit(props.offset[1].toString()) ? props.offset[1] : props.offset[1] + 'px') + ';';
- }
- return styleStr;
-};
-
-var getBadgeOuterClass = function (props) {
- var baseClass = 't-badge';
- var classNames = [baseClass, props.shape === 'ribbon' ? baseClass + '__ribbon-outer' : ''];
- return classNames.join(' ');
-};
-
-var getBadgeInnerClass = function (props) {
- var baseClass = 't-badge';
- var classNames = [
- baseClass + '--basic',
- props.dot ? baseClass + '--dot' : '',
- baseClass + '--' + props.size,
- baseClass + '--' + props.shape,
- !props.dot && props.count ? baseClass + '--count' : '',
- ];
- return classNames.join(' ');
-};
-
-var isShowBadge = function (props) {
- if (props.dot) {
- return true;
- }
- if (!props.showZero && !isNaN(props.count) && parseInt(props.count) === 0) {
- return false;
- }
- if (props.count == null) return false;
- return true;
-};
-
-module.exports.getBadgeValue = getBadgeValue;
-module.exports.getBadgeStyles = getBadgeStyles;
-module.exports.getBadgeOuterClass = getBadgeOuterClass;
-module.exports.getBadgeInnerClass = getBadgeInnerClass;
-module.exports.isShowBadge = isShowBadge;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.wxss
deleted file mode 100644
index 5398f031..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/badge.wxss
+++ /dev/null
@@ -1,113 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-badge {
- position: relative;
- display: inline-flex;
- align-items: start;
-}
-.t-badge--basic {
- z-index: 100;
- padding: 0 var(--td-badge-basic-padding, 8rpx);
- font-size: var(--td-badge-font-size, var(--td-font-size-xs, var(--td-font-size, 20rpx)));
- color: var(--td-badge-text-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
- background-color: var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
- text-align: center;
- height: var(--td-badge-basic-height, 32rpx);
- line-height: var(--td-badge-basic-height, 32rpx);
- font-weight: var(--td-badge-font-weight, 600);
- border-radius: var(--td-badge-border-radius, 4rpx);
-}
-.t-badge--dot {
- height: var(--td-badge-dot-size, 16rpx);
- border-radius: 50%;
- min-width: var(--td-badge-dot-size, 16rpx);
- padding: 0;
-}
-.t-badge--count {
- min-width: var(--td-badge-basic-width, 32rpx);
- white-space: nowrap;
- box-sizing: border-box;
-}
-.t-badge--circle {
- border-radius: calc(var(--td-badge-basic-height, 32rpx) / 2);
-}
-.t-badge__ribbon-outer {
- position: absolute;
- top: 0;
- right: 0;
-}
-.t-badge--ribbon {
- position: relative;
- display: inline-block;
- transform-origin: center center;
- transform: translate(calc(50% - var(--td-badge-basic-height, 32rpx) + 1rpx), calc(-50% + var(--td-badge-basic-height, 32rpx) - 1rpx)) rotate(45deg);
- border-radius: 0;
-}
-.t-badge--ribbon::before,
-.t-badge--ribbon::after {
- content: '';
- position: absolute;
- width: 0;
- height: 0;
- bottom: 0;
- border-bottom: var(--td-badge-basic-height, 32rpx) solid var(--td-badge-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
- font-size: 0;
-}
-.t-badge--ribbon::before {
- left: calc(-1 * var(--td-badge-basic-height, 32rpx) + 1rpx);
- border-left: var(--td-badge-basic-height, 32rpx) solid transparent;
-}
-.t-badge--ribbon::after {
- right: calc(-1 * var(--td-badge-basic-height, 32rpx) + 1rpx);
- border-right: var(--td-badge-basic-height, 32rpx) solid transparent;
-}
-.t-badge--bubble {
- border-radius: var(--td-badge-bubble-border-radius, 20rpx 20rpx 20rpx 1px);
-}
-.t-badge--large {
- font-size: var(--td-badge-large-font-size, var(--td-font-size-s, 24rpx));
- height: var(--td-badge-large-height, 40rpx);
- min-width: var(--td-badge-large-height, 40rpx);
- line-height: var(--td-badge-large-height, 40rpx);
- padding: 0 var(--td-badge-large-padding, 10rpx);
-}
-.t-badge--large.t-badge--circle {
- border-radius: calc(var(--td-badge-large-height, 40rpx) / 2);
-}
-.t-badge__content:not(:empty) + .t-has-count {
- transform-origin: center center;
- transform: translate(-50%, -50%);
- position: absolute;
- left: 100%;
- top: 0;
-}
-.t-badge__content-text {
- display: block;
- line-height: 48rpx;
- color: var(--td-badge-content-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/index.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/index.d.ts
deleted file mode 100644
index 85b119ac..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './type';
-export * from './props';
-export * from './badge';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/index.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/index.js
deleted file mode 100644
index 85b119ac..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './type';
-export * from './props';
-export * from './badge';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/props.d.ts
deleted file mode 100644
index e1702fff..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdBadgeProps } from './type';
-declare const props: TdBadgeProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/props.js
deleted file mode 100644
index 095f798b..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/props.js
+++ /dev/null
@@ -1,41 +0,0 @@
-const props = {
- color: {
- type: String,
- value: '',
- },
- content: {
- type: String,
- value: '',
- },
- count: {
- type: null,
- value: 0,
- },
- dot: {
- type: Boolean,
- value: false,
- },
- externalClasses: {
- type: Array,
- },
- maxCount: {
- type: Number,
- value: 99,
- },
- offset: {
- type: Array,
- },
- shape: {
- type: String,
- value: 'circle',
- },
- showZero: {
- type: Boolean,
- value: false,
- },
- size: {
- type: String,
- value: 'medium',
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/type.d.ts
deleted file mode 100644
index 20292711..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/type.d.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-export interface TdBadgeProps {
- color?: {
- type: StringConstructor;
- value?: string;
- };
- content?: {
- type: StringConstructor;
- value?: string;
- };
- count?: {
- type: null;
- value?: string | number;
- };
- dot?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- externalClasses?: {
- type: ArrayConstructor;
- value?: ['t-class', 't-class-content', 't-class-count'];
- };
- maxCount?: {
- type: NumberConstructor;
- value?: number;
- };
- offset?: {
- type: ArrayConstructor;
- value?: Array;
- };
- shape?: {
- type: StringConstructor;
- value?: 'circle' | 'square' | 'bubble' | 'ribbon';
- };
- showZero?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- size?: {
- type: StringConstructor;
- value?: 'medium' | 'large';
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/badge/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/README.en-US.md
deleted file mode 100644
index 7239ad9e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/README.en-US.md
+++ /dev/null
@@ -1,232 +0,0 @@
----
-title: Button
-description: Buttons are used to open a closed-loop task, such as "delete" an object, "buy" an item, etc.
-spline: base
-isComponent: true
----
-
-


-
-
-## Usage
-
-For global import, configure it in `app.json` in the root directory of the miniprogram. For local import, configure it in `index.json` of the page or component that needs to be imported.
-
-```json
-"usingComponents": {
- "t-button": "tdesign-miniprogram/button/button"
-}
-```
-
-
-## Code Demo
-
-### 01 Component Type
-
-#### Basic Buttons
-
-{{ base }}
-
-#### Icon Button
-
-{{ icon-btn }}
-
-#### Ghost Button
-
-{{ ghost-btn }}
-
-#### Combination Button
-
-{{ group-btn }}
-
-#### Banner Button
-
-{{ block-btn }}
-
-### 02 Component State
-
-#### Buttons for different states
-
-{{ disabled }}
-
-### 03 Component Style
-
-#### Different sizes of buttons
-
-{{ size }}
-
-#### Different shaped buttons
-
-{{ shape }}
-
-#### Different color theme buttons
-
-{{ theme }}
-
-
-
-## API
-
-### Button Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-app-parameter | String | - | \- | N
-block | Boolean | false | make button to be a block-level element | N
-content | String / Slot | - | button's children elements。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-custom-dataset | any | - | \- | N
-disabled | Boolean | undefined | disable the button, make it can not be clicked | N
-ghost | Boolean | false | make background-color to be transparent | N
-hover-class | String | - | \- | N
-hover-start-time | Number | 20 | \- | N
-hover-stay-time | Number | 70 | \- | N
-hover-stop-propagation | Boolean | false | \- | N
-icon | String / Object | - | icon name | N
-lang | String | - | message language。options: en/zh_CN/zh_TW | N
-loading | Boolean | false | set button to be loading state | N
-loading-props | Object | - | Typescript:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/button/type.ts) | N
-open-type | String | - | open type of button, [Miniprogram Button](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。options: contact/share/getPhoneNumber/getUserInfo/launchApp/openSetting/feedback/chooseAvatar/agreePrivacyAuthorization | N
-phone-number-no-quota-toast | Boolean | true | \- | N
-send-message-img | String | 截图 | \- | N
-send-message-path | String | 当前分享路径 | \- | N
-send-message-title | String | 当前标题 | \- | N
-session-from | String | - | \- | N
-shape | String | rectangle | button shape。options: rectangle/square/round/circle | N
-show-message-card | Boolean | false | \- | N
-size | String | medium | a button has four size。options: extra-small/small/medium/large | N
-suffix | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-t-id | String | - | id | N
-theme | String | default | button theme。options: default/primary/danger/light | N
-type | String | - | type of button element, same as formType of Miniprogram。options: submit/reset | N
-variant | String | base | variant of button。options: base/outline/dashed/text | N
-
-### Button Events
-
-name | params | description
--- | -- | --
-agreeprivacyauthorization | \- | \-
-chooseavatar | \- | \-
-contact | \- | \-
-createliveactivity | \- | \-
-error | \- | \-
-getphonenumber | \- | \-
-getrealtimephonenumber | \- | \-
-getuserinfo | \- | \-
-launchapp | \- | \-
-opensetting | \- | \-
-tap | `event` | \-
-
-### Button External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-icon | class name of icon
-t-class-loading | class name of loading
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-button-border-radius | @radius-default | -
---td-button-border-width | 4rpx | -
---td-button-danger-active-bg-color | @error-color-active | -
---td-button-danger-active-border-color | @error-color-active | -
---td-button-danger-bg-color | @error-color | -
---td-button-danger-border-color | @error-color | -
---td-button-danger-color | @text-color-anti | -
---td-button-danger-dashed-border-color | @button-danger-dashed-color | -
---td-button-danger-dashed-color | @error-color | -
---td-button-danger-dashed-disabled-color | @button-danger-disabled-color | -
---td-button-danger-disabled-bg | @error-color-3 | -
---td-button-danger-disabled-border-color | @error-color-3 | -
---td-button-danger-disabled-color | @font-white-1 | -
---td-button-danger-outline-active-bg-color | @bg-color-container-active | -
---td-button-danger-outline-active-border-color | @error-color-active | -
---td-button-danger-outline-border-color | @button-danger-outline-color | -
---td-button-danger-outline-color | @error-color | -
---td-button-danger-outline-disabled-color | @error-color-3 | -
---td-button-danger-text-active-bg-color | @bg-color-container-active | -
---td-button-danger-text-color | @error-color | -
---td-button-danger-text-disabled-color | @button-danger-disabled-color | -
---td-button-default-active-bg-color | @bg-color-component-active | -
---td-button-default-active-border-color | @bg-color-component-active | -
---td-button-default-bg-color | @bg-color-component | -
---td-button-default-border-color | @bg-color-component | -
---td-button-default-color | @text-color-primary | -
---td-button-default-disabled-bg | @bg-color-component-disabled | -
---td-button-default-disabled-border-color | @bg-color-component-disabled | -
---td-button-default-disabled-color | @text-color-disabled | -
---td-button-default-outline-active-bg-color | @bg-color-container-active | -
---td-button-default-outline-active-border-color | @component-border | -
---td-button-default-outline-border-color | @component-border | -
---td-button-default-outline-color | @text-color-primary | -
---td-button-default-outline-disabled-color | @component-border | -
---td-button-default-text-active-bg-color | @bg-color-container-active | -
---td-button-extra-small-font-size | @font-size-base | -
---td-button-extra-small-height | 56rpx | -
---td-button-extra-small-icon-font-size | 36rpx | -
---td-button-extra-small-padding-horizontal | 16rpx | -
---td-button-font-weight | 600 | -
---td-button-ghost-border-color | @button-ghost-color | -
---td-button-ghost-color | @text-color-anti | -
---td-button-ghost-danger-border-color | @error-color | -
---td-button-ghost-danger-color | @error-color | -
---td-button-ghost-danger-hover-color | @error-color-active | -
---td-button-ghost-disabled-color | @font-white-4 | -
---td-button-ghost-hover-color | @font-white-2 | -
---td-button-ghost-primary-border-color | @brand-color | -
---td-button-ghost-primary-color | @brand-color | -
---td-button-ghost-primary-hover-color | @brand-color-active | -
---td-button-icon-border-radius | 8rpx | -
---td-button-icon-spacer | @spacer | -
---td-button-large-font-size | @font-size-m | -
---td-button-large-height | 96rpx | -
---td-button-large-icon-font-size | 48rpx | -
---td-button-large-padding-horizontal | 40rpx | -
---td-button-light-active-bg-color | @brand-color-light-active | -
---td-button-light-active-border-color | @brand-color-light-active | -
---td-button-light-bg-color | @brand-color-light | -
---td-button-light-border-color | @brand-color-light | -
---td-button-light-color | @brand-color | -
---td-button-light-disabled-bg | @brand-color-light | -
---td-button-light-disabled-border-color | @brand-color-light | -
---td-button-light-disabled-color | @brand-color-disabled | -
---td-button-light-outline-active-bg-color | @brand-color-light-active | -
---td-button-light-outline-active-border-color | @brand-color-active | -
---td-button-light-outline-bg-color | @brand-color-light | -
---td-button-light-outline-border-color | @button-light-outline-color | -
---td-button-light-outline-color | @brand-color | -
---td-button-light-outline-disabled-color | @brand-color-disabled | -
---td-button-light-text-active-bg-color | @bg-color-container-active | -
---td-button-light-text-color | @brand-color | -
---td-button-medium-font-size | @font-size-m | -
---td-button-medium-height | 80rpx | -
---td-button-medium-icon-font-size | 40rpx | -
---td-button-medium-padding-horizontal | 32rpx | -
---td-button-primary-active-bg-color | @brand-color-active | -
---td-button-primary-active-border-color | @brand-color-active | -
---td-button-primary-bg-color | @brand-color | -
---td-button-primary-border-color | @brand-color | -
---td-button-primary-color | @text-color-anti | -
---td-button-primary-dashed-border-color | @button-primary-dashed-color | -
---td-button-primary-dashed-color | @brand-color | -
---td-button-primary-dashed-disabled-color | @brand-color-disabled | -
---td-button-primary-disabled-bg | @brand-color-disabled | -
---td-button-primary-disabled-border-color | @brand-color-disabled | -
---td-button-primary-disabled-color | @text-color-anti | -
---td-button-primary-outline-active-bg-color | @bg-color-container-active | -
---td-button-primary-outline-active-border-color | @brand-color-active | -
---td-button-primary-outline-border-color | @button-primary-outline-color | -
---td-button-primary-outline-color | @brand-color | -
---td-button-primary-outline-disabled-color | @brand-color-disabled | -
---td-button-primary-text-active-bg-color | @bg-color-container-active | -
---td-button-primary-text-color | @brand-color | -
---td-button-primary-text-disabled-color | @brand-color-disabled | -
---td-button-small-font-size | @font-size-base | -
---td-button-small-height | 64rpx | -
---td-button-small-icon-font-size | 36rpx | -
---td-button-small-padding-horizontal | 24rpx | -
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/README.md
deleted file mode 100644
index 19169464..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/README.md
+++ /dev/null
@@ -1,234 +0,0 @@
----
-title: Button 按钮
-description: 用于开启一个闭环的操作任务,如“删除”对象、“购买”商品等。
-spline: base
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-button": "tdesign-miniprogram/button/button"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-
-### 01 组件类型
-
-#### 基础按钮
-
-{{ base }}
-
-#### 图标按钮
-
-{{ icon-btn }}
-
-#### 幽灵按钮
-
-{{ ghost-btn }}
-
-#### 组合按钮
-
-{{ group-btn }}
-
-#### 通栏按钮
-
-{{ block-btn }}
-
-### 02 组件状态
-
-#### 按钮禁用态
-
-{{ disabled }}
-
-### 03 组件样式
-
-#### 按钮尺寸
-
-{{ size }}
-
-#### 按钮形状
-
-{{ shape }}
-
-#### 按钮主题
-
-{{ theme }}
-
-## API
-
-### Button Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-app-parameter | String | - | 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 | N
-block | Boolean | false | 是否为块级元素 | N
-content | String / Slot | - | 按钮内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-custom-dataset | any | - | 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取 | N
-disabled | Boolean | undefined | 禁用状态。优先级:Button.disabled > Form.disabled | N
-ghost | Boolean | false | 是否为幽灵按钮(镂空按钮) | N
-hover-class | String | - | 指定按钮按下去的样式类,按钮不为加载或禁用状态时有效。当 `hover-class="none"` 时,没有点击态效果 | N
-hover-start-time | Number | 20 | 按住后多久出现点击态,单位毫秒 | N
-hover-stay-time | Number | 70 | 手指松开后点击态保留时间,单位毫秒 | N
-hover-stop-propagation | Boolean | false | 指定是否阻止本节点的祖先节点出现点击态 | N
-icon | String / Object | - | 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon`。 | N
-lang | String | - | 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。。
具体释义:
`en` 英文;
`zh_CN` 简体中文;
`zh_TW` 繁体中文。
[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。。可选项:en/zh_CN/zh_TW | N
-loading | Boolean | false | 是否显示为加载状态 | N
-loading-props | Object | - | 透传 Loading 组件全部属性。TS 类型:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/button/type.ts) | N
-open-type | String | - | 微信开放能力。
具体释义:
`contact` 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从 bindcontact 回调中获得具体信息,具体说明 (*小程序插件中不能使用*);
`share` 触发用户转发,使用前建议先阅读使用指引;
`getPhoneNumber` 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,具体说明 (*小程序插件中不能使用*);
`getUserInfo` 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 (*小程序插件中不能使用*);
`launchApp` 打开APP,可以通过 app-parameter 属性设定向 APP 传的参数具体说明;
`openSetting` 打开授权设置页;
`feedback` 打开“意见反馈”页面,用户可提交反馈内容并上传日志,开发者可以登录小程序管理后台后进入左侧菜单“客服反馈”页面获取到反馈内容;
`chooseAvatar` 获取用户头像,可以从 bindchooseavatar 回调中获取到头像信息;
`agreePrivacyAuthorization`用户同意隐私协议按钮。用户点击一次此按钮后,所有隐私接口可以正常调用。可通过`bindagreeprivacyauthorization`监听用户同意隐私协议事件。隐私合规开发指南详情可见《小程序隐私协议开发指南》。
[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。。可选项:contact/share/getPhoneNumber/getUserInfo/launchApp/openSetting/feedback/chooseAvatar/agreePrivacyAuthorization | N
-phone-number-no-quota-toast | Boolean | true | 原生按钮属性,当手机号快速验证或手机号实时验证额度用尽时,是否对用户展示“申请获取你的手机号,但该功能使用次数已达当前小程序上限,暂时无法使用”的提示,默认展示,open-type="getPhoneNumber" 或 open-type="getRealtimePhoneNumber" 时有效 | N
-send-message-img | String | 截图 | 会话内消息卡片图片,open-type="contact"时有效 | N
-send-message-path | String | 当前分享路径 | 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效 | N
-send-message-title | String | 当前标题 | 会话内消息卡片标题,open-type="contact"时有效 | N
-session-from | String | - | 会话来源,open-type="contact"时有效 | N
-shape | String | rectangle | 按钮形状,有 4 种:长方形、正方形、圆角长方形、圆形。可选项:rectangle/square/round/circle | N
-show-message-card | Boolean | false | 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,open-type="contact"时有效 | N
-size | String | medium | 组件尺寸。可选项:extra-small/small/medium/large | N
-suffix | Slot | - | 右侧内容,可用于定义右侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-t-id | String | - | 按钮标签id | N
-theme | String | default | 组件风格,依次为品牌色、危险色。可选项:default/primary/danger/light | N
-type | String | - | 同小程序的 formType。可选项:submit/reset | N
-variant | String | base | 按钮形式,基础、线框、虚线、文字。可选项:base/outline/dashed/text | N
-
-### Button Events
-
-名称 | 参数 | 描述
--- | -- | --
-agreeprivacyauthorization | \- | 原生按钮属性,用户同意隐私协议事件回调,open-type=agreePrivacyAuthorization时有效 (Tips: 如果使用 onNeedPrivacyAuthorization 接口,需要在 bindagreeprivacyauthorization 触发后再调用 resolve({ event: "agree", buttonId }))
-chooseavatar | \- | 原生按钮属性,获取用户头像回调,`open-type=chooseAvatar` 时有效。返回 `e.detail.avatarUrl` 为头像临时文件链接
-contact | \- | 原生按钮属性,客服消息回调,`open-type="contact"` 时有效
-createliveactivity | \- | 新的一次性订阅消息下发机制回调,`open-type=liveActivity` 时有效
-error | \- | 原生按钮属性,当使用开放能力时,发生错误的回调,`open-type=launchApp` 时有效
-getphonenumber | \- | 原生按钮属性,手机号快速验证回调,open-type=getPhoneNumber时有效。Tips:在触发 bindgetphonenumber 回调后应立即隐藏手机号按钮组件,或置为 disabled 状态,避免用户重复授权手机号产生额外费用
-getrealtimephonenumber | \- | 原生按钮属性,手机号实时验证回调,open-type=getRealtimePhoneNumber 时有效。Tips:在触发 bindgetrealtimephonenumber 回调后应立即隐藏手机号按钮组件,或置为 disabled 状态,避免用户重复授权手机号产生额外费用
-getuserinfo | \- | 原生按钮属性,用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与wx.getUserInfo返回的一致,open-type="getUserInfo"时有效
-launchapp | \- | 打开 APP 成功的回调,`open-type=launchApp` 时有效
-opensetting | \- | 原生按钮属性,在打开授权设置页后回调,open-type=openSetting时有效
-tap | `event` | 点击按钮,当按钮不为加载或禁用状态时触发
-
-### Button External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-icon | 图标样式类
-t-class-loading | 加载样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-button-border-radius | @radius-default | -
---td-button-border-width | 4rpx | -
---td-button-danger-active-bg-color | @error-color-active | -
---td-button-danger-active-border-color | @error-color-active | -
---td-button-danger-bg-color | @error-color | -
---td-button-danger-border-color | @error-color | -
---td-button-danger-color | @text-color-anti | -
---td-button-danger-dashed-border-color | @button-danger-dashed-color | -
---td-button-danger-dashed-color | @error-color | -
---td-button-danger-dashed-disabled-color | @button-danger-disabled-color | -
---td-button-danger-disabled-bg | @error-color-3 | -
---td-button-danger-disabled-border-color | @error-color-3 | -
---td-button-danger-disabled-color | @font-white-1 | -
---td-button-danger-outline-active-bg-color | @bg-color-container-active | -
---td-button-danger-outline-active-border-color | @error-color-active | -
---td-button-danger-outline-border-color | @button-danger-outline-color | -
---td-button-danger-outline-color | @error-color | -
---td-button-danger-outline-disabled-color | @error-color-3 | -
---td-button-danger-text-active-bg-color | @bg-color-container-active | -
---td-button-danger-text-color | @error-color | -
---td-button-danger-text-disabled-color | @button-danger-disabled-color | -
---td-button-default-active-bg-color | @bg-color-component-active | -
---td-button-default-active-border-color | @bg-color-component-active | -
---td-button-default-bg-color | @bg-color-component | -
---td-button-default-border-color | @bg-color-component | -
---td-button-default-color | @text-color-primary | -
---td-button-default-disabled-bg | @bg-color-component-disabled | -
---td-button-default-disabled-border-color | @bg-color-component-disabled | -
---td-button-default-disabled-color | @text-color-disabled | -
---td-button-default-outline-active-bg-color | @bg-color-container-active | -
---td-button-default-outline-active-border-color | @component-border | -
---td-button-default-outline-border-color | @component-border | -
---td-button-default-outline-color | @text-color-primary | -
---td-button-default-outline-disabled-color | @component-border | -
---td-button-default-text-active-bg-color | @bg-color-container-active | -
---td-button-extra-small-font-size | @font-size-base | -
---td-button-extra-small-height | 56rpx | -
---td-button-extra-small-icon-font-size | 36rpx | -
---td-button-extra-small-padding-horizontal | 16rpx | -
---td-button-font-weight | 600 | -
---td-button-ghost-border-color | @button-ghost-color | -
---td-button-ghost-color | @text-color-anti | -
---td-button-ghost-danger-border-color | @error-color | -
---td-button-ghost-danger-color | @error-color | -
---td-button-ghost-danger-hover-color | @error-color-active | -
---td-button-ghost-disabled-color | @font-white-4 | -
---td-button-ghost-hover-color | @font-white-2 | -
---td-button-ghost-primary-border-color | @brand-color | -
---td-button-ghost-primary-color | @brand-color | -
---td-button-ghost-primary-hover-color | @brand-color-active | -
---td-button-icon-border-radius | 8rpx | -
---td-button-icon-spacer | @spacer | -
---td-button-large-font-size | @font-size-m | -
---td-button-large-height | 96rpx | -
---td-button-large-icon-font-size | 48rpx | -
---td-button-large-padding-horizontal | 40rpx | -
---td-button-light-active-bg-color | @brand-color-light-active | -
---td-button-light-active-border-color | @brand-color-light-active | -
---td-button-light-bg-color | @brand-color-light | -
---td-button-light-border-color | @brand-color-light | -
---td-button-light-color | @brand-color | -
---td-button-light-disabled-bg | @brand-color-light | -
---td-button-light-disabled-border-color | @brand-color-light | -
---td-button-light-disabled-color | @brand-color-disabled | -
---td-button-light-outline-active-bg-color | @brand-color-light-active | -
---td-button-light-outline-active-border-color | @brand-color-active | -
---td-button-light-outline-bg-color | @brand-color-light | -
---td-button-light-outline-border-color | @button-light-outline-color | -
---td-button-light-outline-color | @brand-color | -
---td-button-light-outline-disabled-color | @brand-color-disabled | -
---td-button-light-text-active-bg-color | @bg-color-container-active | -
---td-button-light-text-color | @brand-color | -
---td-button-medium-font-size | @font-size-m | -
---td-button-medium-height | 80rpx | -
---td-button-medium-icon-font-size | 40rpx | -
---td-button-medium-padding-horizontal | 32rpx | -
---td-button-primary-active-bg-color | @brand-color-active | -
---td-button-primary-active-border-color | @brand-color-active | -
---td-button-primary-bg-color | @brand-color | -
---td-button-primary-border-color | @brand-color | -
---td-button-primary-color | @text-color-anti | -
---td-button-primary-dashed-border-color | @button-primary-dashed-color | -
---td-button-primary-dashed-color | @brand-color | -
---td-button-primary-dashed-disabled-color | @brand-color-disabled | -
---td-button-primary-disabled-bg | @brand-color-disabled | -
---td-button-primary-disabled-border-color | @brand-color-disabled | -
---td-button-primary-disabled-color | @text-color-anti | -
---td-button-primary-outline-active-bg-color | @bg-color-container-active | -
---td-button-primary-outline-active-border-color | @brand-color-active | -
---td-button-primary-outline-border-color | @button-primary-outline-color | -
---td-button-primary-outline-color | @brand-color | -
---td-button-primary-outline-disabled-color | @brand-color-disabled | -
---td-button-primary-text-active-bg-color | @bg-color-container-active | -
---td-button-primary-text-color | @brand-color | -
---td-button-primary-text-disabled-color | @brand-color-disabled | -
---td-button-small-font-size | @font-size-base | -
---td-button-small-height | 64rpx | -
---td-button-small-icon-font-size | 36rpx | -
---td-button-small-padding-horizontal | 24rpx | -
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.d.ts
deleted file mode 100644
index 4e88efd9..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.d.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-import type { TdButtonProps } from './type';
-export interface ButtonProps extends TdButtonProps {
-}
-export default class Button extends SuperComponent {
- externalClasses: string[];
- behaviors: string[];
- properties: TdButtonProps;
- options: {
- multipleSlots: boolean;
- };
- data: {
- prefix: string;
- className: string;
- classPrefix: string;
- };
- observers: {
- 'theme, size, plain, block, shape, disabled, loading, variant'(): void;
- icon(icon: any): void;
- };
- lifetimes: {
- attached(): void;
- };
- methods: {
- setClass(): void;
- getuserinfo(e: any): void;
- contact(e: any): void;
- getphonenumber(e: any): void;
- error(e: any): void;
- opensetting(e: any): void;
- launchapp(e: any): void;
- chooseavatar(e: any): void;
- agreeprivacyauthorization(e: any): void;
- handleTap(e: any): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.js
deleted file mode 100644
index 54498189..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.js
+++ /dev/null
@@ -1,101 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { canIUseFormFieldButton } from '../common/version';
-import { calcIcon } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-button`;
-let Button = class Button extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-icon`, `${prefix}-class-loading`];
- this.behaviors = canIUseFormFieldButton() ? ['wx://form-field-button'] : [];
- this.properties = props;
- this.options = {
- multipleSlots: true,
- };
- this.data = {
- prefix,
- className: '',
- classPrefix: name,
- };
- this.observers = {
- 'theme, size, plain, block, shape, disabled, loading, variant'() {
- this.setClass();
- },
- icon(icon) {
- this.setData({
- _icon: calcIcon(icon, ''),
- });
- },
- };
- this.lifetimes = {
- attached() {
- this.setClass();
- },
- };
- this.methods = {
- setClass() {
- const classList = [
- name,
- `${prefix}-class`,
- `${name}--${this.data.variant || 'base'}`,
- `${name}--${this.data.theme || 'default'}`,
- `${name}--${this.data.shape || 'rectangle'}`,
- `${name}--size-${this.data.size || 'medium'}`,
- ];
- if (this.data.block) {
- classList.push(`${name}--block`);
- }
- if (this.data.disabled) {
- classList.push(`${name}--disabled`);
- }
- if (this.data.ghost) {
- classList.push(`${name}--ghost`);
- }
- this.setData({
- className: classList.join(' '),
- });
- },
- getuserinfo(e) {
- this.triggerEvent('getuserinfo', e.detail);
- },
- contact(e) {
- this.triggerEvent('contact', e.detail);
- },
- getphonenumber(e) {
- this.triggerEvent('getphonenumber', e.detail);
- },
- error(e) {
- this.triggerEvent('error', e.detail);
- },
- opensetting(e) {
- this.triggerEvent('opensetting', e.detail);
- },
- launchapp(e) {
- this.triggerEvent('launchapp', e.detail);
- },
- chooseavatar(e) {
- this.triggerEvent('chooseavatar', e.detail);
- },
- agreeprivacyauthorization(e) {
- this.triggerEvent('agreeprivacyauthorization', e.detail);
- },
- handleTap(e) {
- if (this.data.disabled || this.data.loading)
- return;
- this.triggerEvent('tap', e);
- },
- };
- }
-};
-Button = __decorate([
- wxComponent()
-], Button);
-export default Button;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.json
deleted file mode 100644
index a32e8cdf..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon",
- "t-loading": "../loading/loading"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.wxml
deleted file mode 100644
index 6b314ecc..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.wxml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.wxss
deleted file mode 100644
index 2a207c2e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/button.wxss
+++ /dev/null
@@ -1,541 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-button--size-extra-small {
- font-size: var(--td-button-extra-small-font-size, var(--td-font-size-base, 28rpx));
- padding-left: var(--td-button-extra-small-padding-horizontal, 16rpx);
- padding-right: var(--td-button-extra-small-padding-horizontal, 16rpx);
- height: var(--td-button-extra-small-height, 56rpx);
- line-height: var(--td-button-extra-small-height, 56rpx);
-}
-.t-button--size-extra-small .t-button__icon {
- font-size: var(--td-button-extra-small-icon-font-size, 36rpx);
-}
-.t-button--size-small {
- font-size: var(--td-button-small-font-size, var(--td-font-size-base, 28rpx));
- padding-left: var(--td-button-small-padding-horizontal, 24rpx);
- padding-right: var(--td-button-small-padding-horizontal, 24rpx);
- height: var(--td-button-small-height, 64rpx);
- line-height: var(--td-button-small-height, 64rpx);
-}
-.t-button--size-small .t-button__icon {
- font-size: var(--td-button-small-icon-font-size, 36rpx);
-}
-.t-button--size-medium {
- font-size: var(--td-button-medium-font-size, var(--td-font-size-m, 32rpx));
- padding-left: var(--td-button-medium-padding-horizontal, 32rpx);
- padding-right: var(--td-button-medium-padding-horizontal, 32rpx);
- height: var(--td-button-medium-height, 80rpx);
- line-height: var(--td-button-medium-height, 80rpx);
-}
-.t-button--size-medium .t-button__icon {
- font-size: var(--td-button-medium-icon-font-size, 40rpx);
-}
-.t-button--size-large {
- font-size: var(--td-button-large-font-size, var(--td-font-size-m, 32rpx));
- padding-left: var(--td-button-large-padding-horizontal, 40rpx);
- padding-right: var(--td-button-large-padding-horizontal, 40rpx);
- height: var(--td-button-large-height, 96rpx);
- line-height: var(--td-button-large-height, 96rpx);
-}
-.t-button--size-large .t-button__icon {
- font-size: var(--td-button-large-icon-font-size, 48rpx);
-}
-.t-button--default {
- color: var(--td-button-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- background-color: var(--td-button-default-bg-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- border-color: var(--td-button-default-border-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-button--default::after {
- border-width: var(--td-button-border-width, 4rpx);
- border-color: var(--td-button-default-border-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-button--default.t-button--hover {
- z-index: 0;
-}
-.t-button--default.t-button--hover,
-.t-button--default.t-button--hover::after {
- background-color: var(--td-button-default-active-bg-color, var(--td-bg-color-component-active, var(--td-gray-color-6, #a6a6a6)));
- border-color: var(--td-button-default-active-border-color, var(--td-bg-color-component-active, var(--td-gray-color-6, #a6a6a6)));
-}
-.t-button--default.t-button--disabled {
- color: var(--td-button-default-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
- background-color: var(--td-button-default-disabled-bg, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
-}
-.t-button--default.t-button--disabled,
-.t-button--default.t-button--disabled::after {
- border-color: var(--td-button-default-disabled-border-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
-}
-.t-button--primary {
- color: var(--td-button-primary-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
- background-color: var(--td-button-primary-bg-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- border-color: var(--td-button-primary-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-button--primary::after {
- border-width: var(--td-button-border-width, 4rpx);
- border-color: var(--td-button-primary-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-button--primary.t-button--hover {
- z-index: 0;
-}
-.t-button--primary.t-button--hover,
-.t-button--primary.t-button--hover::after {
- background-color: var(--td-button-primary-active-bg-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
- border-color: var(--td-button-primary-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
-}
-.t-button--primary.t-button--disabled {
- color: var(--td-button-primary-disabled-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
- background-color: var(--td-button-primary-disabled-bg, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-button--primary.t-button--disabled,
-.t-button--primary.t-button--disabled::after {
- border-color: var(--td-button-primary-disabled-border-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-button--light {
- color: var(--td-button-light-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- background-color: var(--td-button-light-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
- border-color: var(--td-button-light-border-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
-}
-.t-button--light::after {
- border-width: var(--td-button-border-width, 4rpx);
- border-color: var(--td-button-light-border-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
-}
-.t-button--light.t-button--hover {
- z-index: 0;
-}
-.t-button--light.t-button--hover,
-.t-button--light.t-button--hover::after {
- background-color: var(--td-button-light-active-bg-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
- border-color: var(--td-button-light-active-border-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
-}
-.t-button--light.t-button--disabled {
- color: var(--td-button-light-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
- background-color: var(--td-button-light-disabled-bg, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
-}
-.t-button--light.t-button--disabled,
-.t-button--light.t-button--disabled::after {
- border-color: var(--td-button-light-disabled-border-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
-}
-.t-button--danger {
- color: var(--td-button-danger-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
- background-color: var(--td-button-danger-bg-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
- border-color: var(--td-button-danger-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
-}
-.t-button--danger::after {
- border-width: var(--td-button-border-width, 4rpx);
- border-color: var(--td-button-danger-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
-}
-.t-button--danger.t-button--hover {
- z-index: 0;
-}
-.t-button--danger.t-button--hover,
-.t-button--danger.t-button--hover::after {
- background-color: var(--td-button-danger-active-bg-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
- border-color: var(--td-button-danger-active-border-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
-}
-.t-button--danger.t-button--disabled {
- color: var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff));
- background-color: var(--td-button-danger-disabled-bg, var(--td-error-color-3, #ffb9b0));
-}
-.t-button--danger.t-button--disabled,
-.t-button--danger.t-button--disabled::after {
- border-color: var(--td-button-danger-disabled-border-color, var(--td-error-color-3, #ffb9b0));
-}
-.t-button {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- position: relative;
- white-space: nowrap;
- text-align: center;
- background-image: none;
- transition: all 0.3s;
- touch-action: manipulation;
- border-radius: var(--td-button-border-radius, var(--td-radius-default, 12rpx));
- outline: none;
- font-family: PingFang SC, Microsoft YaHei, Arial Regular;
- font-weight: var(--td-button-font-weight, 600);
- vertical-align: top;
- box-sizing: border-box;
- cursor: pointer;
- -webkit-tap-highlight-color: transparent;
- -webkit-user-select: none;
- user-select: none;
- /* stylelint-disable-next-line */
- -webkit-appearance: none;
-}
-.t-button::after {
- border-radius: calc(var(--td-button-border-radius, var(--td-radius-default, 12rpx)) * 2);
-}
-.t-button--text {
- color: var(--td-button-default-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- background-color: transparent;
-}
-.t-button--text,
-.t-button--text::after {
- border: 0;
-}
-.t-button--text.t-button--hover,
-.t-button--text.t-button--hover::after {
- background-color: var(--td-button-default-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-button--text.t-button--primary {
- color: var(--td-button-primary-text-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- background-color: transparent;
-}
-.t-button--text.t-button--primary.t-button--hover,
-.t-button--text.t-button--primary.t-button--hover::after {
- background-color: var(--td-button-primary-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-button--text.t-button--primary.t-button--disabled {
- color: var(--td-button-primary-text-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
- background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
-}
-.t-button--text.t-button--danger {
- color: var(--td-button-danger-text-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
- background-color: transparent;
-}
-.t-button--text.t-button--danger.t-button--hover,
-.t-button--text.t-button--danger.t-button--hover::after {
- background-color: var(--td-button-danger-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-button--text.t-button--danger.t-button--disabled {
- color: var(--td-button-danger-text-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
- background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
-}
-.t-button--text.t-button--light {
- color: var(--td-button-light-text-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- background-color: transparent;
-}
-.t-button--text.t-button--light.t-button--hover,
-.t-button--text.t-button--light.t-button--hover::after {
- background-color: var(--td-button-light-text-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-button--text.t-button--disabled {
- color: var(--td-button-default-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
-}
-.t-button--outline {
- color: var(--td-button-default-outline-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
-}
-.t-button--outline,
-.t-button--outline::after {
- border-color: var(--td-button-default-outline-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
-}
-.t-button--outline.t-button--hover,
-.t-button--outline.t-button--hover::after {
- background-color: var(--td-button-default-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
- border-color: var(--td-button-default-outline-active-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
-}
-.t-button--outline.t-button--disabled {
- color: var(--td-button-default-outline-disabled-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
-}
-.t-button--outline.t-button--disabled,
-.t-button--outline.t-button--disabled::after {
- border-color: var(--td-button-default-outline-disabled-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
-}
-.t-button--outline.t-button--primary {
- color: var(--td-button-primary-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-button--outline.t-button--primary,
-.t-button--outline.t-button--primary::after {
- border-color: var(--td-button-primary-outline-border-color, var(--td-button-primary-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
-}
-.t-button--outline.t-button--primary.t-button--hover {
- color: var(--td-button-primary-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
-}
-.t-button--outline.t-button--primary.t-button--hover::after {
- background-color: var(--td-button-primary-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
- border-color: var(--td-button-primary-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
-}
-.t-button--outline.t-button--primary.t-button--disabled {
- background-color: transparent;
- color: var(--td-button-primary-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-button--outline.t-button--primary.t-button--disabled,
-.t-button--outline.t-button--primary.t-button--disabled::after {
- border-color: var(--td-button-primary-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-button--outline.t-button--danger {
- color: var(--td-button-danger-outline-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
-}
-.t-button--outline.t-button--danger,
-.t-button--outline.t-button--danger::after {
- border-color: var(--td-button-danger-outline-border-color, var(--td-button-danger-outline-color, var(--td-error-color, var(--td-error-color-6, #d54941))));
-}
-.t-button--outline.t-button--danger.t-button--hover {
- color: var(--td-button-danger-outline-active-border-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
-}
-.t-button--outline.t-button--danger.t-button--hover::after {
- background-color: var(--td-button-danger-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
- border-color: var(--td-button-danger-outline-active-border-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
-}
-.t-button--outline.t-button--danger.t-button--disabled {
- background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
- color: var(--td-button-danger-outline-disabled-color, var(--td-error-color-3, #ffb9b0));
-}
-.t-button--outline.t-button--danger.t-button--disabled,
-.t-button--outline.t-button--danger.t-button--disabled::after {
- border-color: var(--td-button-danger-outline-disabled-color, var(--td-error-color-3, #ffb9b0));
-}
-.t-button--outline.t-button--light {
- color: var(--td-button-light-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- background-color: var(--td-button-light-outline-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
-}
-.t-button--outline.t-button--light,
-.t-button--outline.t-button--light::after {
- border-color: var(--td-button-light-outline-border-color, var(--td-button-light-outline-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
-}
-.t-button--outline.t-button--light.t-button--hover {
- color: var(--td-button-light-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
-}
-.t-button--outline.t-button--light.t-button--hover,
-.t-button--outline.t-button--light.t-button--hover::after {
- background-color: var(--td-button-light-outline-active-bg-color, var(--td-brand-color-light-active, var(--td-primary-color-2, #d9e1ff)));
- border-color: var(--td-button-light-outline-active-border-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
-}
-.t-button--outline.t-button--light.t-button--disabled {
- background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
- color: var(--td-button-light-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-button--outline.t-button--light.t-button--disabled,
-.t-button--outline.t-button--light.t-button--disabled::after {
- border-color: var(--td-button-light-outline-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-button--dashed {
- background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
- border-style: dashed;
- border-width: 2rpx;
-}
-.t-button--dashed::after {
- border: 0;
-}
-.t-button--dashed.t-button--hover,
-.t-button--dashed.t-button--hover::after {
- background-color: var(--td-button-default-outline-active-bg-color, var(--td-bg-color-container-active, var(--td-gray-color-3, #e7e7e7)));
- border-color: var(--td-button-default-outline-active-border-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
-}
-.t-button--dashed.t-button--primary {
- color: var(--td-button-primary-dashed-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-button--dashed.t-button--primary,
-.t-button--dashed.t-button--primary::after {
- border-color: var(--td-button-primary-dashed-border-color, var(--td-button-primary-dashed-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
-}
-.t-button--dashed.t-button--primary.t-button--disabled {
- background-color: var(--td-bg-color-container, var(--td-font-white-1, #ffffff));
- color: var(--td-button-primary-dashed-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-button--dashed.t-button--primary.t-button--disabled,
-.t-button--dashed.t-button--primary.t-button--disabled::after {
- border-color: var(--td-button-primary-dashed-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-button--dashed.t-button--danger {
- color: var(--td-button-danger-dashed-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
-}
-.t-button--dashed.t-button--danger,
-.t-button--dashed.t-button--danger::after {
- border-color: var(--td-button-danger-dashed-border-color, var(--td-button-danger-dashed-color, var(--td-error-color, var(--td-error-color-6, #d54941))));
-}
-.t-button--dashed.t-button--danger.t-button--disabled {
- background-color: transparent;
- color: var(--td-button-danger-dashed-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
-}
-.t-button--dashed.t-button--danger.t-button--disabled::after {
- border-color: var(--td-button-danger-dashed-disabled-color, var(--td-button-danger-disabled-color, var(--td-font-white-1, #ffffff)));
-}
-.t-button--ghost {
- background-color: transparent;
- color: var(--td-button-ghost-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
-}
-.t-button--ghost,
-.t-button--ghost::after {
- border-color: var(--td-button-ghost-border-color, var(--td-button-ghost-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff))));
-}
-.t-button--ghost.t-button--default.t-button--hover {
- color: var(--td-button-ghost-hover-color, var(--td-font-white-2, rgba(255, 255, 255, 0.55)));
-}
-.t-button--ghost.t-button--default.t-button--hover,
-.t-button--ghost.t-button--default.t-button--hover::after {
- background-color: transparent;
- border-color: var(--td-button-ghost-hover-color, var(--td-font-white-2, rgba(255, 255, 255, 0.55)));
-}
-.t-button--ghost.t-button--primary {
- color: var(--td-button-ghost-primary-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-button--ghost.t-button--primary,
-.t-button--ghost.t-button--primary::after {
- border-color: var(--td-button-ghost-primary-border-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-button--ghost.t-button--primary.t-button--hover {
- color: var(--td-button-ghost-primary-hover-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
-}
-.t-button--ghost.t-button--primary.t-button--hover,
-.t-button--ghost.t-button--primary.t-button--hover::after {
- background-color: transparent;
- border-color: var(--td-button-ghost-primary-hover-color, var(--td-brand-color-active, var(--td-primary-color-8, #003cab)));
-}
-.t-button--ghost.t-button--primary.t-button--text.t-button--hover,
-.t-button--ghost.t-button--primary.t-button--text.t-button--hover::after {
- background-color: var(--td-gray-color-10, #4b4b4b);
-}
-.t-button--ghost.t-button--primary.t-button--disabled {
- background-color: transparent;
- color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
-}
-.t-button--ghost.t-button--primary.t-button--disabled,
-.t-button--ghost.t-button--primary.t-button--disabled::after {
- border-color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
-}
-.t-button--ghost.t-button--danger {
- color: var(--td-button-ghost-danger-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
-}
-.t-button--ghost.t-button--danger,
-.t-button--ghost.t-button--danger::after {
- border-color: var(--td-button-ghost-danger-border-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
-}
-.t-button--ghost.t-button--danger.t-button--hover {
- color: var(--td-button-ghost-danger-hover-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
-}
-.t-button--ghost.t-button--danger.t-button--hover,
-.t-button--ghost.t-button--danger.t-button--hover::after {
- background-color: transparent;
- border-color: var(--td-button-ghost-danger-hover-color, var(--td-error-color-active, var(--td-error-color-7, #ad352f)));
-}
-.t-button--ghost.t-button--danger.t-button--text.t-button--hover,
-.t-button--ghost.t-button--danger.t-button--text.t-button--hover::after {
- background-color: var(--td-gray-color-10, #4b4b4b);
-}
-.t-button--ghost.t-button--danger.t-button--disabled {
- background-color: transparent;
- color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
-}
-.t-button--ghost.t-button--danger.t-button--disabled,
-.t-button--ghost.t-button--danger.t-button--disabled::after {
- border-color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
-}
-.t-button--ghost.t-button--default.t-button--text.t-button--hover,
-.t-button--ghost.t-button--default.t-button--text.t-button--hover::after {
- background-color: var(--td-gray-color-10, #4b4b4b);
-}
-.t-button--ghost.t-button--default.t-button--disabled {
- background-color: transparent;
- color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
-}
-.t-button--ghost.t-button--default.t-button--disabled,
-.t-button--ghost.t-button--default.t-button--disabled::after {
- border-color: var(--td-button-ghost-disabled-color, var(--td-font-white-4, rgba(255, 255, 255, 0.22)));
-}
-.t-button__loading + .t-button__content:not(:empty),
-.t-button__icon + .t-button__content:not(:empty) {
- margin-left: 8rpx;
-}
-.t-button__icon {
- border-radius: var(--td-button-icon-border-radius, 8rpx);
-}
-.t-button--round.t-button--size-large {
- border-radius: calc(var(--td-button-large-height, 96rpx) / 2);
-}
-.t-button--round.t-button--size-large::after {
- border-radius: var(--td-button-large-height, 96rpx);
-}
-.t-button--round.t-button--size-medium {
- border-radius: calc(var(--td-button-medium-height, 80rpx) / 2);
-}
-.t-button--round.t-button--size-medium::after {
- border-radius: var(--td-button-medium-height, 80rpx);
-}
-.t-button--round.t-button--size-small {
- border-radius: calc(var(--td-button-small-height, 64rpx) / 2);
-}
-.t-button--round.t-button--size-small::after {
- border-radius: var(--td-button-small-height, 64rpx);
-}
-.t-button--round.t-button--size-extra-small {
- border-radius: calc(var(--td-button-extra-small-height, 56rpx) / 2);
-}
-.t-button--round.t-button--size-extra-small::after {
- border-radius: var(--td-button-extra-small-height, 56rpx);
-}
-.t-button--square {
- padding: 0;
-}
-.t-button--square.t-button--size-large {
- width: var(--td-button-large-height, 96rpx);
-}
-.t-button--square.t-button--size-medium {
- width: var(--td-button-medium-height, 80rpx);
-}
-.t-button--square.t-button--size-small {
- width: var(--td-button-small-height, 64rpx);
-}
-.t-button--square.t-button--size-extra-small {
- width: var(--td-button-extra-small-height, 56rpx);
-}
-.t-button--circle {
- padding: 0;
- border-radius: 50%;
-}
-.t-button--circle.t-button--size-large {
- width: var(--td-button-large-height, 96rpx);
-}
-.t-button--circle.t-button--size-large::after {
- border-radius: 50%;
-}
-.t-button--circle.t-button--size-medium {
- width: var(--td-button-medium-height, 80rpx);
-}
-.t-button--circle.t-button--size-medium::after {
- border-radius: 50%;
-}
-.t-button--circle.t-button--size-small {
- width: var(--td-button-small-height, 64rpx);
-}
-.t-button--circle.t-button--size-small::after {
- border-radius: 50%;
-}
-.t-button--circle.t-button--size-extra-small {
- width: var(--td-button-extra-small-height, 56rpx);
-}
-.t-button--circle.t-button--size-extra-small::after {
- border-radius: 50%;
-}
-.t-button--block {
- display: flex;
- width: 100%;
-}
-.t-button--disabled {
- cursor: not-allowed;
-}
-.t-button__loading--wrapper {
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.t-button.t-button--hover::after {
- z-index: -1;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/index.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/index.d.ts
deleted file mode 100644
index beb0ad57..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './props';
-export * from './type';
-export * from './button';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/index.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/index.js
deleted file mode 100644
index beb0ad57..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './props';
-export * from './type';
-export * from './button';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/props.d.ts
deleted file mode 100644
index 00dc5fba..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdButtonProps } from './type';
-declare const props: TdButtonProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/props.js
deleted file mode 100644
index b81e71bd..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/props.js
+++ /dev/null
@@ -1,108 +0,0 @@
-const props = {
- appParameter: {
- type: String,
- value: '',
- },
- block: {
- type: Boolean,
- value: false,
- },
- content: {
- type: String,
- },
- customDataset: {
- type: null,
- },
- disabled: {
- type: null,
- value: undefined,
- },
- ghost: {
- type: Boolean,
- value: false,
- },
- hoverClass: {
- type: String,
- value: '',
- },
- hoverStartTime: {
- type: Number,
- value: 20,
- },
- hoverStayTime: {
- type: Number,
- value: 70,
- },
- hoverStopPropagation: {
- type: Boolean,
- value: false,
- },
- icon: {
- type: null,
- },
- lang: {
- type: String,
- },
- loading: {
- type: Boolean,
- value: false,
- },
- loadingProps: {
- type: Object,
- },
- openType: {
- type: String,
- },
- phoneNumberNoQuotaToast: {
- type: Boolean,
- value: true,
- },
- sendMessageImg: {
- type: String,
- value: '截图',
- },
- sendMessagePath: {
- type: String,
- value: '当前分享路径',
- },
- sendMessageTitle: {
- type: String,
- value: '当前标题',
- },
- sessionFrom: {
- type: String,
- value: '',
- },
- shape: {
- type: String,
- value: 'rectangle',
- },
- showMessageCard: {
- type: Boolean,
- value: false,
- },
- size: {
- type: String,
- value: 'medium',
- },
- style: {
- type: String,
- value: '',
- },
- tId: {
- type: String,
- value: '',
- },
- theme: {
- type: String,
- value: 'default',
- },
- type: {
- type: String,
- },
- variant: {
- type: String,
- value: 'base',
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/type.d.ts
deleted file mode 100644
index 5a07a2a3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/type.d.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-import { LoadingProps } from '../loading/index';
-export interface TdButtonProps {
- appParameter?: {
- type: StringConstructor;
- value?: string;
- };
- block?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- content?: {
- type: StringConstructor;
- value?: string;
- };
- customDataset?: {
- type: null;
- value?: null;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- ghost?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- hoverClass?: {
- type: StringConstructor;
- value?: string;
- };
- hoverStartTime?: {
- type: NumberConstructor;
- value?: number;
- };
- hoverStayTime?: {
- type: NumberConstructor;
- value?: number;
- };
- hoverStopPropagation?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- icon?: {
- type: null;
- value?: string | object;
- };
- lang?: {
- type: StringConstructor;
- value?: 'en' | 'zh_CN' | 'zh_TW';
- };
- loading?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- loadingProps?: {
- type: ObjectConstructor;
- value?: LoadingProps;
- };
- openType?: {
- type: StringConstructor;
- value?: 'contact' | 'share' | 'getPhoneNumber' | 'getUserInfo' | 'launchApp' | 'openSetting' | 'feedback' | 'chooseAvatar' | 'agreePrivacyAuthorization';
- };
- phoneNumberNoQuotaToast?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- sendMessageImg?: {
- type: StringConstructor;
- value?: string;
- };
- sendMessagePath?: {
- type: StringConstructor;
- value?: string;
- };
- sendMessageTitle?: {
- type: StringConstructor;
- value?: string;
- };
- sessionFrom?: {
- type: StringConstructor;
- value?: string;
- };
- shape?: {
- type: StringConstructor;
- value?: 'rectangle' | 'square' | 'round' | 'circle';
- };
- showMessageCard?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- size?: {
- type: StringConstructor;
- value?: 'extra-small' | 'small' | 'medium' | 'large';
- };
- style?: {
- type: StringConstructor;
- value?: string;
- };
- tId?: {
- type: StringConstructor;
- value?: string;
- };
- theme?: {
- type: StringConstructor;
- value?: 'default' | 'primary' | 'danger' | 'light';
- };
- type?: {
- type: StringConstructor;
- value?: 'submit' | 'reset';
- };
- variant?: {
- type: StringConstructor;
- value?: 'base' | 'outline' | 'dashed' | 'text';
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/button/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/button/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.d.ts
deleted file mode 100644
index 30d14dc0..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.d.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-export default class CellGroup extends SuperComponent {
- externalClasses: string[];
- relations: RelationsOptions;
- properties: import("./type").TdCellGroupProps;
- data: {
- prefix: string;
- classPrefix: string;
- };
- methods: {
- updateLastChid(): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.js
deleted file mode 100644
index 966ceece..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.js
+++ /dev/null
@@ -1,43 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-cell-group`;
-let CellGroup = class CellGroup extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-title`];
- this.relations = {
- '../cell/cell': {
- type: 'child',
- linked() {
- this.updateLastChid();
- },
- unlinked() {
- this.updateLastChid();
- },
- },
- };
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- };
- this.methods = {
- updateLastChid() {
- const items = this.$children;
- items.forEach((child, index) => child.setData({ isLastChild: index === items.length - 1 }));
- },
- };
- }
-};
-CellGroup = __decorate([
- wxComponent()
-], CellGroup);
-export default CellGroup;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.json
deleted file mode 100644
index 79f27309..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared"
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.wxml
deleted file mode 100644
index 404f3f31..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.wxml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- {{ title }}
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.wxss
deleted file mode 100644
index 2076b12a..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/cell-group.wxss
+++ /dev/null
@@ -1,71 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-cell-group {
- position: relative;
-}
-.t-cell-group__title {
- font-family: PingFangSC-Regular;
- font-size: var(--td-cell-group-title-font-size, 28rpx);
- color: var(--td-cell-group-title-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
- text-align: left;
- line-height: var(--td-cell-group-title-line-height, 90rpx);
- background-color: var(--td-cell-group-title-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
- padding-left: var(--td-cell-group-title-padding-left, 32rpx);
-}
-.t-cell-group--bordered::before {
- position: absolute;
- box-sizing: border-box;
- content: ' ';
- pointer-events: none;
- right: 0;
- left: 0;
- top: 0;
- border-top: 1px solid var(--td-cell-group-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
- transform: scaleY(0.5);
- transform-origin: 0 0;
- transform-origin: top;
- z-index: 1;
-}
-.t-cell-group--bordered::after {
- position: absolute;
- box-sizing: border-box;
- content: ' ';
- pointer-events: none;
- right: 0;
- left: 0;
- bottom: 0;
- border-bottom: 1px solid var(--td-cell-group-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
- transform: scaleY(0.5);
- transform-origin: bottom;
- z-index: 1;
-}
-.t-cell-group--card {
- margin: 0 32rpx;
- border-radius: var(--td-radius-large, 18rpx);
- overflow: hidden;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/props.d.ts
deleted file mode 100644
index 4c4a9d09..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdCellGroupProps } from './type';
-declare const props: TdCellGroupProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/props.js
deleted file mode 100644
index c8d887e8..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/props.js
+++ /dev/null
@@ -1,17 +0,0 @@
-const props = {
- bordered: {
- type: Boolean,
- },
- externalClasses: {
- type: Array,
- },
- theme: {
- type: String,
- value: 'default',
- },
- title: {
- type: String,
- value: '',
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/type.d.ts
deleted file mode 100644
index 4c111da3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/type.d.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-export interface TdCellGroupProps {
- bordered?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- style?: {
- type: StringConstructor;
- value?: string;
- };
- externalClasses?: {
- type: ArrayConstructor;
- value?: ['t-class'];
- };
- theme?: {
- type: StringConstructor;
- value?: 'default' | 'card';
- };
- title?: {
- type: StringConstructor;
- value?: string;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell-group/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/README.en-US.md
deleted file mode 100644
index afadd5e4..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/README.en-US.md
+++ /dev/null
@@ -1,81 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Cell Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-align | String | middle | options: top/middle/bottom | N
-arrow | Boolean / Object | false | \- | N
-bordered | Boolean | true | \- | N
-description | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-hover | Boolean | - | \- | N
-image | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-jump-type | String | navigateTo | options: switchTab/reLaunch/redirectTo/navigateTo | N
-left-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-note | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-required | Boolean | false | \- | N
-right-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-title | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-url | String | - | \- | N
-
-### Cell Events
-
-name | params | description
--- | -- | --
-click | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
-### Cell External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-center | \-
-t-class-description | \-
-t-class-hover | \-
-t-class-image | \-
-t-class-left | \-
-t-class-left-icon | \-
-t-class-note | \-
-t-class-right | \-
-t-class-right-icon | \-
-t-class-title | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-cell-group-border-color | @component-stroke | -
---td-cell-group-title-bg-color | @bg-color-secondarycontainer | -
---td-cell-group-title-color | @text-color-placeholder | -
---td-cell-group-title-font-size | 28rpx | -
---td-cell-group-title-line-height | 90rpx | -
---td-cell-group-title-padding-left | 32rpx | -
---td-cell-bg-color | @bg-color-container | -
---td-cell-border-color | @component-stroke | -
---td-cell-border-left-space | @cell-horizontal-padding | -
---td-cell-border-right-space | 0 | -
---td-cell-border-width | 1px | -
---td-cell-description-color | @text-color-secondary | -
---td-cell-description-font-size | @font-size-base | -
---td-cell-description-line-height | 44rpx | -
---td-cell-height | auto | -
---td-cell-horizontal-padding | 32rpx | -
---td-cell-hover-color | @bg-color-secondarycontainer | -
---td-cell-image-height | 96rpx | -
---td-cell-image-width | 96rpx | -
---td-cell-left-icon-color | @brand-color | -
---td-cell-left-icon-font-size | 48rpx | -
---td-cell-line-height | 48rpx | -
---td-cell-note-color | @text-color-placeholder | -
---td-cell-note-font-size | @font-size-m | -
---td-cell-required-color | @error-color | -
---td-cell-required-font-size | @font-size-m | -
---td-cell-right-icon-color | @text-color-placeholder | -
---td-cell-right-icon-font-size | 48rpx | -
---td-cell-title-color | @text-color-primary | -
---td-cell-title-font-size | @font-size-m | -
---td-cell-vertical-padding | 32rpx | -
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/README.md
deleted file mode 100644
index a018b413..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/README.md
+++ /dev/null
@@ -1,126 +0,0 @@
----
-title: Cell 单元格
-description: 用于各个类别行的信息展示。
-spline: data
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-cell": "tdesign-miniprogram/cell/cell",
- "t-cell-group": "tdesign-miniprogram/cell-group/cell-group"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 类型
-
-单行单元格
-
-
-
-{{ base }}
-
-多行单元格
-
-
-
-{{ multiple }}
-
-### 样式
-
-卡片单元格
-
-{{ theme }}
-
-## API
-
-### Cell Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-align | String | middle | 内容的对齐方式,默认居中对齐。可选项:top/middle/bottom | N
-arrow | Boolean / Object | false | 是否显示右侧箭头 | N
-bordered | Boolean | true | 是否显示下边框 | N
-description | String / Slot | - | 下方内容描述。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-hover | Boolean | - | 是否开启点击反馈 | N
-image | String / Slot | - | 主图。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-jump-type | String | navigateTo | 链接跳转类型。可选项:switchTab/reLaunch/redirectTo/navigateTo | N
-left-icon | String / Object / Slot | - | 左侧图标,出现在单元格标题的左侧。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-note | String / Slot | - | 和标题同行的说明文字。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-required | Boolean | false | 是否显示表单必填星号 | N
-right-icon | String / Object / Slot | - | 最右侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-title | String / Slot | - | 标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-url | String | - | 点击后跳转链接地址。如果值为空,则表示不需要跳转 | N
-
-### Cell Events
-
-名称 | 参数 | 描述
--- | -- | --
-click | - | 右侧内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
-### Cell External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-center | 中间(`title`, `description`)内容样式类
-t-class-description | 下方描述内容样式类
-t-class-hover | 悬停样式类
-t-class-image | 图片样式类
-t-class-left | 左侧内容样式类
-t-class-left-icon | 左侧图标样式类
-t-class-note | 右侧说明文字样式类
-t-class-right | 右侧内容样式类
-t-class-right-icon | 右侧图标样式类
-t-class-title | 标题样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-cell-group-border-color | @component-stroke | -
---td-cell-group-title-bg-color | @bg-color-secondarycontainer | -
---td-cell-group-title-color | @text-color-placeholder | -
---td-cell-group-title-font-size | 28rpx | -
---td-cell-group-title-line-height | 90rpx | -
---td-cell-group-title-padding-left | 32rpx | -
---td-cell-bg-color | @bg-color-container | -
---td-cell-border-color | @component-stroke | -
---td-cell-border-left-space | @cell-horizontal-padding | -
---td-cell-border-right-space | 0 | -
---td-cell-border-width | 1px | -
---td-cell-description-color | @text-color-secondary | -
---td-cell-description-font-size | @font-size-base | -
---td-cell-description-line-height | 44rpx | -
---td-cell-height | auto | -
---td-cell-horizontal-padding | 32rpx | -
---td-cell-hover-color | @bg-color-secondarycontainer | -
---td-cell-image-height | 96rpx | -
---td-cell-image-width | 96rpx | -
---td-cell-left-icon-color | @brand-color | -
---td-cell-left-icon-font-size | 48rpx | -
---td-cell-line-height | 48rpx | -
---td-cell-note-color | @text-color-placeholder | -
---td-cell-note-font-size | @font-size-m | -
---td-cell-required-color | @error-color | -
---td-cell-required-font-size | @font-size-m | -
---td-cell-right-icon-color | @text-color-placeholder | -
---td-cell-right-icon-font-size | 48rpx | -
---td-cell-title-color | @text-color-primary | -
---td-cell-title-font-size | @font-size-m | -
---td-cell-vertical-padding | 32rpx | -
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.d.ts
deleted file mode 100644
index d6a89102..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.d.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-export default class Cell extends SuperComponent {
- externalClasses: string[];
- relations: RelationsOptions;
- options: {
- multipleSlots: boolean;
- };
- properties: import("./type").TdCellProps;
- data: {
- prefix: string;
- classPrefix: string;
- isLastChild: boolean;
- };
- observers: {
- leftIcon(v: any): void;
- rightIcon(v: any): void;
- arrow(v: any): void;
- };
- setIcon(name: any, value: any, defaultValue: any): void;
- onClick(e: any): void;
- jumpLink(urlKey?: string, link?: string): void;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.js
deleted file mode 100644
index c7c5ec5e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.js
+++ /dev/null
@@ -1,75 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { calcIcon } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-cell`;
-let Cell = class Cell extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [
- `${prefix}-class`,
- `${prefix}-class-title`,
- `${prefix}-class-description`,
- `${prefix}-class-note`,
- `${prefix}-class-hover`,
- `${prefix}-class-image`,
- `${prefix}-class-left`,
- `${prefix}-class-left-icon`,
- `${prefix}-class-center`,
- `${prefix}-class-right`,
- `${prefix}-class-right-icon`,
- ];
- this.relations = {
- '../cell-group/cell-group': {
- type: 'parent',
- },
- };
- this.options = {
- multipleSlots: true,
- };
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- isLastChild: false,
- };
- this.observers = {
- leftIcon(v) {
- this.setIcon('_leftIcon', v, '');
- },
- rightIcon(v) {
- this.setIcon('_rightIcon', v, '');
- },
- arrow(v) {
- this.setIcon('_arrow', v, 'chevron-right');
- },
- };
- }
- setIcon(name, value, defaultValue) {
- this.setData({
- [name]: calcIcon(value, defaultValue),
- });
- }
- onClick(e) {
- this.triggerEvent('click', e.detail);
- this.jumpLink();
- }
- jumpLink(urlKey = 'url', link = 'jumpType') {
- const url = this.data[urlKey];
- const jumpType = this.data[link];
- if (url) {
- wx[jumpType]({ url });
- }
- }
-};
-Cell = __decorate([
- wxComponent()
-], Cell);
-export default Cell;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.json
deleted file mode 100644
index b7d275dd..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon",
- "t-image": "../image/image"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.wxml
deleted file mode 100644
index 1f0a0af1..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.wxml
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ title}}
-
-
- *
-
-
-
-
- {{description}}
-
-
-
-
-
- {{note}}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.wxss
deleted file mode 100644
index 5007e6c1..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/cell.wxss
+++ /dev/null
@@ -1,122 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-cell {
- position: relative;
- display: flex;
- box-sizing: border-box;
- width: 100%;
- padding: var(--td-cell-vertical-padding, 32rpx) var(--td-cell-horizontal-padding, 32rpx);
- line-height: var(--td-cell-line-height, 48rpx);
- height: var(--td-cell-height, auto);
- background-color: var(--td-cell-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-cell::after {
- position: absolute;
- box-sizing: border-box;
- content: ' ';
- pointer-events: none;
- right: 0;
- left: 0;
- bottom: 0;
- border-bottom: var(--td-cell-border-width, 1px) solid var(--td-cell-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
- transform: scaleY(0.5);
- transform-origin: bottom;
- left: var(--td-cell-border-left-space, var(--td-cell-horizontal-padding, 32rpx));
- right: var(--td-cell-border-right-space, 0);
-}
-.t-cell--borderless::after {
- display: none;
-}
-.t-cell__description {
- font-size: var(--td-cell-description-font-size, var(--td-font-size-base, 28rpx));
- line-height: var(--td-cell-description-line-height, 44rpx);
- color: var(--td-cell-description-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
-}
-.t-cell__description-text {
- margin-top: calc(var(--td-spacer, 16rpx) / 2);
-}
-.t-cell__note {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- color: var(--td-cell-note-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
- font-size: var(--td-cell-note-font-size, var(--td-font-size-m, 32rpx));
-}
-.t-cell__title,
-.t-cell__note {
- flex: 1 1 auto;
-}
-.t-cell__title:empty,
-.t-cell__note:empty {
- display: none;
-}
-.t-cell__title-text {
- display: flex;
- font-size: var(--td-cell-title-font-size, var(--td-font-size-m, 32rpx));
- color: var(--td-cell-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- font-weight: 400;
-}
-.t-cell__left,
-.t-cell__right {
- display: flex;
- align-items: center;
-}
-.t-cell__left:not(:empty) {
- margin-right: var(--td-spacer, 16rpx);
-}
-.t-cell__left-icon {
- color: var(--td-cell-left-icon-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- font-size: var(--td-cell-left-icon-font-size, 48rpx);
-}
-.t-cell__left-image {
- height: var(--td-cell-image-height, 96rpx);
- width: var(--td-cell-image-width, 96rpx);
-}
-.t-cell__right {
- margin-left: calc(var(--td-spacer, 16rpx) / 2);
-}
-.t-cell__right-icon {
- color: var(--td-cell-right-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
- font-size: var(--td-cell-right-icon-font-size, 48rpx);
-}
-.t-cell--hover {
- background-color: var(--td-cell-hover-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
-}
-.t-cell--required {
- font-size: var(--td-cell-required-font-size, var(--td-font-size-m, 32rpx));
- color: var(--td-cell-required-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
-}
-.t-cell--middle {
- align-items: center;
-}
-.t-cell--top {
- align-items: flex-start;
-}
-.t-cell--bottom {
- align-items: flex-end;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/props.d.ts
deleted file mode 100644
index ad657e51..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdCellProps } from './type';
-declare const props: TdCellProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/props.js
deleted file mode 100644
index c5382532..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/props.js
+++ /dev/null
@@ -1,48 +0,0 @@
-const props = {
- align: {
- type: String,
- value: 'middle',
- },
- arrow: {
- type: null,
- value: false,
- },
- bordered: {
- type: Boolean,
- value: true,
- },
- description: {
- type: String,
- },
- hover: {
- type: Boolean,
- },
- image: {
- type: String,
- },
- jumpType: {
- type: String,
- value: 'navigateTo',
- },
- leftIcon: {
- type: null,
- },
- note: {
- type: String,
- },
- required: {
- type: Boolean,
- value: false,
- },
- rightIcon: {
- type: null,
- },
- title: {
- type: String,
- },
- url: {
- type: String,
- value: '',
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/type.d.ts
deleted file mode 100644
index 7ba22586..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/type.d.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-export interface TdCellProps {
- align?: {
- type: StringConstructor;
- value?: 'top' | 'middle' | 'bottom';
- };
- arrow?: {
- type: null;
- value?: boolean | object;
- };
- bordered?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- description?: {
- type: StringConstructor;
- value?: string;
- };
- hover?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- image?: {
- type: StringConstructor;
- value?: string;
- };
- jumpType?: {
- type: StringConstructor;
- value?: 'switchTab' | 'reLaunch' | 'redirectTo' | 'navigateTo';
- };
- leftIcon?: {
- type: null;
- value?: string | object;
- };
- note?: {
- type: StringConstructor;
- value?: string;
- };
- required?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- rightIcon?: {
- type: null;
- value?: string | object;
- };
- title?: {
- type: StringConstructor;
- value?: string;
- };
- url?: {
- type: StringConstructor;
- value?: string;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/cell/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.d.ts
deleted file mode 100644
index fe1681bd..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.d.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-export default class CheckBoxGroup extends SuperComponent {
- externalClasses: string[];
- relations: RelationsOptions;
- data: {
- prefix: string;
- classPrefix: string;
- checkboxOptions: any[];
- };
- properties: import("./type").TdCheckboxGroupProps;
- observers: {
- value(): void;
- options(): void;
- disabled(v: any): void;
- };
- lifetimes: {
- ready(): void;
- };
- controlledProps: {
- key: string;
- event: string;
- }[];
- $checkAll: any;
- methods: {
- getChildren(): any;
- updateChildren(): void;
- updateValue({ value, checked, checkAll, item, indeterminate }: {
- value: any;
- checked: any;
- checkAll: any;
- item: any;
- indeterminate: any;
- }): void;
- initWithOptions(): void;
- handleInnerChildChange(e: any): void;
- setCheckall(): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.js
deleted file mode 100644
index 6d57e566..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.js
+++ /dev/null
@@ -1,162 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-checkbox-group`;
-let CheckBoxGroup = class CheckBoxGroup extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`];
- this.relations = {
- '../checkbox/checkbox': {
- type: 'descendant',
- },
- };
- this.data = {
- prefix,
- classPrefix: name,
- checkboxOptions: [],
- };
- this.properties = props;
- this.observers = {
- value() {
- this.updateChildren();
- },
- options() {
- this.initWithOptions();
- },
- disabled(v) {
- var _a;
- if ((_a = this.data.options) === null || _a === void 0 ? void 0 : _a.length) {
- this.initWithOptions();
- return;
- }
- this.getChildren().forEach((item) => {
- item.setDisabled(v);
- });
- },
- };
- this.lifetimes = {
- ready() {
- this.setCheckall();
- },
- };
- this.controlledProps = [
- {
- key: 'value',
- event: 'change',
- },
- ];
- this.$checkAll = null;
- this.methods = {
- getChildren() {
- let items = this.$children;
- if (!items.length) {
- items = this.selectAllComponents(`.${prefix}-checkbox-option`);
- }
- return items || [];
- },
- updateChildren() {
- const items = this.getChildren();
- const { value } = this.data;
- if (items.length > 0) {
- items.forEach((item) => {
- !item.data.checkAll &&
- item.setData({
- checked: value === null || value === void 0 ? void 0 : value.includes(item.data.value),
- });
- });
- if (items.some((item) => item.data.checkAll)) {
- this.setCheckall();
- }
- }
- },
- updateValue({ value, checked, checkAll, item, indeterminate }) {
- let { value: newValue } = this.data;
- const { max } = this.data;
- const keySet = new Set(this.getChildren().map((item) => item.data.value));
- newValue = newValue.filter((value) => keySet.has(value));
- if (max && checked && newValue.length === max)
- return;
- if (checkAll) {
- const items = this.getChildren();
- newValue =
- !checked && indeterminate
- ? items
- .filter(({ data }) => !(data.disabled && !newValue.includes(data.value)))
- .map((item) => item.data.value)
- : items
- .filter(({ data }) => {
- if (data.disabled) {
- return newValue.includes(data.value);
- }
- return checked && !data.checkAll;
- })
- .map(({ data }) => data.value);
- }
- else if (checked) {
- newValue = newValue.concat(value);
- }
- else {
- const index = newValue.findIndex((v) => v === value);
- newValue.splice(index, 1);
- }
- this._trigger('change', { value: newValue, context: item });
- },
- initWithOptions() {
- const { options, value, keys } = this.data;
- if (!(options === null || options === void 0 ? void 0 : options.length) || !Array.isArray(options))
- return;
- const checkboxOptions = options.map((item) => {
- var _a, _b, _c;
- const isLabel = ['number', 'string'].includes(typeof item);
- return isLabel
- ? {
- label: `${item}`,
- value: item,
- checked: value === null || value === void 0 ? void 0 : value.includes(item),
- }
- : Object.assign(Object.assign({}, item), { label: item[(_a = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _a !== void 0 ? _a : 'label'], value: item[(_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value'], checked: value === null || value === void 0 ? void 0 : value.includes(item[(_c = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _c !== void 0 ? _c : 'value']) });
- });
- this.setData({
- checkboxOptions,
- });
- },
- handleInnerChildChange(e) {
- var _a;
- const { item } = e.target.dataset;
- const { checked } = e.detail;
- const rect = {};
- if (item.checkAll) {
- rect.indeterminate = (_a = this.$checkAll) === null || _a === void 0 ? void 0 : _a.data.indeterminate;
- }
- this.updateValue(Object.assign(Object.assign(Object.assign({}, item), { checked, item }), rect));
- },
- setCheckall() {
- const items = this.getChildren();
- if (!this.$checkAll) {
- this.$checkAll = items.find((item) => item.data.checkAll);
- }
- if (!this.$checkAll)
- return;
- const { value } = this.data;
- const valueSet = new Set(value === null || value === void 0 ? void 0 : value.filter((val) => val !== this.$checkAll.data.value));
- const isCheckall = items.every((item) => (item.data.checkAll ? true : valueSet.has(item.data.value)));
- this.$checkAll.setData({
- checked: valueSet.size > 0,
- indeterminate: !isCheckall,
- });
- },
- };
- }
-};
-CheckBoxGroup = __decorate([
- wxComponent()
-], CheckBoxGroup);
-export default CheckBoxGroup;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.json
deleted file mode 100644
index 9d5b437e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-checkbox": "../checkbox/checkbox"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.wxml
deleted file mode 100644
index 7ad58dac..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.wxml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/checkbox-group.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/props.d.ts
deleted file mode 100644
index f6e5bf58..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdCheckboxGroupProps } from './type';
-declare const props: TdCheckboxGroupProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/props.js
deleted file mode 100644
index 008d05ed..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/props.js
+++ /dev/null
@@ -1,34 +0,0 @@
-const props = {
- borderless: {
- type: Boolean,
- value: false,
- },
- disabled: {
- type: null,
- value: undefined,
- },
- keys: {
- type: Object,
- },
- max: {
- type: Number,
- value: undefined,
- },
- name: {
- type: String,
- value: '',
- },
- options: {
- type: Array,
- value: [],
- },
- value: {
- type: Array,
- value: null,
- },
- defaultValue: {
- type: Array,
- value: [],
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/type.d.ts
deleted file mode 100644
index 568a469f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/type.d.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { KeysType } from '../common/common';
-export interface TdCheckboxGroupProps {
- borderless?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- keys?: {
- type: ObjectConstructor;
- value?: KeysType;
- };
- max?: {
- type: NumberConstructor;
- value?: number;
- };
- name?: {
- type: StringConstructor;
- value?: string;
- };
- options?: {
- type: ArrayConstructor;
- value?: Array;
- };
- value?: {
- type: ArrayConstructor;
- value?: T;
- };
- defaultValue?: {
- type: ArrayConstructor;
- value?: T;
- };
-}
-export declare type CheckboxOption = string | number | CheckboxOptionObj;
-export interface CheckboxOptionObj {
- label?: string;
- value?: string | number;
- disabled?: boolean;
- checkAll?: true;
-}
-export declare type CheckboxGroupValue = Array;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox-group/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/README.en-US.md
deleted file mode 100644
index 33355f7d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/README.en-US.md
+++ /dev/null
@@ -1,88 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Checkbox Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-block | Boolean | true | \- | N
-borderless | Boolean | false | \- | N
-check-all | Boolean | false | \- | N
-checked | Boolean | false | \- | N
-default-checked | Boolean | undefined | uncontrolled property | N
-content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-content-disabled | Boolean | - | \- | N
-disabled | Boolean | undefined | \- | N
-icon | String / Array | 'circle' | Typescript:`'circle' \| 'line' \| 'rectangle' \| string[]` | N
-indeterminate | Boolean | false | \- | N
-label | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-max-content-row | Number | 5 | \- | N
-max-label-row | Number | 3 | \- | N
-name | String | - | \- | N
-placement | String | left | options: left/right | N
-readonly | Boolean | false | \- | N
-value | String / Number / Boolean | - | value of checkbox。Typescript:`string \| number \| boolean` | N
-
-### Checkbox Events
-
-name | params | description
--- | -- | --
-change | `(checked: boolean, context: { value: boolean\|number\|string, label: boolean\|number\|string })` | \-
-
-### Checkbox External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-border | \-
-t-class-content | \-
-t-class-icon | \-
-t-class-label | \-
-
-
-### CheckboxGroup Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-borderless | Boolean | false | \- | N
-disabled | Boolean | undefined | \- | N
-keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-max | Number | undefined | \- | N
-name | String | - | \- | N
-options | Array | [] | Typescript:`Array` `type CheckboxOption = string \| number \| CheckboxOptionObj` `interface CheckboxOptionObj { label?: string; value?: string \| number; disabled?: boolean; checkAll?: true }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
-value | Array | [] | Typescript:`T` `type CheckboxGroupValue = Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
-default-value | Array | undefined | uncontrolled property。Typescript:`T` `type CheckboxGroupValue = Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
-
-### CheckboxGroup Events
-
-name | params | description
--- | -- | --
-change | `(value: CheckboxGroupValue, context: { value: boolean\|number\|string, label: boolean\|number\|string })` | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-checkbox-bg-color | @bg-color-container | -
---td-checkbox-border-color | @component-stroke | -
---td-checkbox-description-color | @text-color-secondary | -
---td-checkbox-description-disabled-color | @text-color-disabled | -
---td-checkbox-description-line-height | 44rpx | -
---td-checkbox-font-size | 32rpx | -
---td-checkbox-icon-checked-color | @brand-color | -
---td-checkbox-icon-color | @component-border | -
---td-checkbox-icon-disabled-bg-color | @bg-color-component-disabled | -
---td-checkbox-icon-disabled-color | @brand-color-disabled | -
---td-checkbox-icon-size | 48rpx | -
---td-checkbox-tag-active-bg-color | @brand-color-light | -
---td-checkbox-tag-active-color | @brand-color | -
---td-checkbox-title-color | @text-color-primary | -
---td-checkbox-title-disabled-color | @text-color-disabled | -
---td-checkbox-title-line-height | 48rpx | -
---td-checkbox-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/README.md
deleted file mode 100644
index f6030c16..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/README.md
+++ /dev/null
@@ -1,152 +0,0 @@
----
-title: Checkbox 多选框
-description: 用于预设的一组选项中执行多项选择,并呈现选择结果。
-spline: form
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
- "t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 组件类型
-
-纵向多选框
-
-{{ base }}
-
-横向多选框
-
-{{ horizontal }}
-
-带全选多选框
-
-{{ all }}
-
-### 组件状态
-
-多选框状态
-
-{{ status }}
-
-### 组件样式
-
-勾选样式
-
-{{ type }}
-
-勾选显示位置
-
-{{ right }}
-
-非通栏多选样式
-
-{{ card }}
-
-### 组件规格
-
-多选框尺寸规格
-
-{{ special }}
-
-## API
-
-### Checkbox Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-block | Boolean | true | 是否为块级元素 | N
-borderless | Boolean | false | 是否开启无边框模式 | N
-check-all | Boolean | false | 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 | N
-checked | Boolean | false | 是否选中 | N
-default-checked | Boolean | undefined | 是否选中。非受控属性 | N
-content | String / Slot | - | 多选框内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-content-disabled | Boolean | - | 是否禁用组件内容(content)触发选中 | N
-disabled | Boolean | undefined | 是否禁用组件。如果父组件存在 CheckboxGroup,默认值由 CheckboxGroup.disabled 控制。优先级:Checkbox.disabled > CheckboxGroup.disabled > Form.disabled | N
-icon | String / Array | 'circle' | 自定义选中图标和非选中图标。使用 Array 时表示:`[选中态图标,非选中态图标,半选中态图标]`。使用 String 时,值为 circle 表示填充圆形图标、值为 line 表示描边型图标、值为 rectangle 表示填充矩形图标。TS 类型:`'circle' \| 'line' \| 'rectangle' \| string[]` | N
-indeterminate | Boolean | false | 是否为半选 | N
-label | String / Slot | - | 主文案。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-max-content-row | Number | 5 | 内容最大行数限制 | N
-max-label-row | Number | 3 | 主文案最大行数限制 | N
-name | String | - | HTML 元素原生属性 | N
-placement | String | left | 多选框和内容相对位置。可选项:left/right | N
-readonly | Boolean | false | 只读状态 | N
-value | String / Number / Boolean | - | 多选框的值。TS 类型:`string \| number \| boolean` | N
-
-### Checkbox Events
-
-名称 | 参数 | 描述
--- | -- | --
-change | `(checked: boolean, context: { value: boolean\|number\|string, label: boolean\|number\|string })` | 值变化时触发。`context` 表示当前点击项内容。
-
-### Checkbox External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-border | 边框样式类
-t-class-content | 内容样式类
-t-class-icon | 图标样式类
-t-class-label | 标签样式类
-
-
-### CheckboxGroup Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-borderless | Boolean | false | 是否开启无边框模式 | N
-disabled | Boolean | undefined | 是否禁用组件。优先级:Form.disabled < CheckboxGroup.disabled < Checkbox.disabled | N
-keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-max | Number | undefined | 支持最多选中的数量 | N
-name | String | - | 统一设置内部复选框 HTML 属性 | N
-options | Array | [] | 以配置形式设置子元素。示例1:`['北京', '上海']` ,示例2: `[{ label: '全选', checkAll: true }, { label: '上海', value: 'shanghai' }]`。checkAll 值为 true 表示当前选项为「全选选项」。TS 类型:`Array` `type CheckboxOption = string \| number \| CheckboxOptionObj` `interface CheckboxOptionObj { label?: string; value?: string \| number; disabled?: boolean; checkAll?: true }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
-value | Array | [] | 选中值。TS 类型:`T` `type CheckboxGroupValue = Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
-default-value | Array | undefined | 选中值。非受控属性。TS 类型:`T` `type CheckboxGroupValue = Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
-
-### CheckboxGroup Events
-
-名称 | 参数 | 描述
--- | -- | --
-change | `(value: CheckboxGroupValue, context: { value: boolean\|number\|string, label: boolean\|number\|string })` | 值变化时触发。`context` 表示当前点击项内容。
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-checkbox-bg-color | @bg-color-container | -
---td-checkbox-border-color | @component-stroke | -
---td-checkbox-description-color | @text-color-secondary | -
---td-checkbox-description-disabled-color | @text-color-disabled | -
---td-checkbox-description-line-height | 44rpx | -
---td-checkbox-font-size | 32rpx | -
---td-checkbox-icon-checked-color | @brand-color | -
---td-checkbox-icon-color | @component-border | -
---td-checkbox-icon-disabled-bg-color | @bg-color-component-disabled | -
---td-checkbox-icon-disabled-color | @brand-color-disabled | -
---td-checkbox-icon-size | 48rpx | -
---td-checkbox-tag-active-bg-color | @brand-color-light | -
---td-checkbox-tag-active-color | @brand-color | -
---td-checkbox-title-color | @text-color-primary | -
---td-checkbox-title-disabled-color | @text-color-disabled | -
---td-checkbox-title-line-height | 48rpx | -
---td-checkbox-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.d.ts
deleted file mode 100644
index 3cfb0f97..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.d.ts
+++ /dev/null
@@ -1,100 +0,0 @@
-import { SuperComponent, ComponentsOptionsType, RelationsOptions } from '../common/src/index';
-export default class CheckBox extends SuperComponent {
- externalClasses: string[];
- behaviors: string[];
- relations: RelationsOptions;
- options: ComponentsOptionsType;
- properties: {
- theme: {
- type: StringConstructor;
- value: string;
- };
- tId: {
- type: StringConstructor;
- };
- block?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- borderless?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- checkAll?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- checked?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- defaultChecked?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- content?: {
- type: StringConstructor;
- value?: string;
- };
- contentDisabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- icon?: {
- type: null;
- value?: string[] | "rectangle" | "circle" | "line";
- };
- indeterminate?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- label?: {
- type: StringConstructor;
- value?: string;
- };
- maxContentRow?: {
- type: NumberConstructor;
- value?: number;
- };
- maxLabelRow?: {
- type: NumberConstructor;
- value?: number;
- };
- name?: {
- type: StringConstructor;
- value?: string;
- };
- placement?: {
- type: StringConstructor;
- value?: "left" | "right";
- };
- readonly?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- value?: {
- type: null;
- value?: string | number | boolean;
- };
- };
- data: {
- prefix: string;
- classPrefix: string;
- _disabled: boolean;
- };
- observers: {
- disabled(v: any): void;
- };
- controlledProps: {
- key: string;
- event: string;
- }[];
- methods: {
- handleTap(e: WechatMiniprogram.TouchEvent): void;
- setDisabled(disabled: Boolean): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.js
deleted file mode 100644
index b4e3025a..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.js
+++ /dev/null
@@ -1,99 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import Props from './props';
-const { prefix } = config;
-const name = `${prefix}-checkbox`;
-let CheckBox = class CheckBox extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [
- `${prefix}-class`,
- `${prefix}-class-label`,
- `${prefix}-class-icon`,
- `${prefix}-class-content`,
- `${prefix}-class-border`,
- ];
- this.behaviors = ['wx://form-field'];
- this.relations = {
- '../checkbox-group/checkbox-group': {
- type: 'ancestor',
- linked(parent) {
- const { value, disabled, borderless } = parent.data;
- const valueSet = new Set(value);
- const checkedFromParent = valueSet.has(this.data.value);
- const data = {
- _disabled: this.data.disabled == null ? disabled : this.data.disabled,
- };
- if (borderless) {
- data.borderless = true;
- }
- data.checked = this.data.checked || checkedFromParent;
- if (this.data.checked) {
- parent.updateValue(this.data);
- }
- if (this.data.checkAll) {
- data.checked = valueSet.size > 0;
- }
- this.setData(data);
- },
- },
- };
- this.options = {
- multipleSlots: true,
- };
- this.properties = Object.assign(Object.assign({}, Props), { theme: {
- type: String,
- value: 'default',
- }, tId: {
- type: String,
- } });
- this.data = {
- prefix,
- classPrefix: name,
- _disabled: false,
- };
- this.observers = {
- disabled(v) {
- this.setData({ _disabled: v });
- },
- };
- this.controlledProps = [
- {
- key: 'checked',
- event: 'change',
- },
- ];
- this.methods = {
- handleTap(e) {
- const { _disabled, readonly, contentDisabled } = this.data;
- const { target } = e.currentTarget.dataset;
- if (_disabled || readonly || (target === 'text' && contentDisabled))
- return;
- const { value, label } = this.data;
- const checked = !this.data.checked;
- const parent = this.$parent;
- if (parent) {
- parent.updateValue(Object.assign(Object.assign({}, this.data), { checked, item: { label, value, checked } }));
- }
- else {
- this._trigger('change', { context: { value, label }, checked });
- }
- },
- setDisabled(disabled) {
- this.setData({
- _disabled: this.data.disabled || disabled,
- });
- },
- };
- }
-};
-CheckBox = __decorate([
- wxComponent()
-], CheckBox);
-export default CheckBox;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.json
deleted file mode 100644
index f783dae7..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.wxml
deleted file mode 100644
index 26a15bd1..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.wxml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{label}}
-
-
-
-
- {{content}}
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.wxss
deleted file mode 100644
index 6622ddba..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/checkbox.wxss
+++ /dev/null
@@ -1,202 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-checkbox {
- display: inline-flex;
- vertical-align: middle;
- position: relative;
- font-size: var(--td-checkbox-font-size, 32rpx);
- background: var(--td-checkbox-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-checkbox:focus {
- outline: 0;
-}
-.t-checkbox--block {
- display: flex;
- padding: var(--td-checkbox-vertical-padding, 32rpx);
-}
-.t-checkbox--right {
- flex-direction: row-reverse;
-}
-.t-checkbox .limit-title-row {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- overflow: hidden;
-}
-.t-checkbox .image-center {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
-}
-.t-checkbox__icon-left {
- margin-right: 20rpx;
- width: 40rpx;
-}
-.t-checkbox__icon-right {
- right: 0px;
- display: contents;
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
-}
-.t-checkbox__icon-image {
- width: var(--td-checkbox-icon-size, 48rpx);
- height: var(--td-checkbox-icon-size, 48rpx);
- vertical-align: top;
-}
-.t-checkbox__icon {
- position: relative;
- display: block;
- width: var(--td-checkbox-icon-size, 48rpx);
- height: var(--td-checkbox-icon-size, 48rpx);
- color: var(--td-checkbox-icon-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
- font-size: var(--td-checkbox-icon-size, 48rpx);
- margin-top: calc((var(--td-checkbox-title-line-height, 48rpx) - var(--td-checkbox-icon-size, 48rpx)) / 2);
-}
-.t-checkbox__icon:empty {
- display: none;
-}
-.t-checkbox__icon--checked {
- color: var(--td-checkbox-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-checkbox__icon--disabled {
- cursor: not-allowed;
- color: var(--td-checkbox-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-checkbox__icon--left {
- margin-right: 16rpx;
-}
-.t-checkbox__icon-circle {
- width: calc((var(--td-checkbox-icon-size, 48rpx) - 4rpx) * 2);
- height: calc((var(--td-checkbox-icon-size, 48rpx) - 4rpx) * 2);
- border: calc(4rpx * 2) solid var(--td-checkbox-icon-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
- border-radius: 50%;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) scale(0.5);
- box-sizing: border-box;
-}
-.t-checkbox__icon-circle--disabled {
- background: var(--td-checkbox-icon-disabled-bg-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
-}
-.t-checkbox__icon-rectangle {
- width: calc((var(--td-checkbox-icon-size, 48rpx) - 4rpx * 2) * 2);
- height: calc((var(--td-checkbox-icon-size, 48rpx) - 4rpx * 2) * 2);
- border: calc(4rpx * 2) solid var(--td-checkbox-icon-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) scale(0.5);
- box-sizing: border-box;
-}
-.t-checkbox__icon-rectangle--disabled {
- background: var(--td-checkbox-icon-disabled-bg-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
-}
-.t-checkbox__icon-line::before,
-.t-checkbox__icon-line::after {
- content: '';
- display: block;
- position: absolute;
- width: 5rpx;
- border-radius: 2rpx;
- background: var(--td-checkbox-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- transform-origin: top center;
-}
-.t-checkbox__icon-line::before {
- height: 16rpx;
- left: 8rpx;
- top: 22rpx;
- transform: rotate(-45deg);
-}
-.t-checkbox__icon-line::after {
- height: 26rpx;
- right: 8rpx;
- top: 14rpx;
- transform: rotate(45deg);
-}
-.t-checkbox__icon-line--disabled::before,
-.t-checkbox__icon-line--disabled::after {
- background: var(--td-checkbox-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-checkbox__content {
- flex: 1;
-}
-.t-checkbox__title {
- color: var(--td-checkbox-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- line-height: var(--td-checkbox-title-line-height, 48rpx);
- display: -webkit-box;
- -webkit-box-orient: vertical;
- overflow: hidden;
-}
-.t-checkbox__title--disabled {
- color: var(--td-checkbox-title-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
-}
-.t-checkbox__description {
- color: var(--td-checkbox-description-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
- display: -webkit-box;
- -webkit-box-orient: vertical;
- overflow: hidden;
- font-size: 28rpx;
- line-height: var(--td-checkbox-description-line-height, 44rpx);
-}
-.t-checkbox__description--disabled {
- color: var(--td-checkbox-description-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
-}
-.t-checkbox__title + .t-checkbox__description:not(:empty) {
- margin-top: 8rpx;
-}
-.t-checkbox__border {
- position: absolute;
- bottom: 0;
- left: 96rpx;
- right: 0;
- height: 1px;
- background: var(--td-checkbox-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
- transform: scaleY(0.5);
-}
-.t-checkbox__border--right {
- left: 32rpx;
-}
-.t-checkbox--tag {
- font-size: 28rpx;
- padding-top: 16rpx;
- padding-bottom: 16rpx;
- text-align: center;
- background-color: var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3));
- border-radius: 12rpx;
-}
-.t-checkbox--tag.t-checkbox--checked {
- color: var(--td-checkbox-tag-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- background-color: var(--td-checkbox-tag-active-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
-}
-.t-checkbox--tag .t-checkbox__title--checked {
- color: var(--td-checkbox-tag-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-checkbox--tag .t-checkbox__content {
- margin-right: 0;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/props.d.ts
deleted file mode 100644
index 81c619e9..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdCheckboxProps } from './type';
-declare const props: TdCheckboxProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/props.js
deleted file mode 100644
index b7192f0b..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/props.js
+++ /dev/null
@@ -1,67 +0,0 @@
-const props = {
- block: {
- type: Boolean,
- value: true,
- },
- borderless: {
- type: Boolean,
- value: false,
- },
- checkAll: {
- type: Boolean,
- value: false,
- },
- checked: {
- type: Boolean,
- value: null,
- },
- defaultChecked: {
- type: Boolean,
- value: false,
- },
- content: {
- type: String,
- },
- contentDisabled: {
- type: Boolean,
- },
- disabled: {
- type: null,
- value: undefined,
- },
- icon: {
- type: null,
- value: 'circle',
- },
- indeterminate: {
- type: Boolean,
- value: false,
- },
- label: {
- type: String,
- },
- maxContentRow: {
- type: Number,
- value: 5,
- },
- maxLabelRow: {
- type: Number,
- value: 3,
- },
- name: {
- type: String,
- value: '',
- },
- placement: {
- type: String,
- value: 'left',
- },
- readonly: {
- type: Boolean,
- value: false,
- },
- value: {
- type: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/type.d.ts
deleted file mode 100644
index 1250d5bb..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/type.d.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-export interface TdCheckboxProps {
- block?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- borderless?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- checkAll?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- checked?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- defaultChecked?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- content?: {
- type: StringConstructor;
- value?: string;
- };
- contentDisabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- icon?: {
- type: null;
- value?: 'circle' | 'line' | 'rectangle' | string[];
- };
- indeterminate?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- label?: {
- type: StringConstructor;
- value?: string;
- };
- maxContentRow?: {
- type: NumberConstructor;
- value?: number;
- };
- maxLabelRow?: {
- type: NumberConstructor;
- value?: number;
- };
- name?: {
- type: StringConstructor;
- value?: string;
- };
- placement?: {
- type: StringConstructor;
- value?: 'left' | 'right';
- };
- readonly?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- value?: {
- type: null;
- value?: string | number | boolean;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/checkbox/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/bus.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/bus.d.ts
deleted file mode 100644
index fddbb54d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/bus.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export default class Bus {
- listeners: Map;
- emitted: Set;
- constructor();
- on(evtName: string, listener: any): void;
- emit(evtName: string): void;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/bus.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/bus.js
deleted file mode 100644
index 5a6c8898..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/bus.js
+++ /dev/null
@@ -1,22 +0,0 @@
-export default class Bus {
- constructor() {
- this.listeners = new Map();
- this.emitted = new Set();
- }
- on(evtName, listener) {
- if (this.emitted.has(evtName)) {
- listener();
- return;
- }
- const target = this.listeners.get(evtName) || [];
- target.push(listener);
- this.listeners.set(evtName, target);
- }
- emit(evtName) {
- const listeners = this.listeners.get(evtName);
- if (listeners) {
- listeners.forEach((func) => func());
- }
- this.emitted.add(evtName);
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/common.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/common.d.ts
deleted file mode 100644
index 12f8f81f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/common.d.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-export declare type Classes = Array;
-export interface Styles {
- [css: string]: string | number;
-}
-export declare type ImageEvent = any;
-export declare type PlainObject = {
- [key: string]: any;
-};
-export declare type OptionData = {
- label?: string;
- value?: string | number;
-} & PlainObject;
-export declare type TreeOptionData = {
- children?: Array> | boolean;
- label?: string;
- text?: string;
- value?: T;
- content?: string;
-} & PlainObject;
-export declare type SizeEnum = 'small' | 'medium' | 'large';
-export declare type ShapeEnum = 'circle' | 'round';
-export declare type HorizontalAlignEnum = 'left' | 'center' | 'right';
-export declare type VerticalAlignEnum = 'top' | 'middle' | 'bottom';
-export declare type LayoutEnum = 'vertical' | 'horizontal';
-export declare type ClassName = {
- [className: string]: any;
-} | ClassName[] | string;
-export declare type CSSSelector = string;
-export interface KeysType {
- value?: string;
- label?: string;
- disabled?: string;
-}
-export interface TreeKeysType extends KeysType {
- children?: string;
-}
-export interface HTMLElementAttributes {
- [attribute: string]: string;
-}
-export interface TScroll {
- bufferSize?: number;
- isFixedRowHeight?: boolean;
- rowHeight?: number;
- threshold?: number;
- type: 'lazy' | 'virtual';
-}
-export declare type InfinityScroll = TScroll;
-export interface ScrollToElementParams {
- index?: number;
- top?: number;
- time?: number;
- behavior?: 'auto' | 'smooth';
-}
-export interface ComponentScrollToElementParams extends ScrollToElementParams {
- key?: string | number;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/common.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/common.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/common.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/component.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/component.d.ts
deleted file mode 100644
index a8d86aee..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/component.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-///
-declare const TComponent: typeof Component;
-export default TComponent;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/component.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/component.js
deleted file mode 100644
index 4e01a69e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/component.js
+++ /dev/null
@@ -1,5 +0,0 @@
-const TComponent = (options) => {
- options.options = Object.assign({ multipleSlots: true, addGlobalClass: true }, options.options);
- return Component(options);
-};
-export default TComponent;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/config.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/config.d.ts
deleted file mode 100644
index 68879b46..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/config.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-declare const _default: {
- prefix: string;
-};
-export default _default;
-export declare const prefix = "t";
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/config.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/config.js
deleted file mode 100644
index c0dfab2b..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/config.js
+++ /dev/null
@@ -1,4 +0,0 @@
-export default {
- prefix: "t",
-};
-export const prefix = "t";
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/index.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/index.wxss
deleted file mode 100644
index 1d532d2d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/index.wxss
+++ /dev/null
@@ -1,27 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/index.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/index.d.ts
deleted file mode 100644
index d9336de1..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/index.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import type { TDate, TCalendarType, TCalendarValue } from './type';
-export default class TCalendar {
- firstDayOfWeek: number;
- value: TCalendarValue | TCalendarValue[];
- type: TCalendarType;
- minDate: Date;
- maxDate: Date;
- format: (day: TDate) => TDate;
- constructor(options?: {});
- getTrimValue(): Date | Date[];
- getDays(weekdays: string[]): any[];
- getMonths(): any[];
- select({ cellType, year, month, date }: {
- cellType: any;
- year: any;
- month: any;
- date: any;
- }): Date | TCalendarValue[];
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/index.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/index.js
deleted file mode 100644
index 62fda1f7..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/index.js
+++ /dev/null
@@ -1,127 +0,0 @@
-import { getDateRect, isSameDate, getMonthDateRect, isValidDate, getDate } from '../date';
-export default class TCalendar {
- constructor(options = {}) {
- this.type = 'single';
- Object.assign(this, options);
- if (!this.minDate)
- this.minDate = getDate();
- if (!this.maxDate)
- this.maxDate = getDate(6);
- }
- getTrimValue() {
- const { value, type } = this;
- const format = (val) => {
- if (val instanceof Date)
- return val;
- if (typeof val === 'number')
- return new Date(val);
- return new Date();
- };
- if (type === 'single' && isValidDate(value))
- return format(value);
- if (type === 'multiple' || type === 'range') {
- if (Array.isArray(value)) {
- const isValid = value.every((item) => isValidDate(item));
- return isValid ? value.map((item) => format(item)) : [];
- }
- return [];
- }
- }
- getDays(weekdays) {
- const ans = [];
- let i = this.firstDayOfWeek % 7;
- while (ans.length < 7) {
- ans.push(weekdays[i]);
- i = (i + 1) % 7;
- }
- return ans;
- }
- getMonths() {
- const ans = [];
- const selectedDate = this.getTrimValue();
- const { minDate, maxDate, type, format } = this;
- let { year: minYear, month: minMonth, time: minTime } = getDateRect(minDate);
- const { year: maxYear, month: maxMonth, time: maxTime } = getDateRect(maxDate);
- const calcType = (year, month, date) => {
- const curDate = new Date(year, month, date, 23, 59, 59);
- if (type === 'single' && selectedDate) {
- if (isSameDate({ year, month, date }, selectedDate))
- return 'selected';
- }
- if (type === 'multiple' && selectedDate) {
- const hit = selectedDate.some((item) => isSameDate({ year, month, date }, item));
- if (hit) {
- return 'selected';
- }
- }
- if (type === 'range' && selectedDate) {
- if (Array.isArray(selectedDate)) {
- const [startDate, endDate] = selectedDate;
- if (startDate && isSameDate({ year, month, date }, startDate))
- return 'start';
- if (endDate && isSameDate({ year, month, date }, endDate))
- return 'end';
- if (startDate && endDate && curDate.getTime() > startDate.getTime() && curDate.getTime() < endDate.getTime())
- return 'centre';
- }
- }
- const minCurDate = new Date(year, month, date, 0, 0, 0);
- if (curDate.getTime() < minTime || minCurDate.getTime() > maxTime) {
- return 'disabled';
- }
- return '';
- };
- while (minYear < maxYear || (minYear === maxYear && minMonth <= maxMonth)) {
- const target = getMonthDateRect(new Date(minYear, minMonth, 1));
- const months = [];
- for (let i = 1; i <= 31; i++) {
- if (i > target.lastDate)
- break;
- const dateObj = {
- date: new Date(minYear, minMonth, i),
- day: i,
- type: calcType(minYear, minMonth, i),
- };
- months.push(format ? format(dateObj) : dateObj);
- }
- ans.push({
- year: minYear,
- month: minMonth,
- months,
- weekdayOfFirstDay: target.weekdayOfFirstDay,
- });
- const curDate = getDateRect(new Date(minYear, minMonth + 1, 1));
- minYear = curDate.year;
- minMonth = curDate.month;
- }
- return ans;
- }
- select({ cellType, year, month, date }) {
- const { type } = this;
- const selectedDate = this.getTrimValue();
- if (cellType === 'disabled')
- return;
- const selected = new Date(year, month, date);
- this.value = selected;
- if (type === 'range' && Array.isArray(selectedDate)) {
- if (selectedDate.length === 1 && selected > selectedDate[0]) {
- this.value = [selectedDate[0], selected];
- }
- else {
- this.value = [selected];
- }
- }
- else if (type === 'multiple' && Array.isArray(selectedDate)) {
- const newVal = [...selectedDate];
- const index = selectedDate.findIndex((item) => isSameDate(item, selected));
- if (index > -1) {
- newVal.splice(index, 1);
- }
- else {
- newVal.push(selected);
- }
- this.value = newVal;
- }
- return this.value;
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/type.d.ts
deleted file mode 100644
index 621b9496..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/type.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export interface TDate {
- date: Date;
- day: number;
- type: TDateType;
- className?: string;
- prefix?: string;
- suffix?: string;
-}
-export declare type TCalendarValue = number | Date;
-export declare type TDateType = 'selected' | 'disabled' | 'start' | 'centre' | 'end' | '';
-export declare type TCalendarType = 'single' | 'multiple' | 'range';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/calendar/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/cmyk.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/cmyk.d.ts
deleted file mode 100644
index d0e92a83..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/cmyk.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export declare const rgb2cmyk: (red: number, green: number, blue: number) => number[];
-export declare const cmyk2rgb: (cyan: number, magenta: number, yellow: number, black: number) => {
- r: number;
- g: number;
- b: number;
-};
-export declare const cmykInputToColor: (input: string) => string;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/cmyk.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/cmyk.js
deleted file mode 100644
index d6273beb..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/cmyk.js
+++ /dev/null
@@ -1,57 +0,0 @@
-export const rgb2cmyk = (red, green, blue) => {
- let computedC = 0;
- let computedM = 0;
- let computedY = 0;
- let computedK = 0;
- const r = parseInt(`${red}`.replace(/\s/g, ''), 10);
- const g = parseInt(`${green}`.replace(/\s/g, ''), 10);
- const b = parseInt(`${blue}`.replace(/\s/g, ''), 10);
- if (r === 0 && g === 0 && b === 0) {
- computedK = 1;
- return [0, 0, 0, 1];
- }
- computedC = 1 - r / 255;
- computedM = 1 - g / 255;
- computedY = 1 - b / 255;
- const minCMY = Math.min(computedC, Math.min(computedM, computedY));
- computedC = (computedC - minCMY) / (1 - minCMY);
- computedM = (computedM - minCMY) / (1 - minCMY);
- computedY = (computedY - minCMY) / (1 - minCMY);
- computedK = minCMY;
- return [computedC, computedM, computedY, computedK];
-};
-export const cmyk2rgb = (cyan, magenta, yellow, black) => {
- let c = cyan / 100;
- let m = magenta / 100;
- let y = yellow / 100;
- const k = black / 100;
- c = c * (1 - k) + k;
- m = m * (1 - k) + k;
- y = y * (1 - k) + k;
- let r = 1 - c;
- let g = 1 - m;
- let b = 1 - y;
- r = Math.round(255 * r);
- g = Math.round(255 * g);
- b = Math.round(255 * b);
- return {
- r,
- g,
- b,
- };
-};
-const REG_CMYK_STRING = /cmyk\((\d+%?),(\d+%?),(\d+%?),(\d+%?)\)/;
-const toNumber = (str) => Math.max(0, Math.min(255, parseInt(str, 10)));
-export const cmykInputToColor = (input) => {
- if (/cmyk/i.test(input)) {
- const str = input.replace(/\s/g, '');
- const match = str.match(REG_CMYK_STRING);
- const c = toNumber(match[1]);
- const m = toNumber(match[2]);
- const y = toNumber(match[3]);
- const k = toNumber(match[4]);
- const { r, g, b } = cmyk2rgb(c, m, y, k);
- return `rgb(${r}, ${g}, ${b})`;
- }
- return input;
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/color.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/color.d.ts
deleted file mode 100644
index 49b30fa3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/color.d.ts
+++ /dev/null
@@ -1,107 +0,0 @@
-import tinyColor from 'tinycolor2';
-import { GradientColors, GradientColorPoint } from './gradient';
-export interface ColorObject {
- alpha: number;
- css: string;
- hex: string;
- hex8: string;
- hsl: string;
- hsla: string;
- hsv: string;
- hsva: string;
- rgb: string;
- rgba: string;
- saturation: number;
- value: number;
- isGradient: boolean;
- linearGradient?: string;
-}
-interface ColorStates {
- s: number;
- v: number;
- h: number;
- a: number;
-}
-interface GradientStates {
- colors: GradientColorPoint[];
- degree: number;
- selectedId: string;
- css?: string;
-}
-export declare const gradientColors2string: (object: GradientColors) => string;
-export declare const getColorWithoutAlpha: (color: string) => string;
-export declare const genId: () => string;
-export declare const genGradientPoint: (left: number, color: string) => GradientColorPoint;
-export declare class Color {
- states: ColorStates;
- originColor: string;
- isGradient: boolean;
- gradientStates: GradientStates;
- constructor(input: string);
- update(input: string): void;
- get saturation(): number;
- set saturation(value: number);
- get value(): number;
- set value(value: number);
- get hue(): number;
- set hue(value: number);
- get alpha(): number;
- set alpha(value: number);
- get rgb(): string;
- get rgba(): string;
- get hsv(): string;
- get hsva(): string;
- get hsl(): string;
- get hsla(): string;
- get hex(): string;
- get hex8(): string;
- get cmyk(): string;
- get css(): string;
- get linearGradient(): string;
- get gradientColors(): GradientColorPoint[];
- set gradientColors(colors: GradientColorPoint[]);
- get gradientSelectedId(): string;
- set gradientSelectedId(id: string);
- get gradientDegree(): number;
- set gradientDegree(degree: number);
- get gradientSelectedPoint(): GradientColorPoint;
- getFormatsColorMap(): {
- HEX: string;
- CMYK: string;
- RGB: string;
- RGBA: string;
- HSL: string;
- HSLA: string;
- HSV: string;
- HSVA: string;
- CSS: string;
- HEX8: string;
- };
- updateCurrentGradientColor(): false | this;
- updateStates(input: string): void;
- getRgba(): {
- r: number;
- g: number;
- b: number;
- a: number;
- };
- getCmyk(): {
- c: number;
- m: number;
- y: number;
- k: number;
- };
- getHsva(): tinyColor.ColorFormats.HSVA;
- getHsla(): tinyColor.ColorFormats.HSLA;
- equals(color: string): boolean;
- static isValid(color: string): boolean;
- static hsva2color(h: number, s: number, v: number, a: number): string;
- static hsla2color(h: number, s: number, l: number, a: number): string;
- static rgba2color(r: number, g: number, b: number, a: number): string;
- static hex2color(hex: string, a: number): string;
- static object2color(object: any, format: string): string;
- static isGradientColor: (input: string) => boolean;
- static compare: (color1: string, color2: string) => boolean;
-}
-export declare const getColorObject: (color: Color) => ColorObject;
-export default Color;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/color.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/color.js
deleted file mode 100644
index 847ec5bd..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/color.js
+++ /dev/null
@@ -1,334 +0,0 @@
-import tinyColor from 'tinycolor2';
-import { cmykInputToColor, rgb2cmyk } from './cmyk';
-import { parseGradientString, isGradientColor } from './gradient';
-const mathRound = Math.round;
-const hsv2rgba = (states) => tinyColor(states).toRgb();
-const hsv2hsva = (states) => tinyColor(states).toHsv();
-const hsv2hsla = (states) => tinyColor(states).toHsl();
-export const gradientColors2string = (object) => {
- const { points, degree } = object;
- const colorsStop = points
- .sort((pA, pB) => pA.left - pB.left)
- .map((p) => `${p.color} ${Math.round(p.left * 100) / 100}%`);
- return `linear-gradient(${degree}deg,${colorsStop.join(',')})`;
-};
-export const getColorWithoutAlpha = (color) => tinyColor(color).setAlpha(1).toHexString();
-export const genId = () => (1 + Math.random() * 4294967295).toString(16);
-export const genGradientPoint = (left, color) => ({
- id: genId(),
- left,
- color,
-});
-export class Color {
- constructor(input) {
- this.states = {
- s: 100,
- v: 100,
- h: 100,
- a: 1,
- };
- this.gradientStates = {
- colors: [],
- degree: 0,
- selectedId: null,
- css: '',
- };
- this.update(input);
- }
- update(input) {
- var _a, _b;
- const gradientColors = parseGradientString(input);
- if (this.isGradient && !gradientColors) {
- const colorHsv = tinyColor(input).toHsv();
- this.states = colorHsv;
- this.updateCurrentGradientColor();
- return;
- }
- this.originColor = input;
- this.isGradient = false;
- let colorInput = input;
- if (gradientColors) {
- this.isGradient = true;
- const object = gradientColors;
- const points = object.points.map((c) => genGradientPoint(c.left, c.color));
- this.gradientStates = {
- colors: points,
- degree: object.degree,
- selectedId: ((_a = points[0]) === null || _a === void 0 ? void 0 : _a.id) || null,
- };
- this.gradientStates.css = this.linearGradient;
- colorInput = (_b = this.gradientSelectedPoint) === null || _b === void 0 ? void 0 : _b.color;
- }
- this.updateStates(colorInput);
- }
- get saturation() {
- return this.states.s;
- }
- set saturation(value) {
- this.states.s = Math.max(0, Math.min(100, value));
- this.updateCurrentGradientColor();
- }
- get value() {
- return this.states.v;
- }
- set value(value) {
- this.states.v = Math.max(0, Math.min(100, value));
- this.updateCurrentGradientColor();
- }
- get hue() {
- return this.states.h;
- }
- set hue(value) {
- this.states.h = Math.max(0, Math.min(360, value));
- this.updateCurrentGradientColor();
- }
- get alpha() {
- return this.states.a;
- }
- set alpha(value) {
- this.states.a = Math.max(0, Math.min(1, Math.round(value * 100) / 100));
- this.updateCurrentGradientColor();
- }
- get rgb() {
- const { r, g, b } = hsv2rgba(this.states);
- return `rgb(${mathRound(r)}, ${mathRound(g)}, ${mathRound(b)})`;
- }
- get rgba() {
- const { r, g, b, a } = hsv2rgba(this.states);
- return `rgba(${mathRound(r)}, ${mathRound(g)}, ${mathRound(b)}, ${a})`;
- }
- get hsv() {
- const { h, s, v } = this.getHsva();
- return `hsv(${h}, ${s}%, ${v}%)`;
- }
- get hsva() {
- const { h, s, v, a } = this.getHsva();
- return `hsva(${h}, ${s}%, ${v}%, ${a})`;
- }
- get hsl() {
- const { h, s, l } = this.getHsla();
- return `hsl(${h}, ${s}%, ${l}%)`;
- }
- get hsla() {
- const { h, s, l, a } = this.getHsla();
- return `hsla(${h}, ${s}%, ${l}%, ${a})`;
- }
- get hex() {
- return tinyColor(this.states).toHexString();
- }
- get hex8() {
- return tinyColor(this.states).toHex8String();
- }
- get cmyk() {
- const { c, m, y, k } = this.getCmyk();
- return `cmyk(${c}, ${m}, ${y}, ${k})`;
- }
- get css() {
- if (this.isGradient) {
- return this.linearGradient;
- }
- return this.rgba;
- }
- get linearGradient() {
- const { gradientColors, gradientDegree } = this;
- return gradientColors2string({
- points: gradientColors,
- degree: gradientDegree,
- });
- }
- get gradientColors() {
- return this.gradientStates.colors;
- }
- set gradientColors(colors) {
- this.gradientStates.colors = colors;
- this.gradientStates.css = this.linearGradient;
- }
- get gradientSelectedId() {
- return this.gradientStates.selectedId;
- }
- set gradientSelectedId(id) {
- var _a;
- if (id === this.gradientSelectedId) {
- return;
- }
- this.gradientStates.selectedId = id;
- this.updateStates((_a = this.gradientSelectedPoint) === null || _a === void 0 ? void 0 : _a.color);
- }
- get gradientDegree() {
- return this.gradientStates.degree;
- }
- set gradientDegree(degree) {
- this.gradientStates.degree = Math.max(0, Math.min(360, degree));
- this.gradientStates.css = this.linearGradient;
- }
- get gradientSelectedPoint() {
- const { gradientColors, gradientSelectedId } = this;
- return gradientColors.find((color) => color.id === gradientSelectedId);
- }
- getFormatsColorMap() {
- return {
- HEX: this.hex,
- CMYK: this.cmyk,
- RGB: this.rgb,
- RGBA: this.rgba,
- HSL: this.hsl,
- HSLA: this.hsla,
- HSV: this.hsv,
- HSVA: this.hsva,
- CSS: this.css,
- HEX8: this.hex8,
- };
- }
- updateCurrentGradientColor() {
- const { isGradient, gradientColors, gradientSelectedId } = this;
- const { length } = gradientColors;
- const current = this.gradientSelectedPoint;
- if (!isGradient || length === 0 || !current) {
- return false;
- }
- const index = gradientColors.findIndex((color) => color.id === gradientSelectedId);
- const newColor = Object.assign(Object.assign({}, current), { color: this.rgba });
- gradientColors.splice(index, 1, newColor);
- this.gradientColors = gradientColors.slice();
- return this;
- }
- updateStates(input) {
- const color = tinyColor(cmykInputToColor(input));
- const hsva = color.toHsv();
- this.states = hsva;
- }
- getRgba() {
- const { r, g, b, a } = hsv2rgba(this.states);
- return {
- r: mathRound(r),
- g: mathRound(g),
- b: mathRound(b),
- a,
- };
- }
- getCmyk() {
- const { r, g, b } = this.getRgba();
- const [c, m, y, k] = rgb2cmyk(r, g, b);
- return {
- c: mathRound(c * 100),
- m: mathRound(m * 100),
- y: mathRound(y * 100),
- k: mathRound(k * 100),
- };
- }
- getHsva() {
- let { h, s, v, a } = hsv2hsva(this.states);
- h = mathRound(h);
- s = mathRound(s * 100);
- v = mathRound(v * 100);
- a *= 1;
- return {
- h,
- s,
- v,
- a,
- };
- }
- getHsla() {
- let { h, s, l, a } = hsv2hsla(this.states);
- h = mathRound(h);
- s = mathRound(s * 100);
- l = mathRound(l * 100);
- a *= 1;
- return {
- h,
- s,
- l,
- a,
- };
- }
- equals(color) {
- return tinyColor.equals(this.rgba, color);
- }
- static isValid(color) {
- if (parseGradientString(color)) {
- return true;
- }
- return tinyColor(color).isValid();
- }
- static hsva2color(h, s, v, a) {
- return tinyColor({
- h,
- s,
- v,
- a,
- }).toHsvString();
- }
- static hsla2color(h, s, l, a) {
- return tinyColor({
- h,
- s,
- l,
- a,
- }).toHslString();
- }
- static rgba2color(r, g, b, a) {
- return tinyColor({
- r,
- g,
- b,
- a,
- }).toHsvString();
- }
- static hex2color(hex, a) {
- const color = tinyColor(hex);
- color.setAlpha(a);
- return color.toHexString();
- }
- static object2color(object, format) {
- if (format === 'CMYK') {
- const { c, m, y, k } = object;
- return `cmyk(${c}, ${m}, ${y}, ${k})`;
- }
- const color = tinyColor(object, {
- format,
- });
- return color.toRgbString();
- }
-}
-Color.isGradientColor = (input) => !!isGradientColor(input);
-Color.compare = (color1, color2) => {
- const isGradientColor1 = Color.isGradientColor(color1);
- const isGradientColor2 = Color.isGradientColor(color2);
- if (isGradientColor1 && isGradientColor2) {
- const gradientColor1 = gradientColors2string(parseGradientString(color1));
- const gradientColor2 = gradientColors2string(parseGradientString(color2));
- return gradientColor1 === gradientColor2;
- }
- if (!isGradientColor1 && !isGradientColor2) {
- return tinyColor.equals(color1, color2);
- }
- return false;
-};
-const COLOR_OBJECT_OUTPUT_KEYS = [
- 'alpha',
- 'css',
- 'hex',
- 'hex8',
- 'hsl',
- 'hsla',
- 'hsv',
- 'hsva',
- 'rgb',
- 'rgba',
- 'saturation',
- 'value',
- 'isGradient',
-];
-export const getColorObject = (color) => {
- if (!color) {
- return null;
- }
- const colorObject = Object.create(null);
- COLOR_OBJECT_OUTPUT_KEYS.forEach((key) => (colorObject[key] = color[key]));
- if (color.isGradient) {
- colorObject.linearGradient = color.linearGradient;
- }
- return colorObject;
-};
-export default Color;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/gradient.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/gradient.d.ts
deleted file mode 100644
index 3f496b0b..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/gradient.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export interface GradientColorPoint {
- id?: string;
- color?: string;
- left?: number;
-}
-export interface GradientColors {
- points: GradientColorPoint[];
- degree: number;
-}
-export declare const isGradientColor: (input: string) => null | RegExpExecArray;
-export declare const parseGradientString: (input: string) => GradientColors | boolean;
-export default parseGradientString;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/gradient.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/gradient.js
deleted file mode 100644
index 18eacb20..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/gradient.js
+++ /dev/null
@@ -1,119 +0,0 @@
-import isString from 'lodash/isString';
-import isNull from 'lodash/isNull';
-import tinyColor from 'tinycolor2';
-const combineRegExp = (regexpList, flags) => {
- let source = '';
- for (let i = 0; i < regexpList.length; i++) {
- if (isString(regexpList[i])) {
- source += regexpList[i];
- }
- else {
- source += regexpList[i].source;
- }
- }
- return new RegExp(source, flags);
-};
-const generateRegExp = () => {
- const searchFlags = 'gi';
- const rAngle = /(?:[+-]?\d*\.?\d+)(?:deg|grad|rad|turn)/;
- const rSideCornerCapture = /to\s+((?:(?:left|right|top|bottom)(?:\s+(?:top|bottom|left|right))?))/;
- const rComma = /\s*,\s*/;
- const rColorHex = /#(?:[a-f0-9]{6}|[a-f0-9]{3})/;
- const rDigits3 = /\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)/;
- const rDigits4 = /\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*,\s*\d*\.?\d+\)/;
- const rValue = /(?:[+-]?\d*\.?\d+)(?:%|[a-z]+)?/;
- const rKeyword = /[_a-z-][_a-z0-9-]*/;
- const rColor = combineRegExp(['(?:', rColorHex, '|', '(?:rgb|hsl)', rDigits3, '|', '(?:rgba|hsla)', rDigits4, '|', rKeyword, ')'], '');
- const rColorStop = combineRegExp([rColor, '(?:\\s+', rValue, '(?:\\s+', rValue, ')?)?'], '');
- const rColorStopList = combineRegExp(['(?:', rColorStop, rComma, ')*', rColorStop], '');
- const rLineCapture = combineRegExp(['(?:(', rAngle, ')|', rSideCornerCapture, ')'], '');
- const rGradientSearch = combineRegExp(['(?:(', rLineCapture, ')', rComma, ')?(', rColorStopList, ')'], searchFlags);
- const rColorStopSearch = combineRegExp(['\\s*(', rColor, ')', '(?:\\s+', '(', rValue, '))?', '(?:', rComma, '\\s*)?'], searchFlags);
- return {
- gradientSearch: rGradientSearch,
- colorStopSearch: rColorStopSearch,
- };
-};
-const parseGradient = (regExpLib, input) => {
- let result;
- let matchColorStop;
- let stopResult;
- regExpLib.gradientSearch.lastIndex = 0;
- const matchGradient = regExpLib.gradientSearch.exec(input);
- if (!isNull(matchGradient)) {
- result = {
- original: matchGradient[0],
- colorStopList: [],
- };
- if (matchGradient[1]) {
- result.line = matchGradient[1];
- }
- if (matchGradient[2]) {
- result.angle = matchGradient[2];
- }
- if (matchGradient[3]) {
- result.sideCorner = matchGradient[3];
- }
- regExpLib.colorStopSearch.lastIndex = 0;
- matchColorStop = regExpLib.colorStopSearch.exec(matchGradient[4]);
- while (!isNull(matchColorStop)) {
- stopResult = {
- color: matchColorStop[1],
- };
- if (matchColorStop[2]) {
- stopResult.position = matchColorStop[2];
- }
- result.colorStopList.push(stopResult);
- matchColorStop = regExpLib.colorStopSearch.exec(matchGradient[4]);
- }
- }
- return result;
-};
-const REGEXP_LIB = generateRegExp();
-const REG_GRADIENT = /.*gradient\s*\(((?:\([^)]*\)|[^)(]*)*)\)/gim;
-export const isGradientColor = (input) => {
- REG_GRADIENT.lastIndex = 0;
- return REG_GRADIENT.exec(input);
-};
-const sideCornerDegreeMap = {
- top: 0,
- right: 90,
- bottom: 180,
- left: 270,
- 'top left': 225,
- 'left top': 225,
- 'top right': 135,
- 'right top': 135,
- 'bottom left': 315,
- 'left bottom': 315,
- 'bottom right': 45,
- 'right bottom': 45,
-};
-export const parseGradientString = (input) => {
- const match = isGradientColor(input);
- if (!match) {
- return false;
- }
- const gradientColors = {
- points: [],
- degree: 0,
- };
- const result = parseGradient(REGEXP_LIB, match[1]);
- if (result.original.trim() !== match[1].trim()) {
- return false;
- }
- const points = result.colorStopList.map(({ color, position }) => {
- const point = Object.create(null);
- point.color = tinyColor(color).toRgbString();
- point.left = parseFloat(position);
- return point;
- });
- gradientColors.points = points;
- let degree = parseInt(result.angle, 10);
- if (Number.isNaN(degree)) {
- degree = sideCornerDegreeMap[result.sideCorner] || 90;
- }
- gradientColors.degree = degree;
- return gradientColors;
-};
-export default parseGradientString;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/index.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/index.d.ts
deleted file mode 100644
index ad18475c..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './cmyk';
-export * from './color';
-export * from './gradient';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/index.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/index.js
deleted file mode 100644
index ad18475c..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/color-picker/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './cmyk';
-export * from './color';
-export * from './gradient';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/date.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/date.d.ts
deleted file mode 100644
index e123831f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/date.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-export declare type CompareDate = Date | number | {
- year: number;
- month: number;
- date: number;
-};
-export declare const getDateRect: (date: Date | number) => {
- year: number;
- month: number;
- date: number;
- day: number;
- time: number;
-};
-export declare const isSameDate: (date1: CompareDate, date2: CompareDate) => boolean;
-export declare const getMonthDateRect: (date: Date | number) => {
- year: number;
- month: number;
- weekdayOfFirstDay: number;
- lastDate: number;
-};
-export declare const isValidDate: (val: any) => boolean;
-export declare const getDate: (...args: any[]) => any;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/date.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/date.js
deleted file mode 100644
index 3ac46b37..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/shared/date.js
+++ /dev/null
@@ -1,41 +0,0 @@
-export const getDateRect = (date) => {
- const _date = new Date(date);
- return {
- year: _date.getFullYear(),
- month: _date.getMonth(),
- date: _date.getDate(),
- day: _date.getDay(),
- time: _date.getTime(),
- };
-};
-export const isSameDate = (date1, date2) => {
- if (date1 instanceof Date || typeof date1 === 'number')
- date1 = getDateRect(date1);
- if (date2 instanceof Date || typeof date2 === 'number')
- date2 = getDateRect(date2);
- const keys = ['year', 'month', 'date'];
- return keys.every((key) => date1[key] === date2[key]);
-};
-export const getMonthDateRect = (date) => {
- const { year, month } = getDateRect(date);
- const firstDay = new Date(year, month, 1);
- const weekdayOfFirstDay = firstDay.getDay();
- const lastDate = new Date(+new Date(year, month + 1, 1) - 24 * 3600 * 1000).getDate();
- return {
- year,
- month,
- weekdayOfFirstDay,
- lastDate,
- };
-};
-export const isValidDate = (val) => typeof val === 'number' || val instanceof Date;
-export const getDate = (...args) => {
- const now = new Date();
- if (args.length === 0)
- return now;
- if (args.length === 1 && args[0] <= 1000) {
- const { year, month, date } = getDateRect(now);
- return new Date(year, month + args[0], date);
- }
- return Date.apply(null, args);
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/control.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/control.d.ts
deleted file mode 100644
index ed3f4a08..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/control.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-declare type ControlInstance = {
- controlled: boolean;
- initValue: any;
- set(newVal: any, extObj?: Object, fn?: any): void;
- get(): any;
- change(newVal: any, customChangeData?: any, customUpdateFn?: any): void;
-};
-declare type ControlOption = {
- valueKey?: string;
- defaultValueKey?: string;
- changeEventName?: string;
- strict?: boolean;
-};
-declare function useControl(this: any, option?: ControlOption): ControlInstance;
-export { ControlOption, ControlInstance, useControl };
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/control.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/control.js
deleted file mode 100644
index 03c9e772..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/control.js
+++ /dev/null
@@ -1,40 +0,0 @@
-const defaultOption = {
- valueKey: 'value',
- defaultValueKey: 'defaultValue',
- changeEventName: 'change',
- strict: true,
-};
-function useControl(option = {}) {
- const { valueKey, defaultValueKey, changeEventName, strict } = Object.assign(Object.assign({}, defaultOption), option);
- const props = this.properties || {};
- const value = props[valueKey];
- const defaultValue = props[strict ? defaultValueKey : valueKey];
- let controlled = false;
- if (strict && typeof value !== 'undefined' && value !== null) {
- controlled = true;
- }
- const set = (newVal, extObj, fn) => {
- this.setData(Object.assign({ [`_${valueKey}`]: newVal }, extObj), fn);
- };
- return {
- controlled,
- initValue: controlled ? value : defaultValue,
- set,
- get: () => {
- return this.data[`_${valueKey}`];
- },
- change: (newVal, customChangeData, customUpdateFn) => {
- this.triggerEvent(changeEventName, typeof customChangeData !== 'undefined' ? customChangeData : newVal);
- if (controlled) {
- return;
- }
- if (typeof customUpdateFn === 'function') {
- customUpdateFn();
- }
- else {
- set(newVal);
- }
- },
- };
-}
-export { useControl };
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/flatTool.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/flatTool.d.ts
deleted file mode 100644
index 4183d793..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/flatTool.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-export declare const getPrototypeOf: (obj: any) => any;
-export declare const isObject: (something: any) => boolean;
-export declare const iterateInheritedPrototype: (callback: (proto: Record) => boolean | void, fromCtor: any, toCtor: any, includeToCtor?: boolean) => void;
-export interface ClassInstanceToObjectOptions {
- bindTo?: any;
- excludes?: string[];
- till?: any;
- enumerable?: 0 | boolean;
- configurable?: 0 | boolean;
- writable?: 0 | boolean;
-}
-export declare const toObject: (something: any, options?: ClassInstanceToObjectOptions) => {
- [key: string]: any;
-};
-export declare const isPlainObject: (something: any) => boolean;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/flatTool.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/flatTool.js
deleted file mode 100644
index 045abd77..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/flatTool.js
+++ /dev/null
@@ -1,57 +0,0 @@
-export const getPrototypeOf = function (obj) {
- return Object.getPrototypeOf ? Object.getPrototypeOf(obj) : obj.__proto__;
-};
-export const isObject = function isObject(something) {
- const type = typeof something;
- return something !== null && (type === 'function' || type === 'object');
-};
-export const iterateInheritedPrototype = function iterateInheritedPrototype(callback, fromCtor, toCtor, includeToCtor = true) {
- let proto = fromCtor.prototype || fromCtor;
- const toProto = toCtor.prototype || toCtor;
- while (proto) {
- if (!includeToCtor && proto === toProto)
- break;
- if (callback(proto) === false)
- break;
- if (proto === toProto)
- break;
- proto = getPrototypeOf(proto);
- }
-};
-export const toObject = function toObject(something, options = {}) {
- const obj = {};
- if (!isObject(something))
- return obj;
- const excludes = options.excludes || ['constructor'];
- const { enumerable = true, configurable = 0, writable = 0 } = options;
- const defaultDesc = {};
- if (enumerable !== 0)
- defaultDesc.enumerable = enumerable;
- if (configurable !== 0)
- defaultDesc.configurable = configurable;
- if (writable !== 0)
- defaultDesc.writable = writable;
- iterateInheritedPrototype((proto) => {
- Object.getOwnPropertyNames(proto).forEach((key) => {
- if (excludes.indexOf(key) >= 0)
- return;
- if (Object.prototype.hasOwnProperty.call(obj, key))
- return;
- const desc = Object.getOwnPropertyDescriptor(proto, key);
- const fnKeys = ['get', 'set', 'value'];
- fnKeys.forEach((k) => {
- if (typeof desc[k] === 'function') {
- const oldFn = desc[k];
- desc[k] = function (...args) {
- return oldFn.apply(Object.prototype.hasOwnProperty.call(options, 'bindTo') ? options.bindTo : this, args);
- };
- }
- });
- Object.defineProperty(obj, key, Object.assign(Object.assign({}, desc), defaultDesc));
- });
- }, something, options.till || Object, false);
- return obj;
-};
-export const isPlainObject = function isPlainObject(something) {
- return Object.prototype.toString.call(something) === '[object Object]';
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/index.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/index.d.ts
deleted file mode 100644
index 94e7ce12..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export * from './superComponent';
-export * from './flatTool';
-export * from './instantiationDecorator';
-export * from './control';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/index.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/index.js
deleted file mode 100644
index 94e7ce12..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-export * from './superComponent';
-export * from './flatTool';
-export * from './instantiationDecorator';
-export * from './control';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/instantiationDecorator.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/instantiationDecorator.d.ts
deleted file mode 100644
index 3a06f2c6..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/instantiationDecorator.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { SuperComponent } from './superComponent';
-export declare const toComponent: (options: Record) => Record;
-export declare const wxComponent: () => (constructor: new () => SuperComponent) => void;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/instantiationDecorator.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/instantiationDecorator.js
deleted file mode 100644
index d9b15b72..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/instantiationDecorator.js
+++ /dev/null
@@ -1,139 +0,0 @@
-import { isPlainObject, toObject } from './flatTool';
-import { canUseVirtualHost } from '../version';
-const RawLifeCycles = ['Created', 'Attached', 'Ready', 'Moved', 'Detached', 'Error'];
-const NativeLifeCycles = RawLifeCycles.map((k) => k.toLowerCase());
-const ComponentNativeProps = [
- 'properties',
- 'data',
- 'observers',
- 'methods',
- 'behaviors',
- ...NativeLifeCycles,
- 'relations',
- 'externalClasses',
- 'options',
- 'lifetimes',
- 'pageLifeTimes',
- 'definitionFilter',
-];
-export const toComponent = function toComponent(options) {
- const { relations, behaviors = [], externalClasses = [] } = options;
- if (options.properties) {
- Object.keys(options.properties).forEach((k) => {
- let opt = options.properties[k];
- if (!isPlainObject(opt)) {
- opt = { type: opt };
- }
- options.properties[k] = opt;
- });
- const ariaProps = [
- { key: 'ariaHidden', type: Boolean },
- { key: 'ariaRole', type: String },
- { key: 'ariaLabel', type: String },
- { key: 'ariaLabelledby', type: String },
- { key: 'ariaDescribedby', type: String },
- { key: 'ariaBusy', type: Boolean },
- ];
- ariaProps.forEach(({ key, type }) => {
- options.properties[key] = {
- type,
- };
- });
- options.properties.style = { type: String, value: '' };
- options.properties.customStyle = { type: String, value: '' };
- }
- if (!options.methods)
- options.methods = {};
- if (!options.lifetimes)
- options.lifetimes = {};
- const inits = {};
- if (relations) {
- const getRelations = (relation, path) => Behavior({
- created() {
- Object.defineProperty(this, `$${relation}`, {
- get: () => {
- const nodes = this.getRelationNodes(path) || [];
- return relation === 'parent' ? nodes[0] : nodes;
- },
- });
- },
- });
- const map = {};
- Object.keys(relations).forEach((path) => {
- const comp = relations[path];
- const relation = ['parent', 'ancestor'].includes(comp.type) ? 'parent' : 'children';
- const mixin = getRelations(relation, path);
- map[relation] = mixin;
- });
- behaviors.push(...Object.keys(map).map((key) => map[key]));
- }
- options.behaviors = [...behaviors];
- options.externalClasses = ['class', ...externalClasses];
- Object.getOwnPropertyNames(options).forEach((k) => {
- const desc = Object.getOwnPropertyDescriptor(options, k);
- if (!desc)
- return;
- if (NativeLifeCycles.indexOf(k) < 0 && typeof desc.value === 'function') {
- Object.defineProperty(options.methods, k, desc);
- delete options[k];
- }
- else if (ComponentNativeProps.indexOf(k) < 0) {
- inits[k] = desc;
- }
- else if (NativeLifeCycles.indexOf(k) >= 0) {
- options.lifetimes[k] = options[k];
- }
- });
- if (Object.keys(inits).length) {
- const oldCreated = options.lifetimes.created;
- const oldAttached = options.lifetimes.attached;
- const { controlledProps = [] } = options;
- options.lifetimes.created = function (...args) {
- Object.defineProperties(this, inits);
- if (oldCreated)
- oldCreated.apply(this, args);
- };
- options.lifetimes.attached = function (...args) {
- if (oldAttached)
- oldAttached.apply(this, args);
- controlledProps.forEach(({ key }) => {
- const defaultKey = `default${key.replace(/^(\w)/, (m, m1) => m1.toUpperCase())}`;
- const props = this.properties;
- if (props[key] == null) {
- this._selfControlled = true;
- }
- if (props[key] == null && props[defaultKey] != null) {
- this.setData({
- [key]: props[defaultKey],
- });
- }
- });
- };
- options.methods._trigger = function (evtName, detail, opts) {
- const target = controlledProps.find((item) => item.event == evtName);
- if (target) {
- const { key } = target;
- if (this._selfControlled) {
- this.setData({
- [key]: detail[key],
- });
- }
- }
- this.triggerEvent(evtName, detail, opts);
- };
- }
- return options;
-};
-export const wxComponent = function wxComponent() {
- return function (constructor) {
- class WxComponent extends constructor {
- }
- const current = new WxComponent();
- current.options = current.options || {};
- if (canUseVirtualHost()) {
- current.options.virtualHost = true;
- }
- const obj = toComponent(toObject(current));
- Component(obj);
- };
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/superComponent.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/superComponent.d.ts
deleted file mode 100644
index 4455e199..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/superComponent.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-///
-export interface ComponentsOptionsType extends WechatMiniprogram.Component.ComponentOptions {
- styleIsolation?: 'isolated' | 'apply-shared' | 'shared' | 'page-isolated' | 'page-apply-shared' | 'page-shared';
-}
-export interface RelationsOptions {
- [componentName: string]: WechatMiniprogram.Component.RelationOption;
-}
-export interface SuperComponent extends WechatMiniprogram.Component.Lifetimes, WechatMiniprogram.Component.OtherOption, WechatMiniprogram.Component.InstanceMethods {
- properties: P;
- data: D;
- options: ComponentsOptionsType;
- methods: M | Record any>;
- $global: Function;
- [x: string]: any;
-}
-export declare class SuperComponent {
- readonly app: any;
- constructor();
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/superComponent.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/superComponent.js
deleted file mode 100644
index 3cb17dc7..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/src/superComponent.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export class SuperComponent {
- constructor() {
- this.app = getApp();
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/_variables.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/_variables.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/base.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/base.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/icons.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/icons.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/index.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/index.wxss
deleted file mode 100644
index 1d532d2d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/index.wxss
+++ /dev/null
@@ -1,27 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/mixins/_clearfix.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/mixins/_clearfix.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/mixins/_cursor.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/mixins/_cursor.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/mixins/_ellipsis.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/mixins/_ellipsis.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/mixins/_hairline.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/mixins/_hairline.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/mixins/_index.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/mixins/_index.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_components.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_components.wxss
deleted file mode 100644
index 6171d7a4..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_components.wxss
+++ /dev/null
@@ -1,17 +0,0 @@
-@media (prefers-color-scheme: light) {
- page,
- .page {
- --td-picker-transparent-color: rgba(255, 255, 255, 0);
- }
-}
-@media (prefers-color-scheme: dark) {
- page,
- .page {
- --td-button-primary-disabled-color: var(--td-font-white-4);
- --td-skeleton-animation-gradient: rgba(255, 255, 255, 0.06);
- --td-slider-dot-bg-color: var(--td-gray-color-4);
- --td-slider-dot-disabled-bg-color: var(--td-gray-color-11);
- --td-slider-dot-disabled-border-color: var(--td-gray-color-12);
- --td-picker-transparent-color: transparent;
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_dark.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_dark.wxss
deleted file mode 100644
index 33ec4329..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_dark.wxss
+++ /dev/null
@@ -1,123 +0,0 @@
-@media (prefers-color-scheme: dark) {
- page,
- .page {
- --td-primary-color-1: #1b2f51;
- --td-primary-color-2: #173463;
- --td-primary-color-3: #143975;
- --td-primary-color-4: #103d88;
- --td-primary-color-5: #0d429a;
- --td-primary-color-6: #054bbe;
- --td-primary-color-7: #2667d4;
- --td-primary-color-8: #4582e6;
- --td-primary-color-9: #699ef5;
- --td-primary-color-10: #96bbf8;
- --td-warning-color-1: #4f2a1d;
- --td-warning-color-2: #582f21;
- --td-warning-color-3: #733c23;
- --td-warning-color-4: #a75d2b;
- --td-warning-color-5: #cf6e2d;
- --td-warning-color-6: #dc7633;
- --td-warning-color-7: #e8935c;
- --td-warning-color-8: #ecbf91;
- --td-warning-color-9: #eed7bf;
- --td-warning-color-10: #f3e9dc;
- --td-error-color-1: #472324;
- --td-error-color-2: #5e2a2d;
- --td-error-color-3: #703439;
- --td-error-color-4: #83383e;
- --td-error-color-5: #a03f46;
- --td-error-color-6: #c64751;
- --td-error-color-7: #de6670;
- --td-error-color-8: #ec888e;
- --td-error-color-9: #edb1b6;
- --td-error-color-10: #eeced0;
- --td-success-color-1: #193a2a;
- --td-success-color-2: #1a4230;
- --td-success-color-3: #17533d;
- --td-success-color-4: #0d7a55;
- --td-success-color-5: #059465;
- --td-success-color-6: #43af8a;
- --td-success-color-7: #46bf96;
- --td-success-color-8: #80d2b6;
- --td-success-color-9: #b4e1d3;
- --td-success-color-10: #deede8;
- --td-gray-color-1: #f3f3f3;
- --td-gray-color-2: #eee;
- --td-gray-color-3: #e8e8e8;
- --td-gray-color-4: #ddd;
- --td-gray-color-5: #c6c6c6;
- --td-gray-color-6: #a6a6a6;
- --td-gray-color-7: #8b8b8b;
- --td-gray-color-8: #777;
- --td-gray-color-9: #5e5e5e;
- --td-gray-color-10: #4b4b4b;
- --td-gray-color-11: #383838;
- --td-gray-color-12: #2c2c2c;
- --td-gray-color-13: #242424;
- --td-gray-color-14: #181818;
- --td-font-white-1: rgba(255, 255, 255, 0.9);
- --td-font-white-2: rgba(255, 255, 255, 0.55);
- --td-font-white-3: rgba(255, 255, 255, 0.35);
- --td-font-white-4: rgba(255, 255, 255, 0.22);
- --td-font-gray-1: rgba(0, 0, 0, 0.9);
- --td-font-gray-2: rgba(0, 0, 0, 0.6);
- --td-font-gray-3: rgba(0, 0, 0, 0.4);
- --td-font-gray-4: rgba(0, 0, 0, 0.26);
- --td-brand-color: var(--td-primary-color-8);
- --td-warning-color: var(--td-warning-color-5);
- --td-error-color: var(--td-error-color-6);
- --td-success-color: var(--td-success-color-5);
- --td-brand-color-focus: var(--td-primary-color-1);
- --td-brand-color-active: var(--td-primary-color-9);
- --td-brand-color-disabled: var(--td-primary-color-3);
- --td-brand-color-light: var(--td-primary-color-1);
- --td-brand-color-light-active: var(--td-primary-color-2);
- --td-warning-color-focus: var(--td-warning-color-2);
- --td-warning-color-active: var(--td-warning-color-4);
- --td-warning-color-disabled: var(--td-warning-color-3);
- --td-warning-color-light: var(--td-warning-color-1);
- --td-warning-color-light-active: var(--td-warning-color-2);
- --td-error-color-focus: var(--td-error-color-2);
- --td-error-color-active: var(--td-error-color-5);
- --td-error-color-disabled: var(--td-error-color-3);
- --td-error-color-light: var(--td-error-color-1);
- --td-error-color-light-active: var(--td-error-color-2);
- --td-success-color-focus: var(--td-success-color-2);
- --td-success-color-active: var(--td-success-color-4);
- --td-success-color-disabled: var(--td-success-color-3);
- --td-success-color-light: var(--td-success-color-1);
- --td-success-color-light-active: var(--td-success-color-2);
- --td-mask-active: rgba(0, 0, 0, 0.4);
- --td-mask-disabled: rgba(0, 0, 0, 0.6);
- --td-bg-color-page: var(--td-gray-color-14);
- --td-bg-color-container: var(--td-gray-color-13);
- --td-bg-color-secondarycontainer: var(--td-gray-color-12);
- --td-bg-color-component: var(--td-gray-color-11);
- --td-bg-color-container-active: var(--td-gray-color-12);
- --td-bg-color-secondarycontainer-active: var(--td-gray-color-11);
- --td-bg-color-component-active: var(--td-gray-color-10);
- --td-bg-color-component-disabled: var(--td-gray-color-12);
- --td-bg-color-specialcomponent: transparent;
- --td-text-color-primary: var(--td-font-white-1);
- --td-text-color-secondary: var(--td-font-white-2);
- --td-text-color-placeholder: var(--td-font-white-3);
- --td-text-color-disabled: var(--td-font-white-4);
- --td-text-color-anti: var(--td-font-white-1);
- --td-text-color-brand: var(--td-primary-color-8);
- --td-text-color-link: var(--td-primary-color-8);
- --td-border-level-1-color: var(--td-gray-color-11);
- --td-component-stroke: var(--td-gray-color-11);
- --td-border-level-2-color: var(--td-gray-color-9);
- --td-component-border: var(--td-gray-color-9);
- --td-shadow-1: 0 4px 6px rgba(0, 0, 0, 0.06), 0 1px 10px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.12);
- --td-shadow-2: 0 8px 10px rgba(0, 0, 0, 0.12), 0 3px 14px rgba(0, 0, 0, 0.1), 0 5px 5px rgba(0, 0, 0, 0.16);
- --td-shadow-3: 0 16px 24px rgba(0, 0, 0, 0.14), 0 6px 30px rgba(0, 0, 0, 0.12), 0 8px 10px rgba(0, 0, 0, 0.2);
- --td-shadow-inset-top: inset 0 0.5px 0 #5e5e5e;
- --td-shadow-inset-right: inset 0.5px 0 0 #5e5e5e;
- --td-shadow-inset-bottom: inset 0 -0.5px 0 #5e5e5e;
- --td-shadow-inset-left: inset -0.5px 0 0 #5e5e5e;
- --td-table-shadow-color: rgba(0, 0, 0, 0.55);
- --td-scrollbar-color: rgba(255, 255, 255, 0.1);
- --td-scroll-track-color: #333;
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_font.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_font.wxss
deleted file mode 100644
index f0cf5a1c..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_font.wxss
+++ /dev/null
@@ -1,33 +0,0 @@
-page,
-.page {
- --td-font-family: PingFang SC, Microsoft YaHei, Arial Regular;
- --td-font-family-medium: PingFang SC, Microsoft YaHei, Arial Medium;
- --td-font-size-link-small: 24rpx;
- --td-font-size-link-medium: 28rpx;
- --td-font-size-link-large: 32rpx;
- --td-font-size-mark-extra-small: 20rpx;
- --td-font-size-mark-small: 24rpx;
- --td-font-size-mark-medium: 28rpx;
- --td-font-size-mark-large: 32rpx;
- --td-font-size-body-extra-small: 20rpx;
- --td-font-size-body-small: 24rpx;
- --td-font-size-body-medium: 28rpx;
- --td-font-size-body-large: 32rpx;
- --td-font-size-title-small: 28rpx;
- --td-font-size-title-medium: 32rpx;
- --td-font-size-title-large: 36rpx;
- --td-font-size-title-extra-large: 40rpx;
- --td-font-size-headline-small: 48rpx;
- --td-font-size-headline-medium: 56rpx;
- --td-font-size-headline-large: 72rpx;
- --td-font-size-display-medium: 96rpx;
- --td-font-size-display-large: 128rpx;
- --td-font-size: 20rpx;
- --td-font-size-xs: var(--td-font-size-body-extra-small);
- --td-font-size-s: var(--td-font-size-body-small);
- --td-font-size-base: var(--td-font-size-title-small);
- --td-font-size-m: var(--td-font-size-title-medium);
- --td-font-size-l: var(--td-font-size-title-large);
- --td-font-size-xl: var(--td-font-size-title-extra-large);
- --td-font-size-xxl: var(--td-font-size-headline-large);
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_index.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_index.wxss
deleted file mode 100644
index 33e32f14..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_index.wxss
+++ /dev/null
@@ -1,319 +0,0 @@
-@media (prefers-color-scheme: light) {
- page,
- .page {
- --td-primary-color-1: #f2f3ff;
- --td-primary-color-2: #d9e1ff;
- --td-primary-color-3: #b5c7ff;
- --td-primary-color-4: #8eabff;
- --td-primary-color-5: #618dff;
- --td-primary-color-6: #366ef4;
- --td-primary-color-7: #0052d9;
- --td-primary-color-8: #003cab;
- --td-primary-color-9: #002a7c;
- --td-primary-color-10: #001a57;
- --td-warning-color-1: #fff1e9;
- --td-warning-color-2: #ffd9c2;
- --td-warning-color-3: #ffb98c;
- --td-warning-color-4: #fa9550;
- --td-warning-color-5: #e37318;
- --td-warning-color-6: #be5a00;
- --td-warning-color-7: #954500;
- --td-warning-color-8: #713300;
- --td-warning-color-9: #532300;
- --td-warning-color-10: #3b1700;
- --td-error-color-1: #fff0ed;
- --td-error-color-2: #ffd8d2;
- --td-error-color-3: #ffb9b0;
- --td-error-color-4: #ff9285;
- --td-error-color-5: #f6685d;
- --td-error-color-6: #d54941;
- --td-error-color-7: #ad352f;
- --td-error-color-8: #881f1c;
- --td-error-color-9: #68070a;
- --td-error-color-10: #490002;
- --td-success-color-1: #e3f9e9;
- --td-success-color-2: #c6f3d7;
- --td-success-color-3: #92dab2;
- --td-success-color-4: #56c08d;
- --td-success-color-5: #2ba471;
- --td-success-color-6: #008858;
- --td-success-color-7: #006c45;
- --td-success-color-8: #005334;
- --td-success-color-9: #003b23;
- --td-success-color-10: #002515;
- --td-gray-color-1: #f3f3f3;
- --td-gray-color-2: #eeeeee;
- --td-gray-color-3: #e7e7e7;
- --td-gray-color-4: #dcdcdc;
- --td-gray-color-5: #c5c5c5;
- --td-gray-color-6: #a6a6a6;
- --td-gray-color-7: #8b8b8b;
- --td-gray-color-8: #777777;
- --td-gray-color-9: #5e5e5e;
- --td-gray-color-10: #4b4b4b;
- --td-gray-color-11: #383838;
- --td-gray-color-12: #2c2c2c;
- --td-gray-color-13: #242424;
- --td-gray-color-14: #181818;
- --td-font-white-1: #ffffff;
- --td-font-white-2: rgba(255, 255, 255, 0.55);
- --td-font-white-3: rgba(255, 255, 255, 0.35);
- --td-font-white-4: rgba(255, 255, 255, 0.22);
- --td-font-gray-1: rgba(0, 0, 0, 0.9);
- --td-font-gray-2: rgba(0, 0, 0, 0.6);
- --td-font-gray-3: rgba(0, 0, 0, 0.4);
- --td-font-gray-4: rgba(0, 0, 0, 0.26);
- --td-brand-color: var(--td-primary-color-7);
- --td-warning-color: var(--td-warning-color-5);
- --td-error-color: var(--td-error-color-6);
- --td-success-color: var(--td-success-color-5);
- --td-brand-color-focus: var(--td-primary-color-1);
- --td-brand-color-active: var(--td-primary-color-8);
- --td-brand-color-disabled: var(--td-primary-color-3);
- --td-brand-color-light: var(--td-primary-color-1);
- --td-brand-color-light-active: var(--td-primary-color-2);
- --td-warning-color-active: var(--td-warning-color-6);
- --td-warning-color-disabled: var(--td-warning-color-3);
- --td-warning-color-focus: var(--td-warning-color-2);
- --td-warning-color-light: var(--td-warning-color-1);
- --td-warning-color-light-active: var(--td-warning-color-2);
- --td-error-color-focus: var(--td-error-color-2);
- --td-error-color-active: var(--td-error-color-7);
- --td-error-color-disabled: var(--td-error-color-3);
- --td-error-color-light: var(--td-error-color-1);
- --td-error-color-light-active: var(--td-error-color-2);
- --td-success-color-focus: var(--td-success-color-2);
- --td-success-color-active: var(--td-success-color-6);
- --td-success-color-disabled: var(--td-success-color-3);
- --td-success-color-light: var(--td-success-color-1);
- --td-success-color-light-active: var(--td-success-color-2);
- --td-mask-active: rgba(0, 0, 0, 0.6);
- --td-mask-disabled: rgba(255, 255, 255, 0.6);
- --td-bg-color-page: var(--td-gray-color-1);
- --td-bg-color-container: var(--td-font-white-1);
- --td-bg-color-container-active: var(--td-gray-color-3);
- --td-bg-color-secondarycontainer: var(--td-gray-color-1);
- --td-bg-color-secondarycontainer-active: var(--td-gray-color-4);
- --td-bg-color-component: var(--td-gray-color-3);
- --td-bg-color-component-active: var(--td-gray-color-6);
- --td-bg-color-component-disabled: var(--td-gray-color-2);
- --td-bg-color-secondarycomponent: var(--td-gray-color-4);
- --td-bg-color-secondarycomponent-active: var(--td-gray-color-6);
- --td-bg-color-specialcomponent: #fff;
- --td-text-color-primary: var(--td-font-gray-1);
- --td-text-color-secondary: var(--td-font-gray-2);
- --td-text-color-placeholder: var(--td-font-gray-3);
- --td-text-color-disabled: var(--td-font-gray-4);
- --td-text-color-anti: var(--td-font-white-1);
- --td-text-color-brand: var(--td-brand-color);
- --td-text-color-link: var(--td-brand-color);
- --td-border-level-1-color: var(--td-gray-color-3);
- --td-component-stroke: var(--td-gray-color-3);
- --td-border-level-2-color: var(--td-gray-color-4);
- --td-component-border: var(--td-gray-color-4);
- --td-shadow-1: 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12);
- --td-shadow-2: 0 3px 14px 2px rgba(0, 0, 0, 0.05), 0 8px 10px 1px rgba(0, 0, 0, 0.06), 0 5px 5px -3px rgba(0, 0, 0, 0.1);
- --td-shadow-3: 0 6px 30px 5px rgba(0, 0, 0, 0.05), 0 16px 24px 2px rgba(0, 0, 0, 0.04), 0 8px 10px -5px rgba(0, 0, 0, 0.08);
- --td-shadow-4: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
- --td-shadow-inset-top: inset 0 0.5px 0 #dcdcdc;
- --td-shadow-inset-right: inset 0.5px 0 0 #dcdcdc;
- --td-shadow-inset-bottom: inset 0 -0.5px 0 #dcdcdc;
- --td-shadow-inset-left: inset -0.5px 0 0 #dcdcdc;
- --td-table-shadow-color: rgba(0, 0, 0, 0.08);
- --td-scrollbar-color: rgba(0, 0, 0, 0.1);
- --td-scrollbar-hover-color: rgba(0, 0, 0, 0.3);
- --td-scroll-track-color: #fff;
- }
-}
-@media (prefers-color-scheme: dark) {
- page,
- .page {
- --td-primary-color-1: #1b2f51;
- --td-primary-color-2: #173463;
- --td-primary-color-3: #143975;
- --td-primary-color-4: #103d88;
- --td-primary-color-5: #0d429a;
- --td-primary-color-6: #054bbe;
- --td-primary-color-7: #2667d4;
- --td-primary-color-8: #4582e6;
- --td-primary-color-9: #699ef5;
- --td-primary-color-10: #96bbf8;
- --td-warning-color-1: #4f2a1d;
- --td-warning-color-2: #582f21;
- --td-warning-color-3: #733c23;
- --td-warning-color-4: #a75d2b;
- --td-warning-color-5: #cf6e2d;
- --td-warning-color-6: #dc7633;
- --td-warning-color-7: #e8935c;
- --td-warning-color-8: #ecbf91;
- --td-warning-color-9: #eed7bf;
- --td-warning-color-10: #f3e9dc;
- --td-error-color-1: #472324;
- --td-error-color-2: #5e2a2d;
- --td-error-color-3: #703439;
- --td-error-color-4: #83383e;
- --td-error-color-5: #a03f46;
- --td-error-color-6: #c64751;
- --td-error-color-7: #de6670;
- --td-error-color-8: #ec888e;
- --td-error-color-9: #edb1b6;
- --td-error-color-10: #eeced0;
- --td-success-color-1: #193a2a;
- --td-success-color-2: #1a4230;
- --td-success-color-3: #17533d;
- --td-success-color-4: #0d7a55;
- --td-success-color-5: #059465;
- --td-success-color-6: #43af8a;
- --td-success-color-7: #46bf96;
- --td-success-color-8: #80d2b6;
- --td-success-color-9: #b4e1d3;
- --td-success-color-10: #deede8;
- --td-gray-color-1: #f3f3f3;
- --td-gray-color-2: #eee;
- --td-gray-color-3: #e8e8e8;
- --td-gray-color-4: #ddd;
- --td-gray-color-5: #c6c6c6;
- --td-gray-color-6: #a6a6a6;
- --td-gray-color-7: #8b8b8b;
- --td-gray-color-8: #777;
- --td-gray-color-9: #5e5e5e;
- --td-gray-color-10: #4b4b4b;
- --td-gray-color-11: #383838;
- --td-gray-color-12: #2c2c2c;
- --td-gray-color-13: #242424;
- --td-gray-color-14: #181818;
- --td-font-white-1: rgba(255, 255, 255, 0.9);
- --td-font-white-2: rgba(255, 255, 255, 0.55);
- --td-font-white-3: rgba(255, 255, 255, 0.35);
- --td-font-white-4: rgba(255, 255, 255, 0.22);
- --td-font-gray-1: rgba(0, 0, 0, 0.9);
- --td-font-gray-2: rgba(0, 0, 0, 0.6);
- --td-font-gray-3: rgba(0, 0, 0, 0.4);
- --td-font-gray-4: rgba(0, 0, 0, 0.26);
- --td-brand-color: var(--td-primary-color-8);
- --td-warning-color: var(--td-warning-color-5);
- --td-error-color: var(--td-error-color-6);
- --td-success-color: var(--td-success-color-5);
- --td-brand-color-focus: var(--td-primary-color-1);
- --td-brand-color-active: var(--td-primary-color-9);
- --td-brand-color-disabled: var(--td-primary-color-3);
- --td-brand-color-light: var(--td-primary-color-1);
- --td-brand-color-light-active: var(--td-primary-color-2);
- --td-warning-color-focus: var(--td-warning-color-2);
- --td-warning-color-active: var(--td-warning-color-4);
- --td-warning-color-disabled: var(--td-warning-color-3);
- --td-warning-color-light: var(--td-warning-color-1);
- --td-warning-color-light-active: var(--td-warning-color-2);
- --td-error-color-focus: var(--td-error-color-2);
- --td-error-color-active: var(--td-error-color-5);
- --td-error-color-disabled: var(--td-error-color-3);
- --td-error-color-light: var(--td-error-color-1);
- --td-error-color-light-active: var(--td-error-color-2);
- --td-success-color-focus: var(--td-success-color-2);
- --td-success-color-active: var(--td-success-color-4);
- --td-success-color-disabled: var(--td-success-color-3);
- --td-success-color-light: var(--td-success-color-1);
- --td-success-color-light-active: var(--td-success-color-2);
- --td-mask-active: rgba(0, 0, 0, 0.4);
- --td-mask-disabled: rgba(0, 0, 0, 0.6);
- --td-bg-color-page: var(--td-gray-color-14);
- --td-bg-color-container: var(--td-gray-color-13);
- --td-bg-color-secondarycontainer: var(--td-gray-color-12);
- --td-bg-color-component: var(--td-gray-color-11);
- --td-bg-color-container-active: var(--td-gray-color-12);
- --td-bg-color-secondarycontainer-active: var(--td-gray-color-11);
- --td-bg-color-component-active: var(--td-gray-color-10);
- --td-bg-color-component-disabled: var(--td-gray-color-12);
- --td-bg-color-specialcomponent: transparent;
- --td-text-color-primary: var(--td-font-white-1);
- --td-text-color-secondary: var(--td-font-white-2);
- --td-text-color-placeholder: var(--td-font-white-3);
- --td-text-color-disabled: var(--td-font-white-4);
- --td-text-color-anti: var(--td-font-white-1);
- --td-text-color-brand: var(--td-primary-color-8);
- --td-text-color-link: var(--td-primary-color-8);
- --td-border-level-1-color: var(--td-gray-color-11);
- --td-component-stroke: var(--td-gray-color-11);
- --td-border-level-2-color: var(--td-gray-color-9);
- --td-component-border: var(--td-gray-color-9);
- --td-shadow-1: 0 4px 6px rgba(0, 0, 0, 0.06), 0 1px 10px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.12);
- --td-shadow-2: 0 8px 10px rgba(0, 0, 0, 0.12), 0 3px 14px rgba(0, 0, 0, 0.1), 0 5px 5px rgba(0, 0, 0, 0.16);
- --td-shadow-3: 0 16px 24px rgba(0, 0, 0, 0.14), 0 6px 30px rgba(0, 0, 0, 0.12), 0 8px 10px rgba(0, 0, 0, 0.2);
- --td-shadow-inset-top: inset 0 0.5px 0 #5e5e5e;
- --td-shadow-inset-right: inset 0.5px 0 0 #5e5e5e;
- --td-shadow-inset-bottom: inset 0 -0.5px 0 #5e5e5e;
- --td-shadow-inset-left: inset -0.5px 0 0 #5e5e5e;
- --td-table-shadow-color: rgba(0, 0, 0, 0.55);
- --td-scrollbar-color: rgba(255, 255, 255, 0.1);
- --td-scroll-track-color: #333;
- }
-}
-page,
-.page {
- --td-radius-small: 6rpx;
- --td-radius-default: 12rpx;
- --td-radius-large: 18rpx;
- --td-radius-extra-large: 24rpx;
- --td-radius-round: 999px;
- --td-radius-circle: 50%;
-}
-page,
-.page {
- --td-font-family: PingFang SC, Microsoft YaHei, Arial Regular;
- --td-font-family-medium: PingFang SC, Microsoft YaHei, Arial Medium;
- --td-font-size-link-small: 24rpx;
- --td-font-size-link-medium: 28rpx;
- --td-font-size-link-large: 32rpx;
- --td-font-size-mark-extra-small: 20rpx;
- --td-font-size-mark-small: 24rpx;
- --td-font-size-mark-medium: 28rpx;
- --td-font-size-mark-large: 32rpx;
- --td-font-size-body-extra-small: 20rpx;
- --td-font-size-body-small: 24rpx;
- --td-font-size-body-medium: 28rpx;
- --td-font-size-body-large: 32rpx;
- --td-font-size-title-small: 28rpx;
- --td-font-size-title-medium: 32rpx;
- --td-font-size-title-large: 36rpx;
- --td-font-size-title-extra-large: 40rpx;
- --td-font-size-headline-small: 48rpx;
- --td-font-size-headline-medium: 56rpx;
- --td-font-size-headline-large: 72rpx;
- --td-font-size-display-medium: 96rpx;
- --td-font-size-display-large: 128rpx;
- --td-font-size: 20rpx;
- --td-font-size-xs: var(--td-font-size-body-extra-small);
- --td-font-size-s: var(--td-font-size-body-small);
- --td-font-size-base: var(--td-font-size-title-small);
- --td-font-size-m: var(--td-font-size-title-medium);
- --td-font-size-l: var(--td-font-size-title-large);
- --td-font-size-xl: var(--td-font-size-title-extra-large);
- --td-font-size-xxl: var(--td-font-size-headline-large);
-}
-page,
-.page {
- --td-spacer: 16rpx;
- --td-spacer-1: 24rpx;
- --td-spacer-2: 32rpx;
- --td-spacer-3: 48rpx;
- --td-spacer-4: 64rpx;
- --td-spacer-5: 96rpx;
- --td-spacer-6: 160rpx;
-}
-@media (prefers-color-scheme: light) {
- page,
- .page {
- --td-picker-transparent-color: rgba(255, 255, 255, 0);
- }
-}
-@media (prefers-color-scheme: dark) {
- page,
- .page {
- --td-button-primary-disabled-color: var(--td-font-white-4);
- --td-skeleton-animation-gradient: rgba(255, 255, 255, 0.06);
- --td-slider-dot-bg-color: var(--td-gray-color-4);
- --td-slider-dot-disabled-bg-color: var(--td-gray-color-11);
- --td-slider-dot-disabled-border-color: var(--td-gray-color-12);
- --td-picker-transparent-color: transparent;
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_light.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_light.wxss
deleted file mode 100644
index 21e6cadf..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_light.wxss
+++ /dev/null
@@ -1,127 +0,0 @@
-@media (prefers-color-scheme: light) {
- page,
- .page {
- --td-primary-color-1: #f2f3ff;
- --td-primary-color-2: #d9e1ff;
- --td-primary-color-3: #b5c7ff;
- --td-primary-color-4: #8eabff;
- --td-primary-color-5: #618dff;
- --td-primary-color-6: #366ef4;
- --td-primary-color-7: #0052d9;
- --td-primary-color-8: #003cab;
- --td-primary-color-9: #002a7c;
- --td-primary-color-10: #001a57;
- --td-warning-color-1: #fff1e9;
- --td-warning-color-2: #ffd9c2;
- --td-warning-color-3: #ffb98c;
- --td-warning-color-4: #fa9550;
- --td-warning-color-5: #e37318;
- --td-warning-color-6: #be5a00;
- --td-warning-color-7: #954500;
- --td-warning-color-8: #713300;
- --td-warning-color-9: #532300;
- --td-warning-color-10: #3b1700;
- --td-error-color-1: #fff0ed;
- --td-error-color-2: #ffd8d2;
- --td-error-color-3: #ffb9b0;
- --td-error-color-4: #ff9285;
- --td-error-color-5: #f6685d;
- --td-error-color-6: #d54941;
- --td-error-color-7: #ad352f;
- --td-error-color-8: #881f1c;
- --td-error-color-9: #68070a;
- --td-error-color-10: #490002;
- --td-success-color-1: #e3f9e9;
- --td-success-color-2: #c6f3d7;
- --td-success-color-3: #92dab2;
- --td-success-color-4: #56c08d;
- --td-success-color-5: #2ba471;
- --td-success-color-6: #008858;
- --td-success-color-7: #006c45;
- --td-success-color-8: #005334;
- --td-success-color-9: #003b23;
- --td-success-color-10: #002515;
- --td-gray-color-1: #f3f3f3;
- --td-gray-color-2: #eeeeee;
- --td-gray-color-3: #e7e7e7;
- --td-gray-color-4: #dcdcdc;
- --td-gray-color-5: #c5c5c5;
- --td-gray-color-6: #a6a6a6;
- --td-gray-color-7: #8b8b8b;
- --td-gray-color-8: #777777;
- --td-gray-color-9: #5e5e5e;
- --td-gray-color-10: #4b4b4b;
- --td-gray-color-11: #383838;
- --td-gray-color-12: #2c2c2c;
- --td-gray-color-13: #242424;
- --td-gray-color-14: #181818;
- --td-font-white-1: #ffffff;
- --td-font-white-2: rgba(255, 255, 255, 0.55);
- --td-font-white-3: rgba(255, 255, 255, 0.35);
- --td-font-white-4: rgba(255, 255, 255, 0.22);
- --td-font-gray-1: rgba(0, 0, 0, 0.9);
- --td-font-gray-2: rgba(0, 0, 0, 0.6);
- --td-font-gray-3: rgba(0, 0, 0, 0.4);
- --td-font-gray-4: rgba(0, 0, 0, 0.26);
- --td-brand-color: var(--td-primary-color-7);
- --td-warning-color: var(--td-warning-color-5);
- --td-error-color: var(--td-error-color-6);
- --td-success-color: var(--td-success-color-5);
- --td-brand-color-focus: var(--td-primary-color-1);
- --td-brand-color-active: var(--td-primary-color-8);
- --td-brand-color-disabled: var(--td-primary-color-3);
- --td-brand-color-light: var(--td-primary-color-1);
- --td-brand-color-light-active: var(--td-primary-color-2);
- --td-warning-color-active: var(--td-warning-color-6);
- --td-warning-color-disabled: var(--td-warning-color-3);
- --td-warning-color-focus: var(--td-warning-color-2);
- --td-warning-color-light: var(--td-warning-color-1);
- --td-warning-color-light-active: var(--td-warning-color-2);
- --td-error-color-focus: var(--td-error-color-2);
- --td-error-color-active: var(--td-error-color-7);
- --td-error-color-disabled: var(--td-error-color-3);
- --td-error-color-light: var(--td-error-color-1);
- --td-error-color-light-active: var(--td-error-color-2);
- --td-success-color-focus: var(--td-success-color-2);
- --td-success-color-active: var(--td-success-color-6);
- --td-success-color-disabled: var(--td-success-color-3);
- --td-success-color-light: var(--td-success-color-1);
- --td-success-color-light-active: var(--td-success-color-2);
- --td-mask-active: rgba(0, 0, 0, 0.6);
- --td-mask-disabled: rgba(255, 255, 255, 0.6);
- --td-bg-color-page: var(--td-gray-color-1);
- --td-bg-color-container: var(--td-font-white-1);
- --td-bg-color-container-active: var(--td-gray-color-3);
- --td-bg-color-secondarycontainer: var(--td-gray-color-1);
- --td-bg-color-secondarycontainer-active: var(--td-gray-color-4);
- --td-bg-color-component: var(--td-gray-color-3);
- --td-bg-color-component-active: var(--td-gray-color-6);
- --td-bg-color-component-disabled: var(--td-gray-color-2);
- --td-bg-color-secondarycomponent: var(--td-gray-color-4);
- --td-bg-color-secondarycomponent-active: var(--td-gray-color-6);
- --td-bg-color-specialcomponent: #fff;
- --td-text-color-primary: var(--td-font-gray-1);
- --td-text-color-secondary: var(--td-font-gray-2);
- --td-text-color-placeholder: var(--td-font-gray-3);
- --td-text-color-disabled: var(--td-font-gray-4);
- --td-text-color-anti: var(--td-font-white-1);
- --td-text-color-brand: var(--td-brand-color);
- --td-text-color-link: var(--td-brand-color);
- --td-border-level-1-color: var(--td-gray-color-3);
- --td-component-stroke: var(--td-gray-color-3);
- --td-border-level-2-color: var(--td-gray-color-4);
- --td-component-border: var(--td-gray-color-4);
- --td-shadow-1: 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12);
- --td-shadow-2: 0 3px 14px 2px rgba(0, 0, 0, 0.05), 0 8px 10px 1px rgba(0, 0, 0, 0.06), 0 5px 5px -3px rgba(0, 0, 0, 0.1);
- --td-shadow-3: 0 6px 30px 5px rgba(0, 0, 0, 0.05), 0 16px 24px 2px rgba(0, 0, 0, 0.04), 0 8px 10px -5px rgba(0, 0, 0, 0.08);
- --td-shadow-4: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
- --td-shadow-inset-top: inset 0 0.5px 0 #dcdcdc;
- --td-shadow-inset-right: inset 0.5px 0 0 #dcdcdc;
- --td-shadow-inset-bottom: inset 0 -0.5px 0 #dcdcdc;
- --td-shadow-inset-left: inset -0.5px 0 0 #dcdcdc;
- --td-table-shadow-color: rgba(0, 0, 0, 0.08);
- --td-scrollbar-color: rgba(0, 0, 0, 0.1);
- --td-scrollbar-hover-color: rgba(0, 0, 0, 0.3);
- --td-scroll-track-color: #fff;
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_radius.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_radius.wxss
deleted file mode 100644
index d559d996..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_radius.wxss
+++ /dev/null
@@ -1,9 +0,0 @@
-page,
-.page {
- --td-radius-small: 6rpx;
- --td-radius-default: 12rpx;
- --td-radius-large: 18rpx;
- --td-radius-extra-large: 24rpx;
- --td-radius-round: 999px;
- --td-radius-circle: 50%;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_spacer.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_spacer.wxss
deleted file mode 100644
index bda90f9d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/theme/_spacer.wxss
+++ /dev/null
@@ -1,10 +0,0 @@
-page,
-.page {
- --td-spacer: 16rpx;
- --td-spacer-1: 24rpx;
- --td-spacer-2: 32rpx;
- --td-spacer-3: 48rpx;
- --td-spacer-4: 64rpx;
- --td-spacer-5: 96rpx;
- --td-spacer-6: 160rpx;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/utilities/_animation.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/utilities/_animation.wxss
deleted file mode 100644
index a04e7c52..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/utilities/_animation.wxss
+++ /dev/null
@@ -1,8 +0,0 @@
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/utilities/_float.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/utilities/_float.wxss
deleted file mode 100644
index e88ef0ed..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/utilities/_float.wxss
+++ /dev/null
@@ -1,6 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/utilities/_index.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/utilities/_index.wxss
deleted file mode 100644
index 1d532d2d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/style/utilities/_index.wxss
+++ /dev/null
@@ -1,27 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/badge.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/badge.wxml
deleted file mode 100644
index a7607c76..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/badge.wxml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/button.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/button.wxml
deleted file mode 100644
index 9aae79cf..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/button.wxml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/icon.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/icon.wxml
deleted file mode 100644
index 0db675e3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/icon.wxml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/image.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/image.wxml
deleted file mode 100644
index a47c5a49..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/template/image.wxml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/utils.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/utils.d.ts
deleted file mode 100644
index 6639e879..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/utils.d.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-///
-///
-///
-export declare const systemInfo: WechatMiniprogram.WindowInfo | WechatMiniprogram.SystemInfo;
-export declare const appBaseInfo: WechatMiniprogram.AppBaseInfo | WechatMiniprogram.SystemInfo;
-export declare const deviceInfo: WechatMiniprogram.DeviceInfo | WechatMiniprogram.SystemInfo;
-declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
-export declare const debounce: (func: any, wait?: number) => (...rest: any[]) => void;
-export declare const throttle: (func: any, wait?: number, options?: any) => (...args: any[]) => void;
-export declare const classNames: (...args: any[]) => string;
-export declare const styles: (styleObj: any) => string;
-export declare const getAnimationFrame: (context: any, cb: Function) => any;
-export declare const getRect: (context: any, selector: string, needAll?: boolean) => Promise;
-export declare const isNumber: (value: any) => boolean;
-export declare const isNull: (value: any) => boolean;
-export declare const isUndefined: (value: any) => boolean;
-export declare const isDef: (value: any) => boolean;
-export declare const isIOS: () => boolean;
-export declare const addUnit: (value?: string | number) => string | undefined;
-export declare const getCharacterLength: (type: string, char: string | number, max?: number) => {
- length: number;
- characters: string;
-};
-export declare const chunk: (arr: any[], size: number) => any[][];
-export declare const getInstance: (context?: Context, selector?: string) => WechatMiniprogram.Component.TrivialInstance;
-export declare const unitConvert: (value: number | string | null | undefined) => number;
-export declare const setIcon: (iconName: any, icon: any, defaultIcon: any) => {
- [x: string]: any;
-};
-export declare const isBool: (val: any) => boolean;
-export declare const isObject: (val: any) => boolean;
-export declare const isString: (val: any) => boolean;
-export declare const toCamel: (str: any) => any;
-export declare const getCurrentPage: () => T & WechatMiniprogram.OptionalInterface & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods & WechatMiniprogram.Page.Data & WechatMiniprogram.IAnyObject;
-export declare const uniqueFactory: (compName: any) => () => string;
-export declare const calcIcon: (icon: string | Record, defaultIcon?: string) => string | Record;
-export declare const isOverSize: (size: any, sizeLimit: any) => boolean;
-export declare const rpx2px: (rpx: any) => number;
-export declare const nextTick: () => Promise;
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/utils.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/utils.js
deleted file mode 100644
index 2ae1bb53..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/utils.js
+++ /dev/null
@@ -1,252 +0,0 @@
-import { prefix } from './config';
-import { getWindowInfo, getAppBaseInfo, getDeviceInfo } from './wechat';
-export const systemInfo = getWindowInfo();
-export const appBaseInfo = getAppBaseInfo();
-export const deviceInfo = getDeviceInfo();
-export const debounce = function (func, wait = 500) {
- let timerId;
- return function (...rest) {
- if (timerId) {
- clearTimeout(timerId);
- }
- timerId = setTimeout(() => {
- func.apply(this, rest);
- }, wait);
- };
-};
-export const throttle = (func, wait = 100, options = null) => {
- let previous = 0;
- let timerid = null;
- if (!options) {
- options = {
- leading: true,
- };
- }
- return function (...args) {
- const now = Date.now();
- if (!previous && !options.leading)
- previous = now;
- const remaining = wait - (now - previous);
- const context = this;
- if (remaining <= 0) {
- if (timerid) {
- clearTimeout(timerid);
- timerid = null;
- }
- previous = now;
- func.apply(context, args);
- }
- };
-};
-export const classNames = function (...args) {
- const hasOwn = {}.hasOwnProperty;
- const classes = [];
- args.forEach((arg) => {
- if (!arg)
- return;
- const argType = typeof arg;
- if (argType === 'string' || argType === 'number') {
- classes.push(arg);
- }
- else if (Array.isArray(arg) && arg.length) {
- const inner = classNames(...arg);
- if (inner) {
- classes.push(inner);
- }
- }
- else if (argType === 'object') {
- for (const key in arg) {
- if (hasOwn.call(arg, key) && arg[key]) {
- classes.push(key);
- }
- }
- }
- });
- return classes.join(' ');
-};
-export const styles = function (styleObj) {
- return Object.keys(styleObj)
- .map((styleKey) => `${styleKey}: ${styleObj[styleKey]}`)
- .join('; ');
-};
-export const getAnimationFrame = function (context, cb) {
- return context
- .createSelectorQuery()
- .selectViewport()
- .boundingClientRect()
- .exec(() => {
- cb();
- });
-};
-export const getRect = function (context, selector, needAll = false) {
- return new Promise((resolve, reject) => {
- context
- .createSelectorQuery()[needAll ? 'selectAll' : 'select'](selector)
- .boundingClientRect((rect) => {
- if (rect) {
- resolve(rect);
- }
- else {
- reject(rect);
- }
- })
- .exec();
- });
-};
-export const isNumber = function (value) {
- return /^\d+(\.\d+)?$/.test(value);
-};
-export const isNull = function (value) {
- return value === null;
-};
-export const isUndefined = (value) => typeof value === 'undefined';
-export const isDef = function (value) {
- return !isUndefined(value) && !isNull(value);
-};
-export const isIOS = function () {
- var _a;
- return !!(((_a = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.system) === null || _a === void 0 ? void 0 : _a.toLowerCase().search('ios')) + 1);
-};
-export const addUnit = function (value) {
- if (!isDef(value)) {
- return undefined;
- }
- value = String(value);
- return isNumber(value) ? `${value}px` : value;
-};
-export const getCharacterLength = (type, char, max) => {
- const str = String(char !== null && char !== void 0 ? char : '');
- if (str.length === 0) {
- return {
- length: 0,
- characters: '',
- };
- }
- if (type === 'maxcharacter') {
- let len = 0;
- for (let i = 0; i < str.length; i += 1) {
- let currentStringLength = 0;
- if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
- currentStringLength = 2;
- }
- else {
- currentStringLength = 1;
- }
- if (len + currentStringLength > max) {
- return {
- length: len,
- characters: str.slice(0, i),
- };
- }
- len += currentStringLength;
- }
- return {
- length: len,
- characters: str,
- };
- }
- else if (type === 'maxlength') {
- const length = str.length > max ? max : str.length;
- return {
- length,
- characters: str.slice(0, length),
- };
- }
- return {
- length: str.length,
- characters: str,
- };
-};
-export const chunk = (arr, size) => Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => arr.slice(i * size, i * size + size));
-export const getInstance = function (context, selector) {
- if (!context) {
- const pages = getCurrentPages();
- const page = pages[pages.length - 1];
- context = page.$$basePage || page;
- }
- const instance = context ? context.selectComponent(selector) : null;
- if (!instance) {
- console.warn('未找到组件,请检查selector是否正确');
- return null;
- }
- return instance;
-};
-export const unitConvert = (value) => {
- var _a;
- if (typeof value === 'string') {
- if (value.includes('rpx')) {
- return (parseInt(value, 10) * ((_a = systemInfo === null || systemInfo === void 0 ? void 0 : systemInfo.screenWidth) !== null && _a !== void 0 ? _a : 750)) / 750;
- }
- return parseInt(value, 10);
- }
- return value !== null && value !== void 0 ? value : 0;
-};
-export const setIcon = (iconName, icon, defaultIcon) => {
- if (icon) {
- if (typeof icon === 'string') {
- return {
- [`${iconName}Name`]: icon,
- [`${iconName}Data`]: {},
- };
- }
- else if (typeof icon === 'object') {
- return {
- [`${iconName}Name`]: '',
- [`${iconName}Data`]: icon,
- };
- }
- else {
- return {
- [`${iconName}Name`]: defaultIcon,
- [`${iconName}Data`]: {},
- };
- }
- }
- return {
- [`${iconName}Name`]: '',
- [`${iconName}Data`]: {},
- };
-};
-export const isBool = (val) => typeof val === 'boolean';
-export const isObject = (val) => typeof val === 'object' && val != null;
-export const isString = (val) => typeof val === 'string';
-export const toCamel = (str) => str.replace(/-(\w)/g, (match, m1) => m1.toUpperCase());
-export const getCurrentPage = function () {
- const pages = getCurrentPages();
- return pages[pages.length - 1];
-};
-export const uniqueFactory = (compName) => {
- let number = 0;
- return () => `${prefix}_${compName}_${number++}`;
-};
-export const calcIcon = (icon, defaultIcon) => {
- if (icon && ((isBool(icon) && defaultIcon) || isString(icon))) {
- return { name: isBool(icon) ? defaultIcon : icon };
- }
- if (isObject(icon)) {
- return icon;
- }
- return null;
-};
-export const isOverSize = (size, sizeLimit) => {
- var _a;
- if (!sizeLimit)
- return false;
- const base = 1000;
- const unitMap = {
- B: 1,
- KB: base,
- MB: base * base,
- GB: base * base * base,
- };
- const computedSize = typeof sizeLimit === 'number' ? sizeLimit * base : (sizeLimit === null || sizeLimit === void 0 ? void 0 : sizeLimit.size) * unitMap[(_a = sizeLimit === null || sizeLimit === void 0 ? void 0 : sizeLimit.unit) !== null && _a !== void 0 ? _a : 'KB'];
- return size > computedSize;
-};
-export const rpx2px = (rpx) => Math.floor((systemInfo.windowWidth * rpx) / 750);
-export const nextTick = () => {
- return new Promise((resolve) => {
- wx.nextTick(() => {
- resolve();
- });
- });
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/utils.wxs b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/utils.wxs
deleted file mode 100644
index 10c7ade3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/utils.wxs
+++ /dev/null
@@ -1,144 +0,0 @@
-/* utils */
-
-/**
- * addUnit */
-// 为 css 添加单位
-function addUnit(value) {
- // prettier-ignore
- var REGEXP = getRegExp('^-?\d+(.\d+)?$');
- if (value == null) {
- return undefined;
- }
- return REGEXP.test('' + value) ? value + 'px' : value;
-}
-
-function isString(string) {
- return string && string.constructor === 'String';
-}
-
-function isArray(array) {
- return array && array.constructor === 'Array';
-}
-
-function isObject(obj) {
- return obj && obj.constructor === 'Object';
-}
-
-var isNoEmptyObj = function (obj) {
- return isObject(obj) && JSON.stringify(obj) !== '{}';
-};
-
-function includes(arr, value) {
- if (!arr || !isArray(arr)) return false;
-
- var i = 0;
- var len = arr.length;
-
- for (; i < len; i++) {
- if (arr[i] === value) return true;
- }
- return false;
-}
-
-function cls(base, arr) {
- var res = [base];
- var i = 0;
- for (var size = arr.length; i < size; i++) {
- var item = arr[i];
-
- if (item && item.constructor === 'Array') {
- var key = arr[i][0];
- var value = arr[i][1];
-
- if (value) {
- res.push(base + '--' + key);
- }
- } else if (typeof item === 'string' || typeof item === 'number') {
- if (item) {
- res.push(base + '--' + item);
- }
- }
- }
- return res.join(' ');
-}
-
-function getBadgeAriaLabel(options) {
- var maxCount = options.maxCount || 99;
- if (options.dot) {
- return '有新的消息';
- }
- if (options.count === '...') {
- return '有很多消息';
- }
- if (isNaN(options.count)) {
- return options.count;
- }
- var str1 = '有' + maxCount + '+条消息';
- var str2 = '有' + options.count + '条消息';
- return Number(options.count) > maxCount ? str1 : str2;
-}
-
-function endsWith(str, endStr) {
- return str.slice(-endStr.length) === endStr ? str : str + endStr;
-}
-
-function keys(obj) {
- return JSON.stringify(obj)
- .replace(getRegExp('{|}|"', 'g'), '')
- .split(',')
- .map(function (item) {
- return item.split(':')[0];
- });
-}
-
-function kebabCase(str) {
- return str
- .replace(getRegExp('[A-Z]', 'g'), function (ele) {
- return '-' + ele;
- })
- .toLowerCase();
-}
-
-function _style(styles) {
- if (isArray(styles)) {
- return styles
- .filter(function (item) {
- return item != null && item !== '';
- })
- .map(function (item) {
- return isArray(item) ? _style(item) : endsWith(item, ';');
- })
- .join(' ');
- }
-
- if (isObject(styles)) {
- return keys(styles)
- .filter(function (key) {
- return styles[key] != null && styles[key] !== '';
- })
- .map(function (key) {
- return [kebabCase(key), [styles[key]]].join(':');
- })
- .join(';');
- }
-
- return styles;
-}
-
-function isValidIconName(str) {
- // prettier-ignore
- return getRegExp('^[A-Za-z0-9\-]+$').test(str);
-}
-
-module.exports = {
- addUnit: addUnit,
- isString: isString,
- isArray: isArray,
- isObject: isObject,
- isNoEmptyObj: isNoEmptyObj,
- includes: includes,
- cls: cls,
- getBadgeAriaLabel: getBadgeAriaLabel,
- _style: _style,
- isValidIconName: isValidIconName,
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/version.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/version.d.ts
deleted file mode 100644
index 21e0b9e6..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/version.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export declare function compareVersion(v1: any, v2: any): 0 | 1 | -1;
-export declare function canIUseFormFieldButton(): boolean;
-export declare function canUseVirtualHost(): boolean;
-export declare function canUseProxyScrollView(): boolean;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/version.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/version.js
deleted file mode 100644
index 86a45218..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/version.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import { getAppBaseInfo } from './wechat';
-let systemInfo;
-function getSystemInfo() {
- if (systemInfo == null) {
- systemInfo = getAppBaseInfo();
- }
- return systemInfo;
-}
-export 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]);
- const num2 = parseInt(v2[i]);
- if (num1 > num2) {
- return 1;
- }
- else if (num1 < num2) {
- return -1;
- }
- }
- return 0;
-}
-function judgeByVersion(version) {
- const currentSDKVersion = getSystemInfo().SDKVersion;
- return compareVersion(currentSDKVersion, version) >= 0;
-}
-export function canIUseFormFieldButton() {
- return judgeByVersion('2.10.3');
-}
-export function canUseVirtualHost() {
- return judgeByVersion('2.19.2');
-}
-export function canUseProxyScrollView() {
- return judgeByVersion('2.19.2');
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/wechat.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/wechat.d.ts
deleted file mode 100644
index db570692..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/wechat.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export declare const getObserver: (context: any, selector: string) => Promise;
-export declare const getWindowInfo: () => WechatMiniprogram.WindowInfo | WechatMiniprogram.SystemInfo;
-export declare const getAppBaseInfo: () => WechatMiniprogram.SystemInfo | WechatMiniprogram.AppBaseInfo;
-export declare const getDeviceInfo: () => WechatMiniprogram.SystemInfo | WechatMiniprogram.DeviceInfo;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/wechat.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/common/wechat.js
deleted file mode 100644
index c776abf2..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/common/wechat.js
+++ /dev/null
@@ -1,19 +0,0 @@
-export const getObserver = (context, selector) => {
- return new Promise((resolve, reject) => {
- context
- .createIntersectionObserver(context)
- .relativeToViewport()
- .observe(selector, (res) => {
- resolve(res);
- });
- });
-};
-export const getWindowInfo = () => {
- return wx.getWindowInfo ? wx.getWindowInfo() || wx.getSystemInfoSync() : wx.getSystemInfoSync();
-};
-export const getAppBaseInfo = () => {
- return wx.getAppBaseInfo ? wx.getAppBaseInfo() || wx.getSystemInfoSync() : wx.getSystemInfoSync();
-};
-export const getDeviceInfo = () => {
- return wx.getDeviceInfo ? wx.getDeviceInfo() || wx.getSystemInfoSync() : wx.getSystemInfoSync();
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/README.en-US.md
deleted file mode 100644
index 08a4d5ab..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/README.en-US.md
+++ /dev/null
@@ -1,31 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Divider Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-align | String | center | options: left/right/center | N
-content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-dashed | Boolean | false | \- | N
-layout | String | horizontal | options: horizontal/vertical | N
-### Divider External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-content | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-divider-color | @bg-color-component | -
---td-divider-content-color | @font-gray-3 | -
---td-divider-content-font-size | 24rpx | -
---td-divider-content-line-height | 40rpx | -
---td-divider-content-line-style | solid | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/README.md
deleted file mode 100644
index d567bcbe..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
----
-title: Divider 分割线
-description: 用于分割、组织、细化有一定逻辑的组织元素内容和页面结构。
-spline: message
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-divider": "tdesign-miniprogram/divider/divider"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-
-
-### 基础分割符
-
-分割符主要是由直线和文字组成,通过`slot`传入分割线文案或者其他自定义内容,通过`layout`控制分隔符是垂直还是横向
-
-{{ base }}
-
-### 虚线样式
-
-{{ theme }}
-
-## API
-
-### Divider Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-align | String | center | 文本位置(仅在水平分割线有效)。可选项:left/right/center | N
-content | String / Slot | - | 子元素。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-dashed | Boolean | false | 是否虚线(仅在水平分割线有效) | N
-layout | String | horizontal | 分隔线类型有两种:水平和垂直。可选项:horizontal/vertical | N
-### Divider External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-content | 内容样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-divider-color | @bg-color-component | -
---td-divider-content-color | @font-gray-3 | -
---td-divider-content-font-size | 24rpx | -
---td-divider-content-line-height | 40rpx | -
---td-divider-content-line-style | solid | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.d.ts
deleted file mode 100644
index d4d837cc..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.d.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class Divider extends SuperComponent {
- externalClasses: string[];
- options: {
- multipleSlots: boolean;
- };
- properties: import("./type").TdDividerProps;
- data: {
- prefix: string;
- classPrefix: string;
- };
- observers: {
- lineColor(): void;
- };
- methods: {
- setStyle(): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.js
deleted file mode 100644
index 7e3247de..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.js
+++ /dev/null
@@ -1,43 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-divider`;
-let Divider = class Divider extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-content`];
- this.options = {
- multipleSlots: true,
- };
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- };
- this.observers = {
- lineColor() {
- this.setStyle();
- },
- };
- this.methods = {
- setStyle() {
- const { lineColor } = this.properties;
- const dividerStyle = `${lineColor ? `border-color: ${lineColor};` : ''}`;
- this.setData({
- dividerStyle,
- });
- },
- };
- }
-};
-Divider = __decorate([
- wxComponent()
-], Divider);
-export default Divider;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.json
deleted file mode 100644
index 79f27309..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared"
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.wxml
deleted file mode 100644
index fb83e6b2..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.wxml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
- {{content}}
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.wxss
deleted file mode 100644
index 28433f33..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/divider.wxss
+++ /dev/null
@@ -1,85 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-divider {
- display: flex;
- color: var(--td-divider-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- border-color: var(--td-divider-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- border-style: var(--td-divider-content-line-style, solid);
- border-width: 0;
-}
-.t-divider::before,
-.t-divider::after {
- content: '';
- display: block;
- flex: 1;
- box-sizing: border-box;
- border: inherit;
- border-color: inherit;
- border-style: inherit;
-}
-.t-divider--horizontal {
- align-items: center;
- margin-top: 20rpx;
- margin-bottom: 20rpx;
-}
-.t-divider--horizontal::before,
-.t-divider--horizontal::after {
- border-top-width: 1px;
- transform: scaleY(0.5);
- transform-origin: bottom;
-}
-.t-divider--horizontal .t-divider__content:not(:empty) {
- margin: 0 24rpx;
-}
-.t-divider--vertical {
- flex-direction: column;
- height: 28rpx;
- margin: 0 16rpx;
-}
-.t-divider--vertical::before,
-.t-divider--vertical::after {
- border-left-width: 1px;
- transform: scaleX(0.5);
- transform-origin: bottom;
-}
-.t-divider--vertical-center {
- align-items: center;
- height: 100%;
-}
-.t-divider--dashed {
- border-style: dashed;
-}
-.t-divider__content {
- font-size: var(--td-divider-content-font-size, 24rpx);
- line-height: var(--td-divider-content-line-height, 40rpx);
- color: var(--td-divider-content-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
-}
-.t-divider--left::before,
-.t-divider--right::after {
- max-width: 60rpx;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/props.d.ts
deleted file mode 100644
index 806aab2e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdDividerProps } from './type';
-declare const props: TdDividerProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/props.js
deleted file mode 100644
index 395a3aa3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/props.js
+++ /dev/null
@@ -1,18 +0,0 @@
-const props = {
- align: {
- type: String,
- value: 'center',
- },
- content: {
- type: String,
- },
- dashed: {
- type: Boolean,
- value: false,
- },
- layout: {
- type: String,
- value: 'horizontal',
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/type.d.ts
deleted file mode 100644
index 424a7b21..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/type.d.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-export interface TdDividerProps {
- align?: {
- type: StringConstructor;
- value?: 'left' | 'right' | 'center';
- };
- content?: {
- type: StringConstructor;
- value?: string;
- };
- dashed?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- layout?: {
- type: StringConstructor;
- value?: 'horizontal' | 'vertical';
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/divider/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/README.en-US.md
deleted file mode 100644
index cfdbbddd..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/README.en-US.md
+++ /dev/null
@@ -1,33 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Empty Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-action | Slot | - | action block。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-description | String / Slot | - | empty component description。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-icon | String / Object | - | \- | N
-image | String / Slot | - | image url, or Image component props, or custom any node you need.。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-### Empty External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-description | \-
-t-class-image | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-empty-action-margin-top | @spacer-4 | -
---td-empty-description-color | @font-gray-3 | -
---td-empty-description-font-size | @font-size-base | -
---td-empty-description-line-height | 44rpx | -
---td-empty-description-margin-top | @spacer-2 | -
---td-empty-icon-color | @font-gray-3 | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/README.md
deleted file mode 100644
index 802b9a10..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
----
-title: Empty 空状态
-description: 用于空状态时的占位提示。
-spline: data
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-empty": "tdesign-miniprogram/empty/empty"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 类型
-
-图标空状态
-
-{{ base }}
-
-自定义图片空状态
-
-{{ imageEmpty }}
-
-带操作空状态
-
-{{ buttonEmpty }}
-
-
-
-## API
-
-### Empty Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-action | Slot | - | 操作按钮。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-description | String / Slot | - | 描述文字。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-icon | String / Object | - | 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon`。 | N
-image | String / Slot | - | 图片地址。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-### Empty External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-description | 描述样式类
-t-class-image | 图片样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-empty-action-margin-top | @spacer-4 | -
---td-empty-description-color | @font-gray-3 | -
---td-empty-description-font-size | @font-size-base | -
---td-empty-description-line-height | 44rpx | -
---td-empty-description-margin-top | @spacer-2 | -
---td-empty-icon-color | @font-gray-3 | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.d.ts
deleted file mode 100644
index cd582e05..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class extends SuperComponent {
- options: {
- multipleSlots: boolean;
- };
- externalClasses: string[];
- properties: import("./type").TdEmptyProps;
- data: {
- prefix: string;
- classPrefix: string;
- };
- observers: {
- icon(icon: any): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.js
deleted file mode 100644
index 7d99bf99..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.js
+++ /dev/null
@@ -1,36 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import props from './props';
-import config from '../common/config';
-import { setIcon } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-empty`;
-let default_1 = class extends SuperComponent {
- constructor() {
- super(...arguments);
- this.options = {
- multipleSlots: true,
- };
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-description`, `${prefix}-class-image`];
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- };
- this.observers = {
- icon(icon) {
- const obj = setIcon('icon', icon, '');
- this.setData(Object.assign({}, obj));
- },
- };
- }
-};
-default_1 = __decorate([
- wxComponent()
-], default_1);
-export default default_1;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.json
deleted file mode 100644
index b7d275dd..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon",
- "t-image": "../image/image"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.wxml
deleted file mode 100644
index 142b73c4..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.wxml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- {{description}}
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.wxss
deleted file mode 100644
index 04c4a893..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/empty.wxss
+++ /dev/null
@@ -1,49 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-empty {
- display: flex;
- flex-direction: column;
- align-items: center;
-}
-.t-empty__icon {
- font-size: 192rpx;
- color: var(--td-empty-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
-}
-.t-empty__thumb + .t-empty__description:not(:empty) {
- margin-top: var(--td-empty-description-margin-top, var(--td-spacer-2, 32rpx));
-}
-.t-empty__description {
- text-align: center;
- color: var(--td-empty-description-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
- font-size: var(--td-empty-description-font-size, var(--td-font-size-base, 28rpx));
- line-height: var(--td-empty-description-line-height, 44rpx);
- white-space: pre-wrap;
-}
-.t-empty__description + .t-empty__actions:not(:empty) {
- margin-top: var(--td-empty-action-margin-top, var(--td-spacer-4, 64rpx));
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/props.d.ts
deleted file mode 100644
index 6f04c799..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdEmptyProps } from './type';
-declare const props: TdEmptyProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/props.js
deleted file mode 100644
index aa55217b..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/props.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const props = {
- description: {
- type: String,
- },
- externalClasses: {
- type: Array,
- },
- icon: {
- type: null,
- },
- image: {
- type: String,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/type.d.ts
deleted file mode 100644
index 8a319f37..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/type.d.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-export interface TdEmptyProps {
- description?: {
- type: StringConstructor;
- value?: string;
- };
- externalClasses?: {
- type: ArrayConstructor;
- value?: ['t-class', 't-class-description', 't-class-image', 't-class-actions'];
- };
- icon?: {
- type: null;
- value?: string | object;
- };
- image?: {
- type: StringConstructor;
- value?: string;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/empty/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/README.en-US.md
deleted file mode 100644
index b408f55c..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/README.en-US.md
+++ /dev/null
@@ -1,26 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-
-### Icon Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-color | String | - | \- | N
-name | String | - | required | Y
-prefix | String | - | \- | N
-size | String / Number | - | \- | N
-
-### Icon Events
-
-name | params | description
--- | -- | --
-click | \- | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
-### Icon External Classes
-
-className | Description
--- | --
-t-class | \-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/README.md
deleted file mode 100644
index 916e3f93..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/README.md
+++ /dev/null
@@ -1,122 +0,0 @@
----
-title: Icon 图标
-description: 图标。
-spline: base
-isComponent: true
----
-
-


-
-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-icon": "tdesign-miniprogram/icon/icon"
-}
-```
-
-## 常见问题
-
-
-
- 控制台告警:Failed to load font
- 👇
-
-
- 告警属于开发者工具的 bug,可以忽略,具体可以看 官网文档
-
-
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-
-### 基础组件图标
-
-{{ base }}
-
-### 自定义组件图标
-
-{{ custom }}
-
-自定义图标用法,下面以 `iconfont` 为例
-
-#### 准备图标文件
-
-文件后缀应为`.wxss`,如下方代码块所示:
-
-```css
-@font-face {
- font-family: 'icon'; // 使用自定义的字体名称
- ···
-}
-
-.icon {
- font-family: 'icon' !important; // 字体名称
- ···
-}
-
-.icon-a-0:before { // icon 图标。注意 FontClass 前缀与 font-family 保持一致
- content: '\e64d';
-}
-```
-- 添加所需图标,下载图标。图标库一般会提供 **在线链接** 或者 **下载至本地** 等使用方式。**在线链接** 方式会指向一个 `.css` 文件,可以下载或复制其内容,将其修改成后缀名为 `.wxss` 的文件
-- 将 `.wxss` 文件中的 `FontClass/Symbol前缀` 与 `Font Family` 两项内容保持一致,如: `FontClass/Symbol` 前缀为 `icon-`,则 `Font Family` 为 `icon`。
-
-> 注:若是采用 `下载至本地` 方式,需关注 `.css` 和 `.ttf` 文件。由于微信小程序不支持处理 `ttf、woff、eot` 等文件,但支持 `base64`,所以需要将 `.ttf` 文件转换为 `base64` (可借助转换工具,如 [transfonter.org](https://transfonter.org/),会得到一个 `stylesheet.css` 文件),然后将 `.css` 文件中的 `@font-face {}` 内容替换为 `stylesheet.css` 中的 `base64` 内容,最后将 `.css` 文件修改后缀为 `.wxss`
-
-#### 引入自定义图标
-
-- 全局引入:在项目 `app.wxss`,使用 `@import` 引入上述的 `.wxss` 文件
-- 局部引入:在 `page` 对应的 `.wxss` 中,使用 `@import` 引入上述的 `.wxss` 文件
-
-#### 自定义图标的使用
-
- `` 组件中的 `prefix` 属性值与前面设置的 `Font Family` 保持一致,即 `prefix="icon"`,`name` 属性值为自定义图标名称,如图标的 `className` 为 `icon-a-1h`,则 `name="a-1h"`。
-
-### 图片链接
-
-{{ iconImage }}
-
-### 全部图标
-
-
-
-
大部分图标在 1.8.0 版本中新增,如果发现引入组件库后,部分图标无法使用,请检查安装的组件库`tdesign-miniprogram`的版本。支持中文英文搜索,如果觉得可以再增加其他关键词提示,欢迎到 图标仓库 提交PR,帮我们一起补充。
-
-
-
-
-
-## API
-
-### Icon Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-color | String | - | 图标颜色 | N
-name | String | - | 必需。图标名称或图片链接 | Y
-prefix | String | - | 自定义图标前缀 | N
-size | String / Number | - | 图标大小, 如 `20`, `20px`, `48rpx`, 默认单位是 `px` | N
-
-### Icon Events
-
-名称 | 参数 | 描述
--- | -- | --
-click | \- | 点击图标时触发。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
-### Icon External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.d.ts
deleted file mode 100644
index b70696a6..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.d.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class Icon extends SuperComponent {
- externalClasses: string[];
- properties: import("./type").TdIconProps;
- data: {
- componentPrefix: string;
- classPrefix: string;
- isImage: boolean;
- iconStyle: any;
- };
- observers: {
- 'name, color, size, style'(): void;
- };
- methods: {
- onTap(event: any): void;
- setIconStyle(): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.js
deleted file mode 100644
index 797cae00..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.js
+++ /dev/null
@@ -1,71 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { styles, addUnit, getRect } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-icon`;
-let Icon = class Icon extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`];
- this.properties = props;
- this.data = {
- componentPrefix: prefix,
- classPrefix: name,
- isImage: false,
- iconStyle: undefined,
- };
- this.observers = {
- 'name, color, size, style'() {
- this.setIconStyle();
- },
- };
- this.methods = {
- onTap(event) {
- this.triggerEvent('click', event.detail);
- },
- setIconStyle() {
- const { name, color, size, classPrefix } = this.data;
- const isImage = name.indexOf('/') !== -1;
- const sizeValue = addUnit(size);
- const colorStyle = color ? { color: color } : {};
- const fontStyle = size ? { 'font-size': sizeValue } : {};
- const iconStyle = Object.assign(Object.assign({}, colorStyle), fontStyle);
- this.setData({ isImage }, () => __awaiter(this, void 0, void 0, function* () {
- if (isImage) {
- let iconSize = sizeValue;
- if (!iconSize) {
- yield getRect(this, `.${classPrefix}`)
- .then((res) => {
- iconSize = addUnit(res === null || res === void 0 ? void 0 : res.height);
- })
- .catch(() => { });
- }
- iconStyle.width = iconSize;
- iconStyle.height = iconSize;
- }
- this.setData({ iconStyle: `${styles(iconStyle)}` });
- }));
- },
- };
- }
-};
-Icon = __decorate([
- wxComponent()
-], Icon);
-export default Icon;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.json
deleted file mode 100644
index 4f0a3f08..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {}
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.wxml
deleted file mode 100644
index bfa4de83..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.wxml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.wxss
deleted file mode 100644
index 26f660fb..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/icon.wxss
+++ /dev/null
@@ -1,6407 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-@font-face {
- font-family: t;
- src: url('https://tdesign.gtimg.com/icon/0.3.1/fonts/t.eot'), url('https://tdesign.gtimg.com/icon/0.3.1/fonts/t.eot?#iefix') format('ded-opentype'), url('https://tdesign.gtimg.com/icon/0.3.1/fonts/t.woff') format('woff'), url('https://tdesign.gtimg.com/icon/0.3.1/fonts/t.ttf') format('truetype'), url('https://tdesign.gtimg.com/icon/0.3.1/fonts/t.svg') format('svg');
- /* iOS 4.1- */
- font-weight: normal;
- font-style: normal;
-}
-.t-icon--image {
- width: 100%;
- height: 100%;
-}
-.t-icon__image {
- vertical-align: top;
- width: 100%;
- height: 100%;
-}
-.t-icon-base {
- font-style: normal;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
- line-height: 1;
- text-align: center;
- display: block;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-.t-icon {
- /* stylelint-disable-next-line declaration-no-important */
- font-family: t !important;
- /* prevent issues with browser extensions that change fonts */
-}
-.t-icon-accessibility-filled:before {
- content: '\E001';
-}
-.t-icon-accessibility:before {
- content: '\E002';
-}
-.t-icon-activity-filled:before {
- content: '\E003';
-}
-.t-icon-activity:before {
- content: '\E004';
-}
-.t-icon-add-and-subtract:before {
- content: '\E005';
-}
-.t-icon-add-circle-filled:before {
- content: '\E006';
-}
-.t-icon-add-circle:before {
- content: '\E007';
-}
-.t-icon-add-rectangle-filled:before {
- content: '\E008';
-}
-.t-icon-add-rectangle:before {
- content: '\E009';
-}
-.t-icon-add:before {
- content: '\E00A';
-}
-.t-icon-address-book-filled:before {
- content: '\E00B';
-}
-.t-icon-address-book:before {
- content: '\E00C';
-}
-.t-icon-adjustment-filled:before {
- content: '\E00D';
-}
-.t-icon-adjustment:before {
- content: '\E00E';
-}
-.t-icon-airplay-wave-filled:before {
- content: '\E00F';
-}
-.t-icon-airplay-wave:before {
- content: '\E010';
-}
-.t-icon-alarm-add-filled:before {
- content: '\E011';
-}
-.t-icon-alarm-add:before {
- content: '\E012';
-}
-.t-icon-alarm-filled:before {
- content: '\E013';
-}
-.t-icon-alarm-off-filled:before {
- content: '\E014';
-}
-.t-icon-alarm-off:before {
- content: '\E015';
-}
-.t-icon-alarm:before {
- content: '\E016';
-}
-.t-icon-align-top:before {
- content: '\E017';
-}
-.t-icon-align-vertical:before {
- content: '\E018';
-}
-.t-icon-alpha:before {
- content: '\E019';
-}
-.t-icon-analytics-filled:before {
- content: '\E01A';
-}
-.t-icon-analytics:before {
- content: '\E01B';
-}
-.t-icon-anchor:before {
- content: '\E01C';
-}
-.t-icon-angry-filled:before {
- content: '\E01D';
-}
-.t-icon-angry:before {
- content: '\E01E';
-}
-.t-icon-animation-1-filled:before {
- content: '\E01F';
-}
-.t-icon-animation-1:before {
- content: '\E020';
-}
-.t-icon-animation-filled:before {
- content: '\E021';
-}
-.t-icon-animation:before {
- content: '\E022';
-}
-.t-icon-anticlockwise-filled:before {
- content: '\E023';
-}
-.t-icon-anticlockwise:before {
- content: '\E024';
-}
-.t-icon-api:before {
- content: '\E025';
-}
-.t-icon-app-filled:before {
- content: '\E026';
-}
-.t-icon-app:before {
- content: '\E027';
-}
-.t-icon-apple-filled:before {
- content: '\E028';
-}
-.t-icon-apple:before {
- content: '\E029';
-}
-.t-icon-application-filled:before {
- content: '\E02A';
-}
-.t-icon-application:before {
- content: '\E02B';
-}
-.t-icon-architecture-hui-style-filled:before {
- content: '\E02C';
-}
-.t-icon-architecture-hui-style:before {
- content: '\E02D';
-}
-.t-icon-archway-1-filled:before {
- content: '\E02E';
-}
-.t-icon-archway-1:before {
- content: '\E02F';
-}
-.t-icon-archway-filled:before {
- content: '\E030';
-}
-.t-icon-archway:before {
- content: '\E031';
-}
-.t-icon-arrow-down-circle-filled:before {
- content: '\E032';
-}
-.t-icon-arrow-down-circle:before {
- content: '\E033';
-}
-.t-icon-arrow-down-rectangle-filled:before {
- content: '\E034';
-}
-.t-icon-arrow-down-rectangle:before {
- content: '\E035';
-}
-.t-icon-arrow-down:before {
- content: '\E036';
-}
-.t-icon-arrow-left-circle-filled:before {
- content: '\E037';
-}
-.t-icon-arrow-left-circle:before {
- content: '\E038';
-}
-.t-icon-arrow-left-down-circle-filled:before {
- content: '\E039';
-}
-.t-icon-arrow-left-down-circle:before {
- content: '\E03A';
-}
-.t-icon-arrow-left-down:before {
- content: '\E03B';
-}
-.t-icon-arrow-left-right-1:before {
- content: '\E03C';
-}
-.t-icon-arrow-left-right-2:before {
- content: '\E03D';
-}
-.t-icon-arrow-left-right-3:before {
- content: '\E03E';
-}
-.t-icon-arrow-left-right-circle-filled:before {
- content: '\E03F';
-}
-.t-icon-arrow-left-right-circle:before {
- content: '\E040';
-}
-.t-icon-arrow-left-up-circle-filled:before {
- content: '\E041';
-}
-.t-icon-arrow-left-up-circle:before {
- content: '\E042';
-}
-.t-icon-arrow-left-up:before {
- content: '\E043';
-}
-.t-icon-arrow-left:before {
- content: '\E044';
-}
-.t-icon-arrow-right-circle-filled:before {
- content: '\E045';
-}
-.t-icon-arrow-right-circle:before {
- content: '\E046';
-}
-.t-icon-arrow-right-down-circle-filled:before {
- content: '\E047';
-}
-.t-icon-arrow-right-down-circle:before {
- content: '\E048';
-}
-.t-icon-arrow-right-down:before {
- content: '\E049';
-}
-.t-icon-arrow-right-up-circle-filled:before {
- content: '\E04A';
-}
-.t-icon-arrow-right-up-circle:before {
- content: '\E04B';
-}
-.t-icon-arrow-right-up:before {
- content: '\E04C';
-}
-.t-icon-arrow-right:before {
- content: '\E04D';
-}
-.t-icon-arrow-triangle-down-filled:before {
- content: '\E04E';
-}
-.t-icon-arrow-triangle-down:before {
- content: '\E04F';
-}
-.t-icon-arrow-triangle-up-filled:before {
- content: '\E050';
-}
-.t-icon-arrow-triangle-up:before {
- content: '\E051';
-}
-.t-icon-arrow-up-circle-filled:before {
- content: '\E052';
-}
-.t-icon-arrow-up-circle:before {
- content: '\E053';
-}
-.t-icon-arrow-up-down-1:before {
- content: '\E054';
-}
-.t-icon-arrow-up-down-2:before {
- content: '\E055';
-}
-.t-icon-arrow-up-down-3:before {
- content: '\E056';
-}
-.t-icon-arrow-up-down-circle-filled:before {
- content: '\E057';
-}
-.t-icon-arrow-up-down-circle:before {
- content: '\E058';
-}
-.t-icon-arrow-up:before {
- content: '\E059';
-}
-.t-icon-artboard:before {
- content: '\E05A';
-}
-.t-icon-article-filled:before {
- content: '\E05B';
-}
-.t-icon-article:before {
- content: '\E05C';
-}
-.t-icon-assignment-checked-filled:before {
- content: '\E05D';
-}
-.t-icon-assignment-checked:before {
- content: '\E05E';
-}
-.t-icon-assignment-code-filled:before {
- content: '\E05F';
-}
-.t-icon-assignment-code:before {
- content: '\E060';
-}
-.t-icon-assignment-error-filled:before {
- content: '\E061';
-}
-.t-icon-assignment-error:before {
- content: '\E062';
-}
-.t-icon-assignment-filled:before {
- content: '\E063';
-}
-.t-icon-assignment-user-filled:before {
- content: '\E064';
-}
-.t-icon-assignment-user:before {
- content: '\E065';
-}
-.t-icon-assignment:before {
- content: '\E066';
-}
-.t-icon-attach:before {
- content: '\E067';
-}
-.t-icon-attic-1-filled:before {
- content: '\E068';
-}
-.t-icon-attic-1:before {
- content: '\E069';
-}
-.t-icon-attic-filled:before {
- content: '\E06A';
-}
-.t-icon-attic:before {
- content: '\E06B';
-}
-.t-icon-audio-filled:before {
- content: '\E06C';
-}
-.t-icon-audio:before {
- content: '\E06D';
-}
-.t-icon-awkward-filled:before {
- content: '\E06E';
-}
-.t-icon-awkward:before {
- content: '\E06F';
-}
-.t-icon-backtop-rectangle-filled:before {
- content: '\E070';
-}
-.t-icon-backtop-rectangle:before {
- content: '\E071';
-}
-.t-icon-backtop:before {
- content: '\E072';
-}
-.t-icon-backup-filled:before {
- content: '\E073';
-}
-.t-icon-backup:before {
- content: '\E074';
-}
-.t-icon-backward-filled:before {
- content: '\E075';
-}
-.t-icon-backward:before {
- content: '\E076';
-}
-.t-icon-bad-laugh-filled:before {
- content: '\E077';
-}
-.t-icon-bad-laugh:before {
- content: '\E078';
-}
-.t-icon-bamboo-shoot-filled:before {
- content: '\E079';
-}
-.t-icon-bamboo-shoot:before {
- content: '\E07A';
-}
-.t-icon-banana-filled:before {
- content: '\E07B';
-}
-.t-icon-banana:before {
- content: '\E07C';
-}
-.t-icon-barbecue-filled:before {
- content: '\E07D';
-}
-.t-icon-barbecue:before {
- content: '\E07E';
-}
-.t-icon-barcode-1:before {
- content: '\E07F';
-}
-.t-icon-barcode:before {
- content: '\E080';
-}
-.t-icon-base-station:before {
- content: '\E081';
-}
-.t-icon-battery-add-filled:before {
- content: '\E082';
-}
-.t-icon-battery-add:before {
- content: '\E083';
-}
-.t-icon-battery-charging-filled:before {
- content: '\E084';
-}
-.t-icon-battery-charging:before {
- content: '\E085';
-}
-.t-icon-battery-filled:before {
- content: '\E086';
-}
-.t-icon-battery-low-filled:before {
- content: '\E087';
-}
-.t-icon-battery-low:before {
- content: '\E088';
-}
-.t-icon-battery:before {
- content: '\E089';
-}
-.t-icon-bean-filled:before {
- content: '\E08A';
-}
-.t-icon-bean:before {
- content: '\E08B';
-}
-.t-icon-beer-filled:before {
- content: '\E08C';
-}
-.t-icon-beer:before {
- content: '\E08D';
-}
-.t-icon-beta:before {
- content: '\E08E';
-}
-.t-icon-bifurcate-filled:before {
- content: '\E08F';
-}
-.t-icon-bifurcate:before {
- content: '\E090';
-}
-.t-icon-bill-filled:before {
- content: '\E091';
-}
-.t-icon-bill:before {
- content: '\E092';
-}
-.t-icon-bluetooth:before {
- content: '\E093';
-}
-.t-icon-bone-filled:before {
- content: '\E094';
-}
-.t-icon-bone:before {
- content: '\E095';
-}
-.t-icon-book-filled:before {
- content: '\E096';
-}
-.t-icon-book-open-filled:before {
- content: '\E097';
-}
-.t-icon-book-open:before {
- content: '\E098';
-}
-.t-icon-book-unknown-filled:before {
- content: '\E099';
-}
-.t-icon-book-unknown:before {
- content: '\E09A';
-}
-.t-icon-book:before {
- content: '\E09B';
-}
-.t-icon-bookmark-add-filled:before {
- content: '\E09C';
-}
-.t-icon-bookmark-add:before {
- content: '\E09D';
-}
-.t-icon-bookmark-checked-filled:before {
- content: '\E09E';
-}
-.t-icon-bookmark-checked:before {
- content: '\E09F';
-}
-.t-icon-bookmark-double-filled:before {
- content: '\E0A0';
-}
-.t-icon-bookmark-double:before {
- content: '\E0A1';
-}
-.t-icon-bookmark-filled:before {
- content: '\E0A2';
-}
-.t-icon-bookmark-minus-filled:before {
- content: '\E0A3';
-}
-.t-icon-bookmark-minus:before {
- content: '\E0A4';
-}
-.t-icon-bookmark:before {
- content: '\E0A5';
-}
-.t-icon-braces:before {
- content: '\E0A6';
-}
-.t-icon-brackets:before {
- content: '\E0A7';
-}
-.t-icon-bread-filled:before {
- content: '\E0A8';
-}
-.t-icon-bread:before {
- content: '\E0A9';
-}
-.t-icon-bridge-1-filled:before {
- content: '\E0AA';
-}
-.t-icon-bridge-1:before {
- content: '\E0AB';
-}
-.t-icon-bridge-2-filled:before {
- content: '\E0AC';
-}
-.t-icon-bridge-2:before {
- content: '\E0AD';
-}
-.t-icon-bridge-3:before {
- content: '\E0AE';
-}
-.t-icon-bridge-4:before {
- content: '\E0AF';
-}
-.t-icon-bridge-5-filled:before {
- content: '\E0B0';
-}
-.t-icon-bridge-5:before {
- content: '\E0B1';
-}
-.t-icon-bridge-6-filled:before {
- content: '\E0B2';
-}
-.t-icon-bridge-6:before {
- content: '\E0B3';
-}
-.t-icon-bridge:before {
- content: '\E0B4';
-}
-.t-icon-brightness-1-filled:before {
- content: '\E0B5';
-}
-.t-icon-brightness-1:before {
- content: '\E0B6';
-}
-.t-icon-brightness-filled:before {
- content: '\E0B7';
-}
-.t-icon-brightness:before {
- content: '\E0B8';
-}
-.t-icon-broccoli-filled:before {
- content: '\E0B9';
-}
-.t-icon-broccoli:before {
- content: '\E0BA';
-}
-.t-icon-browse-filled:before {
- content: '\E0BB';
-}
-.t-icon-browse-gallery-filled:before {
- content: '\E0BC';
-}
-.t-icon-browse-gallery:before {
- content: '\E0BD';
-}
-.t-icon-browse-off-filled:before {
- content: '\E0BE';
-}
-.t-icon-browse-off:before {
- content: '\E0BF';
-}
-.t-icon-browse:before {
- content: '\E0C0';
-}
-.t-icon-brush-filled:before {
- content: '\E0C1';
-}
-.t-icon-brush:before {
- content: '\E0C2';
-}
-.t-icon-bug-filled:before {
- content: '\E0C3';
-}
-.t-icon-bug-report-filled:before {
- content: '\E0C4';
-}
-.t-icon-bug-report:before {
- content: '\E0C5';
-}
-.t-icon-bug:before {
- content: '\E0C6';
-}
-.t-icon-building-1-filled:before {
- content: '\E0C7';
-}
-.t-icon-building-1:before {
- content: '\E0C8';
-}
-.t-icon-building-2-filled:before {
- content: '\E0C9';
-}
-.t-icon-building-2:before {
- content: '\E0CA';
-}
-.t-icon-building-3-filled:before {
- content: '\E0CB';
-}
-.t-icon-building-3:before {
- content: '\E0CC';
-}
-.t-icon-building-4-filled:before {
- content: '\E0CD';
-}
-.t-icon-building-4:before {
- content: '\E0CE';
-}
-.t-icon-building-5-filled:before {
- content: '\E0CF';
-}
-.t-icon-building-5:before {
- content: '\E0D0';
-}
-.t-icon-building-filled:before {
- content: '\E0D1';
-}
-.t-icon-building:before {
- content: '\E0D2';
-}
-.t-icon-bulletpoint:before {
- content: '\E0D3';
-}
-.t-icon-button-filled:before {
- content: '\E0D4';
-}
-.t-icon-button:before {
- content: '\E0D5';
-}
-.t-icon-cabbage-filled:before {
- content: '\E0D6';
-}
-.t-icon-cabbage:before {
- content: '\E0D7';
-}
-.t-icon-cake-filled:before {
- content: '\E0D8';
-}
-.t-icon-cake:before {
- content: '\E0D9';
-}
-.t-icon-calculation-1-filled:before {
- content: '\E0DA';
-}
-.t-icon-calculation-1:before {
- content: '\E0DB';
-}
-.t-icon-calculation:before {
- content: '\E0DC';
-}
-.t-icon-calculator-1:before {
- content: '\E0DD';
-}
-.t-icon-calculator-filled:before {
- content: '\E0DE';
-}
-.t-icon-calculator:before {
- content: '\E0DF';
-}
-.t-icon-calendar-1-filled:before {
- content: '\E0E0';
-}
-.t-icon-calendar-1:before {
- content: '\E0E1';
-}
-.t-icon-calendar-2-filled:before {
- content: '\E0E2';
-}
-.t-icon-calendar-2:before {
- content: '\E0E3';
-}
-.t-icon-calendar-edit-filled:before {
- content: '\E0E4';
-}
-.t-icon-calendar-edit:before {
- content: '\E0E5';
-}
-.t-icon-calendar-event-filled:before {
- content: '\E0E6';
-}
-.t-icon-calendar-event:before {
- content: '\E0E7';
-}
-.t-icon-calendar-filled:before {
- content: '\E0E8';
-}
-.t-icon-calendar:before {
- content: '\E0E9';
-}
-.t-icon-call-1-filled:before {
- content: '\E0EA';
-}
-.t-icon-call-1:before {
- content: '\E0EB';
-}
-.t-icon-call-cancel-filled:before {
- content: '\E0EC';
-}
-.t-icon-call-cancel:before {
- content: '\E0ED';
-}
-.t-icon-call-filled:before {
- content: '\E0EE';
-}
-.t-icon-call-forwarded-filled:before {
- content: '\E0EF';
-}
-.t-icon-call-forwarded:before {
- content: '\E0F0';
-}
-.t-icon-call-incoming-filled:before {
- content: '\E0F1';
-}
-.t-icon-call-incoming:before {
- content: '\E0F2';
-}
-.t-icon-call-off-filled:before {
- content: '\E0F3';
-}
-.t-icon-call-off:before {
- content: '\E0F4';
-}
-.t-icon-call:before {
- content: '\E0F5';
-}
-.t-icon-calm-1-filled:before {
- content: '\E0F6';
-}
-.t-icon-calm-1:before {
- content: '\E0F7';
-}
-.t-icon-calm-filled:before {
- content: '\E0F8';
-}
-.t-icon-calm:before {
- content: '\E0F9';
-}
-.t-icon-camera-1-filled:before {
- content: '\E0FA';
-}
-.t-icon-camera-1:before {
- content: '\E0FB';
-}
-.t-icon-camera-2-filled:before {
- content: '\E0FC';
-}
-.t-icon-camera-2:before {
- content: '\E0FD';
-}
-.t-icon-camera-filled:before {
- content: '\E0FE';
-}
-.t-icon-camera-off-filled:before {
- content: '\E0FF';
-}
-.t-icon-camera-off:before {
- content: '\E100';
-}
-.t-icon-camera:before {
- content: '\E101';
-}
-.t-icon-candy-filled:before {
- content: '\E102';
-}
-.t-icon-candy:before {
- content: '\E103';
-}
-.t-icon-card-filled:before {
- content: '\E104';
-}
-.t-icon-card:before {
- content: '\E105';
-}
-.t-icon-cardmembership-filled:before {
- content: '\E106';
-}
-.t-icon-cardmembership:before {
- content: '\E107';
-}
-.t-icon-caret-down-small:before {
- content: '\E108';
-}
-.t-icon-caret-down:before {
- content: '\E109';
-}
-.t-icon-caret-left-small:before {
- content: '\E10A';
-}
-.t-icon-caret-left:before {
- content: '\E10B';
-}
-.t-icon-caret-right-small:before {
- content: '\E10C';
-}
-.t-icon-caret-right:before {
- content: '\E10D';
-}
-.t-icon-caret-up-small:before {
- content: '\E10E';
-}
-.t-icon-caret-up:before {
- content: '\E10F';
-}
-.t-icon-cart-add-filled:before {
- content: '\E110';
-}
-.t-icon-cart-add:before {
- content: '\E111';
-}
-.t-icon-cart-filled:before {
- content: '\E112';
-}
-.t-icon-cart:before {
- content: '\E113';
-}
-.t-icon-cast-filled:before {
- content: '\E114';
-}
-.t-icon-cast:before {
- content: '\E115';
-}
-.t-icon-castle-1-filled:before {
- content: '\E116';
-}
-.t-icon-castle-1:before {
- content: '\E117';
-}
-.t-icon-castle-2-filled:before {
- content: '\E118';
-}
-.t-icon-castle-2:before {
- content: '\E119';
-}
-.t-icon-castle-3-filled:before {
- content: '\E11A';
-}
-.t-icon-castle-3:before {
- content: '\E11B';
-}
-.t-icon-castle-4-filled:before {
- content: '\E11C';
-}
-.t-icon-castle-4:before {
- content: '\E11D';
-}
-.t-icon-castle-5-filled:before {
- content: '\E11E';
-}
-.t-icon-castle-5:before {
- content: '\E11F';
-}
-.t-icon-castle-6-filled:before {
- content: '\E120';
-}
-.t-icon-castle-6:before {
- content: '\E121';
-}
-.t-icon-castle-7-filled:before {
- content: '\E122';
-}
-.t-icon-castle-7:before {
- content: '\E123';
-}
-.t-icon-castle-filled:before {
- content: '\E124';
-}
-.t-icon-castle:before {
- content: '\E125';
-}
-.t-icon-cat-filled:before {
- content: '\E126';
-}
-.t-icon-cat:before {
- content: '\E127';
-}
-.t-icon-catalog-filled:before {
- content: '\E128';
-}
-.t-icon-catalog:before {
- content: '\E129';
-}
-.t-icon-cd-filled:before {
- content: '\E12A';
-}
-.t-icon-cd:before {
- content: '\E12B';
-}
-.t-icon-celsius:before {
- content: '\E12C';
-}
-.t-icon-center-focus-strong-filled:before {
- content: '\E12D';
-}
-.t-icon-center-focus-strong:before {
- content: '\E12E';
-}
-.t-icon-centimeter:before {
- content: '\E12F';
-}
-.t-icon-certificate-1-filled:before {
- content: '\E130';
-}
-.t-icon-certificate-1:before {
- content: '\E131';
-}
-.t-icon-certificate-filled:before {
- content: '\E132';
-}
-.t-icon-certificate:before {
- content: '\E133';
-}
-.t-icon-chart-3d-filled:before {
- content: '\E134';
-}
-.t-icon-chart-3d:before {
- content: '\E135';
-}
-.t-icon-chart-add-filled:before {
- content: '\E136';
-}
-.t-icon-chart-add:before {
- content: '\E137';
-}
-.t-icon-chart-analytics:before {
- content: '\E138';
-}
-.t-icon-chart-area-filled:before {
- content: '\E139';
-}
-.t-icon-chart-area-multi-filled:before {
- content: '\E13A';
-}
-.t-icon-chart-area-multi:before {
- content: '\E13B';
-}
-.t-icon-chart-area:before {
- content: '\E13C';
-}
-.t-icon-chart-bar-filled:before {
- content: '\E13D';
-}
-.t-icon-chart-bar:before {
- content: '\E13E';
-}
-.t-icon-chart-bubble-filled:before {
- content: '\E13F';
-}
-.t-icon-chart-bubble:before {
- content: '\E140';
-}
-.t-icon-chart-column-filled:before {
- content: '\E141';
-}
-.t-icon-chart-column:before {
- content: '\E142';
-}
-.t-icon-chart-combo-filled:before {
- content: '\E143';
-}
-.t-icon-chart-combo:before {
- content: '\E144';
-}
-.t-icon-chart-filled:before {
- content: '\E145';
-}
-.t-icon-chart-line-data-1:before {
- content: '\E146';
-}
-.t-icon-chart-line-data:before {
- content: '\E147';
-}
-.t-icon-chart-line-multi:before {
- content: '\E148';
-}
-.t-icon-chart-line:before {
- content: '\E149';
-}
-.t-icon-chart-maximum:before {
- content: '\E14A';
-}
-.t-icon-chart-median:before {
- content: '\E14B';
-}
-.t-icon-chart-minimum:before {
- content: '\E14C';
-}
-.t-icon-chart-pie-filled:before {
- content: '\E14D';
-}
-.t-icon-chart-pie:before {
- content: '\E14E';
-}
-.t-icon-chart-radar-filled:before {
- content: '\E14F';
-}
-.t-icon-chart-radar:before {
- content: '\E150';
-}
-.t-icon-chart-radial:before {
- content: '\E151';
-}
-.t-icon-chart-ring-1-filled:before {
- content: '\E152';
-}
-.t-icon-chart-ring-1:before {
- content: '\E153';
-}
-.t-icon-chart-ring-filled:before {
- content: '\E154';
-}
-.t-icon-chart-ring:before {
- content: '\E155';
-}
-.t-icon-chart-scatter:before {
- content: '\E156';
-}
-.t-icon-chart-stacked-filled:before {
- content: '\E157';
-}
-.t-icon-chart-stacked:before {
- content: '\E158';
-}
-.t-icon-chart:before {
- content: '\E159';
-}
-.t-icon-chat-add-filled:before {
- content: '\E15A';
-}
-.t-icon-chat-add:before {
- content: '\E15B';
-}
-.t-icon-chat-bubble-1-filled:before {
- content: '\E15C';
-}
-.t-icon-chat-bubble-1:before {
- content: '\E15D';
-}
-.t-icon-chat-bubble-add-filled:before {
- content: '\E15E';
-}
-.t-icon-chat-bubble-add:before {
- content: '\E15F';
-}
-.t-icon-chat-bubble-error-filled:before {
- content: '\E160';
-}
-.t-icon-chat-bubble-error:before {
- content: '\E161';
-}
-.t-icon-chat-bubble-filled:before {
- content: '\E162';
-}
-.t-icon-chat-bubble-help-filled:before {
- content: '\E163';
-}
-.t-icon-chat-bubble-help:before {
- content: '\E164';
-}
-.t-icon-chat-bubble-history-filled:before {
- content: '\E165';
-}
-.t-icon-chat-bubble-history:before {
- content: '\E166';
-}
-.t-icon-chat-bubble-locked-filled:before {
- content: '\E167';
-}
-.t-icon-chat-bubble-locked:before {
- content: '\E168';
-}
-.t-icon-chat-bubble-smile-filled:before {
- content: '\E169';
-}
-.t-icon-chat-bubble-smile:before {
- content: '\E16A';
-}
-.t-icon-chat-bubble:before {
- content: '\E16B';
-}
-.t-icon-chat-checked-filled:before {
- content: '\E16C';
-}
-.t-icon-chat-checked:before {
- content: '\E16D';
-}
-.t-icon-chat-clear-filled:before {
- content: '\E16E';
-}
-.t-icon-chat-clear:before {
- content: '\E16F';
-}
-.t-icon-chat-double-filled:before {
- content: '\E170';
-}
-.t-icon-chat-double:before {
- content: '\E171';
-}
-.t-icon-chat-error-filled:before {
- content: '\E172';
-}
-.t-icon-chat-error:before {
- content: '\E173';
-}
-.t-icon-chat-filled:before {
- content: '\E174';
-}
-.t-icon-chat-heart-filled:before {
- content: '\E175';
-}
-.t-icon-chat-heart:before {
- content: '\E176';
-}
-.t-icon-chat-message-filled:before {
- content: '\E177';
-}
-.t-icon-chat-message:before {
- content: '\E178';
-}
-.t-icon-chat-off-filled:before {
- content: '\E179';
-}
-.t-icon-chat-off:before {
- content: '\E17A';
-}
-.t-icon-chat-poll-filled:before {
- content: '\E17B';
-}
-.t-icon-chat-poll:before {
- content: '\E17C';
-}
-.t-icon-chat-setting-filled:before {
- content: '\E17D';
-}
-.t-icon-chat-setting:before {
- content: '\E17E';
-}
-.t-icon-chat:before {
- content: '\E17F';
-}
-.t-icon-check-circle-filled:before {
- content: '\E180';
-}
-.t-icon-check-circle:before {
- content: '\E181';
-}
-.t-icon-check-double:before {
- content: '\E182';
-}
-.t-icon-check-rectangle-filled:before {
- content: '\E183';
-}
-.t-icon-check-rectangle:before {
- content: '\E184';
-}
-.t-icon-check:before {
- content: '\E185';
-}
-.t-icon-cheese-filled:before {
- content: '\E186';
-}
-.t-icon-cheese:before {
- content: '\E187';
-}
-.t-icon-cherry-filled:before {
- content: '\E188';
-}
-.t-icon-cherry:before {
- content: '\E189';
-}
-.t-icon-chevron-down-circle-filled:before {
- content: '\E18A';
-}
-.t-icon-chevron-down-circle:before {
- content: '\E18B';
-}
-.t-icon-chevron-down-double-s:before {
- content: '\E18C';
-}
-.t-icon-chevron-down-double:before {
- content: '\E18D';
-}
-.t-icon-chevron-down-rectangle-filled:before {
- content: '\E18E';
-}
-.t-icon-chevron-down-rectangle:before {
- content: '\E18F';
-}
-.t-icon-chevron-down-s:before {
- content: '\E190';
-}
-.t-icon-chevron-down:before {
- content: '\E191';
-}
-.t-icon-chevron-left-circle-filled:before {
- content: '\E192';
-}
-.t-icon-chevron-left-circle:before {
- content: '\E193';
-}
-.t-icon-chevron-left-double-s:before {
- content: '\E194';
-}
-.t-icon-chevron-left-double:before {
- content: '\E195';
-}
-.t-icon-chevron-left-rectangle-filled:before {
- content: '\E196';
-}
-.t-icon-chevron-left-rectangle:before {
- content: '\E197';
-}
-.t-icon-chevron-left-s:before {
- content: '\E198';
-}
-.t-icon-chevron-left:before {
- content: '\E199';
-}
-.t-icon-chevron-right-circle-filled:before {
- content: '\E19A';
-}
-.t-icon-chevron-right-circle:before {
- content: '\E19B';
-}
-.t-icon-chevron-right-double-s:before {
- content: '\E19C';
-}
-.t-icon-chevron-right-double:before {
- content: '\E19D';
-}
-.t-icon-chevron-right-rectangle-filled:before {
- content: '\E19E';
-}
-.t-icon-chevron-right-rectangle:before {
- content: '\E19F';
-}
-.t-icon-chevron-right-s:before {
- content: '\E1A0';
-}
-.t-icon-chevron-right:before {
- content: '\E1A1';
-}
-.t-icon-chevron-up-circle-filled:before {
- content: '\E1A2';
-}
-.t-icon-chevron-up-circle:before {
- content: '\E1A3';
-}
-.t-icon-chevron-up-double-s:before {
- content: '\E1A4';
-}
-.t-icon-chevron-up-double:before {
- content: '\E1A5';
-}
-.t-icon-chevron-up-rectangle-filled:before {
- content: '\E1A6';
-}
-.t-icon-chevron-up-rectangle:before {
- content: '\E1A7';
-}
-.t-icon-chevron-up-s:before {
- content: '\E1A8';
-}
-.t-icon-chevron-up:before {
- content: '\E1A9';
-}
-.t-icon-chicken:before {
- content: '\E1AA';
-}
-.t-icon-chili-filled:before {
- content: '\E1AB';
-}
-.t-icon-chili:before {
- content: '\E1AC';
-}
-.t-icon-chimney-1-filled:before {
- content: '\E1AD';
-}
-.t-icon-chimney-1:before {
- content: '\E1AE';
-}
-.t-icon-chimney-2-filled:before {
- content: '\E1AF';
-}
-.t-icon-chimney-2:before {
- content: '\E1B0';
-}
-.t-icon-chimney-filled:before {
- content: '\E1B1';
-}
-.t-icon-chimney:before {
- content: '\E1B2';
-}
-.t-icon-chinese-cabbage-filled:before {
- content: '\E1B3';
-}
-.t-icon-chinese-cabbage:before {
- content: '\E1B4';
-}
-.t-icon-church-filled:before {
- content: '\E1B5';
-}
-.t-icon-church:before {
- content: '\E1B6';
-}
-.t-icon-circle-filled:before {
- content: '\E1B7';
-}
-.t-icon-circle:before {
- content: '\E1B8';
-}
-.t-icon-city-1-filled:before {
- content: '\E1B9';
-}
-.t-icon-city-1:before {
- content: '\E1BA';
-}
-.t-icon-city-10-filled:before {
- content: '\E1BB';
-}
-.t-icon-city-10:before {
- content: '\E1BC';
-}
-.t-icon-city-11-filled:before {
- content: '\E1BD';
-}
-.t-icon-city-11:before {
- content: '\E1BE';
-}
-.t-icon-city-12-filled:before {
- content: '\E1BF';
-}
-.t-icon-city-12:before {
- content: '\E1C0';
-}
-.t-icon-city-13-filled:before {
- content: '\E1C1';
-}
-.t-icon-city-13:before {
- content: '\E1C2';
-}
-.t-icon-city-14-filled:before {
- content: '\E1C3';
-}
-.t-icon-city-14:before {
- content: '\E1C4';
-}
-.t-icon-city-15-filled:before {
- content: '\E1C5';
-}
-.t-icon-city-15:before {
- content: '\E1C6';
-}
-.t-icon-city-2-filled:before {
- content: '\E1C7';
-}
-.t-icon-city-2:before {
- content: '\E1C8';
-}
-.t-icon-city-3-filled:before {
- content: '\E1C9';
-}
-.t-icon-city-3:before {
- content: '\E1CA';
-}
-.t-icon-city-4-filled:before {
- content: '\E1CB';
-}
-.t-icon-city-4:before {
- content: '\E1CC';
-}
-.t-icon-city-5-filled:before {
- content: '\E1CD';
-}
-.t-icon-city-5:before {
- content: '\E1CE';
-}
-.t-icon-city-6-filled:before {
- content: '\E1CF';
-}
-.t-icon-city-6:before {
- content: '\E1D0';
-}
-.t-icon-city-7-filled:before {
- content: '\E1D1';
-}
-.t-icon-city-7:before {
- content: '\E1D2';
-}
-.t-icon-city-8-filled:before {
- content: '\E1D3';
-}
-.t-icon-city-8:before {
- content: '\E1D4';
-}
-.t-icon-city-9-filled:before {
- content: '\E1D5';
-}
-.t-icon-city-9:before {
- content: '\E1D6';
-}
-.t-icon-city-ancient-1-filled:before {
- content: '\E1D7';
-}
-.t-icon-city-ancient-1:before {
- content: '\E1D8';
-}
-.t-icon-city-ancient-2-filled:before {
- content: '\E1D9';
-}
-.t-icon-city-ancient-2:before {
- content: '\E1DA';
-}
-.t-icon-city-ancient-filled:before {
- content: '\E1DB';
-}
-.t-icon-city-ancient:before {
- content: '\E1DC';
-}
-.t-icon-city-filled:before {
- content: '\E1DD';
-}
-.t-icon-city:before {
- content: '\E1DE';
-}
-.t-icon-clear-filled:before {
- content: '\E1DF';
-}
-.t-icon-clear-formatting-1-filled:before {
- content: '\E1E0';
-}
-.t-icon-clear-formatting-1:before {
- content: '\E1E1';
-}
-.t-icon-clear-formatting-filled:before {
- content: '\E1E2';
-}
-.t-icon-clear-formatting:before {
- content: '\E1E3';
-}
-.t-icon-clear:before {
- content: '\E1E4';
-}
-.t-icon-close-circle-filled:before {
- content: '\E1E5';
-}
-.t-icon-close-circle:before {
- content: '\E1E6';
-}
-.t-icon-close-octagon-filled:before {
- content: '\E1E7';
-}
-.t-icon-close-octagon:before {
- content: '\E1E8';
-}
-.t-icon-close-rectangle-filled:before {
- content: '\E1E9';
-}
-.t-icon-close-rectangle:before {
- content: '\E1EA';
-}
-.t-icon-close:before {
- content: '\E1EB';
-}
-.t-icon-cloud-download:before {
- content: '\E1EC';
-}
-.t-icon-cloud-filled:before {
- content: '\E1ED';
-}
-.t-icon-cloud-upload:before {
- content: '\E1EE';
-}
-.t-icon-cloud:before {
- content: '\E1EF';
-}
-.t-icon-cloudy-day-filled:before {
- content: '\E1F0';
-}
-.t-icon-cloudy-day:before {
- content: '\E1F1';
-}
-.t-icon-cloudy-night-filled:before {
- content: '\E1F2';
-}
-.t-icon-cloudy-night-rain-filled:before {
- content: '\E1F3';
-}
-.t-icon-cloudy-night-rain:before {
- content: '\E1F4';
-}
-.t-icon-cloudy-night:before {
- content: '\E1F5';
-}
-.t-icon-cloudy-rain-filled:before {
- content: '\E1F6';
-}
-.t-icon-cloudy-rain:before {
- content: '\E1F7';
-}
-.t-icon-cloudy-sunny-filled:before {
- content: '\E1F8';
-}
-.t-icon-cloudy-sunny:before {
- content: '\E1F9';
-}
-.t-icon-code-1:before {
- content: '\E1FA';
-}
-.t-icon-code-off:before {
- content: '\E1FB';
-}
-.t-icon-code:before {
- content: '\E1FC';
-}
-.t-icon-cola-filled:before {
- content: '\E1FD';
-}
-.t-icon-cola:before {
- content: '\E1FE';
-}
-.t-icon-collage-filled:before {
- content: '\E1FF';
-}
-.t-icon-collage:before {
- content: '\E200';
-}
-.t-icon-collection-filled:before {
- content: '\E201';
-}
-.t-icon-collection:before {
- content: '\E202';
-}
-.t-icon-color-invert-filled:before {
- content: '\E203';
-}
-.t-icon-color-invert:before {
- content: '\E204';
-}
-.t-icon-combination-filled:before {
- content: '\E205';
-}
-.t-icon-combination:before {
- content: '\E206';
-}
-.t-icon-command:before {
- content: '\E207';
-}
-.t-icon-compass-1-filled:before {
- content: '\E208';
-}
-.t-icon-compass-1:before {
- content: '\E209';
-}
-.t-icon-compass-filled:before {
- content: '\E20A';
-}
-.t-icon-compass:before {
- content: '\E20B';
-}
-.t-icon-component-breadcrumb-filled:before {
- content: '\E20C';
-}
-.t-icon-component-breadcrumb:before {
- content: '\E20D';
-}
-.t-icon-component-checkbox-filled:before {
- content: '\E20E';
-}
-.t-icon-component-checkbox:before {
- content: '\E20F';
-}
-.t-icon-component-divider-horizontal-filled:before {
- content: '\E210';
-}
-.t-icon-component-divider-horizontal:before {
- content: '\E211';
-}
-.t-icon-component-divider-vertical-filled:before {
- content: '\E212';
-}
-.t-icon-component-divider-vertical:before {
- content: '\E213';
-}
-.t-icon-component-dropdown-filled:before {
- content: '\E214';
-}
-.t-icon-component-dropdown:before {
- content: '\E215';
-}
-.t-icon-component-grid-filled:before {
- content: '\E216';
-}
-.t-icon-component-grid:before {
- content: '\E217';
-}
-.t-icon-component-input-filled:before {
- content: '\E218';
-}
-.t-icon-component-input:before {
- content: '\E219';
-}
-.t-icon-component-layout-filled:before {
- content: '\E21A';
-}
-.t-icon-component-layout:before {
- content: '\E21B';
-}
-.t-icon-component-radio:before {
- content: '\E21C';
-}
-.t-icon-component-space-filled:before {
- content: '\E21D';
-}
-.t-icon-component-space:before {
- content: '\E21E';
-}
-.t-icon-component-steps-filled:before {
- content: '\E21F';
-}
-.t-icon-component-steps:before {
- content: '\E220';
-}
-.t-icon-component-switch-filled:before {
- content: '\E221';
-}
-.t-icon-component-switch:before {
- content: '\E222';
-}
-.t-icon-constraint:before {
- content: '\E223';
-}
-.t-icon-contrast-1-filled:before {
- content: '\E224';
-}
-.t-icon-contrast-1:before {
- content: '\E225';
-}
-.t-icon-contrast-filled:before {
- content: '\E226';
-}
-.t-icon-contrast:before {
- content: '\E227';
-}
-.t-icon-control-platform-filled:before {
- content: '\E228';
-}
-.t-icon-control-platform:before {
- content: '\E229';
-}
-.t-icon-cooperate-filled:before {
- content: '\E22A';
-}
-.t-icon-cooperate:before {
- content: '\E22B';
-}
-.t-icon-coordinate-system-filled:before {
- content: '\E22C';
-}
-.t-icon-coordinate-system:before {
- content: '\E22D';
-}
-.t-icon-copy-filled:before {
- content: '\E22E';
-}
-.t-icon-copy:before {
- content: '\E22F';
-}
-.t-icon-copyright-filled:before {
- content: '\E230';
-}
-.t-icon-copyright:before {
- content: '\E231';
-}
-.t-icon-corn-filled:before {
- content: '\E232';
-}
-.t-icon-corn:before {
- content: '\E233';
-}
-.t-icon-coupon-filled:before {
- content: '\E234';
-}
-.t-icon-coupon:before {
- content: '\E235';
-}
-.t-icon-course-filled:before {
- content: '\E236';
-}
-.t-icon-course:before {
- content: '\E237';
-}
-.t-icon-cpu-filled:before {
- content: '\E238';
-}
-.t-icon-cpu:before {
- content: '\E239';
-}
-.t-icon-crack-filled:before {
- content: '\E23A';
-}
-.t-icon-crack:before {
- content: '\E23B';
-}
-.t-icon-creditcard-add-filled:before {
- content: '\E23C';
-}
-.t-icon-creditcard-add:before {
- content: '\E23D';
-}
-.t-icon-creditcard-filled:before {
- content: '\E23E';
-}
-.t-icon-creditcard-off-filled:before {
- content: '\E23F';
-}
-.t-icon-creditcard-off:before {
- content: '\E240';
-}
-.t-icon-creditcard:before {
- content: '\E241';
-}
-.t-icon-crooked-smile-filled:before {
- content: '\E242';
-}
-.t-icon-crooked-smile:before {
- content: '\E243';
-}
-.t-icon-cry-and-laugh-filled:before {
- content: '\E244';
-}
-.t-icon-cry-and-laugh:before {
- content: '\E245';
-}
-.t-icon-cry-loudly-filled:before {
- content: '\E246';
-}
-.t-icon-cry-loudly:before {
- content: '\E247';
-}
-.t-icon-css3-filled:before {
- content: '\E248';
-}
-.t-icon-css3:before {
- content: '\E249';
-}
-.t-icon-cucumber:before {
- content: '\E24A';
-}
-.t-icon-currency-exchange:before {
- content: '\E24B';
-}
-.t-icon-cursor-filled:before {
- content: '\E24C';
-}
-.t-icon-cursor:before {
- content: '\E24D';
-}
-.t-icon-curtain-filled:before {
- content: '\E24E';
-}
-.t-icon-curtain:before {
- content: '\E24F';
-}
-.t-icon-curve:before {
- content: '\E250';
-}
-.t-icon-cut-1:before {
- content: '\E251';
-}
-.t-icon-cut:before {
- content: '\E252';
-}
-.t-icon-dam-1-filled:before {
- content: '\E253';
-}
-.t-icon-dam-1:before {
- content: '\E254';
-}
-.t-icon-dam-2-filled:before {
- content: '\E255';
-}
-.t-icon-dam-2:before {
- content: '\E256';
-}
-.t-icon-dam-3-filled:before {
- content: '\E257';
-}
-.t-icon-dam-3:before {
- content: '\E258';
-}
-.t-icon-dam-4-filled:before {
- content: '\E259';
-}
-.t-icon-dam-4:before {
- content: '\E25A';
-}
-.t-icon-dam-5-filled:before {
- content: '\E25B';
-}
-.t-icon-dam-5:before {
- content: '\E25C';
-}
-.t-icon-dam-6-filled:before {
- content: '\E25D';
-}
-.t-icon-dam-6:before {
- content: '\E25E';
-}
-.t-icon-dam-7-filled:before {
- content: '\E25F';
-}
-.t-icon-dam-7:before {
- content: '\E260';
-}
-.t-icon-dam-filled:before {
- content: '\E261';
-}
-.t-icon-dam:before {
- content: '\E262';
-}
-.t-icon-dart-board-filled:before {
- content: '\E263';
-}
-.t-icon-dart-board:before {
- content: '\E264';
-}
-.t-icon-dashboard-1-filled:before {
- content: '\E265';
-}
-.t-icon-dashboard-1:before {
- content: '\E266';
-}
-.t-icon-dashboard-filled:before {
- content: '\E267';
-}
-.t-icon-dashboard:before {
- content: '\E268';
-}
-.t-icon-data-base-filled:before {
- content: '\E269';
-}
-.t-icon-data-base:before {
- content: '\E26A';
-}
-.t-icon-data-checked-filled:before {
- content: '\E26B';
-}
-.t-icon-data-checked:before {
- content: '\E26C';
-}
-.t-icon-data-display:before {
- content: '\E26D';
-}
-.t-icon-data-error-filled:before {
- content: '\E26E';
-}
-.t-icon-data-error:before {
- content: '\E26F';
-}
-.t-icon-data-filled:before {
- content: '\E270';
-}
-.t-icon-data-search-filled:before {
- content: '\E271';
-}
-.t-icon-data-search:before {
- content: '\E272';
-}
-.t-icon-data:before {
- content: '\E273';
-}
-.t-icon-delete-1-filled:before {
- content: '\E274';
-}
-.t-icon-delete-1:before {
- content: '\E275';
-}
-.t-icon-delete-filled:before {
- content: '\E276';
-}
-.t-icon-delete-time-filled:before {
- content: '\E277';
-}
-.t-icon-delete-time:before {
- content: '\E278';
-}
-.t-icon-delete:before {
- content: '\E279';
-}
-.t-icon-delta-filled:before {
- content: '\E27A';
-}
-.t-icon-delta:before {
- content: '\E27B';
-}
-.t-icon-depressed-filled:before {
- content: '\E27C';
-}
-.t-icon-depressed:before {
- content: '\E27D';
-}
-.t-icon-desktop-1-filled:before {
- content: '\E27E';
-}
-.t-icon-desktop-1:before {
- content: '\E27F';
-}
-.t-icon-desktop-filled:before {
- content: '\E280';
-}
-.t-icon-desktop:before {
- content: '\E281';
-}
-.t-icon-despise-filled:before {
- content: '\E282';
-}
-.t-icon-despise:before {
- content: '\E283';
-}
-.t-icon-device-filled:before {
- content: '\E284';
-}
-.t-icon-device:before {
- content: '\E285';
-}
-.t-icon-discount-filled:before {
- content: '\E286';
-}
-.t-icon-discount:before {
- content: '\E287';
-}
-.t-icon-dissatisfaction-filled:before {
- content: '\E288';
-}
-.t-icon-dissatisfaction:before {
- content: '\E289';
-}
-.t-icon-divide:before {
- content: '\E28A';
-}
-.t-icon-dividers-1:before {
- content: '\E28B';
-}
-.t-icon-dividers:before {
- content: '\E28C';
-}
-.t-icon-doge-filled:before {
- content: '\E28D';
-}
-.t-icon-doge:before {
- content: '\E28E';
-}
-.t-icon-double-storey-filled:before {
- content: '\E28F';
-}
-.t-icon-double-storey:before {
- content: '\E290';
-}
-.t-icon-download-1:before {
- content: '\E291';
-}
-.t-icon-download-2-filled:before {
- content: '\E292';
-}
-.t-icon-download-2:before {
- content: '\E293';
-}
-.t-icon-download:before {
- content: '\E294';
-}
-.t-icon-downscale:before {
- content: '\E295';
-}
-.t-icon-drag-drop:before {
- content: '\E296';
-}
-.t-icon-drag-move:before {
- content: '\E297';
-}
-.t-icon-drink-filled:before {
- content: '\E298';
-}
-.t-icon-drink:before {
- content: '\E299';
-}
-.t-icon-drumstick-filled:before {
- content: '\E29A';
-}
-.t-icon-drumstick:before {
- content: '\E29B';
-}
-.t-icon-dv-filled:before {
- content: '\E29C';
-}
-.t-icon-dv:before {
- content: '\E29D';
-}
-.t-icon-dvd-filled:before {
- content: '\E29E';
-}
-.t-icon-dvd:before {
- content: '\E29F';
-}
-.t-icon-earphone-filled:before {
- content: '\E2A0';
-}
-.t-icon-earphone:before {
- content: '\E2A1';
-}
-.t-icon-earth-filled:before {
- content: '\E2A2';
-}
-.t-icon-earth:before {
- content: '\E2A3';
-}
-.t-icon-edit-1-filled:before {
- content: '\E2A4';
-}
-.t-icon-edit-1:before {
- content: '\E2A5';
-}
-.t-icon-edit-2-filled:before {
- content: '\E2A6';
-}
-.t-icon-edit-2:before {
- content: '\E2A7';
-}
-.t-icon-edit-filled:before {
- content: '\E2A8';
-}
-.t-icon-edit-off-filled:before {
- content: '\E2A9';
-}
-.t-icon-edit-off:before {
- content: '\E2AA';
-}
-.t-icon-edit:before {
- content: '\E2AB';
-}
-.t-icon-education-filled:before {
- content: '\E2AC';
-}
-.t-icon-education:before {
- content: '\E2AD';
-}
-.t-icon-eggplant-filled:before {
- content: '\E2AE';
-}
-.t-icon-eggplant:before {
- content: '\E2AF';
-}
-.t-icon-ellipsis:before {
- content: '\E2B0';
-}
-.t-icon-emo-emotional-filled:before {
- content: '\E2B1';
-}
-.t-icon-emo-emotional:before {
- content: '\E2B2';
-}
-.t-icon-enter:before {
- content: '\E2B3';
-}
-.t-icon-equal:before {
- content: '\E2B4';
-}
-.t-icon-error-circle-filled:before {
- content: '\E2B5';
-}
-.t-icon-error-circle:before {
- content: '\E2B6';
-}
-.t-icon-error-triangle-filled:before {
- content: '\E2B7';
-}
-.t-icon-error-triangle:before {
- content: '\E2B8';
-}
-.t-icon-error:before {
- content: '\E2B9';
-}
-.t-icon-excited-1-filled:before {
- content: '\E2BA';
-}
-.t-icon-excited-1:before {
- content: '\E2BB';
-}
-.t-icon-excited-filled:before {
- content: '\E2BC';
-}
-.t-icon-excited:before {
- content: '\E2BD';
-}
-.t-icon-expand-down-filled:before {
- content: '\E2BE';
-}
-.t-icon-expand-down:before {
- content: '\E2BF';
-}
-.t-icon-expand-horizontal:before {
- content: '\E2C0';
-}
-.t-icon-expand-up-filled:before {
- content: '\E2C1';
-}
-.t-icon-expand-up:before {
- content: '\E2C2';
-}
-.t-icon-expand-vertical:before {
- content: '\E2C3';
-}
-.t-icon-explore-filled:before {
- content: '\E2C4';
-}
-.t-icon-explore-off-filled:before {
- content: '\E2C5';
-}
-.t-icon-explore-off:before {
- content: '\E2C6';
-}
-.t-icon-explore:before {
- content: '\E2C7';
-}
-.t-icon-exposure-filled:before {
- content: '\E2C8';
-}
-.t-icon-exposure:before {
- content: '\E2C9';
-}
-.t-icon-extension-filled:before {
- content: '\E2CA';
-}
-.t-icon-extension-off-filled:before {
- content: '\E2CB';
-}
-.t-icon-extension-off:before {
- content: '\E2CC';
-}
-.t-icon-extension:before {
- content: '\E2CD';
-}
-.t-icon-face-retouching-filled:before {
- content: '\E2CE';
-}
-.t-icon-face-retouching:before {
- content: '\E2CF';
-}
-.t-icon-fact-check-filled:before {
- content: '\E2D0';
-}
-.t-icon-fact-check:before {
- content: '\E2D1';
-}
-.t-icon-fahrenheit-scale:before {
- content: '\E2D2';
-}
-.t-icon-feel-at-ease-filled:before {
- content: '\E2D3';
-}
-.t-icon-feel-at-ease:before {
- content: '\E2D4';
-}
-.t-icon-ferocious-filled:before {
- content: '\E2D5';
-}
-.t-icon-ferocious:before {
- content: '\E2D6';
-}
-.t-icon-ferris-wheel-filled:before {
- content: '\E2D7';
-}
-.t-icon-ferris-wheel:before {
- content: '\E2D8';
-}
-.t-icon-file-1-filled:before {
- content: '\E2D9';
-}
-.t-icon-file-1:before {
- content: '\E2DA';
-}
-.t-icon-file-add-1-filled:before {
- content: '\E2DB';
-}
-.t-icon-file-add-1:before {
- content: '\E2DC';
-}
-.t-icon-file-add-filled:before {
- content: '\E2DD';
-}
-.t-icon-file-add:before {
- content: '\E2DE';
-}
-.t-icon-file-attachment-filled:before {
- content: '\E2DF';
-}
-.t-icon-file-attachment:before {
- content: '\E2E0';
-}
-.t-icon-file-blocked-filled:before {
- content: '\E2E1';
-}
-.t-icon-file-blocked:before {
- content: '\E2E2';
-}
-.t-icon-file-code-1-filled:before {
- content: '\E2E3';
-}
-.t-icon-file-code-1:before {
- content: '\E2E4';
-}
-.t-icon-file-code-filled:before {
- content: '\E2E5';
-}
-.t-icon-file-code:before {
- content: '\E2E6';
-}
-.t-icon-file-copy-filled:before {
- content: '\E2E7';
-}
-.t-icon-file-copy:before {
- content: '\E2E8';
-}
-.t-icon-file-download-filled:before {
- content: '\E2E9';
-}
-.t-icon-file-download:before {
- content: '\E2EA';
-}
-.t-icon-file-excel-filled:before {
- content: '\E2EB';
-}
-.t-icon-file-excel:before {
- content: '\E2EC';
-}
-.t-icon-file-export-filled:before {
- content: '\E2ED';
-}
-.t-icon-file-export:before {
- content: '\E2EE';
-}
-.t-icon-file-filled:before {
- content: '\E2EF';
-}
-.t-icon-file-icon-filled:before {
- content: '\E2F0';
-}
-.t-icon-file-icon:before {
- content: '\E2F1';
-}
-.t-icon-file-image-filled:before {
- content: '\E2F2';
-}
-.t-icon-file-image:before {
- content: '\E2F3';
-}
-.t-icon-file-import-filled:before {
- content: '\E2F4';
-}
-.t-icon-file-import:before {
- content: '\E2F5';
-}
-.t-icon-file-locked-filled:before {
- content: '\E2F6';
-}
-.t-icon-file-locked:before {
- content: '\E2F7';
-}
-.t-icon-file-minus-filled:before {
- content: '\E2F8';
-}
-.t-icon-file-minus:before {
- content: '\E2F9';
-}
-.t-icon-file-music-filled:before {
- content: '\E2FA';
-}
-.t-icon-file-music:before {
- content: '\E2FB';
-}
-.t-icon-file-onenote-filled:before {
- content: '\E2FC';
-}
-.t-icon-file-onenote:before {
- content: '\E2FD';
-}
-.t-icon-file-outlook-filled:before {
- content: '\E2FE';
-}
-.t-icon-file-outlook:before {
- content: '\E2FF';
-}
-.t-icon-file-paste-filled:before {
- content: '\E300';
-}
-.t-icon-file-paste:before {
- content: '\E301';
-}
-.t-icon-file-pdf-filled:before {
- content: '\E302';
-}
-.t-icon-file-pdf:before {
- content: '\E303';
-}
-.t-icon-file-powerpoint-filled:before {
- content: '\E304';
-}
-.t-icon-file-powerpoint:before {
- content: '\E305';
-}
-.t-icon-file-restore-filled:before {
- content: '\E306';
-}
-.t-icon-file-restore:before {
- content: '\E307';
-}
-.t-icon-file-safety-filled:before {
- content: '\E308';
-}
-.t-icon-file-safety:before {
- content: '\E309';
-}
-.t-icon-file-search-filled:before {
- content: '\E30A';
-}
-.t-icon-file-search:before {
- content: '\E30B';
-}
-.t-icon-file-setting-filled:before {
- content: '\E30C';
-}
-.t-icon-file-setting:before {
- content: '\E30D';
-}
-.t-icon-file-teams-filled:before {
- content: '\E30E';
-}
-.t-icon-file-teams:before {
- content: '\E30F';
-}
-.t-icon-file-transmit-double-filled:before {
- content: '\E310';
-}
-.t-icon-file-transmit-double:before {
- content: '\E311';
-}
-.t-icon-file-transmit-filled:before {
- content: '\E312';
-}
-.t-icon-file-transmit:before {
- content: '\E313';
-}
-.t-icon-file-unknown-filled:before {
- content: '\E314';
-}
-.t-icon-file-unknown:before {
- content: '\E315';
-}
-.t-icon-file-unlocked-filled:before {
- content: '\E316';
-}
-.t-icon-file-unlocked:before {
- content: '\E317';
-}
-.t-icon-file-word-filled:before {
- content: '\E318';
-}
-.t-icon-file-word:before {
- content: '\E319';
-}
-.t-icon-file-zip-filled:before {
- content: '\E31A';
-}
-.t-icon-file-zip:before {
- content: '\E31B';
-}
-.t-icon-file:before {
- content: '\E31C';
-}
-.t-icon-fill-color-1-filled:before {
- content: '\E31D';
-}
-.t-icon-fill-color-1:before {
- content: '\E31E';
-}
-.t-icon-fill-color-filled:before {
- content: '\E31F';
-}
-.t-icon-fill-color:before {
- content: '\E320';
-}
-.t-icon-film-1-filled:before {
- content: '\E321';
-}
-.t-icon-film-1:before {
- content: '\E322';
-}
-.t-icon-film-filled:before {
- content: '\E323';
-}
-.t-icon-film:before {
- content: '\E324';
-}
-.t-icon-filter-1-filled:before {
- content: '\E325';
-}
-.t-icon-filter-1:before {
- content: '\E326';
-}
-.t-icon-filter-2-filled:before {
- content: '\E327';
-}
-.t-icon-filter-2:before {
- content: '\E328';
-}
-.t-icon-filter-3-filled:before {
- content: '\E329';
-}
-.t-icon-filter-3:before {
- content: '\E32A';
-}
-.t-icon-filter-clear-filled:before {
- content: '\E32B';
-}
-.t-icon-filter-clear:before {
- content: '\E32C';
-}
-.t-icon-filter-filled:before {
- content: '\E32D';
-}
-.t-icon-filter-off-filled:before {
- content: '\E32E';
-}
-.t-icon-filter-off:before {
- content: '\E32F';
-}
-.t-icon-filter-sort-filled:before {
- content: '\E330';
-}
-.t-icon-filter-sort:before {
- content: '\E331';
-}
-.t-icon-filter:before {
- content: '\E332';
-}
-.t-icon-fingerprint-1:before {
- content: '\E333';
-}
-.t-icon-fingerprint-2:before {
- content: '\E334';
-}
-.t-icon-fingerprint-3:before {
- content: '\E335';
-}
-.t-icon-fingerprint:before {
- content: '\E336';
-}
-.t-icon-fish-filled:before {
- content: '\E337';
-}
-.t-icon-fish:before {
- content: '\E338';
-}
-.t-icon-flag-1-filled:before {
- content: '\E339';
-}
-.t-icon-flag-1:before {
- content: '\E33A';
-}
-.t-icon-flag-2-filled:before {
- content: '\E33B';
-}
-.t-icon-flag-2:before {
- content: '\E33C';
-}
-.t-icon-flag-3-filled:before {
- content: '\E33D';
-}
-.t-icon-flag-3:before {
- content: '\E33E';
-}
-.t-icon-flag-4-filled:before {
- content: '\E33F';
-}
-.t-icon-flag-4:before {
- content: '\E340';
-}
-.t-icon-flag-filled:before {
- content: '\E341';
-}
-.t-icon-flag:before {
- content: '\E342';
-}
-.t-icon-flashlight-filled:before {
- content: '\E343';
-}
-.t-icon-flashlight:before {
- content: '\E344';
-}
-.t-icon-flight-landing-filled:before {
- content: '\E345';
-}
-.t-icon-flight-landing:before {
- content: '\E346';
-}
-.t-icon-flight-takeoff-filled:before {
- content: '\E347';
-}
-.t-icon-flight-takeoff:before {
- content: '\E348';
-}
-.t-icon-flip-smiling-face-filled:before {
- content: '\E349';
-}
-.t-icon-flip-smiling-face:before {
- content: '\E34A';
-}
-.t-icon-flip-to-back-filled:before {
- content: '\E34B';
-}
-.t-icon-flip-to-back:before {
- content: '\E34C';
-}
-.t-icon-flip-to-front-filled:before {
- content: '\E34D';
-}
-.t-icon-flip-to-front:before {
- content: '\E34E';
-}
-.t-icon-focus-filled:before {
- content: '\E34F';
-}
-.t-icon-focus:before {
- content: '\E350';
-}
-.t-icon-fog-filled:before {
- content: '\E351';
-}
-.t-icon-fog-night-filled:before {
- content: '\E352';
-}
-.t-icon-fog-night:before {
- content: '\E353';
-}
-.t-icon-fog-sunny-filled:before {
- content: '\E354';
-}
-.t-icon-fog-sunny:before {
- content: '\E355';
-}
-.t-icon-fog:before {
- content: '\E356';
-}
-.t-icon-folder-1-filled:before {
- content: '\E357';
-}
-.t-icon-folder-1:before {
- content: '\E358';
-}
-.t-icon-folder-add-1-filled:before {
- content: '\E359';
-}
-.t-icon-folder-add-1:before {
- content: '\E35A';
-}
-.t-icon-folder-add-filled:before {
- content: '\E35B';
-}
-.t-icon-folder-add:before {
- content: '\E35C';
-}
-.t-icon-folder-blocked-filled:before {
- content: '\E35D';
-}
-.t-icon-folder-blocked:before {
- content: '\E35E';
-}
-.t-icon-folder-details-filled:before {
- content: '\E35F';
-}
-.t-icon-folder-details:before {
- content: '\E360';
-}
-.t-icon-folder-export-filled:before {
- content: '\E361';
-}
-.t-icon-folder-export:before {
- content: '\E362';
-}
-.t-icon-folder-filled:before {
- content: '\E363';
-}
-.t-icon-folder-import-filled:before {
- content: '\E364';
-}
-.t-icon-folder-import:before {
- content: '\E365';
-}
-.t-icon-folder-locked-filled:before {
- content: '\E366';
-}
-.t-icon-folder-locked:before {
- content: '\E367';
-}
-.t-icon-folder-minus-filled:before {
- content: '\E368';
-}
-.t-icon-folder-minus:before {
- content: '\E369';
-}
-.t-icon-folder-move-filled:before {
- content: '\E36A';
-}
-.t-icon-folder-move:before {
- content: '\E36B';
-}
-.t-icon-folder-off-filled:before {
- content: '\E36C';
-}
-.t-icon-folder-off:before {
- content: '\E36D';
-}
-.t-icon-folder-open-1-filled:before {
- content: '\E36E';
-}
-.t-icon-folder-open-1:before {
- content: '\E36F';
-}
-.t-icon-folder-open-filled:before {
- content: '\E370';
-}
-.t-icon-folder-open:before {
- content: '\E371';
-}
-.t-icon-folder-search-filled:before {
- content: '\E372';
-}
-.t-icon-folder-search:before {
- content: '\E373';
-}
-.t-icon-folder-setting-filled:before {
- content: '\E374';
-}
-.t-icon-folder-setting:before {
- content: '\E375';
-}
-.t-icon-folder-shared-filled:before {
- content: '\E376';
-}
-.t-icon-folder-shared:before {
- content: '\E377';
-}
-.t-icon-folder-unlocked-filled:before {
- content: '\E378';
-}
-.t-icon-folder-unlocked:before {
- content: '\E379';
-}
-.t-icon-folder-zip-filled:before {
- content: '\E37A';
-}
-.t-icon-folder-zip:before {
- content: '\E37B';
-}
-.t-icon-folder:before {
- content: '\E37C';
-}
-.t-icon-forest-filled:before {
- content: '\E37D';
-}
-.t-icon-forest:before {
- content: '\E37E';
-}
-.t-icon-fork-filled:before {
- content: '\E37F';
-}
-.t-icon-fork:before {
- content: '\E380';
-}
-.t-icon-form-filled:before {
- content: '\E381';
-}
-.t-icon-form:before {
- content: '\E382';
-}
-.t-icon-format-horizontal-align-bottom:before {
- content: '\E383';
-}
-.t-icon-format-horizontal-align-center:before {
- content: '\E384';
-}
-.t-icon-format-horizontal-align-top:before {
- content: '\E385';
-}
-.t-icon-format-vertical-align-center:before {
- content: '\E386';
-}
-.t-icon-format-vertical-align-left:before {
- content: '\E387';
-}
-.t-icon-format-vertical-align-right:before {
- content: '\E388';
-}
-.t-icon-forward-filled:before {
- content: '\E389';
-}
-.t-icon-forward:before {
- content: '\E38A';
-}
-.t-icon-frame-1-filled:before {
- content: '\E38B';
-}
-.t-icon-frame-1:before {
- content: '\E38C';
-}
-.t-icon-frame-filled:before {
- content: '\E38D';
-}
-.t-icon-frame:before {
- content: '\E38E';
-}
-.t-icon-fries-filled:before {
- content: '\E38F';
-}
-.t-icon-fries:before {
- content: '\E390';
-}
-.t-icon-fullscreen-1:before {
- content: '\E391';
-}
-.t-icon-fullscreen-2:before {
- content: '\E392';
-}
-.t-icon-fullscreen-exit-1:before {
- content: '\E393';
-}
-.t-icon-fullscreen-exit:before {
- content: '\E394';
-}
-.t-icon-fullscreen:before {
- content: '\E395';
-}
-.t-icon-function-curve:before {
- content: '\E396';
-}
-.t-icon-functions-1:before {
- content: '\E397';
-}
-.t-icon-functions:before {
- content: '\E398';
-}
-.t-icon-gamepad-1-filled:before {
- content: '\E399';
-}
-.t-icon-gamepad-1:before {
- content: '\E39A';
-}
-.t-icon-gamepad-filled:before {
- content: '\E39B';
-}
-.t-icon-gamepad:before {
- content: '\E39C';
-}
-.t-icon-gamma:before {
- content: '\E39D';
-}
-.t-icon-garlic-filled:before {
- content: '\E39E';
-}
-.t-icon-garlic:before {
- content: '\E39F';
-}
-.t-icon-gender-female:before {
- content: '\E3A0';
-}
-.t-icon-gender-male:before {
- content: '\E3A1';
-}
-.t-icon-gesture-applause-filled:before {
- content: '\E3A2';
-}
-.t-icon-gesture-applause:before {
- content: '\E3A3';
-}
-.t-icon-gesture-click-filled:before {
- content: '\E3A4';
-}
-.t-icon-gesture-click:before {
- content: '\E3A5';
-}
-.t-icon-gesture-down-filled:before {
- content: '\E3A6';
-}
-.t-icon-gesture-down:before {
- content: '\E3A7';
-}
-.t-icon-gesture-expansion-filled:before {
- content: '\E3A8';
-}
-.t-icon-gesture-expansion:before {
- content: '\E3A9';
-}
-.t-icon-gesture-left-filled:before {
- content: '\E3AA';
-}
-.t-icon-gesture-left-slip-filled:before {
- content: '\E3AB';
-}
-.t-icon-gesture-left-slip:before {
- content: '\E3AC';
-}
-.t-icon-gesture-left:before {
- content: '\E3AD';
-}
-.t-icon-gesture-open-filled:before {
- content: '\E3AE';
-}
-.t-icon-gesture-open:before {
- content: '\E3AF';
-}
-.t-icon-gesture-pray-filled:before {
- content: '\E3B0';
-}
-.t-icon-gesture-pray:before {
- content: '\E3B1';
-}
-.t-icon-gesture-press-filled:before {
- content: '\E3B2';
-}
-.t-icon-gesture-press:before {
- content: '\E3B3';
-}
-.t-icon-gesture-ranslation-filled:before {
- content: '\E3B4';
-}
-.t-icon-gesture-ranslation:before {
- content: '\E3B5';
-}
-.t-icon-gesture-right-filled:before {
- content: '\E3B6';
-}
-.t-icon-gesture-right-slip-filled:before {
- content: '\E3B7';
-}
-.t-icon-gesture-right-slip:before {
- content: '\E3B8';
-}
-.t-icon-gesture-right:before {
- content: '\E3B9';
-}
-.t-icon-gesture-slide-left-and-right-filled:before {
- content: '\E3BA';
-}
-.t-icon-gesture-slide-left-and-right:before {
- content: '\E3BB';
-}
-.t-icon-gesture-slide-up-filled:before {
- content: '\E3BC';
-}
-.t-icon-gesture-slide-up:before {
- content: '\E3BD';
-}
-.t-icon-gesture-typing-filled:before {
- content: '\E3BE';
-}
-.t-icon-gesture-typing:before {
- content: '\E3BF';
-}
-.t-icon-gesture-up-and-down-filled:before {
- content: '\E3C0';
-}
-.t-icon-gesture-up-and-down:before {
- content: '\E3C1';
-}
-.t-icon-gesture-up-filled:before {
- content: '\E3C2';
-}
-.t-icon-gesture-up:before {
- content: '\E3C3';
-}
-.t-icon-gesture-wipe-down-filled:before {
- content: '\E3C4';
-}
-.t-icon-gesture-wipe-down:before {
- content: '\E3C5';
-}
-.t-icon-gift-filled:before {
- content: '\E3C6';
-}
-.t-icon-gift:before {
- content: '\E3C7';
-}
-.t-icon-giggle-filled:before {
- content: '\E3C8';
-}
-.t-icon-giggle:before {
- content: '\E3C9';
-}
-.t-icon-git-branch-filled:before {
- content: '\E3CA';
-}
-.t-icon-git-branch:before {
- content: '\E3CB';
-}
-.t-icon-git-commit-filled:before {
- content: '\E3CC';
-}
-.t-icon-git-commit:before {
- content: '\E3CD';
-}
-.t-icon-git-merge-filled:before {
- content: '\E3CE';
-}
-.t-icon-git-merge:before {
- content: '\E3CF';
-}
-.t-icon-git-pull-request-filled:before {
- content: '\E3D0';
-}
-.t-icon-git-pull-request:before {
- content: '\E3D1';
-}
-.t-icon-git-repository-commits-filled:before {
- content: '\E3D2';
-}
-.t-icon-git-repository-commits:before {
- content: '\E3D3';
-}
-.t-icon-git-repository-filled:before {
- content: '\E3D4';
-}
-.t-icon-git-repository-private-filled:before {
- content: '\E3D5';
-}
-.t-icon-git-repository-private:before {
- content: '\E3D6';
-}
-.t-icon-git-repository:before {
- content: '\E3D7';
-}
-.t-icon-gps-filled:before {
- content: '\E3D8';
-}
-.t-icon-gps:before {
- content: '\E3D9';
-}
-.t-icon-grape-filled:before {
- content: '\E3DA';
-}
-.t-icon-grape:before {
- content: '\E3DB';
-}
-.t-icon-greater-than-or-equal:before {
- content: '\E3DC';
-}
-.t-icon-greater-than:before {
- content: '\E3DD';
-}
-.t-icon-green-onion:before {
- content: '\E3DE';
-}
-.t-icon-grid-add-filled:before {
- content: '\E3DF';
-}
-.t-icon-grid-add:before {
- content: '\E3E0';
-}
-.t-icon-grid-view-filled:before {
- content: '\E3E1';
-}
-.t-icon-grid-view:before {
- content: '\E3E2';
-}
-.t-icon-guitar-filled:before {
- content: '\E3E3';
-}
-.t-icon-guitar:before {
- content: '\E3E4';
-}
-.t-icon-hamburger-filled:before {
- content: '\E3E5';
-}
-.t-icon-hamburger:before {
- content: '\E3E6';
-}
-.t-icon-happy-filled:before {
- content: '\E3E7';
-}
-.t-icon-happy:before {
- content: '\E3E8';
-}
-.t-icon-hard-disk-storage-filled:before {
- content: '\E3E9';
-}
-.t-icon-hard-disk-storage:before {
- content: '\E3EA';
-}
-.t-icon-hard-drive-filled:before {
- content: '\E3EB';
-}
-.t-icon-hard-drive:before {
- content: '\E3EC';
-}
-.t-icon-hashtag:before {
- content: '\E3ED';
-}
-.t-icon-hd-filled:before {
- content: '\E3EE';
-}
-.t-icon-hd:before {
- content: '\E3EF';
-}
-.t-icon-heart-filled:before {
- content: '\E3F0';
-}
-.t-icon-heart:before {
- content: '\E3F1';
-}
-.t-icon-help-circle-filled:before {
- content: '\E3F2';
-}
-.t-icon-help-circle:before {
- content: '\E3F3';
-}
-.t-icon-help-rectangle-filled:before {
- content: '\E3F4';
-}
-.t-icon-help-rectangle:before {
- content: '\E3F5';
-}
-.t-icon-help:before {
- content: '\E3F6';
-}
-.t-icon-highlight-1-filled:before {
- content: '\E3F7';
-}
-.t-icon-highlight-1:before {
- content: '\E3F8';
-}
-.t-icon-highlight:before {
- content: '\E3F9';
-}
-.t-icon-history-setting:before {
- content: '\E3FA';
-}
-.t-icon-history:before {
- content: '\E3FB';
-}
-.t-icon-home-filled:before {
- content: '\E3FC';
-}
-.t-icon-home:before {
- content: '\E3FD';
-}
-.t-icon-horizontal-filled:before {
- content: '\E3FE';
-}
-.t-icon-horizontal:before {
- content: '\E3FF';
-}
-.t-icon-hospital-1-filled:before {
- content: '\E400';
-}
-.t-icon-hospital-1:before {
- content: '\E401';
-}
-.t-icon-hospital-filled:before {
- content: '\E402';
-}
-.t-icon-hospital:before {
- content: '\E403';
-}
-.t-icon-hotspot-wave-filled:before {
- content: '\E404';
-}
-.t-icon-hotspot-wave:before {
- content: '\E405';
-}
-.t-icon-hourglass-filled:before {
- content: '\E406';
-}
-.t-icon-hourglass:before {
- content: '\E407';
-}
-.t-icon-houses-1-filled:before {
- content: '\E408';
-}
-.t-icon-houses-1:before {
- content: '\E409';
-}
-.t-icon-houses-2-filled:before {
- content: '\E40A';
-}
-.t-icon-houses-2:before {
- content: '\E40B';
-}
-.t-icon-houses-filled:before {
- content: '\E40C';
-}
-.t-icon-houses:before {
- content: '\E40D';
-}
-.t-icon-html5-filled:before {
- content: '\E40E';
-}
-.t-icon-html5:before {
- content: '\E40F';
-}
-.t-icon-https-filled:before {
- content: '\E410';
-}
-.t-icon-https:before {
- content: '\E411';
-}
-.t-icon-ice-cream-filled:before {
- content: '\E412';
-}
-.t-icon-ice-cream:before {
- content: '\E413';
-}
-.t-icon-icon-filled:before {
- content: '\E414';
-}
-.t-icon-icon:before {
- content: '\E415';
-}
-.t-icon-image-1-filled:before {
- content: '\E416';
-}
-.t-icon-image-1:before {
- content: '\E417';
-}
-.t-icon-image-add-filled:before {
- content: '\E418';
-}
-.t-icon-image-add:before {
- content: '\E419';
-}
-.t-icon-image-edit-filled:before {
- content: '\E41A';
-}
-.t-icon-image-edit:before {
- content: '\E41B';
-}
-.t-icon-image-error-filled:before {
- content: '\E41C';
-}
-.t-icon-image-error:before {
- content: '\E41D';
-}
-.t-icon-image-filled:before {
- content: '\E41E';
-}
-.t-icon-image-off-filled:before {
- content: '\E41F';
-}
-.t-icon-image-off:before {
- content: '\E420';
-}
-.t-icon-image-search-filled:before {
- content: '\E421';
-}
-.t-icon-image-search:before {
- content: '\E422';
-}
-.t-icon-image:before {
- content: '\E423';
-}
-.t-icon-indent-left:before {
- content: '\E424';
-}
-.t-icon-indent-right:before {
- content: '\E425';
-}
-.t-icon-indicator-filled:before {
- content: '\E426';
-}
-.t-icon-indicator:before {
- content: '\E427';
-}
-.t-icon-info-circle-filled:before {
- content: '\E428';
-}
-.t-icon-info-circle:before {
- content: '\E429';
-}
-.t-icon-ink-filled:before {
- content: '\E42A';
-}
-.t-icon-ink:before {
- content: '\E42B';
-}
-.t-icon-install-desktop-filled:before {
- content: '\E42C';
-}
-.t-icon-install-desktop:before {
- content: '\E42D';
-}
-.t-icon-install-filled:before {
- content: '\E42E';
-}
-.t-icon-install-mobile-filled:before {
- content: '\E42F';
-}
-.t-icon-install-mobile:before {
- content: '\E430';
-}
-.t-icon-install:before {
- content: '\E431';
-}
-.t-icon-institution-checked-filled:before {
- content: '\E432';
-}
-.t-icon-institution-checked:before {
- content: '\E433';
-}
-.t-icon-institution-filled:before {
- content: '\E434';
-}
-.t-icon-institution:before {
- content: '\E435';
-}
-.t-icon-internet-filled:before {
- content: '\E436';
-}
-.t-icon-internet:before {
- content: '\E437';
-}
-.t-icon-ipod-filled:before {
- content: '\E438';
-}
-.t-icon-ipod:before {
- content: '\E439';
-}
-.t-icon-joyful-filled:before {
- content: '\E43A';
-}
-.t-icon-joyful:before {
- content: '\E43B';
-}
-.t-icon-jump-double:before {
- content: '\E43C';
-}
-.t-icon-jump-off:before {
- content: '\E43D';
-}
-.t-icon-jump:before {
- content: '\E43E';
-}
-.t-icon-key-filled:before {
- content: '\E43F';
-}
-.t-icon-key:before {
- content: '\E440';
-}
-.t-icon-keyboard-filled:before {
- content: '\E441';
-}
-.t-icon-keyboard:before {
- content: '\E442';
-}
-.t-icon-laptop-filled:before {
- content: '\E443';
-}
-.t-icon-laptop:before {
- content: '\E444';
-}
-.t-icon-layers-filled:before {
- content: '\E445';
-}
-.t-icon-layers:before {
- content: '\E446';
-}
-.t-icon-layout-filled:before {
- content: '\E447';
-}
-.t-icon-layout:before {
- content: '\E448';
-}
-.t-icon-leaderboard-filled:before {
- content: '\E449';
-}
-.t-icon-leaderboard:before {
- content: '\E44A';
-}
-.t-icon-lemon-filled:before {
- content: '\E44B';
-}
-.t-icon-lemon-slice-filled:before {
- content: '\E44C';
-}
-.t-icon-lemon-slice:before {
- content: '\E44D';
-}
-.t-icon-lemon:before {
- content: '\E44E';
-}
-.t-icon-less-than-or-equal:before {
- content: '\E44F';
-}
-.t-icon-less-than:before {
- content: '\E450';
-}
-.t-icon-letters-a:before {
- content: '\E451';
-}
-.t-icon-letters-b:before {
- content: '\E452';
-}
-.t-icon-letters-c:before {
- content: '\E453';
-}
-.t-icon-letters-d:before {
- content: '\E454';
-}
-.t-icon-letters-e:before {
- content: '\E455';
-}
-.t-icon-letters-f:before {
- content: '\E456';
-}
-.t-icon-letters-g:before {
- content: '\E457';
-}
-.t-icon-letters-h:before {
- content: '\E458';
-}
-.t-icon-letters-i:before {
- content: '\E459';
-}
-.t-icon-letters-j:before {
- content: '\E45A';
-}
-.t-icon-letters-k:before {
- content: '\E45B';
-}
-.t-icon-letters-l:before {
- content: '\E45C';
-}
-.t-icon-letters-m:before {
- content: '\E45D';
-}
-.t-icon-letters-n:before {
- content: '\E45E';
-}
-.t-icon-letters-o:before {
- content: '\E45F';
-}
-.t-icon-letters-p:before {
- content: '\E460';
-}
-.t-icon-letters-q:before {
- content: '\E461';
-}
-.t-icon-letters-r:before {
- content: '\E462';
-}
-.t-icon-letters-s:before {
- content: '\E463';
-}
-.t-icon-letters-t:before {
- content: '\E464';
-}
-.t-icon-letters-u:before {
- content: '\E465';
-}
-.t-icon-letters-v:before {
- content: '\E466';
-}
-.t-icon-letters-w:before {
- content: '\E467';
-}
-.t-icon-letters-x:before {
- content: '\E468';
-}
-.t-icon-letters-y:before {
- content: '\E469';
-}
-.t-icon-letters-z:before {
- content: '\E46A';
-}
-.t-icon-lightbulb-circle-filled:before {
- content: '\E46B';
-}
-.t-icon-lightbulb-circle:before {
- content: '\E46C';
-}
-.t-icon-lightbulb-filled:before {
- content: '\E46D';
-}
-.t-icon-lightbulb:before {
- content: '\E46E';
-}
-.t-icon-lighthouse-1-filled:before {
- content: '\E46F';
-}
-.t-icon-lighthouse-1:before {
- content: '\E470';
-}
-.t-icon-lighthouse-2-filled:before {
- content: '\E471';
-}
-.t-icon-lighthouse-2:before {
- content: '\E472';
-}
-.t-icon-lighthouse-filled:before {
- content: '\E473';
-}
-.t-icon-lighthouse:before {
- content: '\E474';
-}
-.t-icon-lighting-circle-filled:before {
- content: '\E475';
-}
-.t-icon-lighting-circle:before {
- content: '\E476';
-}
-.t-icon-line-height:before {
- content: '\E477';
-}
-.t-icon-link-1:before {
- content: '\E478';
-}
-.t-icon-link-unlink:before {
- content: '\E479';
-}
-.t-icon-link:before {
- content: '\E47A';
-}
-.t-icon-liquor-filled:before {
- content: '\E47B';
-}
-.t-icon-liquor:before {
- content: '\E47C';
-}
-.t-icon-list-numbered:before {
- content: '\E47D';
-}
-.t-icon-list:before {
- content: '\E47E';
-}
-.t-icon-load:before {
- content: '\E47F';
-}
-.t-icon-loading:before {
- content: '\E480';
-}
-.t-icon-location-1-filled:before {
- content: '\E481';
-}
-.t-icon-location-1:before {
- content: '\E482';
-}
-.t-icon-location-enlargement-filled:before {
- content: '\E483';
-}
-.t-icon-location-enlargement:before {
- content: '\E484';
-}
-.t-icon-location-error-filled:before {
- content: '\E485';
-}
-.t-icon-location-error:before {
- content: '\E486';
-}
-.t-icon-location-filled:before {
- content: '\E487';
-}
-.t-icon-location-parking-place-filled:before {
- content: '\E488';
-}
-.t-icon-location-parking-place:before {
- content: '\E489';
-}
-.t-icon-location-reduction-filled:before {
- content: '\E48A';
-}
-.t-icon-location-reduction:before {
- content: '\E48B';
-}
-.t-icon-location-setting-filled:before {
- content: '\E48C';
-}
-.t-icon-location-setting:before {
- content: '\E48D';
-}
-.t-icon-location:before {
- content: '\E48E';
-}
-.t-icon-lock-off-filled:before {
- content: '\E48F';
-}
-.t-icon-lock-off:before {
- content: '\E490';
-}
-.t-icon-lock-on-filled:before {
- content: '\E491';
-}
-.t-icon-lock-on:before {
- content: '\E492';
-}
-.t-icon-lock-time-filled:before {
- content: '\E493';
-}
-.t-icon-lock-time:before {
- content: '\E494';
-}
-.t-icon-login:before {
- content: '\E495';
-}
-.t-icon-logo-adobe-illustrate-filled:before {
- content: '\E496';
-}
-.t-icon-logo-adobe-illustrate:before {
- content: '\E497';
-}
-.t-icon-logo-adobe-lightroom-filled:before {
- content: '\E498';
-}
-.t-icon-logo-adobe-lightroom:before {
- content: '\E499';
-}
-.t-icon-logo-adobe-photoshop-filled:before {
- content: '\E49A';
-}
-.t-icon-logo-adobe-photoshop:before {
- content: '\E49B';
-}
-.t-icon-logo-alipay-filled:before {
- content: '\E49C';
-}
-.t-icon-logo-alipay:before {
- content: '\E49D';
-}
-.t-icon-logo-android-filled:before {
- content: '\E49E';
-}
-.t-icon-logo-android:before {
- content: '\E49F';
-}
-.t-icon-logo-apple-filled:before {
- content: '\E4A0';
-}
-.t-icon-logo-apple:before {
- content: '\E4A1';
-}
-.t-icon-logo-behance-filled:before {
- content: '\E4A2';
-}
-.t-icon-logo-behance:before {
- content: '\E4A3';
-}
-.t-icon-logo-chrome-filled:before {
- content: '\E4A4';
-}
-.t-icon-logo-chrome:before {
- content: '\E4A5';
-}
-.t-icon-logo-cinema4d-filled:before {
- content: '\E4A6';
-}
-.t-icon-logo-cinema4d:before {
- content: '\E4A7';
-}
-.t-icon-logo-codepen:before {
- content: '\E4A8';
-}
-.t-icon-logo-codesandbox:before {
- content: '\E4A9';
-}
-.t-icon-logo-dribbble-filled:before {
- content: '\E4AA';
-}
-.t-icon-logo-dribbble:before {
- content: '\E4AB';
-}
-.t-icon-logo-facebook-filled:before {
- content: '\E4AC';
-}
-.t-icon-logo-facebook:before {
- content: '\E4AD';
-}
-.t-icon-logo-figma-filled:before {
- content: '\E4AE';
-}
-.t-icon-logo-figma:before {
- content: '\E4AF';
-}
-.t-icon-logo-framer-filled:before {
- content: '\E4B0';
-}
-.t-icon-logo-framer:before {
- content: '\E4B1';
-}
-.t-icon-logo-github-filled:before {
- content: '\E4B2';
-}
-.t-icon-logo-github:before {
- content: '\E4B3';
-}
-.t-icon-logo-gitlab-filled:before {
- content: '\E4B4';
-}
-.t-icon-logo-gitlab:before {
- content: '\E4B5';
-}
-.t-icon-logo-ie-filled:before {
- content: '\E4B6';
-}
-.t-icon-logo-ie:before {
- content: '\E4B7';
-}
-.t-icon-logo-instagram-filled:before {
- content: '\E4B8';
-}
-.t-icon-logo-instagram:before {
- content: '\E4B9';
-}
-.t-icon-logo-qq-filled:before {
- content: '\E4BA';
-}
-.t-icon-logo-qq:before {
- content: '\E4BB';
-}
-.t-icon-logo-twitter-filled:before {
- content: '\E4BC';
-}
-.t-icon-logo-twitter:before {
- content: '\E4BD';
-}
-.t-icon-logo-wechat-stroke-filled:before {
- content: '\E4BE';
-}
-.t-icon-logo-wechat-stroke:before {
- content: '\E4BF';
-}
-.t-icon-logo-wechatpay-filled:before {
- content: '\E4C0';
-}
-.t-icon-logo-wechatpay:before {
- content: '\E4C1';
-}
-.t-icon-logo-wecom:before {
- content: '\E4C2';
-}
-.t-icon-logo-windows-filled:before {
- content: '\E4C3';
-}
-.t-icon-logo-windows:before {
- content: '\E4C4';
-}
-.t-icon-logo-youtube-filled:before {
- content: '\E4C5';
-}
-.t-icon-logo-youtube:before {
- content: '\E4C6';
-}
-.t-icon-logout:before {
- content: '\E4C7';
-}
-.t-icon-look-around-filled:before {
- content: '\E4C8';
-}
-.t-icon-look-around:before {
- content: '\E4C9';
-}
-.t-icon-loudspeaker-filled:before {
- content: '\E4CA';
-}
-.t-icon-loudspeaker:before {
- content: '\E4CB';
-}
-.t-icon-mail-filled:before {
- content: '\E4CC';
-}
-.t-icon-mail:before {
- content: '\E4CD';
-}
-.t-icon-map-3d-filled:before {
- content: '\E4CE';
-}
-.t-icon-map-3d:before {
- content: '\E4CF';
-}
-.t-icon-map-add-filled:before {
- content: '\E4D0';
-}
-.t-icon-map-add:before {
- content: '\E4D1';
-}
-.t-icon-map-aiming-filled:before {
- content: '\E4D2';
-}
-.t-icon-map-aiming:before {
- content: '\E4D3';
-}
-.t-icon-map-blocked-filled:before {
- content: '\E4D4';
-}
-.t-icon-map-blocked:before {
- content: '\E4D5';
-}
-.t-icon-map-bubble-filled:before {
- content: '\E4D6';
-}
-.t-icon-map-bubble:before {
- content: '\E4D7';
-}
-.t-icon-map-cancel-filled:before {
- content: '\E4D8';
-}
-.t-icon-map-cancel:before {
- content: '\E4D9';
-}
-.t-icon-map-chat-filled:before {
- content: '\E4DA';
-}
-.t-icon-map-chat:before {
- content: '\E4DB';
-}
-.t-icon-map-checked-filled:before {
- content: '\E4DC';
-}
-.t-icon-map-checked:before {
- content: '\E4DD';
-}
-.t-icon-map-collection-filled:before {
- content: '\E4DE';
-}
-.t-icon-map-collection:before {
- content: '\E4DF';
-}
-.t-icon-map-connection-filled:before {
- content: '\E4E0';
-}
-.t-icon-map-connection:before {
- content: '\E4E1';
-}
-.t-icon-map-distance-filled:before {
- content: '\E4E2';
-}
-.t-icon-map-distance:before {
- content: '\E4E3';
-}
-.t-icon-map-double-filled:before {
- content: '\E4E4';
-}
-.t-icon-map-double:before {
- content: '\E4E5';
-}
-.t-icon-map-edit-filled:before {
- content: '\E4E6';
-}
-.t-icon-map-edit:before {
- content: '\E4E7';
-}
-.t-icon-map-filled:before {
- content: '\E4E8';
-}
-.t-icon-map-grid-filled:before {
- content: '\E4E9';
-}
-.t-icon-map-grid:before {
- content: '\E4EA';
-}
-.t-icon-map-information-1-filled:before {
- content: '\E4EB';
-}
-.t-icon-map-information-1:before {
- content: '\E4EC';
-}
-.t-icon-map-information-2-filled:before {
- content: '\E4ED';
-}
-.t-icon-map-information-2:before {
- content: '\E4EE';
-}
-.t-icon-map-information-filled:before {
- content: '\E4EF';
-}
-.t-icon-map-information:before {
- content: '\E4F0';
-}
-.t-icon-map-location-filled:before {
- content: '\E4F1';
-}
-.t-icon-map-location:before {
- content: '\E4F2';
-}
-.t-icon-map-locked-filled:before {
- content: '\E4F3';
-}
-.t-icon-map-locked:before {
- content: '\E4F4';
-}
-.t-icon-map-marked-filled:before {
- content: '\E4F5';
-}
-.t-icon-map-marked:before {
- content: '\E4F6';
-}
-.t-icon-map-navigation-filled:before {
- content: '\E4F7';
-}
-.t-icon-map-navigation:before {
- content: '\E4F8';
-}
-.t-icon-map-outline-filled:before {
- content: '\E4F9';
-}
-.t-icon-map-outline:before {
- content: '\E4FA';
-}
-.t-icon-map-route-planning-filled:before {
- content: '\E4FB';
-}
-.t-icon-map-route-planning:before {
- content: '\E4FC';
-}
-.t-icon-map-ruler-filled:before {
- content: '\E4FD';
-}
-.t-icon-map-ruler:before {
- content: '\E4FE';
-}
-.t-icon-map-safety-filled:before {
- content: '\E4FF';
-}
-.t-icon-map-safety:before {
- content: '\E500';
-}
-.t-icon-map-search-1-filled:before {
- content: '\E501';
-}
-.t-icon-map-search-1:before {
- content: '\E502';
-}
-.t-icon-map-search-filled:before {
- content: '\E503';
-}
-.t-icon-map-search:before {
- content: '\E504';
-}
-.t-icon-map-setting-filled:before {
- content: '\E505';
-}
-.t-icon-map-setting:before {
- content: '\E506';
-}
-.t-icon-map-unlocked-filled:before {
- content: '\E507';
-}
-.t-icon-map-unlocked:before {
- content: '\E508';
-}
-.t-icon-map:before {
- content: '\E509';
-}
-.t-icon-mark-as-unread-filled:before {
- content: '\E50A';
-}
-.t-icon-mark-as-unread:before {
- content: '\E50B';
-}
-.t-icon-markup-filled:before {
- content: '\E50C';
-}
-.t-icon-markup:before {
- content: '\E50D';
-}
-.t-icon-mathematics-filled:before {
- content: '\E50E';
-}
-.t-icon-mathematics:before {
- content: '\E50F';
-}
-.t-icon-measurement-1-filled:before {
- content: '\E510';
-}
-.t-icon-measurement-1:before {
- content: '\E511';
-}
-.t-icon-measurement-2-filled:before {
- content: '\E512';
-}
-.t-icon-measurement-2:before {
- content: '\E513';
-}
-.t-icon-measurement-filled:before {
- content: '\E514';
-}
-.t-icon-measurement:before {
- content: '\E515';
-}
-.t-icon-meat-pepper-filled:before {
- content: '\E516';
-}
-.t-icon-meat-pepper:before {
- content: '\E517';
-}
-.t-icon-media-library-filled:before {
- content: '\E518';
-}
-.t-icon-media-library:before {
- content: '\E519';
-}
-.t-icon-member-filled:before {
- content: '\E51A';
-}
-.t-icon-member:before {
- content: '\E51B';
-}
-.t-icon-menu-application:before {
- content: '\E51C';
-}
-.t-icon-menu-filled:before {
- content: '\E51D';
-}
-.t-icon-menu-fold:before {
- content: '\E51E';
-}
-.t-icon-menu-unfold:before {
- content: '\E51F';
-}
-.t-icon-menu:before {
- content: '\E520';
-}
-.t-icon-merge-cells-filled:before {
- content: '\E521';
-}
-.t-icon-merge-cells:before {
- content: '\E522';
-}
-.t-icon-microphone-1-filled:before {
- content: '\E523';
-}
-.t-icon-microphone-1:before {
- content: '\E524';
-}
-.t-icon-microphone-2-filled:before {
- content: '\E525';
-}
-.t-icon-microphone-2:before {
- content: '\E526';
-}
-.t-icon-microphone-filled:before {
- content: '\E527';
-}
-.t-icon-microphone:before {
- content: '\E528';
-}
-.t-icon-milk-filled:before {
- content: '\E529';
-}
-.t-icon-milk:before {
- content: '\E52A';
-}
-.t-icon-minus-circle-filled:before {
- content: '\E52B';
-}
-.t-icon-minus-circle:before {
- content: '\E52C';
-}
-.t-icon-minus-rectangle-filled:before {
- content: '\E52D';
-}
-.t-icon-minus-rectangle:before {
- content: '\E52E';
-}
-.t-icon-minus:before {
- content: '\E52F';
-}
-.t-icon-mirror-filled:before {
- content: '\E530';
-}
-.t-icon-mirror:before {
- content: '\E531';
-}
-.t-icon-mobile-blocked-filled:before {
- content: '\E532';
-}
-.t-icon-mobile-blocked:before {
- content: '\E533';
-}
-.t-icon-mobile-filled:before {
- content: '\E534';
-}
-.t-icon-mobile-list-filled:before {
- content: '\E535';
-}
-.t-icon-mobile-list:before {
- content: '\E536';
-}
-.t-icon-mobile-navigation-filled:before {
- content: '\E537';
-}
-.t-icon-mobile-navigation:before {
- content: '\E538';
-}
-.t-icon-mobile-shortcut-filled:before {
- content: '\E539';
-}
-.t-icon-mobile-shortcut:before {
- content: '\E53A';
-}
-.t-icon-mobile-vibrate-filled:before {
- content: '\E53B';
-}
-.t-icon-mobile-vibrate:before {
- content: '\E53C';
-}
-.t-icon-mobile:before {
- content: '\E53D';
-}
-.t-icon-mode-dark-filled:before {
- content: '\E53E';
-}
-.t-icon-mode-dark:before {
- content: '\E53F';
-}
-.t-icon-mode-light-filled:before {
- content: '\E540';
-}
-.t-icon-mode-light:before {
- content: '\E541';
-}
-.t-icon-module-filled:before {
- content: '\E542';
-}
-.t-icon-module:before {
- content: '\E543';
-}
-.t-icon-money-filled:before {
- content: '\E544';
-}
-.t-icon-money:before {
- content: '\E545';
-}
-.t-icon-monument-filled:before {
- content: '\E546';
-}
-.t-icon-monument:before {
- content: '\E547';
-}
-.t-icon-moon-fall-filled:before {
- content: '\E548';
-}
-.t-icon-moon-fall:before {
- content: '\E549';
-}
-.t-icon-moon-filled:before {
- content: '\E54A';
-}
-.t-icon-moon-rising-filled:before {
- content: '\E54B';
-}
-.t-icon-moon-rising:before {
- content: '\E54C';
-}
-.t-icon-moon:before {
- content: '\E54D';
-}
-.t-icon-more:before {
- content: '\E54E';
-}
-.t-icon-mosque-1-filled:before {
- content: '\E54F';
-}
-.t-icon-mosque-1:before {
- content: '\E550';
-}
-.t-icon-mosque-filled:before {
- content: '\E551';
-}
-.t-icon-mosque:before {
- content: '\E552';
-}
-.t-icon-mouse-filled:before {
- content: '\E553';
-}
-.t-icon-mouse:before {
- content: '\E554';
-}
-.t-icon-move-1:before {
- content: '\E555';
-}
-.t-icon-move:before {
- content: '\E556';
-}
-.t-icon-movie-clapper-filled:before {
- content: '\E557';
-}
-.t-icon-movie-clapper:before {
- content: '\E558';
-}
-.t-icon-multiply:before {
- content: '\E559';
-}
-.t-icon-museum-1-filled:before {
- content: '\E55A';
-}
-.t-icon-museum-1:before {
- content: '\E55B';
-}
-.t-icon-museum-2-filled:before {
- content: '\E55C';
-}
-.t-icon-museum-2:before {
- content: '\E55D';
-}
-.t-icon-museum-filled:before {
- content: '\E55E';
-}
-.t-icon-museum:before {
- content: '\E55F';
-}
-.t-icon-mushroom-1-filled:before {
- content: '\E560';
-}
-.t-icon-mushroom-1:before {
- content: '\E561';
-}
-.t-icon-mushroom-filled:before {
- content: '\E562';
-}
-.t-icon-mushroom:before {
- content: '\E563';
-}
-.t-icon-music-1-filled:before {
- content: '\E564';
-}
-.t-icon-music-1:before {
- content: '\E565';
-}
-.t-icon-music-2-filled:before {
- content: '\E566';
-}
-.t-icon-music-2:before {
- content: '\E567';
-}
-.t-icon-music-filled:before {
- content: '\E568';
-}
-.t-icon-music-rectangle-add-filled:before {
- content: '\E569';
-}
-.t-icon-music-rectangle-add:before {
- content: '\E56A';
-}
-.t-icon-music:before {
- content: '\E56B';
-}
-.t-icon-navigation-arrow-filled:before {
- content: '\E56C';
-}
-.t-icon-navigation-arrow:before {
- content: '\E56D';
-}
-.t-icon-next-filled:before {
- content: '\E56E';
-}
-.t-icon-next:before {
- content: '\E56F';
-}
-.t-icon-no-expression-filled:before {
- content: '\E570';
-}
-.t-icon-no-expression:before {
- content: '\E571';
-}
-.t-icon-noodle-filled:before {
- content: '\E572';
-}
-.t-icon-noodle:before {
- content: '\E573';
-}
-.t-icon-notification-add-filled:before {
- content: '\E574';
-}
-.t-icon-notification-add:before {
- content: '\E575';
-}
-.t-icon-notification-circle-filled:before {
- content: '\E576';
-}
-.t-icon-notification-circle:before {
- content: '\E577';
-}
-.t-icon-notification-error-filled:before {
- content: '\E578';
-}
-.t-icon-notification-error:before {
- content: '\E579';
-}
-.t-icon-notification-filled:before {
- content: '\E57A';
-}
-.t-icon-notification:before {
- content: '\E57B';
-}
-.t-icon-numbers-0-1:before {
- content: '\E57C';
-}
-.t-icon-numbers-0:before {
- content: '\E57D';
-}
-.t-icon-numbers-1-1:before {
- content: '\E57E';
-}
-.t-icon-numbers-1:before {
- content: '\E57F';
-}
-.t-icon-numbers-2-1:before {
- content: '\E580';
-}
-.t-icon-numbers-2:before {
- content: '\E581';
-}
-.t-icon-numbers-3-1:before {
- content: '\E582';
-}
-.t-icon-numbers-3:before {
- content: '\E583';
-}
-.t-icon-numbers-4-1:before {
- content: '\E584';
-}
-.t-icon-numbers-4:before {
- content: '\E585';
-}
-.t-icon-numbers-5-1:before {
- content: '\E586';
-}
-.t-icon-numbers-5:before {
- content: '\E587';
-}
-.t-icon-numbers-6-1:before {
- content: '\E588';
-}
-.t-icon-numbers-6:before {
- content: '\E589';
-}
-.t-icon-numbers-7-1:before {
- content: '\E58A';
-}
-.t-icon-numbers-7:before {
- content: '\E58B';
-}
-.t-icon-numbers-8-1:before {
- content: '\E58C';
-}
-.t-icon-numbers-8:before {
- content: '\E58D';
-}
-.t-icon-numbers-9-1:before {
- content: '\E58E';
-}
-.t-icon-numbers-9:before {
- content: '\E58F';
-}
-.t-icon-nut-filled:before {
- content: '\E590';
-}
-.t-icon-nut:before {
- content: '\E591';
-}
-.t-icon-object-storage:before {
- content: '\E592';
-}
-.t-icon-open-mouth-filled:before {
- content: '\E593';
-}
-.t-icon-open-mouth:before {
- content: '\E594';
-}
-.t-icon-opera-filled:before {
- content: '\E595';
-}
-.t-icon-opera:before {
- content: '\E596';
-}
-.t-icon-order-adjustment-column:before {
- content: '\E597';
-}
-.t-icon-order-ascending:before {
- content: '\E598';
-}
-.t-icon-order-descending:before {
- content: '\E599';
-}
-.t-icon-outbox-filled:before {
- content: '\E59A';
-}
-.t-icon-outbox:before {
- content: '\E59B';
-}
-.t-icon-page-first:before {
- content: '\E59C';
-}
-.t-icon-page-head-filled:before {
- content: '\E59D';
-}
-.t-icon-page-head:before {
- content: '\E59E';
-}
-.t-icon-page-last:before {
- content: '\E59F';
-}
-.t-icon-palace-1-filled:before {
- content: '\E5A0';
-}
-.t-icon-palace-1:before {
- content: '\E5A1';
-}
-.t-icon-palace-2-filled:before {
- content: '\E5A2';
-}
-.t-icon-palace-2:before {
- content: '\E5A3';
-}
-.t-icon-palace-3-filled:before {
- content: '\E5A4';
-}
-.t-icon-palace-3:before {
- content: '\E5A5';
-}
-.t-icon-palace-4-filled:before {
- content: '\E5A6';
-}
-.t-icon-palace-4:before {
- content: '\E5A7';
-}
-.t-icon-palace-filled:before {
- content: '\E5A8';
-}
-.t-icon-palace:before {
- content: '\E5A9';
-}
-.t-icon-palette-1-filled:before {
- content: '\E5AA';
-}
-.t-icon-palette-1:before {
- content: '\E5AB';
-}
-.t-icon-palette-filled:before {
- content: '\E5AC';
-}
-.t-icon-palette:before {
- content: '\E5AD';
-}
-.t-icon-panorama-horizontal-filled:before {
- content: '\E5AE';
-}
-.t-icon-panorama-horizontal:before {
- content: '\E5AF';
-}
-.t-icon-panorama-vertical-filled:before {
- content: '\E5B0';
-}
-.t-icon-panorama-vertical:before {
- content: '\E5B1';
-}
-.t-icon-pantone-filled:before {
- content: '\E5B2';
-}
-.t-icon-pantone:before {
- content: '\E5B3';
-}
-.t-icon-parabola:before {
- content: '\E5B4';
-}
-.t-icon-parentheses:before {
- content: '\E5B5';
-}
-.t-icon-paste-filled:before {
- content: '\E5B6';
-}
-.t-icon-paste:before {
- content: '\E5B7';
-}
-.t-icon-patio-filled:before {
- content: '\E5B8';
-}
-.t-icon-patio:before {
- content: '\E5B9';
-}
-.t-icon-pause-circle-filled:before {
- content: '\E5BA';
-}
-.t-icon-pause-circle-stroke-filled:before {
- content: '\E5BB';
-}
-.t-icon-pause-circle-stroke:before {
- content: '\E5BC';
-}
-.t-icon-pause-circle:before {
- content: '\E5BD';
-}
-.t-icon-pause:before {
- content: '\E5BE';
-}
-.t-icon-pea-filled:before {
- content: '\E5BF';
-}
-.t-icon-pea:before {
- content: '\E5C0';
-}
-.t-icon-peach-filled:before {
- content: '\E5C1';
-}
-.t-icon-peach:before {
- content: '\E5C2';
-}
-.t-icon-pear-filled:before {
- content: '\E5C3';
-}
-.t-icon-pear:before {
- content: '\E5C4';
-}
-.t-icon-pearl-of-the-orient-filled:before {
- content: '\E5C5';
-}
-.t-icon-pearl-of-the-orient:before {
- content: '\E5C6';
-}
-.t-icon-pen-ball-filled:before {
- content: '\E5C7';
-}
-.t-icon-pen-ball:before {
- content: '\E5C8';
-}
-.t-icon-pen-brush-filled:before {
- content: '\E5C9';
-}
-.t-icon-pen-brush:before {
- content: '\E5CA';
-}
-.t-icon-pen-filled:before {
- content: '\E5CB';
-}
-.t-icon-pen-mark-filled:before {
- content: '\E5CC';
-}
-.t-icon-pen-mark:before {
- content: '\E5CD';
-}
-.t-icon-pen-quill-filled:before {
- content: '\E5CE';
-}
-.t-icon-pen-quill:before {
- content: '\E5CF';
-}
-.t-icon-pen:before {
- content: '\E5D0';
-}
-.t-icon-pending-filled:before {
- content: '\E5D1';
-}
-.t-icon-pending:before {
- content: '\E5D2';
-}
-.t-icon-percent:before {
- content: '\E5D3';
-}
-.t-icon-personal-information-filled:before {
- content: '\E5D4';
-}
-.t-icon-personal-information:before {
- content: '\E5D5';
-}
-.t-icon-phone-locked-filled:before {
- content: '\E5D6';
-}
-.t-icon-phone-locked:before {
- content: '\E5D7';
-}
-.t-icon-phone-search-filled:before {
- content: '\E5D8';
-}
-.t-icon-phone-search:before {
- content: '\E5D9';
-}
-.t-icon-pi:before {
- content: '\E5DA';
-}
-.t-icon-piano-filled:before {
- content: '\E5DB';
-}
-.t-icon-piano:before {
- content: '\E5DC';
-}
-.t-icon-pin-filled:before {
- content: '\E5DD';
-}
-.t-icon-pin:before {
- content: '\E5DE';
-}
-.t-icon-play-circle-filled:before {
- content: '\E5DF';
-}
-.t-icon-play-circle-stroke-add-filled:before {
- content: '\E5E0';
-}
-.t-icon-play-circle-stroke-add:before {
- content: '\E5E1';
-}
-.t-icon-play-circle-stroke-filled:before {
- content: '\E5E2';
-}
-.t-icon-play-circle-stroke:before {
- content: '\E5E3';
-}
-.t-icon-play-circle:before {
- content: '\E5E4';
-}
-.t-icon-play-demo-filled:before {
- content: '\E5E5';
-}
-.t-icon-play-demo:before {
- content: '\E5E6';
-}
-.t-icon-play-rectangle-filled:before {
- content: '\E5E7';
-}
-.t-icon-play-rectangle:before {
- content: '\E5E8';
-}
-.t-icon-play:before {
- content: '\E5E9';
-}
-.t-icon-plus:before {
- content: '\E5EA';
-}
-.t-icon-popsicle-filled:before {
- content: '\E5EB';
-}
-.t-icon-popsicle:before {
- content: '\E5EC';
-}
-.t-icon-portrait-filled:before {
- content: '\E5ED';
-}
-.t-icon-portrait:before {
- content: '\E5EE';
-}
-.t-icon-pout-filled:before {
- content: '\E5EF';
-}
-.t-icon-pout:before {
- content: '\E5F0';
-}
-.t-icon-poweroff:before {
- content: '\E5F1';
-}
-.t-icon-precise-monitor:before {
- content: '\E5F2';
-}
-.t-icon-previous-filled:before {
- content: '\E5F3';
-}
-.t-icon-previous:before {
- content: '\E5F4';
-}
-.t-icon-print-filled:before {
- content: '\E5F5';
-}
-.t-icon-print:before {
- content: '\E5F6';
-}
-.t-icon-pumpkin-filled:before {
- content: '\E5F7';
-}
-.t-icon-pumpkin:before {
- content: '\E5F8';
-}
-.t-icon-pyramid-filled:before {
- content: '\E5F9';
-}
-.t-icon-pyramid-maya-filled:before {
- content: '\E5FA';
-}
-.t-icon-pyramid-maya:before {
- content: '\E5FB';
-}
-.t-icon-pyramid:before {
- content: '\E5FC';
-}
-.t-icon-qrcode:before {
- content: '\E5FD';
-}
-.t-icon-quadratic:before {
- content: '\E5FE';
-}
-.t-icon-questionnaire-double-filled:before {
- content: '\E5FF';
-}
-.t-icon-questionnaire-double:before {
- content: '\E600';
-}
-.t-icon-questionnaire-filled:before {
- content: '\E601';
-}
-.t-icon-questionnaire:before {
- content: '\E602';
-}
-.t-icon-queue-filled:before {
- content: '\E603';
-}
-.t-icon-queue:before {
- content: '\E604';
-}
-.t-icon-radar:before {
- content: '\E605';
-}
-.t-icon-radio-1-filled:before {
- content: '\E606';
-}
-.t-icon-radio-1:before {
- content: '\E607';
-}
-.t-icon-radio-2-filled:before {
- content: '\E608';
-}
-.t-icon-radio-2:before {
- content: '\E609';
-}
-.t-icon-radish-filled:before {
- content: '\E60A';
-}
-.t-icon-radish:before {
- content: '\E60B';
-}
-.t-icon-rain-heavy:before {
- content: '\E60C';
-}
-.t-icon-rain-light-filled:before {
- content: '\E60D';
-}
-.t-icon-rain-light:before {
- content: '\E60E';
-}
-.t-icon-rain-medium:before {
- content: '\E60F';
-}
-.t-icon-rainbow:before {
- content: '\E610';
-}
-.t-icon-rectangle-filled:before {
- content: '\E611';
-}
-.t-icon-rectangle:before {
- content: '\E612';
-}
-.t-icon-refresh:before {
- content: '\E613';
-}
-.t-icon-relation:before {
- content: '\E614';
-}
-.t-icon-relativity-filled:before {
- content: '\E615';
-}
-.t-icon-relativity:before {
- content: '\E616';
-}
-.t-icon-remote-wave-filled:before {
- content: '\E617';
-}
-.t-icon-remote-wave:before {
- content: '\E618';
-}
-.t-icon-remove:before {
- content: '\E619';
-}
-.t-icon-replay-filled:before {
- content: '\E61A';
-}
-.t-icon-replay:before {
- content: '\E61B';
-}
-.t-icon-rice-ball-filled:before {
- content: '\E61C';
-}
-.t-icon-rice-ball:before {
- content: '\E61D';
-}
-.t-icon-rice-filled:before {
- content: '\E61E';
-}
-.t-icon-rice:before {
- content: '\E61F';
-}
-.t-icon-roast-filled:before {
- content: '\E620';
-}
-.t-icon-roast:before {
- content: '\E621';
-}
-.t-icon-rocket-filled:before {
- content: '\E622';
-}
-.t-icon-rocket:before {
- content: '\E623';
-}
-.t-icon-rollback:before {
- content: '\E624';
-}
-.t-icon-rollfront:before {
- content: '\E625';
-}
-.t-icon-root-list-filled:before {
- content: '\E626';
-}
-.t-icon-root-list:before {
- content: '\E627';
-}
-.t-icon-rotate-locked-filled:before {
- content: '\E628';
-}
-.t-icon-rotate-locked:before {
- content: '\E629';
-}
-.t-icon-rotate:before {
- content: '\E62A';
-}
-.t-icon-rotation:before {
- content: '\E62B';
-}
-.t-icon-round-filled:before {
- content: '\E62C';
-}
-.t-icon-round:before {
- content: '\E62D';
-}
-.t-icon-router-wave-filled:before {
- content: '\E62E';
-}
-.t-icon-router-wave:before {
- content: '\E62F';
-}
-.t-icon-rss:before {
- content: '\E630';
-}
-.t-icon-ruler-filled:before {
- content: '\E631';
-}
-.t-icon-ruler:before {
- content: '\E632';
-}
-.t-icon-sailing-hotel-filled:before {
- content: '\E633';
-}
-.t-icon-sailing-hotel:before {
- content: '\E634';
-}
-.t-icon-sandwich-filled:before {
- content: '\E635';
-}
-.t-icon-sandwich:before {
- content: '\E636';
-}
-.t-icon-saturation-filled:before {
- content: '\E637';
-}
-.t-icon-saturation:before {
- content: '\E638';
-}
-.t-icon-sausage-filled:before {
- content: '\E639';
-}
-.t-icon-sausage:before {
- content: '\E63A';
-}
-.t-icon-save-filled:before {
- content: '\E63B';
-}
-.t-icon-save:before {
- content: '\E63C';
-}
-.t-icon-saving-pot-filled:before {
- content: '\E63D';
-}
-.t-icon-saving-pot:before {
- content: '\E63E';
-}
-.t-icon-scan:before {
- content: '\E63F';
-}
-.t-icon-screen-4k-filled:before {
- content: '\E640';
-}
-.t-icon-screen-4k:before {
- content: '\E641';
-}
-.t-icon-screencast-filled:before {
- content: '\E642';
-}
-.t-icon-screencast:before {
- content: '\E643';
-}
-.t-icon-screenshot:before {
- content: '\E644';
-}
-.t-icon-scroll-bar-filled:before {
- content: '\E645';
-}
-.t-icon-scroll-bar:before {
- content: '\E646';
-}
-.t-icon-sd-card-1-filled:before {
- content: '\E647';
-}
-.t-icon-sd-card-1:before {
- content: '\E648';
-}
-.t-icon-sd-card-filled:before {
- content: '\E649';
-}
-.t-icon-sd-card:before {
- content: '\E64A';
-}
-.t-icon-search-error-filled:before {
- content: '\E64B';
-}
-.t-icon-search-error:before {
- content: '\E64C';
-}
-.t-icon-search-filled:before {
- content: '\E64D';
-}
-.t-icon-search:before {
- content: '\E64E';
-}
-.t-icon-secured-filled:before {
- content: '\E64F';
-}
-.t-icon-secured:before {
- content: '\E650';
-}
-.t-icon-send-cancel-filled:before {
- content: '\E651';
-}
-.t-icon-send-cancel:before {
- content: '\E652';
-}
-.t-icon-send-filled:before {
- content: '\E653';
-}
-.t-icon-send:before {
- content: '\E654';
-}
-.t-icon-sensors-1:before {
- content: '\E655';
-}
-.t-icon-sensors-2:before {
- content: '\E656';
-}
-.t-icon-sensors-off:before {
- content: '\E657';
-}
-.t-icon-sensors:before {
- content: '\E658';
-}
-.t-icon-sequence-filled:before {
- content: '\E659';
-}
-.t-icon-sequence:before {
- content: '\E65A';
-}
-.t-icon-serenity-filled:before {
- content: '\E65B';
-}
-.t-icon-serenity:before {
- content: '\E65C';
-}
-.t-icon-server-filled:before {
- content: '\E65D';
-}
-.t-icon-server:before {
- content: '\E65E';
-}
-.t-icon-service-filled:before {
- content: '\E65F';
-}
-.t-icon-service:before {
- content: '\E660';
-}
-.t-icon-setting-1-filled:before {
- content: '\E661';
-}
-.t-icon-setting-1:before {
- content: '\E662';
-}
-.t-icon-setting-filled:before {
- content: '\E663';
-}
-.t-icon-setting:before {
- content: '\E664';
-}
-.t-icon-share-1-filled:before {
- content: '\E665';
-}
-.t-icon-share-1:before {
- content: '\E666';
-}
-.t-icon-share-filled:before {
- content: '\E667';
-}
-.t-icon-share:before {
- content: '\E668';
-}
-.t-icon-sharpness-filled:before {
- content: '\E669';
-}
-.t-icon-sharpness:before {
- content: '\E66A';
-}
-.t-icon-shield-error-filled:before {
- content: '\E66B';
-}
-.t-icon-shield-error:before {
- content: '\E66C';
-}
-.t-icon-shimen-filled:before {
- content: '\E66D';
-}
-.t-icon-shimen:before {
- content: '\E66E';
-}
-.t-icon-shop-1-filled:before {
- content: '\E66F';
-}
-.t-icon-shop-1:before {
- content: '\E670';
-}
-.t-icon-shop-2-filled:before {
- content: '\E671';
-}
-.t-icon-shop-2:before {
- content: '\E672';
-}
-.t-icon-shop-3-filled:before {
- content: '\E673';
-}
-.t-icon-shop-3:before {
- content: '\E674';
-}
-.t-icon-shop-4-filled:before {
- content: '\E675';
-}
-.t-icon-shop-4:before {
- content: '\E676';
-}
-.t-icon-shop-5-filled:before {
- content: '\E677';
-}
-.t-icon-shop-5:before {
- content: '\E678';
-}
-.t-icon-shop-filled:before {
- content: '\E679';
-}
-.t-icon-shop:before {
- content: '\E67A';
-}
-.t-icon-shrimp-filled:before {
- content: '\E67B';
-}
-.t-icon-shrimp:before {
- content: '\E67C';
-}
-.t-icon-shrink-horizontal:before {
- content: '\E67D';
-}
-.t-icon-shrink-vertical:before {
- content: '\E67E';
-}
-.t-icon-shutter-filled:before {
- content: '\E67F';
-}
-.t-icon-shutter:before {
- content: '\E680';
-}
-.t-icon-shutup-filled:before {
- content: '\E681';
-}
-.t-icon-shutup:before {
- content: '\E682';
-}
-.t-icon-sim-card-1-filled:before {
- content: '\E683';
-}
-.t-icon-sim-card-1:before {
- content: '\E684';
-}
-.t-icon-sim-card-2-filled:before {
- content: '\E685';
-}
-.t-icon-sim-card-2:before {
- content: '\E686';
-}
-.t-icon-sim-card-filled:before {
- content: '\E687';
-}
-.t-icon-sim-card:before {
- content: '\E688';
-}
-.t-icon-sinister-smile-filled:before {
- content: '\E689';
-}
-.t-icon-sinister-smile:before {
- content: '\E68A';
-}
-.t-icon-sip-filled:before {
- content: '\E68B';
-}
-.t-icon-sip:before {
- content: '\E68C';
-}
-.t-icon-sitemap-filled:before {
- content: '\E68D';
-}
-.t-icon-sitemap:before {
- content: '\E68E';
-}
-.t-icon-slash:before {
- content: '\E68F';
-}
-.t-icon-sleep-filled:before {
- content: '\E690';
-}
-.t-icon-sleep:before {
- content: '\E691';
-}
-.t-icon-slice-filled:before {
- content: '\E692';
-}
-.t-icon-slice:before {
- content: '\E693';
-}
-.t-icon-slideshow-filled:before {
- content: '\E694';
-}
-.t-icon-slideshow:before {
- content: '\E695';
-}
-.t-icon-smile-filled:before {
- content: '\E696';
-}
-.t-icon-smile:before {
- content: '\E697';
-}
-.t-icon-sneer-filled:before {
- content: '\E698';
-}
-.t-icon-sneer:before {
- content: '\E699';
-}
-.t-icon-snowflake:before {
- content: '\E69A';
-}
-.t-icon-sonic:before {
- content: '\E69B';
-}
-.t-icon-sound-down-filled:before {
- content: '\E69C';
-}
-.t-icon-sound-down:before {
- content: '\E69D';
-}
-.t-icon-sound-filled:before {
- content: '\E69E';
-}
-.t-icon-sound-high-filled:before {
- content: '\E69F';
-}
-.t-icon-sound-high:before {
- content: '\E6A0';
-}
-.t-icon-sound-low-filled:before {
- content: '\E6A1';
-}
-.t-icon-sound-low:before {
- content: '\E6A2';
-}
-.t-icon-sound-mute-1-filled:before {
- content: '\E6A3';
-}
-.t-icon-sound-mute-1:before {
- content: '\E6A4';
-}
-.t-icon-sound-mute-filled:before {
- content: '\E6A5';
-}
-.t-icon-sound-mute:before {
- content: '\E6A6';
-}
-.t-icon-sound-up-filled:before {
- content: '\E6A7';
-}
-.t-icon-sound-up:before {
- content: '\E6A8';
-}
-.t-icon-sound:before {
- content: '\E6A9';
-}
-.t-icon-space:before {
- content: '\E6AA';
-}
-.t-icon-speechless-1-filled:before {
- content: '\E6AB';
-}
-.t-icon-speechless-1:before {
- content: '\E6AC';
-}
-.t-icon-speechless-filled:before {
- content: '\E6AD';
-}
-.t-icon-speechless:before {
- content: '\E6AE';
-}
-.t-icon-star-filled:before {
- content: '\E6AF';
-}
-.t-icon-star:before {
- content: '\E6B0';
-}
-.t-icon-statue-of-jesus-filled:before {
- content: '\E6B1';
-}
-.t-icon-statue-of-jesus:before {
- content: '\E6B2';
-}
-.t-icon-sticky-note-filled:before {
- content: '\E6B3';
-}
-.t-icon-sticky-note:before {
- content: '\E6B4';
-}
-.t-icon-stop-circle-filled:before {
- content: '\E6B5';
-}
-.t-icon-stop-circle-stroke-filled:before {
- content: '\E6B6';
-}
-.t-icon-stop-circle-stroke:before {
- content: '\E6B7';
-}
-.t-icon-stop-circle:before {
- content: '\E6B8';
-}
-.t-icon-stop:before {
- content: '\E6B9';
-}
-.t-icon-store-filled:before {
- content: '\E6BA';
-}
-.t-icon-store:before {
- content: '\E6BB';
-}
-.t-icon-street-road-1-filled:before {
- content: '\E6BC';
-}
-.t-icon-street-road-1:before {
- content: '\E6BD';
-}
-.t-icon-street-road-filled:before {
- content: '\E6BE';
-}
-.t-icon-street-road:before {
- content: '\E6BF';
-}
-.t-icon-subtitle-filled:before {
- content: '\E6C0';
-}
-.t-icon-subtitle:before {
- content: '\E6C1';
-}
-.t-icon-subway-line-filled:before {
- content: '\E6C2';
-}
-.t-icon-subway-line:before {
- content: '\E6C3';
-}
-.t-icon-sum:before {
- content: '\E6C4';
-}
-.t-icon-sun-fall-filled:before {
- content: '\E6C5';
-}
-.t-icon-sun-fall:before {
- content: '\E6C6';
-}
-.t-icon-sun-rising-filled:before {
- content: '\E6C7';
-}
-.t-icon-sun-rising:before {
- content: '\E6C8';
-}
-.t-icon-sunny-filled:before {
- content: '\E6C9';
-}
-.t-icon-sunny:before {
- content: '\E6CA';
-}
-.t-icon-support-filled:before {
- content: '\E6CB';
-}
-.t-icon-support:before {
- content: '\E6CC';
-}
-.t-icon-surprised-1-filled:before {
- content: '\E6CD';
-}
-.t-icon-surprised-1:before {
- content: '\E6CE';
-}
-.t-icon-surprised-filled:before {
- content: '\E6CF';
-}
-.t-icon-surprised:before {
- content: '\E6D0';
-}
-.t-icon-swap-left:before {
- content: '\E6D1';
-}
-.t-icon-swap-right:before {
- content: '\E6D2';
-}
-.t-icon-swap:before {
- content: '\E6D3';
-}
-.t-icon-swear-1-filled:before {
- content: '\E6D4';
-}
-.t-icon-swear-1:before {
- content: '\E6D5';
-}
-.t-icon-swear-2-filled:before {
- content: '\E6D6';
-}
-.t-icon-swear-2:before {
- content: '\E6D7';
-}
-.t-icon-system-2:before {
- content: '\E6D8';
-}
-.t-icon-system-3-filled:before {
- content: '\E6D9';
-}
-.t-icon-system-3:before {
- content: '\E6DA';
-}
-.t-icon-system-application-filled:before {
- content: '\E6DB';
-}
-.t-icon-system-application:before {
- content: '\E6DC';
-}
-.t-icon-system-blocked-filled:before {
- content: '\E6DD';
-}
-.t-icon-system-blocked:before {
- content: '\E6DE';
-}
-.t-icon-system-code-filled:before {
- content: '\E6DF';
-}
-.t-icon-system-code:before {
- content: '\E6E0';
-}
-.t-icon-system-components-filled:before {
- content: '\E6E1';
-}
-.t-icon-system-components:before {
- content: '\E6E2';
-}
-.t-icon-system-coordinate-filled:before {
- content: '\E6E3';
-}
-.t-icon-system-coordinate:before {
- content: '\E6E4';
-}
-.t-icon-system-device-filled:before {
- content: '\E6E5';
-}
-.t-icon-system-device:before {
- content: '\E6E6';
-}
-.t-icon-system-interface-filled:before {
- content: '\E6E7';
-}
-.t-icon-system-interface:before {
- content: '\E6E8';
-}
-.t-icon-system-location-filled:before {
- content: '\E6E9';
-}
-.t-icon-system-location:before {
- content: '\E6EA';
-}
-.t-icon-system-locked-filled:before {
- content: '\E6EB';
-}
-.t-icon-system-locked:before {
- content: '\E6EC';
-}
-.t-icon-system-log-filled:before {
- content: '\E6ED';
-}
-.t-icon-system-log:before {
- content: '\E6EE';
-}
-.t-icon-system-marked-filled:before {
- content: '\E6EF';
-}
-.t-icon-system-marked:before {
- content: '\E6F0';
-}
-.t-icon-system-messages-filled:before {
- content: '\E6F1';
-}
-.t-icon-system-messages:before {
- content: '\E6F2';
-}
-.t-icon-system-regulation-filled:before {
- content: '\E6F3';
-}
-.t-icon-system-regulation:before {
- content: '\E6F4';
-}
-.t-icon-system-search-filled:before {
- content: '\E6F5';
-}
-.t-icon-system-search:before {
- content: '\E6F6';
-}
-.t-icon-system-setting-filled:before {
- content: '\E6F7';
-}
-.t-icon-system-setting:before {
- content: '\E6F8';
-}
-.t-icon-system-storage-filled:before {
- content: '\E6F9';
-}
-.t-icon-system-storage:before {
- content: '\E6FA';
-}
-.t-icon-system-sum:before {
- content: '\E6FB';
-}
-.t-icon-system-unlocked-filled:before {
- content: '\E6FC';
-}
-.t-icon-system-unlocked:before {
- content: '\E6FD';
-}
-.t-icon-tab-filled:before {
- content: '\E6FE';
-}
-.t-icon-tab:before {
- content: '\E6FF';
-}
-.t-icon-table-1-filled:before {
- content: '\E700';
-}
-.t-icon-table-1:before {
- content: '\E701';
-}
-.t-icon-table-2-filled:before {
- content: '\E702';
-}
-.t-icon-table-2:before {
- content: '\E703';
-}
-.t-icon-table-add-filled:before {
- content: '\E704';
-}
-.t-icon-table-add:before {
- content: '\E705';
-}
-.t-icon-table-filled:before {
- content: '\E706';
-}
-.t-icon-table-split-filled:before {
- content: '\E707';
-}
-.t-icon-table-split:before {
- content: '\E708';
-}
-.t-icon-table:before {
- content: '\E709';
-}
-.t-icon-tag-filled:before {
- content: '\E70A';
-}
-.t-icon-tag:before {
- content: '\E70B';
-}
-.t-icon-tangerinr-filled:before {
- content: '\E70C';
-}
-.t-icon-tangerinr:before {
- content: '\E70D';
-}
-.t-icon-tape-filled:before {
- content: '\E70E';
-}
-.t-icon-tape:before {
- content: '\E70F';
-}
-.t-icon-task-1-filled:before {
- content: '\E710';
-}
-.t-icon-task-1:before {
- content: '\E711';
-}
-.t-icon-task-add-1:before {
- content: '\E712';
-}
-.t-icon-task-add-filled:before {
- content: '\E713';
-}
-.t-icon-task-add:before {
- content: '\E714';
-}
-.t-icon-task-checked-1:before {
- content: '\E715';
-}
-.t-icon-task-checked-filled:before {
- content: '\E716';
-}
-.t-icon-task-checked:before {
- content: '\E717';
-}
-.t-icon-task-double-filled:before {
- content: '\E718';
-}
-.t-icon-task-double:before {
- content: '\E719';
-}
-.t-icon-task-error-filled:before {
- content: '\E71A';
-}
-.t-icon-task-error:before {
- content: '\E71B';
-}
-.t-icon-task-filled:before {
- content: '\E71C';
-}
-.t-icon-task-location-filled:before {
- content: '\E71D';
-}
-.t-icon-task-location:before {
- content: '\E71E';
-}
-.t-icon-task-marked-filled:before {
- content: '\E71F';
-}
-.t-icon-task-marked:before {
- content: '\E720';
-}
-.t-icon-task-setting-filled:before {
- content: '\E721';
-}
-.t-icon-task-setting:before {
- content: '\E722';
-}
-.t-icon-task-time-filled:before {
- content: '\E723';
-}
-.t-icon-task-time:before {
- content: '\E724';
-}
-.t-icon-task-visible-filled:before {
- content: '\E725';
-}
-.t-icon-task-visible:before {
- content: '\E726';
-}
-.t-icon-task:before {
- content: '\E727';
-}
-.t-icon-tea-filled:before {
- content: '\E728';
-}
-.t-icon-tea:before {
- content: '\E729';
-}
-.t-icon-teahouse-filled:before {
- content: '\E72A';
-}
-.t-icon-teahouse:before {
- content: '\E72B';
-}
-.t-icon-template-filled:before {
- content: '\E72C';
-}
-.t-icon-template:before {
- content: '\E72D';
-}
-.t-icon-temple-filled:before {
- content: '\E72E';
-}
-.t-icon-temple:before {
- content: '\E72F';
-}
-.t-icon-terminal-rectangle-1-filled:before {
- content: '\E730';
-}
-.t-icon-terminal-rectangle-1:before {
- content: '\E731';
-}
-.t-icon-terminal-rectangle-filled:before {
- content: '\E732';
-}
-.t-icon-terminal-rectangle:before {
- content: '\E733';
-}
-.t-icon-terminal-window-filled:before {
- content: '\E734';
-}
-.t-icon-terminal-window:before {
- content: '\E735';
-}
-.t-icon-terminal:before {
- content: '\E736';
-}
-.t-icon-textbox-filled:before {
- content: '\E737';
-}
-.t-icon-textbox:before {
- content: '\E738';
-}
-.t-icon-textformat-bold:before {
- content: '\E739';
-}
-.t-icon-textformat-color:before {
- content: '\E73A';
-}
-.t-icon-textformat-italic:before {
- content: '\E73B';
-}
-.t-icon-textformat-strikethrough:before {
- content: '\E73C';
-}
-.t-icon-textformat-underline:before {
- content: '\E73D';
-}
-.t-icon-textformat-wrap:before {
- content: '\E73E';
-}
-.t-icon-theaters-filled:before {
- content: '\E73F';
-}
-.t-icon-theaters:before {
- content: '\E740';
-}
-.t-icon-thumb-down-1-filled:before {
- content: '\E741';
-}
-.t-icon-thumb-down-1:before {
- content: '\E742';
-}
-.t-icon-thumb-down-2-filled:before {
- content: '\E743';
-}
-.t-icon-thumb-down-2:before {
- content: '\E744';
-}
-.t-icon-thumb-down-filled:before {
- content: '\E745';
-}
-.t-icon-thumb-down:before {
- content: '\E746';
-}
-.t-icon-thumb-up-1-filled:before {
- content: '\E747';
-}
-.t-icon-thumb-up-1:before {
- content: '\E748';
-}
-.t-icon-thumb-up-2-filled:before {
- content: '\E749';
-}
-.t-icon-thumb-up-2:before {
- content: '\E74A';
-}
-.t-icon-thumb-up-filled:before {
- content: '\E74B';
-}
-.t-icon-thumb-up:before {
- content: '\E74C';
-}
-.t-icon-thunder:before {
- content: '\E74D';
-}
-.t-icon-thunderstorm-night-filled:before {
- content: '\E74E';
-}
-.t-icon-thunderstorm-night:before {
- content: '\E74F';
-}
-.t-icon-thunderstorm-sunny-filled:before {
- content: '\E750';
-}
-.t-icon-thunderstorm-sunny:before {
- content: '\E751';
-}
-.t-icon-thunderstorm:before {
- content: '\E752';
-}
-.t-icon-ticket-filled:before {
- content: '\E753';
-}
-.t-icon-ticket:before {
- content: '\E754';
-}
-.t-icon-time-filled:before {
- content: '\E755';
-}
-.t-icon-time:before {
- content: '\E756';
-}
-.t-icon-tips-double-filled:before {
- content: '\E757';
-}
-.t-icon-tips-double:before {
- content: '\E758';
-}
-.t-icon-tips-filled:before {
- content: '\E759';
-}
-.t-icon-tips:before {
- content: '\E75A';
-}
-.t-icon-tomato-filled:before {
- content: '\E75B';
-}
-.t-icon-tomato:before {
- content: '\E75C';
-}
-.t-icon-tools-circle-filled:before {
- content: '\E75D';
-}
-.t-icon-tools-circle:before {
- content: '\E75E';
-}
-.t-icon-tools-filled:before {
- content: '\E75F';
-}
-.t-icon-tools:before {
- content: '\E760';
-}
-.t-icon-tornado:before {
- content: '\E761';
-}
-.t-icon-tower-1-filled:before {
- content: '\E762';
-}
-.t-icon-tower-1:before {
- content: '\E763';
-}
-.t-icon-tower-2-filled:before {
- content: '\E764';
-}
-.t-icon-tower-2:before {
- content: '\E765';
-}
-.t-icon-tower-3-filled:before {
- content: '\E766';
-}
-.t-icon-tower-3:before {
- content: '\E767';
-}
-.t-icon-tower-clock-filled:before {
- content: '\E768';
-}
-.t-icon-tower-clock:before {
- content: '\E769';
-}
-.t-icon-tower-filled:before {
- content: '\E76A';
-}
-.t-icon-tower:before {
- content: '\E76B';
-}
-.t-icon-town-filled:before {
- content: '\E76C';
-}
-.t-icon-town:before {
- content: '\E76D';
-}
-.t-icon-traffic-events-filled:before {
- content: '\E76E';
-}
-.t-icon-traffic-events:before {
- content: '\E76F';
-}
-.t-icon-traffic-filled:before {
- content: '\E770';
-}
-.t-icon-traffic:before {
- content: '\E771';
-}
-.t-icon-transform-1-filled:before {
- content: '\E772';
-}
-.t-icon-transform-1:before {
- content: '\E773';
-}
-.t-icon-transform-2:before {
- content: '\E774';
-}
-.t-icon-transform-3:before {
- content: '\E775';
-}
-.t-icon-transform-filled:before {
- content: '\E776';
-}
-.t-icon-transform:before {
- content: '\E777';
-}
-.t-icon-translate-1:before {
- content: '\E778';
-}
-.t-icon-translate:before {
- content: '\E779';
-}
-.t-icon-tree-round-dot-filled:before {
- content: '\E77A';
-}
-.t-icon-tree-round-dot-vertical-filled:before {
- content: '\E77B';
-}
-.t-icon-tree-round-dot-vertical:before {
- content: '\E77C';
-}
-.t-icon-tree-round-dot:before {
- content: '\E77D';
-}
-.t-icon-tree-square-dot-filled:before {
- content: '\E77E';
-}
-.t-icon-tree-square-dot-vertical-filled:before {
- content: '\E77F';
-}
-.t-icon-tree-square-dot-vertical:before {
- content: '\E780';
-}
-.t-icon-tree-square-dot:before {
- content: '\E781';
-}
-.t-icon-trending-down:before {
- content: '\E782';
-}
-.t-icon-trending-up:before {
- content: '\E783';
-}
-.t-icon-tv-1-filled:before {
- content: '\E784';
-}
-.t-icon-tv-1:before {
- content: '\E785';
-}
-.t-icon-tv-2-filled:before {
- content: '\E786';
-}
-.t-icon-tv-2:before {
- content: '\E787';
-}
-.t-icon-tv-filled:before {
- content: '\E788';
-}
-.t-icon-tv:before {
- content: '\E789';
-}
-.t-icon-typography-filled:before {
- content: '\E78A';
-}
-.t-icon-typography:before {
- content: '\E78B';
-}
-.t-icon-uncomfortable-1-filled:before {
- content: '\E78C';
-}
-.t-icon-uncomfortable-1:before {
- content: '\E78D';
-}
-.t-icon-uncomfortable-2-filled:before {
- content: '\E78E';
-}
-.t-icon-uncomfortable-2:before {
- content: '\E78F';
-}
-.t-icon-uncomfortable-filled:before {
- content: '\E790';
-}
-.t-icon-uncomfortable:before {
- content: '\E791';
-}
-.t-icon-undertake-delivery-filled:before {
- content: '\E792';
-}
-.t-icon-undertake-delivery:before {
- content: '\E793';
-}
-.t-icon-undertake-environment-protection-filled:before {
- content: '\E794';
-}
-.t-icon-undertake-environment-protection:before {
- content: '\E795';
-}
-.t-icon-undertake-filled:before {
- content: '\E796';
-}
-.t-icon-undertake-hold-up-filled:before {
- content: '\E797';
-}
-.t-icon-undertake-hold-up:before {
- content: '\E798';
-}
-.t-icon-undertake-transaction-filled:before {
- content: '\E799';
-}
-.t-icon-undertake-transaction:before {
- content: '\E79A';
-}
-.t-icon-undertake:before {
- content: '\E79B';
-}
-.t-icon-unfold-less:before {
- content: '\E79C';
-}
-.t-icon-unfold-more:before {
- content: '\E79D';
-}
-.t-icon-unhappy-1-filled:before {
- content: '\E79E';
-}
-.t-icon-unhappy-1:before {
- content: '\E79F';
-}
-.t-icon-unhappy-filled:before {
- content: '\E7A0';
-}
-.t-icon-unhappy:before {
- content: '\E7A1';
-}
-.t-icon-uninstall-filled:before {
- content: '\E7A2';
-}
-.t-icon-uninstall:before {
- content: '\E7A3';
-}
-.t-icon-upload-1:before {
- content: '\E7A4';
-}
-.t-icon-upload:before {
- content: '\E7A5';
-}
-.t-icon-upscale:before {
- content: '\E7A6';
-}
-.t-icon-usb-filled:before {
- content: '\E7A7';
-}
-.t-icon-usb:before {
- content: '\E7A8';
-}
-.t-icon-user-1-filled:before {
- content: '\E7A9';
-}
-.t-icon-user-1:before {
- content: '\E7AA';
-}
-.t-icon-user-add-filled:before {
- content: '\E7AB';
-}
-.t-icon-user-add:before {
- content: '\E7AC';
-}
-.t-icon-user-arrow-down-filled:before {
- content: '\E7AD';
-}
-.t-icon-user-arrow-down:before {
- content: '\E7AE';
-}
-.t-icon-user-arrow-left-filled:before {
- content: '\E7AF';
-}
-.t-icon-user-arrow-left:before {
- content: '\E7B0';
-}
-.t-icon-user-arrow-right-filled:before {
- content: '\E7B1';
-}
-.t-icon-user-arrow-right:before {
- content: '\E7B2';
-}
-.t-icon-user-arrow-up-filled:before {
- content: '\E7B3';
-}
-.t-icon-user-arrow-up:before {
- content: '\E7B4';
-}
-.t-icon-user-avatar-filled:before {
- content: '\E7B5';
-}
-.t-icon-user-avatar:before {
- content: '\E7B6';
-}
-.t-icon-user-blocked-filled:before {
- content: '\E7B7';
-}
-.t-icon-user-blocked:before {
- content: '\E7B8';
-}
-.t-icon-user-business-filled:before {
- content: '\E7B9';
-}
-.t-icon-user-business:before {
- content: '\E7BA';
-}
-.t-icon-user-checked-1-filled:before {
- content: '\E7BB';
-}
-.t-icon-user-checked-1:before {
- content: '\E7BC';
-}
-.t-icon-user-checked-filled:before {
- content: '\E7BD';
-}
-.t-icon-user-checked:before {
- content: '\E7BE';
-}
-.t-icon-user-circle-filled:before {
- content: '\E7BF';
-}
-.t-icon-user-circle:before {
- content: '\E7C0';
-}
-.t-icon-user-clear-filled:before {
- content: '\E7C1';
-}
-.t-icon-user-clear:before {
- content: '\E7C2';
-}
-.t-icon-user-error-1-filled:before {
- content: '\E7C3';
-}
-.t-icon-user-error-1:before {
- content: '\E7C4';
-}
-.t-icon-user-filled:before {
- content: '\E7C5';
-}
-.t-icon-user-invisible-filled:before {
- content: '\E7C6';
-}
-.t-icon-user-invisible:before {
- content: '\E7C7';
-}
-.t-icon-user-list-filled:before {
- content: '\E7C8';
-}
-.t-icon-user-list:before {
- content: '\E7C9';
-}
-.t-icon-user-locked-filled:before {
- content: '\E7CA';
-}
-.t-icon-user-locked:before {
- content: '\E7CB';
-}
-.t-icon-user-marked-filled:before {
- content: '\E7CC';
-}
-.t-icon-user-marked:before {
- content: '\E7CD';
-}
-.t-icon-user-password-filled:before {
- content: '\E7CE';
-}
-.t-icon-user-password:before {
- content: '\E7CF';
-}
-.t-icon-user-safety-filled:before {
- content: '\E7D0';
-}
-.t-icon-user-safety:before {
- content: '\E7D1';
-}
-.t-icon-user-search-filled:before {
- content: '\E7D2';
-}
-.t-icon-user-search:before {
- content: '\E7D3';
-}
-.t-icon-user-setting-filled:before {
- content: '\E7D4';
-}
-.t-icon-user-setting:before {
- content: '\E7D5';
-}
-.t-icon-user-talk-1-filled:before {
- content: '\E7D6';
-}
-.t-icon-user-talk-1:before {
- content: '\E7D7';
-}
-.t-icon-user-talk-filled:before {
- content: '\E7D8';
-}
-.t-icon-user-talk-off-1-filled:before {
- content: '\E7D9';
-}
-.t-icon-user-talk-off-1:before {
- content: '\E7DA';
-}
-.t-icon-user-talk:before {
- content: '\E7DB';
-}
-.t-icon-user-time-filled:before {
- content: '\E7DC';
-}
-.t-icon-user-time:before {
- content: '\E7DD';
-}
-.t-icon-user-transmit-filled:before {
- content: '\E7DE';
-}
-.t-icon-user-transmit:before {
- content: '\E7DF';
-}
-.t-icon-user-unknown-filled:before {
- content: '\E7E0';
-}
-.t-icon-user-unknown:before {
- content: '\E7E1';
-}
-.t-icon-user-unlocked-filled:before {
- content: '\E7E2';
-}
-.t-icon-user-unlocked:before {
- content: '\E7E3';
-}
-.t-icon-user-vip-filled:before {
- content: '\E7E4';
-}
-.t-icon-user-vip:before {
- content: '\E7E5';
-}
-.t-icon-user-visible-filled:before {
- content: '\E7E6';
-}
-.t-icon-user-visible:before {
- content: '\E7E7';
-}
-.t-icon-user:before {
- content: '\E7E8';
-}
-.t-icon-usercase-filled:before {
- content: '\E7E9';
-}
-.t-icon-usercase-link-filled:before {
- content: '\E7EA';
-}
-.t-icon-usercase-link:before {
- content: '\E7EB';
-}
-.t-icon-usercase:before {
- content: '\E7EC';
-}
-.t-icon-usergroup-add-filled:before {
- content: '\E7ED';
-}
-.t-icon-usergroup-add:before {
- content: '\E7EE';
-}
-.t-icon-usergroup-clear-filled:before {
- content: '\E7EF';
-}
-.t-icon-usergroup-clear:before {
- content: '\E7F0';
-}
-.t-icon-usergroup-filled:before {
- content: '\E7F1';
-}
-.t-icon-usergroup:before {
- content: '\E7F2';
-}
-.t-icon-vehicle-filled:before {
- content: '\E7F3';
-}
-.t-icon-vehicle:before {
- content: '\E7F4';
-}
-.t-icon-verified-filled:before {
- content: '\E7F5';
-}
-.t-icon-verified:before {
- content: '\E7F6';
-}
-.t-icon-verify-filled:before {
- content: '\E7F7';
-}
-.t-icon-verify:before {
- content: '\E7F8';
-}
-.t-icon-vertical-filled:before {
- content: '\E7F9';
-}
-.t-icon-vertical:before {
- content: '\E7FA';
-}
-.t-icon-video-camera-1-filled:before {
- content: '\E7FB';
-}
-.t-icon-video-camera-1:before {
- content: '\E7FC';
-}
-.t-icon-video-camera-2-filled:before {
- content: '\E7FD';
-}
-.t-icon-video-camera-2:before {
- content: '\E7FE';
-}
-.t-icon-video-camera-3-filled:before {
- content: '\E7FF';
-}
-.t-icon-video-camera-3:before {
- content: '\E800';
-}
-.t-icon-video-camera-dollar-filled:before {
- content: '\E801';
-}
-.t-icon-video-camera-dollar:before {
- content: '\E802';
-}
-.t-icon-video-camera-filled:before {
- content: '\E803';
-}
-.t-icon-video-camera-minus-filled:before {
- content: '\E804';
-}
-.t-icon-video-camera-minus:before {
- content: '\E805';
-}
-.t-icon-video-camera-music-filled:before {
- content: '\E806';
-}
-.t-icon-video-camera-music:before {
- content: '\E807';
-}
-.t-icon-video-camera-off-filled:before {
- content: '\E808';
-}
-.t-icon-video-camera-off:before {
- content: '\E809';
-}
-.t-icon-video-camera:before {
- content: '\E80A';
-}
-.t-icon-video-filled:before {
- content: '\E80B';
-}
-.t-icon-video-library-filled:before {
- content: '\E80C';
-}
-.t-icon-video-library:before {
- content: '\E80D';
-}
-.t-icon-video:before {
- content: '\E80E';
-}
-.t-icon-view-agenda-filled:before {
- content: '\E80F';
-}
-.t-icon-view-agenda:before {
- content: '\E810';
-}
-.t-icon-view-column:before {
- content: '\E811';
-}
-.t-icon-view-in-ar-filled:before {
- content: '\E812';
-}
-.t-icon-view-in-ar:before {
- content: '\E813';
-}
-.t-icon-view-list:before {
- content: '\E814';
-}
-.t-icon-view-module-filled:before {
- content: '\E815';
-}
-.t-icon-view-module:before {
- content: '\E816';
-}
-.t-icon-visual-recognition-filled:before {
- content: '\E817';
-}
-.t-icon-visual-recognition:before {
- content: '\E818';
-}
-.t-icon-wallet-filled:before {
- content: '\E819';
-}
-.t-icon-wallet:before {
- content: '\E81A';
-}
-.t-icon-watch-filled:before {
- content: '\E81B';
-}
-.t-icon-watch:before {
- content: '\E81C';
-}
-.t-icon-watermelon-filled:before {
- content: '\E81D';
-}
-.t-icon-watermelon:before {
- content: '\E81E';
-}
-.t-icon-wave-bye-filled:before {
- content: '\E81F';
-}
-.t-icon-wave-bye:before {
- content: '\E820';
-}
-.t-icon-wave-left-filled:before {
- content: '\E821';
-}
-.t-icon-wave-left:before {
- content: '\E822';
-}
-.t-icon-wave-right-filled:before {
- content: '\E823';
-}
-.t-icon-wave-right:before {
- content: '\E824';
-}
-.t-icon-wealth-1-filled:before {
- content: '\E825';
-}
-.t-icon-wealth-1:before {
- content: '\E826';
-}
-.t-icon-wealth-filled:before {
- content: '\E827';
-}
-.t-icon-wealth:before {
- content: '\E828';
-}
-.t-icon-widget-filled:before {
- content: '\E829';
-}
-.t-icon-widget:before {
- content: '\E82A';
-}
-.t-icon-wifi-1-filled:before {
- content: '\E82B';
-}
-.t-icon-wifi-1:before {
- content: '\E82C';
-}
-.t-icon-wifi-off-1-filled:before {
- content: '\E82D';
-}
-.t-icon-wifi-off-1:before {
- content: '\E82E';
-}
-.t-icon-wifi-off:before {
- content: '\E82F';
-}
-.t-icon-wifi:before {
- content: '\E830';
-}
-.t-icon-window-1-filled:before {
- content: '\E831';
-}
-.t-icon-window-1:before {
- content: '\E832';
-}
-.t-icon-window-filled:before {
- content: '\E833';
-}
-.t-icon-window:before {
- content: '\E834';
-}
-.t-icon-windy-rain:before {
- content: '\E835';
-}
-.t-icon-windy:before {
- content: '\E836';
-}
-.t-icon-wink-filled:before {
- content: '\E837';
-}
-.t-icon-wink:before {
- content: '\E838';
-}
-.t-icon-work-filled:before {
- content: '\E839';
-}
-.t-icon-work-history-filled:before {
- content: '\E83A';
-}
-.t-icon-work-history:before {
- content: '\E83B';
-}
-.t-icon-work-off-filled:before {
- content: '\E83C';
-}
-.t-icon-work-off:before {
- content: '\E83D';
-}
-.t-icon-work:before {
- content: '\E83E';
-}
-.t-icon-wry-smile-filled:before {
- content: '\E83F';
-}
-.t-icon-wry-smile:before {
- content: '\E840';
-}
-.t-icon-zoom-in-filled:before {
- content: '\E841';
-}
-.t-icon-zoom-in:before {
- content: '\E842';
-}
-.t-icon-zoom-out-filled:before {
- content: '\E843';
-}
-.t-icon-zoom-out:before {
- content: '\E844';
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/props.d.ts
deleted file mode 100644
index a472c016..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdIconProps } from './type';
-declare const props: TdIconProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/props.js
deleted file mode 100644
index 4d0ffa25..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/props.js
+++ /dev/null
@@ -1,19 +0,0 @@
-const props = {
- color: {
- type: String,
- value: '',
- },
- name: {
- type: String,
- value: '',
- required: true,
- },
- prefix: {
- type: String,
- value: '',
- },
- size: {
- type: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/type.d.ts
deleted file mode 100644
index c92226c2..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/type.d.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-export interface TdIconProps {
- color?: {
- type: StringConstructor;
- value?: string;
- };
- name: {
- type: StringConstructor;
- value?: string;
- required?: boolean;
- };
- prefix?: {
- type: StringConstructor;
- value?: string;
- };
- size?: {
- type: null;
- value?: string | number;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/icon/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/README.en-US.md
deleted file mode 100644
index 46e7da93..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/README.en-US.md
+++ /dev/null
@@ -1,46 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Image Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-error | String / Slot | 'default' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-height | String / Number | - | \- | N
-lazy | Boolean | false | \- | N
-loading | String / Slot | 'default' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-mode | String | scaleToFill | options: scaleToFill/aspectFit/aspectFill/widthFix/heightFix/top/bottom/center/left/right/top left/top right/bottom left/bottom right | N
-shape | String | square | options: circle/round/square | N
-show-menu-by-longpress | Boolean | false | \- | N
-src | String | - | src attribute of `
`. image File can also be loaded | N
-t-id | String | - | `1.2.10`。image tag id | N
-webp | Boolean | false | \- | N
-width | String / Number | - | \- | N
-
-### Image Events
-
-name | params | description
--- | -- | --
-error | - | trigger on image load failed
-load | - | trigger on image loaded
-### Image External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-load | \-
-t-class-image | \-
-t-class-error | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-image-color | @font-gray-3 | -
---td-image-loading-bg-color | @bg-color-secondarycontainer | -
---td-image-loading-color | @font-gray-3 | -
---td-image-round-radius | @radius-default | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/README.md
deleted file mode 100644
index 55be345c..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
----
-title: Image 图片
-description: 用于展示效果,主要为上下左右居中裁切、拉伸、平铺等方式。
-spline: base
-isComponent: true
----
-
-


-
-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-image": "tdesign-miniprogram/image/image"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 裁切样式
-
-{{ base }}
-
-### 加载状态
-
-{{ status }}
-
-## 常见问题
-
-
-
- 本地图片无法正确引用?
- 👇
-
-
- 建议使用绝对路径,而不是相对路径。绝对路径以 app.json 所在位置为基准。
-
-
-
-## API
-
-### Image Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-error | String / Slot | 'default' | 加载失败时显示的内容。值为 `default` 则表示使用默认加载失败风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `error`;值为其他则表示普通文本内容,如“加载失败”。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-height | String / Number | - | 高度,默认单位为`px` | N
-lazy | Boolean | false | 是否开启图片懒加载 | N
-loading | String / Slot | 'default' | 加载态内容。值为 `default` 则表示使用默认加载中风格;值为其他则表示普通文本内容,如“加载中”。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-mode | String | scaleToFill | 图片裁剪、缩放的模式;[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/image.html)。可选项:scaleToFill/aspectFit/aspectFill/widthFix/heightFix/top/bottom/center/left/right/top left/top right/bottom left/bottom right | N
-shape | String | square | 图片圆角类型。可选项:circle/round/square | N
-show-menu-by-longpress | Boolean | false | 长按图片显示发送给朋友、收藏、保存图片、搜一搜、打开名片/前往群聊/打开小程序(若图片中包含对应二维码或小程序码)的菜单。 | N
-src | String | - | 图片链接 | N
-t-id | String | - | `1.2.10`。图片标签id | N
-webp | Boolean | false | 默认不解析 webP 格式,只支持网络资源 | N
-width | String / Number | - | 宽度,默认单位为`px` | N
-
-### Image Events
-
-名称 | 参数 | 描述
--- | -- | --
-error | - | 图片加载失败时触发
-load | - | 图片加载完成时触发
-### Image External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-load | 加载样式类
-t-class-image | 图片样式类
-t-class-error | 加载失败样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-image-color | @font-gray-3 | -
---td-image-loading-bg-color | @bg-color-secondarycontainer | -
---td-image-loading-color | @font-gray-3 | -
---td-image-round-radius | @radius-default | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image-info.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image-info.json
deleted file mode 100644
index 7157c4c7..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image-info.json
+++ /dev/null
@@ -1,75 +0,0 @@
-{
- "key": "Image",
- "label": "图片",
- "icon": "",
- "properties": [
- {
- "key": "error",
- "type": ["String", "TNode"],
- "defaultValue": "'default'",
- "desc": "加载失败时显示的内容。值为 `default` 则表示使用默认加载失败风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `error`;值为其他则表示普通文本内容,如“加载失败”",
- "label": ""
- },
- {
- "key": "externalClasses",
- "type": ["Array"],
- "defaultValue": "",
- "desc": "组件类名,分别用于设置加载组件外层元素,中间内容等元素类名",
- "label": ""
- },
- {
- "key": "lazy",
- "type": ["Boolean"],
- "defaultValue": "false",
- "desc": "是否开启图片懒加载",
- "label": ""
- },
- {
- "key": "loading",
- "type": ["String", "TNode"],
- "defaultValue": "'default'",
- "desc": "加载态内容。值为 `default` 则表示使用默认加载中风格;值为空或者 `slot` 表示使用插槽渲染,插槽名称为 `loading`;值为其他则表示普通文本内容,如“加载中”",
- "label": ""
- },
- {
- "key": "MP_EXCLUDE_PROPS",
- "type": ["String"],
- "defaultValue": "",
- "desc": "为避免重复或冲突,需要过滤掉的小程序原生属性",
- "label": ""
- },
- {
- "key": "MP_PROPS",
- "type": ["String"],
- "defaultValue": "",
- "desc": "[小程序原生属性](https://developers.weixin.qq.com/miniprogram/dev/component/image.html)",
- "label": ""
- },
- {
- "key": "shape",
- "type": ["String"],
- "defaultValue": "square",
- "desc": "图片圆角类型",
- "label": ""
- },
- {
- "key": "src",
- "type": ["String"],
- "defaultValue": "",
- "desc": "图片链接",
- "label": ""
- }
- ],
- "events": [
- {
- "key": "error",
- "desc": "图片加载失败时触发",
- "label": ""
- },
- {
- "key": "load",
- "desc": "图片加载完成时触发",
- "label": ""
- }
- ]
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.d.ts
deleted file mode 100644
index 36dc6353..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.d.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class Image extends SuperComponent {
- externalClasses: string[];
- options: {
- multipleSlots: boolean;
- };
- properties: import("./type").TdImageProps;
- data: {
- prefix: string;
- isLoading: boolean;
- isFailed: boolean;
- innerStyle: string;
- classPrefix: string;
- };
- preSrc: any;
- observers: {
- src(): void;
- 'width, height'(width: any, height: any): void;
- };
- methods: {
- onLoaded(e: any): void;
- onLoadError(e: any): void;
- calcSize(width: any, height: any): void;
- update(): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.js
deleted file mode 100644
index 61cf6fd2..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.js
+++ /dev/null
@@ -1,97 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import ImageProps from './props';
-import config from '../common/config';
-import { addUnit, getRect, appBaseInfo } from '../common/utils';
-import { compareVersion } from '../common/version';
-const { prefix } = config;
-const name = `${prefix}-image`;
-let Image = class Image extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-load`, `${prefix}-class-image`, `${prefix}-class-error`];
- this.options = {
- multipleSlots: true,
- };
- this.properties = ImageProps;
- this.data = {
- prefix,
- isLoading: true,
- isFailed: false,
- innerStyle: '',
- classPrefix: name,
- };
- this.preSrc = undefined;
- this.observers = {
- src() {
- if (this.preSrc === this.properties.src)
- return;
- this.update();
- },
- 'width, height'(width, height) {
- this.calcSize(width, height);
- },
- };
- this.methods = {
- onLoaded(e) {
- const sdkVersion = appBaseInfo.SDKVersion;
- const { mode, tId } = this.properties;
- const isInCompatible = compareVersion(sdkVersion, '2.10.3') < 0;
- if (mode === 'heightFix' && isInCompatible) {
- const { height: picHeight, width: picWidth } = e.detail;
- getRect(this, `#${tId || 'image'}`).then((rect) => {
- const { height } = rect;
- const resultWidth = ((height / picHeight) * picWidth).toFixed(2);
- this.setData({ innerStyle: `height: ${addUnit(height)}; width: ${resultWidth}px;` });
- });
- }
- this.setData({
- isLoading: false,
- isFailed: false,
- });
- this.triggerEvent('load', e.detail);
- },
- onLoadError(e) {
- this.setData({
- isLoading: false,
- isFailed: true,
- });
- this.triggerEvent('error', e.detail);
- },
- calcSize(width, height) {
- let innerStyle = '';
- if (width) {
- innerStyle += `width: ${addUnit(width)};`;
- }
- if (height) {
- innerStyle += `height: ${addUnit(height)};`;
- }
- this.setData({
- innerStyle,
- });
- },
- update() {
- const { src } = this.properties;
- this.preSrc = src;
- if (!src) {
- this.onLoadError({ errMsg: '图片链接为空' });
- }
- else {
- this.setData({
- isLoading: true,
- isFailed: false,
- });
- }
- },
- };
- }
-};
-Image = __decorate([
- wxComponent()
-], Image);
-export default Image;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.json
deleted file mode 100644
index 1c9137b6..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-loading": "../loading/loading",
- "t-icon": "../icon/icon"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.wxml
deleted file mode 100644
index be3b8506..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.wxml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
- {{loading}}
-
-
-
-
-
-
-
-
-
- {{error}}
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.wxss
deleted file mode 100644
index 7d550a0f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/image.wxss
+++ /dev/null
@@ -1,71 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-image {
- position: relative;
- display: inline-block;
-}
-.t-image__mask,
-.t-image__img {
- color: var(--td-image-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
- vertical-align: top;
- width: inherit;
- height: inherit;
-}
-.t-image__mask {
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: var(--td-image-loading-bg-color, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
- color: var(--td-image-loading-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
-}
-.t-image--loading-text {
- width: 0;
- height: 0;
-}
-.t-image__common {
- width: 100%;
- height: 100%;
-}
-.t-image--lazy {
- position: absolute;
- top: 0;
- left: 0;
- z-index: -1;
-}
-.t-image--shape-circle {
- border-radius: 50%;
- overflow: hidden;
-}
-.t-image--shape-round {
- border-radius: var(--td-image-round-radius, var(--td-radius-default, 12rpx));
- overflow: hidden;
-}
-.t-image--shape-square {
- border-radius: 0;
- overflow: hidden;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/index.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/index.d.ts
deleted file mode 100644
index 0f85c43d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { TdImageProps } from './type';
-export declare type ImageProps = TdImageProps;
-export * from './props';
-export * from './image';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/index.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/index.js
deleted file mode 100644
index 4fd39538..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './props';
-export * from './image';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/props.d.ts
deleted file mode 100644
index 0ab571bb..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdImageProps } from './type';
-declare const props: TdImageProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/props.js
deleted file mode 100644
index b2a17dac..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/props.js
+++ /dev/null
@@ -1,45 +0,0 @@
-const props = {
- error: {
- type: String,
- value: 'default',
- },
- height: {
- type: null,
- },
- lazy: {
- type: Boolean,
- value: false,
- },
- loading: {
- type: String,
- value: 'default',
- },
- mode: {
- type: String,
- value: 'scaleToFill',
- },
- shape: {
- type: String,
- value: 'square',
- },
- showMenuByLongpress: {
- type: Boolean,
- value: false,
- },
- src: {
- type: String,
- value: '',
- },
- tId: {
- type: String,
- value: '',
- },
- webp: {
- type: Boolean,
- value: false,
- },
- width: {
- type: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/type.d.ts
deleted file mode 100644
index 4279319d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/type.d.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-export interface TdImageProps {
- error?: {
- type: StringConstructor;
- value?: string;
- };
- height?: {
- type: null;
- value?: string | number;
- };
- lazy?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- loading?: {
- type: StringConstructor;
- value?: string;
- };
- mode?: {
- type: StringConstructor;
- value?: 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'center' | 'left' | 'right' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
- };
- shape?: {
- type: StringConstructor;
- value?: 'circle' | 'round' | 'square';
- };
- showMenuByLongpress?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- src?: {
- type: StringConstructor;
- value?: string;
- };
- tId?: {
- type: StringConstructor;
- value?: string;
- };
- webp?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- width?: {
- type: null;
- value?: string | number;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/image/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/image/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/index.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/index.d.ts
deleted file mode 100644
index 9af8cc5b..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export { default as ActionSheet, ActionSheetTheme } from './action-sheet/index';
-export { default as Dialog } from './dialog/index';
-export { default as Message } from './message/index';
-export { default as Toast } from './toast/index';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/index.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/index.js
deleted file mode 100644
index 9af8cc5b..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-export { default as ActionSheet, ActionSheetTheme } from './action-sheet/index';
-export { default as Dialog } from './dialog/index';
-export { default as Message } from './message/index';
-export { default as Toast } from './toast/index';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/README.en-US.md
deleted file mode 100644
index 9aa91378..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/README.en-US.md
+++ /dev/null
@@ -1,62 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Indexes Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-index-list | Array | - | `0.32.0`。Typescript:`string [] \| number[]` | N
-list | Array | [] | `deprecated`。Typescript:`ListItem[] ` `interface ListItem { title: string; index: string; children: { title: string; [key: string]: any} [] }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/indexes/type.ts) | N
-sticky | Boolean | true | Typescript:`Boolean` | N
-sticky-offset | Number | 0 | `1.0.0` | N
-
-### Indexes Events
-
-name | params | description
--- | -- | --
-change | `(index: string \| number)` | `0.34.0`
-select | `(index: string \| number)` | \-
-
-
-### IndexesAnchor Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-index | String / Number | - | \- | N
-### IndexesAnchor External Classes
-
-className | Description
--- | --
-t-class | class name of root node
-t-class-sidebar | \-
-t-class-sidebar-item | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-indexes-sidebar-active-bg-color | @brand-color | -
---td-indexes-sidebar-active-color | @font-white-1 | -
---td-indexes-sidebar-color | @font-gray-1 | -
---td-indexes-sidebar-font-size | 24rpx | -
---td-indexes-sidebar-item-size | 40rpx | -
---td-indexes-sidebar-line-height | 40rpx | -
---td-indexes-sidebar-right | 16rpx | -
---td-indexes-sidebar-tips-bg-color | @brand-color-light | -
---td-indexes-sidebar-tips-color | @brand-color | -
---td-indexes-sidebar-tips-font-size | 40rpx | -
---td-indexes-sidebar-tips-right | calc(100% + 32rpx) | -
---td-indexes-sidebar-tips-size | 96rpx | -
---td-indexes-anchor-active-bg-color | @bg-color-container | -
---td-indexes-anchor-active-color | @brand-color | -
---td-indexes-anchor-active-font-weight | 600 | -
---td-indexes-anchor-bg-color | @bg-color-secondarycontainer | -
---td-indexes-anchor-color | @font-gray-1 | -
---td-indexes-anchor-font-size | 28rpx | -
---td-indexes-anchor-line-height | 44rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/README.md
deleted file mode 100644
index 9ddfa1cf..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/README.md
+++ /dev/null
@@ -1,105 +0,0 @@
----
-title: Indexes 索引
-description: 用于页面中信息快速检索,可以根据目录中的页码快速找到所需的内容。
-spline: navigation
-isComponent: true
----
-
-


-
-
-
- IndexesAnchor 索引锚点组件于 0.32.0 版本上线,请留意版本。
-
-
-
-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-indexes": "tdesign-miniprogram/indexes/indexes",
- "t-indexes-anchor": "tdesign-miniprogram/indexes-anchor/indexes-anchor"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 基础索引
-
-
-{{ base }}
-
-### 自定义索引
-
-{{ custom }}
-
-### API
-
-### Indexes Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-index-list | Array | - | `0.32.0`。索引字符列表。不传默认 `A-Z`。TS 类型:`string [] \| number[]` | N
-list | Array | [] | 已废弃。索引列表的列表数据。每个元素包含三个子元素,index(string):索引值,例如1,2,3,...或A,B,C等;title(string): 索引标题,可不填将默认设为索引值;children(Array<{title: string}>): 子元素列表,title为子元素的展示文案。TS 类型:`ListItem[] ` `interface ListItem { title: string; index: string; children: { title: string; [key: string]: any} [] }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/indexes/type.ts) | N
-sticky | Boolean | true | 索引是否吸顶,默认为true。TS 类型:`Boolean` | N
-sticky-offset | Number | 0 | `1.0.0`。锚点吸顶时与顶部的距离 | N
-
-### Indexes Events
-
-名称 | 参数 | 描述
--- | -- | --
-change | `(index: string \| number)` | `0.34.0`。索引发生变更时触发事件
-select | `(index: string \| number)` | 点击侧边栏时触发事件
-
-
-### IndexesAnchor Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-index | String / Number | - | 索引字符 | N
-### IndexesAnchor External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-sidebar | 侧边栏样式类
-t-class-sidebar-item | 侧边栏选项样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-indexes-sidebar-active-bg-color | @brand-color | -
---td-indexes-sidebar-active-color | @font-white-1 | -
---td-indexes-sidebar-color | @font-gray-1 | -
---td-indexes-sidebar-font-size | 24rpx | -
---td-indexes-sidebar-item-size | 40rpx | -
---td-indexes-sidebar-line-height | 40rpx | -
---td-indexes-sidebar-right | 16rpx | -
---td-indexes-sidebar-tips-bg-color | @brand-color-light | -
---td-indexes-sidebar-tips-color | @brand-color | -
---td-indexes-sidebar-tips-font-size | 40rpx | -
---td-indexes-sidebar-tips-right | calc(100% + 32rpx) | -
---td-indexes-sidebar-tips-size | 96rpx | -
---td-indexes-anchor-active-bg-color | @bg-color-container | -
---td-indexes-anchor-active-color | @brand-color | -
---td-indexes-anchor-active-font-weight | 600 | -
---td-indexes-anchor-bg-color | @bg-color-secondarycontainer | -
---td-indexes-anchor-color | @font-gray-1 | -
---td-indexes-anchor-font-size | 28rpx | -
---td-indexes-anchor-line-height | 44rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.d.ts
deleted file mode 100644
index 0071d197..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.d.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { RelationsOptions, SuperComponent } from '../common/src/index';
-export default class Indexes extends SuperComponent {
- externalClasses: string[];
- properties: import("./type").TdIndexesProps;
- data: {
- prefix: string;
- classPrefix: string;
- _height: number;
- _indexList: any[];
- scrollTop: number;
- activeAnchor: any;
- showTips: boolean;
- };
- relations: RelationsOptions;
- behaviors: string[];
- timer: any;
- groupTop: any[];
- sidebar: any;
- currentTouchAnchor: any;
- observers: {
- indexList(v: any): void;
- height(v: any): void;
- };
- lifetimes: {
- ready(): void;
- };
- methods: {
- setHeight(height: string | number): void;
- setIndexList(list: any): void;
- getAllRect(): void;
- getAnchorsRect(): Promise;
- getSidebarRect(): void;
- toggleTips(flag: boolean): void;
- setAnchorByIndex(index: any): void;
- onClick(e: any): void;
- onTouchMove(e: any): void;
- onTouchCancel(): void;
- onTouchEnd(e: any): void;
- onAnchorTouch: (...args: any[]) => void;
- setAnchorOnScroll(scrollTop: number): void;
- onScroll({ scrollTop }: {
- scrollTop: any;
- }): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.js
deleted file mode 100644
index aad4eeb2..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.js
+++ /dev/null
@@ -1,236 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { getRect, throttle, systemInfo } from '../common/utils';
-import pageScrollMixin from '../mixins/page-scroll';
-const { prefix } = config;
-const name = `${prefix}-indexes`;
-let Indexes = class Indexes extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-sidebar`, `${prefix}-class-sidebar-item`];
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- _height: 0,
- _indexList: [],
- scrollTop: 0,
- activeAnchor: null,
- showTips: false,
- };
- this.relations = {
- '../indexes-anchor/indexes-anchor': {
- type: 'child',
- },
- };
- this.behaviors = [pageScrollMixin()];
- this.timer = null;
- this.groupTop = [];
- this.sidebar = null;
- this.currentTouchAnchor = null;
- this.observers = {
- indexList(v) {
- this.setIndexList(v);
- this.setHeight(this.data._height);
- },
- height(v) {
- this.setHeight(v);
- },
- };
- this.lifetimes = {
- ready() {
- this.timer = null;
- this.groupTop = [];
- this.sidebar = null;
- if (this.data._height === 0) {
- this.setHeight();
- }
- if (this.data.indexList === null) {
- this.setIndexList();
- }
- },
- };
- this.methods = {
- setHeight(height) {
- if (!height) {
- const { windowHeight } = systemInfo;
- height = windowHeight;
- }
- this.setData({
- _height: height,
- }, () => {
- this.getAllRect();
- });
- },
- setIndexList(list) {
- if (!list) {
- const start = 'A'.charCodeAt(0);
- const alphabet = [];
- for (let i = start, end = start + 26; i < end; i += 1) {
- alphabet.push(String.fromCharCode(i));
- }
- this.setData({ _indexList: alphabet });
- }
- else {
- this.setData({ _indexList: list });
- }
- },
- getAllRect() {
- this.getAnchorsRect().then(() => {
- this.groupTop.forEach((item, index) => {
- const next = this.groupTop[index + 1];
- item.totalHeight = ((next === null || next === void 0 ? void 0 : next.top) || Infinity) - item.top;
- });
- this.setAnchorOnScroll(0);
- });
- this.getSidebarRect();
- },
- getAnchorsRect() {
- return Promise.all(this.$children.map((child) => getRect(child, `.${name}-anchor`).then((rect) => {
- this.groupTop.push({
- height: rect.height,
- top: rect.top,
- anchor: child.data.index,
- });
- })));
- },
- getSidebarRect() {
- getRect(this, `#id-${name}__bar`).then((rect) => {
- const { top, height } = rect;
- const { length } = this.data._indexList;
- this.sidebar = {
- top,
- height,
- itemHeight: (height - (length - 1) * 2) / length,
- };
- });
- },
- toggleTips(flag) {
- if (!flag) {
- clearInterval(this.timer);
- this.timer = setTimeout(() => {
- this.setData({
- showTips: false,
- });
- }, 300);
- }
- else {
- this.setData({
- showTips: true,
- });
- }
- },
- setAnchorByIndex(index) {
- const { _indexList, stickyOffset } = this.data;
- const activeAnchor = _indexList[index];
- if (this.data.activeAnchor !== null && this.data.activeAnchor === activeAnchor)
- return;
- const target = this.groupTop.find((item) => item.anchor === activeAnchor);
- if (target) {
- this.currentTouchAnchor = activeAnchor;
- const scrollTop = target.top - stickyOffset;
- wx.pageScrollTo({
- scrollTop,
- duration: 0,
- });
- this.toggleTips(true);
- this.triggerEvent('select', { index: activeAnchor });
- this.setData({ activeAnchor });
- }
- },
- onClick(e) {
- const { index } = e.currentTarget.dataset;
- this.setAnchorByIndex(index);
- },
- onTouchMove(e) {
- this.onAnchorTouch(e);
- },
- onTouchCancel() {
- this.toggleTips(false);
- },
- onTouchEnd(e) {
- this.toggleTips(false);
- this.onAnchorTouch(e);
- },
- onAnchorTouch: throttle(function (e) {
- const getAnchorIndex = (clientY) => {
- const offsetY = clientY - this.sidebar.top;
- if (offsetY <= 0) {
- return 0;
- }
- if (offsetY > this.sidebar.height) {
- return this.data._indexList.length - 1;
- }
- return Math.floor(offsetY / this.sidebar.itemHeight);
- };
- const index = getAnchorIndex(e.changedTouches[0].clientY);
- this.setAnchorByIndex(index);
- }, 1000 / 30),
- setAnchorOnScroll(scrollTop) {
- if (!this.groupTop) {
- return;
- }
- const { sticky, stickyOffset, activeAnchor } = this.data;
- scrollTop += stickyOffset;
- const curIndex = this.groupTop.findIndex((group) => scrollTop >= group.top - group.height && scrollTop <= group.top + group.totalHeight - group.height);
- if (curIndex === -1)
- return;
- const curGroup = this.groupTop[curIndex];
- if (this.currentTouchAnchor !== null) {
- this.triggerEvent('change', { index: curGroup.anchor });
- this.currentTouchAnchor = null;
- }
- else if (activeAnchor !== curGroup.anchor) {
- this.triggerEvent('change', { index: curGroup.anchor });
- this.setData({ activeAnchor: curGroup.anchor });
- }
- if (sticky) {
- const offset = curGroup.top - scrollTop;
- const betwixt = offset < curGroup.height && offset > 0 && scrollTop > stickyOffset;
- this.$children.forEach((child, index) => {
- if (index === curIndex) {
- const sticky = scrollTop > stickyOffset;
- const anchorStyle = `transform: translate3d(0, ${betwixt ? offset : 0}px, 0); top: ${stickyOffset}px`;
- if (anchorStyle !== child.data.anchorStyle || sticky !== child.data.sticky) {
- child.setData({
- sticky,
- active: true,
- style: `height: ${curGroup.height}px`,
- anchorStyle,
- });
- }
- }
- else if (index + 1 === curIndex) {
- const anchorStyle = `transform: translate3d(0, ${betwixt ? offset - curGroup.height : 0}px, 0); top: ${stickyOffset}px`;
- if (anchorStyle !== child.data.anchorStyle) {
- child.setData({
- sticky: true,
- active: true,
- style: `height: ${curGroup.height}px`,
- anchorStyle,
- });
- }
- }
- else {
- child.setData({ active: false, sticky: false, anchorStyle: '' });
- }
- });
- }
- },
- onScroll({ scrollTop }) {
- this.setAnchorOnScroll(scrollTop);
- },
- };
- }
-};
-Indexes = __decorate([
- wxComponent()
-], Indexes);
-export default Indexes;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.json
deleted file mode 100644
index 4ae6508f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon",
- "t-cell": "../cell/cell",
- "t-cell-group": "../cell-group/cell-group"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.wxml
deleted file mode 100644
index 1784c213..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.wxml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.wxs b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.wxs
deleted file mode 100644
index e8bbe2b4..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.wxs
+++ /dev/null
@@ -1,7 +0,0 @@
-function getFirstCharacter(str) {
- return str.toString().substring(0, 1);
-}
-
-module.exports = {
- getFirstCharacter: getFirstCharacter,
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.wxss
deleted file mode 100644
index a723a735..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/indexes.wxss
+++ /dev/null
@@ -1,78 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-indexes {
- position: relative;
- height: 100vh;
-}
-.t-indexes__sidebar {
- position: fixed;
- right: var(--td-indexes-sidebar-right, 16rpx);
- width: var(--td-indexes-sidebar-item-size, 40rpx);
- color: var(--td-indexes-sidebar-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- font-size: var(--td-indexes-sidebar-font-size, 24rpx);
- line-height: var(--td-indexes-sidebar-line-height, 40rpx);
- display: flex;
- flex-flow: column nowrap;
- top: 50%;
- transform: translateY(-50%);
- z-index: 1;
-}
-.t-indexes__sidebar-item {
- border-radius: 50%;
- position: relative;
- text-align: center;
-}
-.t-indexes__sidebar-item--active {
- background-color: var(--td-indexes-sidebar-active-bg-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- color: var(--td-indexes-sidebar-active-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
-}
-.t-indexes__sidebar-item + .t-indexes__sidebar-item {
- margin-top: 4rpx;
-}
-.t-indexes__sidebar-tips {
- min-width: var(--td-indexes-sidebar-tips-size, 96rpx);
- max-width: 198rpx;
- padding: 0 32rpx;
- box-sizing: border-box;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- height: var(--td-indexes-sidebar-tips-size, 96rpx);
- line-height: var(--td-indexes-sidebar-tips-size, 96rpx);
- text-align: center;
- font-size: var(--td-indexes-sidebar-tips-font-size, 40rpx);
- font-weight: 700;
- color: var(--td-indexes-sidebar-tips-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- background-color: var(--td-indexes-sidebar-tips-bg-color, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
- border-radius: var(--td-indexes-sidebar-tips-size, 96rpx);
- position: absolute;
- top: 50%;
- bottom: 0;
- transform: translateY(-50%);
- right: var(--td-indexes-sidebar-tips-right, calc(100% + 32rpx));
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/props.d.ts
deleted file mode 100644
index a3e1619f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdIndexesProps } from './type';
-declare const props: TdIndexesProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/props.js
deleted file mode 100644
index 2ad93eec..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/props.js
+++ /dev/null
@@ -1,14 +0,0 @@
-const props = {
- indexList: {
- type: null,
- },
- sticky: {
- type: Boolean,
- value: true,
- },
- stickyOffset: {
- type: Number,
- value: 0,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/type.d.ts
deleted file mode 100644
index ecf02425..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/type.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-export interface TdIndexesProps {
- indexList?: {
- type: null;
- value?: string[] | number[];
- };
- sticky?: {
- type: BooleanConstructor;
- value?: Boolean;
- };
- stickyOffset?: {
- type: NumberConstructor;
- value?: number;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/indexes/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/README.en-US.md
deleted file mode 100644
index 10f987e9..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/README.en-US.md
+++ /dev/null
@@ -1,41 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Loading Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-delay | Number | 0 | \- | N
-duration | Number | 800 | \- | N
-fullscreen | Boolean | false | `1.8.5` | N
-indicator | Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-inherit-color | Boolean | false | \- | N
-layout | String | horizontal | options: horizontal/vertical | N
-loading | Boolean | true | \- | N
-pause | Boolean | false | \- | N
-progress | Number | - | \- | N
-reverse | Boolean | - | \- | N
-size | String | '20px' | \- | N
-text | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-theme | String | circular | options: circular/spinner/dots | N
-
-### Loading External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-indicator | \-
-t-class-text | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-loading-color | @brand-color | -
---td-loading-text-color | inherit | -
---td-loading-text-font-size | 24rpx | -
---td-loading-text-line-height | 40rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/README.md
deleted file mode 100644
index 13be6196..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/README.md
+++ /dev/null
@@ -1,97 +0,0 @@
----
-title: Loading 加载
-description: 用于表示页面或操作的加载状态,给予用户反馈的同时减缓等待的焦虑感,由一个或一组反馈动效组成。
-spline: message
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-loading": "tdesign-miniprogram/loading/loading"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 纯icon
-
-{{ base }}
-
-### icon加文字横向
-
-{{ horizontal }}
-
-### icon加文字竖向
-
-{{ vertical }}
-
-### 纯文字
-
-{{ text }}
-
-### 加载失败
-
-{{ error }}
-
-### 状态
-
-{{ status }}
-
-### 加载速度
-
-{{ duration }}
-
-### 规格
-
-{{ size }}
-
-## API
-
-### Loading Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-delay | Number | 0 | 延迟显示加载效果的时间,用于防止请求速度过快引起的加载闪烁,单位:毫秒 | N
-duration | Number | 800 | 加载动画执行完成一次的时间,单位:毫秒 | N
-fullscreen | Boolean | false | `1.8.5`。是否显示为全屏加载 | N
-indicator | Boolean / Slot | true | 加载指示符,值为 true 显示默认指示符,值为 false 则不显示,也可以自定义指示符。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-inherit-color | Boolean | false | 是否继承父元素颜色 | N
-layout | String | horizontal | 对齐方式。可选项:horizontal/vertical | N
-loading | Boolean | true | 是否处于加载状态 | N
-pause | Boolean | false | 是否暂停动画 | N
-progress | Number | - | 加载进度 | N
-reverse | Boolean | - | 加载动画是否反向 | N
-size | String | '20px' | 尺寸,示例:20px | N
-text | String / Slot | - | 加载提示文案。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-theme | String | circular | 加载组件类型。可选项:circular/spinner/dots,skyline 模式下暂不支持枚举值 circular | N
-
-### Loading External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-indicator | 指示符样式类
-t-class-text | 文本样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-loading-color | @brand-color | -
---td-loading-text-color | inherit | -
---td-loading-text-font-size | 24rpx | -
---td-loading-text-line-height | 40rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/index.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/index.d.ts
deleted file mode 100644
index 2806bd66..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './props';
-export * from './type';
-export * from './loading';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/index.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/index.js
deleted file mode 100644
index 2806bd66..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './props';
-export * from './type';
-export * from './loading';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.d.ts
deleted file mode 100644
index 4d2f2d41..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.d.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-import type { TdLoadingProps } from './type';
-export interface LoadingProps extends TdLoadingProps {
-}
-export default class Loading extends SuperComponent {
- externalClasses: string[];
- data: {
- prefix: string;
- classPrefix: string;
- show: boolean;
- };
- options: {
- multipleSlots: boolean;
- };
- properties: {
- delay?: {
- type: NumberConstructor;
- value?: number;
- };
- duration?: {
- type: NumberConstructor;
- value?: number;
- };
- fullscreen?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- indicator?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- inheritColor?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- layout?: {
- type: StringConstructor;
- value?: "horizontal" | "vertical";
- };
- loading?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- pause?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- progress?: {
- type: NumberConstructor;
- value?: number;
- };
- reverse?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- size?: {
- type: StringConstructor;
- value?: string;
- };
- text?: {
- type: StringConstructor;
- value?: string;
- };
- theme?: {
- type: StringConstructor;
- value?: "circular" | "spinner" | "dots";
- };
- };
- timer: any;
- observers: {
- loading(this: any, cur: any): void;
- };
- lifetimes: {
- detached(): void;
- };
- refreshPage(): void;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.js
deleted file mode 100644
index f59a423d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-loading`;
-let Loading = class Loading extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-text`, `${prefix}-class-indicator`];
- this.data = {
- prefix,
- classPrefix: name,
- show: true,
- };
- this.options = {
- multipleSlots: true,
- };
- this.properties = Object.assign({}, props);
- this.timer = null;
- this.observers = {
- loading(cur) {
- const { delay } = this.properties;
- if (this.timer) {
- clearTimeout(this.timer);
- }
- if (cur) {
- if (delay) {
- this.timer = setTimeout(() => {
- this.setData({ show: cur });
- this.timer = null;
- }, delay);
- }
- else {
- this.setData({ show: cur });
- }
- }
- else {
- this.setData({ show: cur });
- }
- },
- };
- this.lifetimes = {
- detached() {
- clearTimeout(this.timer);
- },
- };
- }
- refreshPage() {
- this.triggerEvent('reload');
- }
-};
-Loading = __decorate([
- wxComponent()
-], Loading);
-export default Loading;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.json
deleted file mode 100644
index 4f0a3f08..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {}
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.wxml
deleted file mode 100644
index 0557730e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.wxml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{text}}
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.wxss
deleted file mode 100644
index 160f9a63..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/loading.wxss
+++ /dev/null
@@ -1,232 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-loading {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- font-size: 24rpx;
-}
-.t-loading--fullscreen {
- position: fixed;
- display: flex;
- align-items: center;
- vertical-align: middle;
- justify-content: center;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: var(--td-loading-z-index, 3500);
- background-color: var(--td-loading-full-bg-color, rgba(255, 255, 255, 0.6));
-}
-.t-loading__spinner {
- position: relative;
- box-sizing: border-box;
- width: 100%;
- height: 100%;
- max-width: 100%;
- max-height: 100%;
- animation: rotate 0.8s linear infinite;
- color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-loading__spinner.reverse {
- animation-name: rotateReverse;
-}
-.t-loading__spinner--spinner {
- animation-timing-function: steps(12);
- color: var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
-}
-.t-loading__spinner--spinner .t-loading__dot {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
-}
-.t-loading__spinner--spinner .t-loading__dot::before {
- display: block;
- width: 5rpx;
- height: 25%;
- margin: 0 auto;
- background-color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- border-radius: 40%;
- content: ' ';
-}
-.t-loading__spinner--circular .t-loading__circular {
- border-radius: 100%;
- width: 100%;
- height: 100%;
- background: conic-gradient(from 180deg at 50% 50%, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, 0) 60deg, currentColor 330deg, rgba(255, 255, 255, 0) 360deg);
- mask: radial-gradient(transparent calc(50% - 1rpx), #fff 50%);
- /* stylelint-disable-next-line */
- -webkit-mask: radial-gradient(transparent calc(50% - 1rpx), #fff 50%);
-}
-.t-loading__spinner--dots {
- display: flex;
- justify-content: space-between;
- align-items: center;
- animation: none;
-}
-.t-loading__spinner--dots .t-loading__dot {
- width: 20%;
- height: 20%;
- border-radius: 50%;
- background-color: var(--td-loading-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- animation-duration: 1.8s;
- animation-name: dotting;
- animation-timing-function: linear;
- animation-iteration-count: infinite;
- animation-fill-mode: both;
-}
-.t-loading__text {
- color: var(--td-loading-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- font-size: var(--td-loading-text-font-size, 24rpx);
- line-height: var(--td-loading-text-line-height, 40rpx);
-}
-.t-loading__text--vertical:not(:first-child):not(:empty) {
- margin-top: 12rpx;
-}
-.t-loading__text--horizontal:not(:first-child):not(:empty) {
- margin-left: 16rpx;
-}
-.t-loading--vertical {
- flex-direction: column;
-}
-.t-loading--horizontal {
- flex-direction: row;
- vertical-align: top;
-}
-@keyframes t-bar {
- 0% {
- width: 0;
- }
- 50% {
- width: 70%;
- }
- 100% {
- width: 80%;
- }
-}
-@keyframes t-bar-loaded {
- 0% {
- height: 6rpx;
- opacity: 1;
- width: 90%;
- }
- 50% {
- height: 6rpx;
- opacity: 1;
- width: 100%;
- }
- 100% {
- height: 0;
- opacity: 0;
- width: 100%;
- }
-}
-.t-loading__dot-1 {
- transform: rotate(30deg);
- opacity: 0;
-}
-.t-loading__dot-2 {
- transform: rotate(60deg);
- opacity: 0.08333333;
-}
-.t-loading__dot-3 {
- transform: rotate(90deg);
- opacity: 0.16666667;
-}
-.t-loading__dot-4 {
- transform: rotate(120deg);
- opacity: 0.25;
-}
-.t-loading__dot-5 {
- transform: rotate(150deg);
- opacity: 0.33333333;
-}
-.t-loading__dot-6 {
- transform: rotate(180deg);
- opacity: 0.41666667;
-}
-.t-loading__dot-7 {
- transform: rotate(210deg);
- opacity: 0.5;
-}
-.t-loading__dot-8 {
- transform: rotate(240deg);
- opacity: 0.58333333;
-}
-.t-loading__dot-9 {
- transform: rotate(270deg);
- opacity: 0.66666667;
-}
-.t-loading__dot-10 {
- transform: rotate(300deg);
- opacity: 0.75;
-}
-.t-loading__dot-11 {
- transform: rotate(330deg);
- opacity: 0.83333333;
-}
-.t-loading__dot-12 {
- transform: rotate(360deg);
- opacity: 0.91666667;
-}
-@keyframes rotate {
- from {
- transform: rotate(0deg);
- }
- to {
- transform: rotate(360deg);
- }
-}
-@keyframes rotateReverse {
- from {
- transform: rotate(360deg);
- }
- to {
- transform: rotate(0deg);
- }
-}
-@keyframes dotting {
- 0% {
- opacity: 0.15;
- }
- 1% {
- opacity: 0.8;
- }
- 33% {
- opacity: 0.8;
- }
- 34% {
- opacity: 0.15;
- }
- 100% {
- opacity: 0.15;
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/props.d.ts
deleted file mode 100644
index a05a6598..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdLoadingProps } from './type';
-declare const props: TdLoadingProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/props.js
deleted file mode 100644
index 15579d40..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/props.js
+++ /dev/null
@@ -1,52 +0,0 @@
-const props = {
- delay: {
- type: Number,
- value: 0,
- },
- duration: {
- type: Number,
- value: 800,
- },
- fullscreen: {
- type: Boolean,
- value: false,
- },
- indicator: {
- type: Boolean,
- value: true,
- },
- inheritColor: {
- type: Boolean,
- value: false,
- },
- layout: {
- type: String,
- value: 'horizontal',
- },
- loading: {
- type: Boolean,
- value: true,
- },
- pause: {
- type: Boolean,
- value: false,
- },
- progress: {
- type: Number,
- },
- reverse: {
- type: Boolean,
- },
- size: {
- type: String,
- value: '20px',
- },
- text: {
- type: String,
- },
- theme: {
- type: String,
- value: 'circular',
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/type.d.ts
deleted file mode 100644
index 1f9de06d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/type.d.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-export interface TdLoadingProps {
- delay?: {
- type: NumberConstructor;
- value?: number;
- };
- duration?: {
- type: NumberConstructor;
- value?: number;
- };
- fullscreen?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- indicator?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- inheritColor?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- layout?: {
- type: StringConstructor;
- value?: 'horizontal' | 'vertical';
- };
- loading?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- pause?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- progress?: {
- type: NumberConstructor;
- value?: number;
- };
- reverse?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- size?: {
- type: StringConstructor;
- value?: string;
- };
- text?: {
- type: StringConstructor;
- value?: string;
- };
- theme?: {
- type: StringConstructor;
- value?: 'circular' | 'spinner' | 'dots';
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/loading/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/page-scroll.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/page-scroll.d.ts
deleted file mode 100644
index 0e9cf2dc..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/page-scroll.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _default: (funcName?: string) => string;
-export default _default;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/page-scroll.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/page-scroll.js
deleted file mode 100644
index 1d0dcba8..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/page-scroll.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import { getCurrentPage } from '../common/utils';
-const onPageScroll = function (event) {
- const page = getCurrentPage();
- if (!page)
- return;
- const { pageScroller } = page;
- pageScroller === null || pageScroller === void 0 ? void 0 : pageScroller.forEach((scroller) => {
- if (typeof scroller === 'function') {
- scroller(event);
- }
- });
-};
-export default (funcName = 'onScroll') => {
- return Behavior({
- attached() {
- var _a;
- const page = getCurrentPage();
- if (!page)
- return;
- const bindScroller = (_a = this[funcName]) === null || _a === void 0 ? void 0 : _a.bind(this);
- if (bindScroller) {
- this._pageScroller = bindScroller;
- }
- if (Array.isArray(page.pageScroller)) {
- page.pageScroller.push(bindScroller);
- }
- else {
- page.pageScroller =
- typeof page.onPageScroll === 'function' ? [page.onPageScroll.bind(page), bindScroller] : [bindScroller];
- }
- page.onPageScroll = onPageScroll;
- },
- detached() {
- var _a;
- const page = getCurrentPage();
- if (!page)
- return;
- page.pageScroller = ((_a = page.pageScroller) === null || _a === void 0 ? void 0 : _a.filter((item) => item !== this._pageScroller)) || [];
- },
- });
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/theme-change.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/theme-change.d.ts
deleted file mode 100644
index 4821f377..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/theme-change.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const themeChangeBehavior: string;
-export default themeChangeBehavior;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/theme-change.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/theme-change.js
deleted file mode 100644
index 70e44edf..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/theme-change.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import { appBaseInfo } from '../common/utils';
-const themeChangeBehavior = Behavior({
- data: {
- theme: 'light',
- },
- attached() {
- this._initTheme();
- },
- methods: {
- _initTheme() {
- const that = this;
- that.setData({
- theme: appBaseInfo.theme,
- });
- wx.onThemeChange((res) => {
- that.setData({
- theme: res.theme,
- });
- });
- },
- },
-});
-export default themeChangeBehavior;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/touch.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/touch.d.ts
deleted file mode 100644
index ae80ecad..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/touch.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const _default: string;
-export default _default;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/touch.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/touch.js
deleted file mode 100644
index cbabccc0..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/touch.js
+++ /dev/null
@@ -1,35 +0,0 @@
-const MinDistance = 10;
-const getDirection = (x, y) => {
- if (x > y && x > MinDistance) {
- return 'horizontal';
- }
- if (y > x && y > MinDistance) {
- return 'vertical';
- }
- return '';
-};
-export default Behavior({
- methods: {
- resetTouchStatus() {
- this.direction = '';
- this.deltaX = 0;
- this.deltaY = 0;
- this.offsetX = 0;
- this.offsetY = 0;
- },
- touchStart(event) {
- this.resetTouchStatus();
- const [touch] = event.touches;
- this.startX = touch.clientX;
- this.startY = touch.clientY;
- },
- touchMove(event) {
- const [touch] = event.touches;
- this.deltaX = touch.clientX - this.startX;
- this.deltaY = touch.clientY - this.startY;
- this.offsetX = Math.abs(this.deltaX);
- this.offsetY = Math.abs(this.deltaY);
- this.direction = getDirection(this.offsetX, this.offsetY);
- },
- },
-});
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/transition.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/transition.d.ts
deleted file mode 100644
index 8c23e357..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/transition.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-export default function transition(): string;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/transition.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/transition.js
deleted file mode 100644
index ee5215ae..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/transition.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import config from '../common/config';
-const { prefix } = config;
-export default function transition() {
- return Behavior({
- properties: {
- visible: {
- type: Boolean,
- value: null,
- observer: 'watchVisible',
- },
- appear: Boolean,
- name: {
- type: String,
- value: 'fade',
- },
- durations: {
- type: Number,
- optionalTypes: [Array],
- },
- },
- data: {
- transitionClass: '',
- transitionDurations: 300,
- className: '',
- realVisible: false,
- },
- created() {
- this.status = '';
- this.transitionT = 0;
- },
- attached() {
- this.durations = this.getDurations();
- if (this.data.visible) {
- this.enter();
- }
- this.inited = true;
- },
- detached() {
- clearTimeout(this.transitionT);
- },
- methods: {
- watchVisible(curr, prev) {
- if (this.inited && curr !== prev) {
- curr ? this.enter() : this.leave();
- }
- },
- getDurations() {
- const { durations } = this.data;
- if (Array.isArray(durations)) {
- return durations.map((item) => Number(item));
- }
- return [Number(durations), Number(durations)];
- },
- enter() {
- const { name } = this.data;
- const [duration] = this.durations;
- this.status = 'entering';
- this.setData({
- realVisible: true,
- transitionClass: `${prefix}-${name}-enter ${prefix}-${name}-enter-active`,
- });
- setTimeout(() => {
- this.setData({
- transitionClass: `${prefix}-${name}-enter-active ${prefix}-${name}-enter-to`,
- });
- }, 30);
- if (typeof duration === 'number' && duration > 0) {
- this.transitionT = setTimeout(this.entered.bind(this), duration + 30);
- }
- },
- entered() {
- this.customDuration = false;
- clearTimeout(this.transitionT);
- this.status = 'entered';
- this.setData({
- transitionClass: '',
- });
- },
- leave() {
- const { name } = this.data;
- const [, duration] = this.durations;
- this.status = 'leaving';
- this.setData({
- transitionClass: `${prefix}-${name}-leave ${prefix}-${name}-leave-active`,
- });
- clearTimeout(this.transitionT);
- setTimeout(() => {
- this.setData({
- transitionClass: `${prefix}-${name}-leave-active ${prefix}-${name}-leave-to`,
- });
- }, 30);
- if (typeof duration === 'number' && duration > 0) {
- this.customDuration = true;
- this.transitionT = setTimeout(this.leaved.bind(this), duration + 30);
- }
- },
- leaved() {
- this.customDuration = false;
- this.triggerEvent('leaved');
- clearTimeout(this.transitionT);
- this.status = 'leaved';
- this.setData({
- transitionClass: '',
- });
- },
- onTransitionEnd() {
- if (this.customDuration) {
- return;
- }
- clearTimeout(this.transitionT);
- if (this.status === 'entering' && this.data.visible) {
- this.entered();
- }
- else if (this.status === 'leaving' && !this.data.visible) {
- this.leaved();
- this.setData({
- realVisible: false,
- });
- }
- },
- },
- });
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/using-custom-navbar.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/using-custom-navbar.d.ts
deleted file mode 100644
index 908f7711..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/using-custom-navbar.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-declare const useCustomNavbarBehavior: string;
-export default useCustomNavbarBehavior;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/using-custom-navbar.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/using-custom-navbar.js
deleted file mode 100644
index e9bf8e3c..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/mixins/using-custom-navbar.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import { systemInfo } from '../common/utils';
-const useCustomNavbarBehavior = Behavior({
- properties: {
- usingCustomNavbar: {
- type: Boolean,
- value: false,
- },
- customNavbarHeight: {
- type: Number,
- value: 0,
- },
- },
- data: {
- distanceTop: 0,
- },
- lifetimes: {
- attached() {
- if (this.properties.usingCustomNavbar) {
- this.calculateCustomNavbarDistanceTop();
- }
- },
- },
- methods: {
- calculateCustomNavbarDistanceTop() {
- const { statusBarHeight } = systemInfo;
- const menuButton = wx.getMenuButtonBoundingClientRect();
- const distance = menuButton.top + menuButton.bottom - statusBarHeight;
- this.setData({
- distanceTop: Math.max(distance, this.properties.customNavbarHeight + statusBarHeight),
- });
- },
- },
-});
-export default useCustomNavbarBehavior;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/README.en-US.md
deleted file mode 100644
index 500cdbbb..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/README.en-US.md
+++ /dev/null
@@ -1,56 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Navbar Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-animation | Boolean | true | \- | N
-capsule | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-delta | Number | 1 | \- | N
-fixed | Boolean | true | \- | N
-left | Slot | - | `0.26.0`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-left-arrow | Boolean | false | `0.26.0` | N
-title | String / Slot | - | page title。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-title-max-length | Number | - | \- | N
-visible | Boolean | true | \- | N
-
-### Navbar Events
-
-name | params | description
--- | -- | --
-complete | \- | \-
-fail | \- | \-
-go-back | \- | \-
-success | \- | \-
-### Navbar External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-capsule | \-
-t-class-center | \-
-t-class-home-icon | \-
-t-class-left | \-
-t-class-left-icon | \-
-t-class-nav-btn | \-
-t-class-title | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-navbar-bg-color | @bg-color-container | -
---td-navbar-capsule-border-color | #e3e6ea | -
---td-navbar-capsule-border-radius | 32rpx | -
---td-navbar-capsule-height | 64rpx | -
---td-navbar-capsule-width | 176rpx | -
---td-navbar-color | @font-gray-1 | -
---td-navbar-height | 96rpx | -
---td-navbar-left-arrow-size | 48rpx | -
---td-navbar-title-font-size | 36rpx | -
---td-navbar-title-font-weight | 600 | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/README.md
deleted file mode 100644
index ccfad352..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/README.md
+++ /dev/null
@@ -1,105 +0,0 @@
----
-title: Navbar 导航栏
-description: 用于不同页面之间切换或者跳转,位于内容区的上方,系统状态栏的下方。
-spline: navigation
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-navbar": "tdesign-miniprogram/navbar/navbar",
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-
-### 基础导航栏
-
-{{ base }}
-
-### 胶囊样式导航栏
-
-{{ back-home }}
-
-### 带搜索导航栏
-
-{{ search }}
-
-### 带图片导航栏
-
-{{ img }}
-
-### 组件样式
-
-{{ left-title }}
-
-### 自定义颜色
-
-{{ custom-color }}
-
-## API
-
-### Navbar Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-animation | Boolean | true | 是否添加动画效果 | N
-capsule | Slot | - | 左侧胶囊区域。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-delta | Number | 1 | 后退按钮后退层数,含义参考 [wx.navigateBack](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html),特殊的,传入 0 不会发生执行 wx.navigateBack | N
-fixed | Boolean | true | 是否固定在顶部 | N
-left | Slot | - | `0.26.0`。左侧内容区域。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-left-arrow | Boolean | false | `0.26.0`。是否展示左侧箭头 | N
-title | String / Slot | - | 页面标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-title-max-length | Number | - | 标题文字最大长度,超出的范围使用 `...` 表示 | N
-visible | Boolean | true | 是否显示 | N
-
-### Navbar Events
-
-名称 | 参数 | 描述
--- | -- | --
-complete | \- | navigateBack 执行完成后触发(失败或成功均会触发)
-fail | \- | navigateBack 执行失败后触发
-go-back | \- | 点击左侧箭头时触发
-success | \- | navigateBack 执行成功后触发
-### Navbar External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-capsule | 左侧胶囊区域样式类
-t-class-center | 中间内容样式类
-t-class-home-icon | 首页图标样式类
-t-class-left | 左侧内容样式类
-t-class-left-icon | 左侧图标样式类
-t-class-nav-btn | 导航按钮样式类
-t-class-title | 标题样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-navbar-bg-color | @bg-color-container | -
---td-navbar-capsule-border-color | #e3e6ea | -
---td-navbar-capsule-border-radius | 32rpx | -
---td-navbar-capsule-height | 64rpx | -
---td-navbar-capsule-width | 176rpx | -
---td-navbar-color | @font-gray-1 | -
---td-navbar-height | 96rpx | -
---td-navbar-left-arrow-size | 48rpx | -
---td-navbar-title-font-size | 36rpx | -
---td-navbar-title-font-weight | 600 | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.d.ts
deleted file mode 100644
index a53dce9e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.d.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class Navbar extends SuperComponent {
- externalClasses: string[];
- timer: any;
- options: {
- multipleSlots: boolean;
- };
- properties: import("./type").TdNavbarProps;
- observers: {
- visible(this: Navbar, visible: any): void;
- 'title,titleMaxLength'(this: any): void;
- };
- data: {
- prefix: string;
- classPrefix: string;
- boxStyle: string;
- showTitle: string;
- hideLeft: boolean;
- hideCenter: boolean;
- _menuRect: any;
- _leftRect: any;
- _boxStyle: {};
- };
- attached(): void;
- detached(): void;
- methods: {
- initStyle(): void;
- calcCenterStyle(leftRect: WechatMiniprogram.BoundingClientRectResult, menuRect: WechatMiniprogram.BoundingClientRectResult, defaultStyle: object): void;
- getLeftRect(): void;
- getMenuRect(): void;
- onMenuButtonBoundingClientRectWeightChange(): void;
- offMenuButtonBoundingClientRectWeightChange(): void;
- queryElements(capsuleRect: any): void;
- goBack(): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.js
deleted file mode 100644
index 4d54b117..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.js
+++ /dev/null
@@ -1,186 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import { getRect, systemInfo } from '../common/utils';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-navbar`;
-let Navbar = class Navbar extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [
- `${prefix}-class`,
- `${prefix}-class-placeholder`,
- `${prefix}-class-content`,
- `${prefix}-class-title`,
- `${prefix}-class-left`,
- `${prefix}-class-center`,
- `${prefix}-class-left-icon`,
- `${prefix}-class-home-icon`,
- `${prefix}-class-capsule`,
- `${prefix}-class-nav-btn`,
- ];
- this.timer = null;
- this.options = {
- multipleSlots: true,
- };
- this.properties = props;
- this.observers = {
- visible(visible) {
- const { animation } = this.properties;
- const visibleClass = `${name}${visible ? '--visible' : '--hide'}`;
- this.setData({
- visibleClass: `${visibleClass}${animation ? '-animation' : ''}`,
- });
- if (this.timer) {
- clearTimeout(this.timer);
- }
- if (animation) {
- this.timer = setTimeout(() => {
- this.setData({
- visibleClass,
- });
- }, 300);
- }
- },
- 'title,titleMaxLength'() {
- const { title } = this.properties;
- const titleMaxLength = this.properties.titleMaxLength || Number.MAX_SAFE_INTEGER;
- let temp = title.slice(0, titleMaxLength);
- if (titleMaxLength < title.length)
- temp += '...';
- this.setData({
- showTitle: temp,
- });
- },
- };
- this.data = {
- prefix,
- classPrefix: name,
- boxStyle: '',
- showTitle: '',
- hideLeft: false,
- hideCenter: false,
- _menuRect: null,
- _leftRect: null,
- _boxStyle: {},
- };
- this.methods = {
- initStyle() {
- this.getMenuRect();
- const { _menuRect, _leftRect } = this.data;
- if (!_menuRect || !_leftRect || !systemInfo)
- return;
- const _boxStyle = {
- '--td-navbar-padding-top': `${systemInfo.statusBarHeight}px`,
- '--td-navbar-right': `${systemInfo.windowWidth - _menuRect.left}px`,
- '--td-navbar-left-max-width': `${_menuRect.left}px`,
- '--td-navbar-capsule-height': `${_menuRect.height}px`,
- '--td-navbar-capsule-width': `${_menuRect.width}px`,
- '--td-navbar-height': `${(_menuRect.top - systemInfo.statusBarHeight) * 2 + _menuRect.height}px`,
- };
- this.calcCenterStyle(_leftRect, _menuRect, _boxStyle);
- },
- calcCenterStyle(leftRect, menuRect, defaultStyle) {
- const maxSpacing = Math.max(leftRect.right, systemInfo.windowWidth - menuRect.left);
- const _boxStyle = Object.assign(Object.assign({}, defaultStyle), { '--td-navbar-center-left': `${maxSpacing}px`, '--td-navbar-center-width': `${Math.max(menuRect.left - maxSpacing, 0)}px` });
- const boxStyle = Object.entries(_boxStyle)
- .map(([k, v]) => `${k}: ${v}`)
- .join('; ');
- this.setData({
- boxStyle,
- _boxStyle,
- });
- },
- getLeftRect() {
- getRect(this, `.${name}__left`).then((res) => {
- if (res.right > this.data._leftRect.right) {
- this.calcCenterStyle(res, this.data._menuRect, this.data._boxStyle);
- }
- });
- },
- getMenuRect() {
- if (wx.getMenuButtonBoundingClientRect) {
- const rect = wx.getMenuButtonBoundingClientRect();
- this.setData({
- _menuRect: rect,
- _leftRect: {
- right: systemInfo.windowWidth - rect.left,
- },
- });
- }
- },
- onMenuButtonBoundingClientRectWeightChange() {
- if (wx.onMenuButtonBoundingClientRectWeightChange) {
- wx.onMenuButtonBoundingClientRectWeightChange((res) => this.queryElements(res));
- }
- },
- offMenuButtonBoundingClientRectWeightChange() {
- if (wx.offMenuButtonBoundingClientRectWeightChange) {
- wx.offMenuButtonBoundingClientRectWeightChange((res) => this.queryElements(res));
- }
- },
- queryElements(capsuleRect) {
- Promise.all([
- getRect(this, `.${this.data.classPrefix}__left`),
- getRect(this, `.${this.data.classPrefix}__center`),
- ]).then(([leftRect, centerRect]) => {
- if (Math.round(leftRect.right) > capsuleRect.left) {
- this.setData({
- hideLeft: true,
- hideCenter: true,
- });
- }
- else if (Math.round(centerRect.right) > capsuleRect.left) {
- this.setData({
- hideLeft: false,
- hideCenter: true,
- });
- }
- else {
- this.setData({
- hideLeft: false,
- hideCenter: false,
- });
- }
- });
- },
- goBack() {
- const { delta } = this.data;
- const that = this;
- this.triggerEvent('go-back');
- if (delta > 0) {
- wx.navigateBack({
- delta,
- fail(e) {
- that.triggerEvent('fail', e);
- },
- complete(e) {
- that.triggerEvent('complete', e);
- },
- success(e) {
- that.triggerEvent('success', e);
- },
- });
- }
- },
- };
- }
- attached() {
- this.initStyle();
- this.getLeftRect();
- this.onMenuButtonBoundingClientRectWeightChange();
- }
- detached() {
- this.offMenuButtonBoundingClientRectWeightChange();
- }
-};
-Navbar = __decorate([
- wxComponent()
-], Navbar);
-export default Navbar;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.json
deleted file mode 100644
index f783dae7..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.wxml
deleted file mode 100644
index 3ed1f16c..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.wxml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{showTitle}}
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.wxss
deleted file mode 100644
index a2a93cb8..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/navbar.wxss
+++ /dev/null
@@ -1,136 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-navbar--fixed .t-navbar__content {
- position: fixed;
- top: 0;
- left: 0;
- z-index: 5001;
-}
-.t-navbar--visible {
- display: '';
-}
-.t-navbar--visible-animation {
- opacity: 1;
- transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
-}
-.t-navbar--hide-animation {
- opacity: 0;
- transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
-}
-.t-navbar--hide {
- display: none;
-}
-.t-navbar__placeholder {
- height: var(--td-navbar-height, 48px);
- padding-top: var(--td-navbar-padding-top, 20px);
- position: relative;
- visibility: hidden;
- box-sizing: content-box;
-}
-.t-navbar__content {
- position: relative;
- z-index: 1;
- height: var(--td-navbar-height, 48px);
- width: calc(100% - var(--td-navbar-right, 95px));
- padding-right: var(--td-navbar-right, 95px);
- padding-top: var(--td-navbar-padding-top, 20px);
- color: var(--td-navbar-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- background-color: var(--td-navbar-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
- display: flex;
- align-items: center;
- box-sizing: content-box;
-}
-.t-navbar__left {
- position: relative;
- box-sizing: border-box;
- max-width: var(--td-navbar-left-max-width);
- overflow: hidden;
- display: flex;
- align-items: center;
- margin-left: var(--td-spacer-1, 24rpx);
- transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
-}
-.t-navbar__left-arrow {
- font-size: var(--td-navbar-left-arrow-size, 24px);
-}
-.t-navbar__left--hide {
- opacity: 0;
-}
-.t-navbar__capsule {
- box-sizing: border-box;
- width: var(--td-navbar-capsule-width, 88px);
- height: var(--td-navbar-capsule-height, 32px);
- display: flex;
- align-items: center;
-}
-.t-navbar__capsule::before {
- content: '';
- position: absolute;
- z-index: -1;
- top: 0;
- left: 0;
- width: 200%;
- height: 200%;
- transform: scale(0.5);
- transform-origin: 0 0;
- box-sizing: border-box;
- border-radius: calc(var(--td-navbar-capsule-border-radius, 16px) * 2);
- border: 2rpx solid var(--td-navbar-capsule-border-color, var(--td-border-level-1-color, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-navbar__capsule:empty {
- display: none;
-}
-.t-navbar__center {
- font-size: 18px;
- text-align: center;
- position: absolute;
- bottom: 0;
- left: var(--td-navbar-center-left, var(--td-navbar-right, 95px));
- width: var(--td-navbar-center-width);
- height: var(--td-navbar-height, 48px);
- line-height: var(--td-navbar-height, 48px);
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- overflow: hidden;
- transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
-}
-.t-navbar__center:empty {
- display: none;
-}
-.t-navbar__center-title {
- font-size: var(--td-navbar-title-font-size, 18px);
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- font-weight: var(--td-navbar-title-font-weight, 600);
-}
-.t-navbar__center--hide {
- opacity: 0;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/props.d.ts
deleted file mode 100644
index 168bee24..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdNavbarProps } from './type';
-declare const props: TdNavbarProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/props.js
deleted file mode 100644
index 3906316e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/props.js
+++ /dev/null
@@ -1,29 +0,0 @@
-const props = {
- animation: {
- type: Boolean,
- value: true,
- },
- delta: {
- type: Number,
- value: 1,
- },
- fixed: {
- type: Boolean,
- value: true,
- },
- leftArrow: {
- type: Boolean,
- value: false,
- },
- title: {
- type: String,
- },
- titleMaxLength: {
- type: Number,
- },
- visible: {
- type: Boolean,
- value: true,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/type.d.ts
deleted file mode 100644
index 11a4e772..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/type.d.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-export interface TdNavbarProps {
- animation?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- delta?: {
- type: NumberConstructor;
- value?: number;
- };
- fixed?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- leftArrow?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- title?: {
- type: StringConstructor;
- value?: string;
- };
- titleMaxLength?: {
- type: NumberConstructor;
- value?: number;
- };
- visible?: {
- type: BooleanConstructor;
- value?: boolean;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/navbar/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/README.en-US.md
deleted file mode 100644
index f9d303bf..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/README.en-US.md
+++ /dev/null
@@ -1,43 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Progress Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-color | String / Object / Array | '' | Typescript:`string \| Array \| Record` | N
-label | String / Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-percentage | Number | 0 | \- | N
-status | String | - | options: success/error/warning/active。Typescript:`ProgressStatus` `type ProgressStatus = 'success' \| 'error' \| 'warning' \| 'active'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
-stroke-width | String / Number | - | \- | N
-theme | String | line | options: line/plump/circle。Typescript:`ProgressTheme` `type ProgressTheme = 'line' \| 'plump' \| 'circle'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
-track-color | String | '' | \- | N
-
-### Progress External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-bar | \-
-t-class-label | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-
-Name | Default Value | Description
--- | -- | --
---td-progress-circle-inner-bg-color | @font-white-1 | -
---td-progress-circle-width | 224rpx | -
---td-progress-circle-from | 0deg | -
---td-progress-inner-bg-color | @brand-color | -
---td-progress-line-stroke-width | 12rpx | -
---td-progress-stroke-circle-width | 12rpx | -
---td-progress-stroke-plump-width | 40rpx | -
---td-progress-track-bg-color | @bg-color-component | -
---td-progress-circle-label-font-size | 40rpx | -
---td-progress-circle-label-line-height | 56rpx | -
---td-progress-circle-label-font-weight | 700 | -
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/README.md
deleted file mode 100644
index fe838da9..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/README.md
+++ /dev/null
@@ -1,105 +0,0 @@
----
-title: Progress 进度条
-description: 用于展示任务当前的进度。
-spline: message
-isComponent: true
----
-
-


-
-
-
- 该组件于 0.7.3 版本上线,请留意版本。
-
-
-## 引入
-
-### 引入组件
-
-在 `app.json` 或 `page.json` 中引入组件:
-
-```json
-"usingComponents": {
- "t-progress": "tdesign-miniprogram/progress/progress"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 01 组件类型
-
-基础进度条
-
-{{ base }}
-
-过渡样式
-
-{{ transition }}
-
-自定义颜色/圆角
-
-{{ custom }}
-
-### 02 组件状态
-
-线性进度条
-
-{{ line }}
-
-百分比内显进度条
-
-{{ plump }}
-
-环形进度条
-
-{{ circle }}
-
-## API
-
-### Progress Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-color | String / Object / Array | '' | 进度条颜色。示例:'#ED7B2F' 或 'orange' 或 `['#f00', '#0ff', '#f0f']` 或 `{ '0%': '#f00', '100%': '#0ff' }` 或 `{ from: '#000', to: '#000' }` 等。TS 类型:`string \| Array \| Record` | N
-label | String / Boolean / Slot | true | 进度百分比,可自定义。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-percentage | Number | 0 | 进度条百分比 | N
-status | String | - | 进度条状态。可选项:success/error/warning/active。TS 类型:`ProgressStatus` `type ProgressStatus = 'success' \| 'error' \| 'warning' \| 'active'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
-stroke-width | String / Number | - | 进度条线宽,默认单位 `px` | N
-theme | String | line | 进度条风格。值为 line,标签(label)显示在进度条右侧;值为 plump,标签(label)显示在进度条里面;值为 circle,标签(label)显示在进度条正中间。可选项:line/plump/circle。TS 类型:`ProgressTheme` `type ProgressTheme = 'line' \| 'plump' \| 'circle'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/progress/type.ts) | N
-track-color | String | '' | 进度条未完成部分颜色 | N
-
-### Progress External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-bar | 进度文字样式类
-t-class-label | 标签样式类
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-
-名称 | 默认值 | 描述
--- | -- | --
---td-progress-circle-inner-bg-color | @font-white-1 | -
---td-progress-circle-width | 224rpx | -
---td-progress-circle-from | 0deg | -
---td-progress-inner-bg-color | @brand-color | -
---td-progress-line-stroke-width | 12rpx | -
---td-progress-stroke-circle-width | 12rpx | -
---td-progress-stroke-plump-width | 40rpx | -
---td-progress-track-bg-color | @bg-color-component | -
---td-progress-circle-label-font-size | 40rpx | -
---td-progress-circle-label-line-height | 56rpx | -
---td-progress-circle-label-font-weight | 700 | -
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.d.ts
deleted file mode 100644
index ea66946f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.d.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class Progress extends SuperComponent {
- externalClasses: string[];
- options: {
- multipleSlots: boolean;
- };
- properties: import("./type").TdProgressProps;
- data: {
- prefix: string;
- classPrefix: string;
- colorBar: string;
- heightBar: string;
- computedStatus: string;
- computedProgress: number;
- isIOS: boolean;
- };
- attached(): void;
- observers: {
- percentage(percentage: any): void;
- color(color: any): void;
- strokeWidth(strokeWidth: any): string;
- trackColor(trackColor: any): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.js
deleted file mode 100644
index fae98d5c..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.js
+++ /dev/null
@@ -1,71 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-import { getBackgroundColor } from './utils';
-import { unitConvert, deviceInfo } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-progress`;
-let Progress = class Progress extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-bar`, `${prefix}-class-label`];
- this.options = {
- multipleSlots: true,
- };
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- colorBar: '',
- heightBar: '',
- computedStatus: '',
- computedProgress: 0,
- isIOS: false,
- };
- this.observers = {
- percentage(percentage) {
- percentage = Math.max(0, Math.min(percentage, 100));
- this.setData({
- computedStatus: percentage === 100 ? 'success' : '',
- computedProgress: percentage,
- });
- },
- color(color) {
- this.setData({
- colorBar: getBackgroundColor(color),
- colorCircle: typeof color === 'object' ? '' : color,
- });
- },
- strokeWidth(strokeWidth) {
- if (!strokeWidth) {
- return '';
- }
- this.setData({
- heightBar: unitConvert(strokeWidth),
- });
- },
- trackColor(trackColor) {
- this.setData({
- bgColorBar: trackColor,
- });
- },
- };
- }
- attached() {
- var _a;
- const isIOS = !!(((_a = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.system) === null || _a === void 0 ? void 0 : _a.toLowerCase().search('ios')) + 1);
- this.setData({
- isIOS,
- });
- }
-};
-Progress = __decorate([
- wxComponent()
-], Progress);
-export default Progress;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.json
deleted file mode 100644
index f783dae7..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.wxml
deleted file mode 100644
index 62f2481f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.wxml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ _.isString(label)? label: computedProgress + '%' }}
-
-
-
-
-
-
-
- {{ _.isString(label)? label: computedProgress + '%' }}
-
-
-
-
- {{ _.isString(label)? label: computedProgress + '%' }}
-
-
-
-
-
-
-
-
-
- {{ _.isString(label)? label: computedProgress + '%' }}
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.wxs b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.wxs
deleted file mode 100644
index 37f05b2b..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.wxs
+++ /dev/null
@@ -1,63 +0,0 @@
-var STATUS = ['success', 'error', 'warning'];
-var STATUS_TEXT = ['success', 'error', 'warning', 'active'];
-
-var PRO_THEME = {
- LINE: 'line',
- PLUMP: 'plump',
- CIRCLE: 'circle',
-};
-
-var STATUS_COLOR = {
- success: '#00a870',
- error: '#e34d59',
- warning: '#ed7b2f',
-};
-var LINE_STATUS_ICON = {
- success: 'check-circle-filled',
- error: 'error-circle-filled',
- warning: 'error-circle-filled',
-};
-var CIRCLE_STATUS_ICON = {
- success: 'check',
- error: 'close',
- warning: 'error',
-};
-
-/**
- *
- * 1. getIOSAriaLabel, getAndroidAriaLabel 两个函数的初衷是处理progress异常情况的文案识别。
- * 2. iOS可以识别%,而安卓不会识别%,如 80, iOS可以识别成 80%, 而安卓只会80,因此android部分做了一个% 拼接,后续看是否有更好的方案去解决。
- * 3. 安卓 talkback 版本为 8.1.0.278818032 ,只会读一次 80, 最新版本talkback 会读 80.0, 80。(目前也是一个痛点,啰嗦了)
- *
- */
-
-var getIOSAriaLabel = function (status) {
- if (status === 'error') {
- return '进度失败';
- }
- if (status === 'warning') {
- return '进度异常';
- }
- return '';
-};
-
-var getAndroidAriaLabel = function (status) {
- if (status === 'error') {
- return '%' + ',进度失败';
- }
- if (status === 'warning') {
- return '%' + ',进度异常';
- }
- return '%';
-};
-
-module.exports = {
- STATUS: STATUS,
- STATUS_TEXT: STATUS_TEXT,
- PRO_THEME: PRO_THEME,
- STATUS_COLOR: STATUS_COLOR,
- LINE_STATUS_ICON: LINE_STATUS_ICON,
- CIRCLE_STATUS_ICON: CIRCLE_STATUS_ICON,
- getAndroidAriaLabel: getAndroidAriaLabel,
- getIOSAriaLabel: getIOSAriaLabel,
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.wxss
deleted file mode 100644
index fe0eb438..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/progress.wxss
+++ /dev/null
@@ -1,162 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-progress {
- --td-progress-inner-bg-color: var(--td-brand-color, var(--td-primary-color-7, #0052d9));
- --td-progress-track-bg-color: var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7));
- --td-progress-circle-from: 0deg;
-}
-.t-progress__inner {
- position: relative;
- height: 100%;
- background: var(--td-progress-inner-bg-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- border-radius: var(--td-radius-round, 999px);
- transition: all var(--td-anim-duration-base, 0.2s) var(--td-anim-time-fn-easing, cubic-bezier(0.38, 0, 0.24, 1));
-}
-.t-progress__bar {
- width: 100%;
- height: var(--td-progress-line-stroke-width, 12rpx);
- overflow: hidden;
- background: var(--td-progress-track-bg-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- border-radius: var(--td-radius-round, 999px);
-}
-.t-progress__info {
- padding-left: var(--td-spacer, 16rpx);
- box-sizing: border-box;
- color: var(--td-progress-info-dark-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- white-space: nowrap;
- display: inline-flex;
-}
-.t-progress--thin {
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-.t-progress--thin .t-progress__icon {
- font-size: calc(var(--td-font-size-base, 28rpx) + 2px);
-}
-.t-progress--plump {
- height: var(--td-progress-stroke-plump-width, 40rpx);
- border-radius: calc(var(--td-progress-stroke-plump-width, 40rpx) / 2);
- display: flex;
- align-items: center;
-}
-.t-progress--plump .t-progress__info {
- font-size: var(--td-font-size-s, 24rpx);
-}
-.t-progress--over-ten .t-progress__info {
- position: absolute;
- top: 50%;
- right: var(--td-spacer, 16rpx);
- color: var(--td-progress-info-light-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
- transform: translateY(-50%);
-}
-.t-progress--under-ten .t-progress__info,
-.t-progress--under-ten .t-progress__inner {
- display: inline-block;
-}
-.t-progress--under-ten .t-progress__info {
- vertical-align: top;
-}
-.t-progress__canvas--circle {
- position: relative;
- width: var(--td-progress-circle-width, 224rpx);
- height: var(--td-progress-circle-width, 224rpx);
- border-radius: var(--td-radius-circle, 50%);
-}
-.t-progress__canvas--circle .t-progress__canvas--inner {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- width: calc(100% - var(--td-progress-stroke-circle-width, 12rpx)*2);
- height: calc(100% - var(--td-progress-stroke-circle-width, 12rpx)*2);
- border-radius: var(--td-radius-circle, 50%);
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- background-color: var(--td-progress-circle-inner-bg-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
-}
-.t-progress__canvas--circle .t-progress__info {
- margin: 0;
- font-size: var(--td-progress-circle-label-font-size, 40rpx);
- font-weight: var(--td-progress-circle-label-font-weight, 700);
- line-height: var(--td-progress-circle-label-line-height, 56rpx);
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
-}
-.t-progress__canvas--circle .t-progress__icon {
- font-size: 96rpx;
-}
-.t-progress--status--active .t-progress__inner::before {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: 1;
- content: '';
- animation: progress-active-animation 2s cubic-bezier(0.23, 0.99, 0.86, 0.2) infinite;
- background: var(--td-progress-inner-bg-color-active, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
- opacity: 0.2;
-}
-.t-progress--status--success .t-progress__inner {
- background: var(--td-progress-inner-bg-color-success, var(--td-success-color, var(--td-success-color-5, #2ba471)));
-}
-.t-progress--status--success .t-progress__icon {
- color: var(--td-success-color, var(--td-success-color-5, #2ba471));
-}
-.t-progress--status--warning .t-progress__inner {
- background: var(--td-progress-inner-bg-color-warning, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
-}
-.t-progress--status--warning .t-progress__icon {
- color: var(--td-warning-color, var(--td-warning-color-5, #e37318));
-}
-.t-progress--status--error .t-progress__inner {
- background: var(--td-progress-inner-bg-color-error, var(--td-error-color, var(--td-error-color-6, #d54941)));
-}
-.t-progress--status--error .t-progress__icon {
- color: var(--td-error-color, var(--td-error-color-6, #d54941));
-}
-@keyframes progress-active-animation {
- 0% {
- width: 0;
- opacity: 0.1;
- }
- 35% {
- width: 50%;
- opacity: 0.4;
- }
- 100% {
- width: 100%;
- opacity: 0;
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/props.d.ts
deleted file mode 100644
index 214f11aa..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdProgressProps } from './type';
-declare const props: TdProgressProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/props.js
deleted file mode 100644
index 406b7bcd..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/props.js
+++ /dev/null
@@ -1,33 +0,0 @@
-const props = {
- color: {
- type: null,
- value: '',
- },
- label: {
- type: null,
- value: true,
- },
- percentage: {
- type: Number,
- value: 0,
- },
- status: {
- type: String,
- },
- strokeWidth: {
- type: null,
- },
- style: {
- type: String,
- value: '',
- },
- theme: {
- type: String,
- value: 'line',
- },
- trackColor: {
- type: String,
- value: '',
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/type.d.ts
deleted file mode 100644
index 763d3bce..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/type.d.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-export interface TdProgressProps {
- color?: {
- type: null;
- value?: string | Array | Record;
- };
- label?: {
- type: null;
- value?: string | boolean;
- };
- percentage?: {
- type: NumberConstructor;
- value?: number;
- };
- status?: {
- type: StringConstructor;
- value?: ProgressStatus;
- };
- strokeWidth?: {
- type: null;
- value?: string | number;
- };
- style?: {
- type: StringConstructor;
- value?: string;
- };
- theme?: {
- type: StringConstructor;
- value?: ProgressTheme;
- };
- trackColor?: {
- type: StringConstructor;
- value?: string;
- };
-}
-export declare type ProgressStatus = 'success' | 'error' | 'warning' | 'active';
-export declare type ProgressTheme = 'line' | 'plump' | 'circle';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/utils.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/utils.d.ts
deleted file mode 100644
index 84b7889e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/utils.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export declare type Gradients = {
- [percent: string]: string;
-};
-export declare type FromTo = {
- from: string;
- to: string;
-};
-export declare type LinearGradient = {
- direction?: string;
-} & (Gradients | FromTo);
-export declare function getBackgroundColor(color: string | string[] | LinearGradient): string;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/utils.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/utils.js
deleted file mode 100644
index 455982cd..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/progress/utils.js
+++ /dev/null
@@ -1,30 +0,0 @@
-var __rest = (this && this.__rest) || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
- t[p[i]] = s[p[i]];
- }
- return t;
-};
-export function getBackgroundColor(color) {
- if (typeof color === 'string') {
- return color;
- }
- if (Array.isArray(color)) {
- if (color[0] && color[0][0] === '#') {
- color.unshift('90deg');
- }
- return `linear-gradient( ${color.join(',')} )`;
- }
- const { from, to, direction = 'to right' } = color, rest = __rest(color, ["from", "to", "direction"]);
- let keys = Object.keys(rest);
- if (keys.length) {
- keys = keys.sort((a, b) => parseFloat(a.substr(0, a.length - 1)) - parseFloat(b.substr(0, b.length - 1)));
- const tempArr = keys.map((key) => `${rest[key]} ${key}`);
- return `linear-gradient(${direction}, ${tempArr.join(',')})`;
- }
- return `linear-gradient(${direction}, ${from}, ${to})`;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/props.d.ts
deleted file mode 100644
index 40dcb03b..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdRadioGroupProps } from './type';
-declare const props: TdRadioGroupProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/props.js
deleted file mode 100644
index 3de9e57f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/props.js
+++ /dev/null
@@ -1,40 +0,0 @@
-const props = {
- allowUncheck: {
- type: Boolean,
- value: false,
- },
- borderless: {
- type: Boolean,
- value: false,
- },
- disabled: {
- type: null,
- value: undefined,
- },
- icon: {
- type: null,
- value: 'circle',
- },
- keys: {
- type: Object,
- },
- name: {
- type: String,
- value: '',
- },
- options: {
- type: Array,
- },
- placement: {
- type: String,
- value: 'left',
- },
- value: {
- type: null,
- value: null,
- },
- defaultValue: {
- type: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.d.ts
deleted file mode 100644
index c6141eaf..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.d.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-export default class RadioGroup extends SuperComponent {
- externalClasses: string[];
- data: {
- prefix: string;
- classPrefix: string;
- radioOptions: any[];
- };
- relations: RelationsOptions;
- properties: import("./type").TdRadioGroupProps;
- controlledProps: {
- key: string;
- event: string;
- }[];
- observers: {
- value(v: any): void;
- options(): void;
- disabled(v: any): void;
- };
- methods: {
- getChildren(): any;
- updateValue(value: any): void;
- handleRadioChange(e: any): void;
- initWithOptions(): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.js
deleted file mode 100644
index c142af47..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.js
+++ /dev/null
@@ -1,117 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import config from '../common/config';
-import { SuperComponent, wxComponent } from '../common/src/index';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-radio-group`;
-let RadioGroup = class RadioGroup extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`];
- this.data = {
- prefix,
- classPrefix: name,
- radioOptions: [],
- };
- this.relations = {
- '../radio/radio': {
- type: 'descendant',
- linked(target) {
- const { value, disabled } = this.data;
- target.setData({
- checked: value === target.data.value,
- });
- target.setDisabled(disabled);
- },
- },
- };
- this.properties = props;
- this.controlledProps = [
- {
- key: 'value',
- event: 'change',
- },
- ];
- this.observers = {
- value(v) {
- this.getChildren().forEach((item) => {
- item.setData({
- checked: v === item.data.value,
- });
- });
- },
- options() {
- this.initWithOptions();
- },
- disabled(v) {
- var _a;
- if ((_a = this.data.options) === null || _a === void 0 ? void 0 : _a.length) {
- this.initWithOptions();
- return;
- }
- this.getChildren().forEach((item) => {
- item.setDisabled(v);
- });
- },
- };
- this.methods = {
- getChildren() {
- let items = this.$children;
- if (!(items === null || items === void 0 ? void 0 : items.length)) {
- items = this.selectAllComponents(`.${prefix}-radio-option`);
- }
- return items;
- },
- updateValue(value) {
- this._trigger('change', { value });
- },
- handleRadioChange(e) {
- const { checked } = e.detail;
- const { value, index, allowUncheck } = e.target.dataset;
- this._trigger('change', checked === false && allowUncheck ? { value: null, index } : { value, index });
- },
- initWithOptions() {
- const { options, value, keys, disabled } = this.data;
- if (!(options === null || options === void 0 ? void 0 : options.length) || !Array.isArray(options)) {
- this.setData({
- radioOptions: [],
- });
- return;
- }
- const optionsValue = [];
- try {
- options.forEach((element) => {
- var _a, _b, _c;
- const typeName = typeof element;
- if (typeName === 'number' || typeName === 'string') {
- optionsValue.push({
- label: `${element}`,
- value: element,
- checked: value === element,
- disabled,
- });
- }
- else if (typeName === 'object') {
- optionsValue.push(Object.assign(Object.assign({}, element), { label: element[(_a = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _a !== void 0 ? _a : 'label'], value: element[(_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value'], checked: value === element[(_c = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _c !== void 0 ? _c : 'value'], disabled: element.disabled || disabled }));
- }
- });
- this.setData({
- radioOptions: optionsValue,
- });
- }
- catch (error) {
- console.error('error', error);
- }
- },
- };
- }
-};
-RadioGroup = __decorate([
- wxComponent()
-], RadioGroup);
-export default RadioGroup;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.json
deleted file mode 100644
index c2c7a60f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-radio": "../radio/radio"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.wxml
deleted file mode 100644
index 096c01a7..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.wxml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/radio-group.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/type.d.ts
deleted file mode 100644
index 8995b530..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/type.d.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { KeysType } from '../common/common';
-export interface TdRadioGroupProps {
- allowUncheck?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- borderless?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- icon?: {
- type: null;
- value?: 'circle' | 'line' | 'dot' | Array;
- };
- keys?: {
- type: ObjectConstructor;
- value?: KeysType;
- };
- name?: {
- type: StringConstructor;
- value?: string;
- };
- options?: {
- type: ArrayConstructor;
- value?: Array;
- };
- placement?: {
- type: StringConstructor;
- value?: 'left' | 'right';
- };
- value?: {
- type: null;
- value?: T;
- };
- defaultValue?: {
- type: null;
- value?: T;
- };
-}
-export declare type RadioOption = string | number | RadioOptionObj;
-export interface RadioOptionObj {
- label?: string;
- value?: string | number;
- readonly?: boolean;
- disabled?: boolean;
- allowUncheck?: boolean;
-}
-export declare type RadioValue = string | number | boolean;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio-group/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/README.en-US.md
deleted file mode 100644
index 2ca4ba39..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/README.en-US.md
+++ /dev/null
@@ -1,89 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Radio Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-allow-uncheck | Boolean | false | \- | N
-block | Boolean | true | \- | N
-checked | Boolean | false | \- | N
-default-checked | Boolean | undefined | uncontrolled property | N
-content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-content-disabled | Boolean | false | \- | N
-disabled | Boolean | undefined | \- | N
-icon | String / Array / Slot | 'circle' | Typescript:`'circle' \| 'line' \| 'dot' \| Array` | N
-label | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-max-content-row | Number | 5 | \- | N
-max-label-row | Number | 3 | \- | N
-name | String | - | \- | N
-placement | String | left | options: left/right | N
-readonly | Boolean | false | \- | N
-value | String / Number / Boolean | false | Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio/type.ts) | N
-
-### Radio Events
-
-name | params | description
--- | -- | --
-change | `(checked: boolean)` | \-
-
-### Radio External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-border | \-
-t-class-content | \-
-t-class-icon | \-
-t-class-label | \-
-
-
-### RadioGroup Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-allow-uncheck | Boolean | false | \- | N
-borderless | Boolean | false | \- | N
-disabled | Boolean | undefined | \- | N
-icon | String / Array | 'circle' | Typescript:`'circle' \| 'line' \| 'dot' \| Array` | N
-keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-name | String | - | \- | N
-options | Array | - | Typescript:`Array` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string; value?: string \| number; readonly?: boolean; disabled?: boolean; allowUncheck?: boolean; }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
-placement | String | left | options: left/right | N
-value | String / Number / Boolean | - | Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
-default-value | String / Number / Boolean | undefined | uncontrolled property。Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
-
-### RadioGroup Events
-
-name | params | description
--- | -- | --
-change | `(value: RadioValue)` | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-radio-bg-color | @bg-color-container | -
---td-radio-border-color | @component-stroke | -
---td-radio-content-checked-color | @font-gray-2 | -
---td-radio-content-color | @font-gray-2 | -
---td-radio-content-disabled-color | @font-gray-4 | -
---td-radio-content-font-size | 28rpx | -
---td-radio-content-line-height | 44rpx | -
---td-radio-font-size | 32rpx | -
---td-radio-icon-checked-color | @brand-color | -
---td-radio-icon-color | @component-border | -
---td-radio-icon-disabled-bg-color | @bg-color-component-disabled | -
---td-radio-icon-disabled-color | @brand-color-disabled | -
---td-radio-icon-size | 48rpx | -
---td-radio-label-checked-color | @font-gray-1 | -
---td-radio-label-color | @font-gray-1 | -
---td-radio-label-disabled-color | @font-gray-4 | -
---td-radio-label-line-height | 48rpx | -
---td-radio-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/README.md
deleted file mode 100644
index 64078433..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/README.md
+++ /dev/null
@@ -1,142 +0,0 @@
----
-title: Radio 单选框
-description: 用于在预设的一组选项中执行单项选择,并呈现选择结果。
-spline: form
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-radio": "tdesign-miniprogram/radio/radio",
- "t-radio-group": "tdesign-miniprogram/radio-group/radio-group"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 纵向单选框
-
-{{ base }}
-
-### 横向单选框
-
-{{ horizontal }}
-
-### 单选框状态
-
-{{ status }}
-
-### 勾选样式
-
-{{ theme }}
-
-### 勾选显示位置
-
-{{ align }}
-
-### 非通栏单选样式
-
-{{ card }}
-
-### 特殊样式
-
-{{ special }}
-
-## API
-
-### Radio Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-allow-uncheck | Boolean | false | 是否允许取消选中 | N
-block | Boolean | true | 是否为块级元素 | N
-checked | Boolean | false | 是否选中 | N
-default-checked | Boolean | undefined | 是否选中。非受控属性 | N
-content | String / Slot | - | 单选内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-content-disabled | Boolean | false | 是否禁用组件内容(content)触发选中 | N
-disabled | Boolean | undefined | 是否为禁用态 | N
-icon | String / Array / Slot | 'circle' | 自定义选中图标和非选中图标。使用 Array 时表示:`[选中态图标,非选中态图标]`。使用 String 时,值为 circle 表示填充型图标、值为 line 表示描边型图标、值为 dot 表示圆点图标,值为 slot 时使用插槽。TS 类型:`'circle' \| 'line' \| 'dot' \| Array` | N
-label | String / Slot | - | 主文案。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-max-content-row | Number | 5 | 内容最大行数限制 | N
-max-label-row | Number | 3 | 主文案最大行数限制 | N
-name | String | - | HTML 元素原生属性 | N
-placement | String | left | 复选框和内容相对位置。可选项:left/right | N
-readonly | Boolean | false | 只读状态 | N
-value | String / Number / Boolean | false | 单选按钮的值。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio/type.ts) | N
-
-### Radio Events
-
-名称 | 参数 | 描述
--- | -- | --
-change | `(checked: boolean)` | 值变化时触发
-
-### Radio External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-border | 边框样式类
-t-class-content | 内容样式类
-t-class-icon | 图标样式类
-t-class-label | 标签样式类
-
-
-### RadioGroup Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-allow-uncheck | Boolean | false | 是否允许取消选中 | N
-borderless | Boolean | false | 是否开启无边框模式 | N
-disabled | Boolean | undefined | 是否禁用全部子单选框 | N
-icon | String / Array | 'circle' | 自定义选中图标和非选中图标。示例:[选中态图标,非选中态图标]。使用 String 时,值为 circle 表示填充型图标、值为 line 表示描边型图标、值为 dot 表示圆点图标;仅在使用 options 时生效。TS 类型:`'circle' \| 'line' \| 'dot' \| Array` | N
-keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-name | String | - | HTML 元素原生属性 | N
-options | Array | - | 单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同。TS 类型:`Array` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string; value?: string \| number; readonly?: boolean; disabled?: boolean; allowUncheck?: boolean; }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
-placement | String | left | 复选框和内容相对位置。可选项:left/right | N
-value | String / Number / Boolean | - | 选中的值。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
-default-value | String / Number / Boolean | undefined | 选中的值。非受控属性。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio-group/type.ts) | N
-
-### RadioGroup Events
-
-名称 | 参数 | 描述
--- | -- | --
-change | `(value: RadioValue)` | 选中值发生变化时触发
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-radio-bg-color | @bg-color-container | -
---td-radio-border-color | @component-stroke | -
---td-radio-content-checked-color | @font-gray-2 | -
---td-radio-content-color | @font-gray-2 | -
---td-radio-content-disabled-color | @font-gray-4 | -
---td-radio-content-font-size | 28rpx | -
---td-radio-content-line-height | 44rpx | -
---td-radio-font-size | 32rpx | -
---td-radio-icon-checked-color | @brand-color | -
---td-radio-icon-color | @component-border | -
---td-radio-icon-disabled-bg-color | @bg-color-component-disabled | -
---td-radio-icon-disabled-color | @brand-color-disabled | -
---td-radio-icon-size | 48rpx | -
---td-radio-label-checked-color | @font-gray-1 | -
---td-radio-label-color | @font-gray-1 | -
---td-radio-label-disabled-color | @font-gray-4 | -
---td-radio-label-line-height | 48rpx | -
---td-radio-vertical-padding | 32rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/props.d.ts
deleted file mode 100644
index c59a8d0f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdRadioProps } from './type';
-declare const props: TdRadioProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/props.js
deleted file mode 100644
index 545afe27..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/props.js
+++ /dev/null
@@ -1,61 +0,0 @@
-const props = {
- allowUncheck: {
- type: Boolean,
- value: false,
- },
- block: {
- type: Boolean,
- value: true,
- },
- checked: {
- type: Boolean,
- value: null,
- },
- defaultChecked: {
- type: Boolean,
- value: false,
- },
- content: {
- type: String,
- },
- contentDisabled: {
- type: Boolean,
- value: false,
- },
- disabled: {
- type: null,
- value: undefined,
- },
- icon: {
- type: null,
- value: 'circle',
- },
- label: {
- type: String,
- },
- maxContentRow: {
- type: Number,
- value: 5,
- },
- maxLabelRow: {
- type: Number,
- value: 3,
- },
- name: {
- type: String,
- value: '',
- },
- placement: {
- type: String,
- value: 'left',
- },
- readonly: {
- type: Boolean,
- value: false,
- },
- value: {
- type: null,
- value: false,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.d.ts
deleted file mode 100644
index c881c3a1..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.d.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-export default class Radio extends SuperComponent {
- externalClasses: string[];
- behaviors: string[];
- relations: RelationsOptions;
- options: {
- multipleSlots: boolean;
- };
- lifetimes: {
- attached(): void;
- };
- properties: {
- borderless: {
- type: BooleanConstructor;
- value: boolean;
- };
- tId: {
- type: StringConstructor;
- };
- allowUncheck?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- block?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- checked?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- defaultChecked?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- content?: {
- type: StringConstructor;
- value?: string;
- };
- contentDisabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- icon?: {
- type: null;
- value?: string[] | "circle" | "line" | "dot";
- };
- label?: {
- type: StringConstructor;
- value?: string;
- };
- maxContentRow?: {
- type: NumberConstructor;
- value?: number;
- };
- maxLabelRow?: {
- type: NumberConstructor;
- value?: number;
- };
- name?: {
- type: StringConstructor;
- value?: string;
- };
- placement?: {
- type: StringConstructor;
- value?: "left" | "right";
- };
- readonly?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- value?: {
- type: null;
- value?: import("./type").RadioValue;
- };
- };
- controlledProps: {
- key: string;
- event: string;
- }[];
- data: {
- prefix: string;
- classPrefix: string;
- customIcon: boolean;
- slotIcon: boolean;
- optionLinked: boolean;
- iconVal: any[];
- _placement: string;
- _disabled: boolean;
- };
- observers: {
- disabled(v: any): void;
- };
- methods: {
- handleTap(e: any): void;
- doChange(): void;
- init(): void;
- setDisabled(disabled: Boolean): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.js
deleted file mode 100644
index 5dcd7b1a..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.js
+++ /dev/null
@@ -1,109 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import config from '../common/config';
-import { SuperComponent, wxComponent } from '../common/src/index';
-import Props from './props';
-const { prefix } = config;
-const name = `${prefix}-radio`;
-let Radio = class Radio extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [
- `${prefix}-class`,
- `${prefix}-class-label`,
- `${prefix}-class-icon`,
- `${prefix}-class-content`,
- `${prefix}-class-border`,
- ];
- this.behaviors = ['wx://form-field'];
- this.relations = {
- '../radio-group/radio-group': {
- type: 'ancestor',
- linked(parent) {
- if (parent.data.borderless) {
- this.setData({ borderless: true });
- }
- },
- },
- };
- this.options = {
- multipleSlots: true,
- };
- this.lifetimes = {
- attached() {
- this.init();
- },
- };
- this.properties = Object.assign(Object.assign({}, Props), { borderless: {
- type: Boolean,
- value: false,
- }, tId: {
- type: String,
- } });
- this.controlledProps = [
- {
- key: 'checked',
- event: 'change',
- },
- ];
- this.data = {
- prefix,
- classPrefix: name,
- customIcon: false,
- slotIcon: false,
- optionLinked: false,
- iconVal: [],
- _placement: '',
- _disabled: false,
- };
- this.observers = {
- disabled(v) {
- this.setData({ _disabled: v });
- },
- };
- this.methods = {
- handleTap(e) {
- const { _disabled, readonly, contentDisabled } = this.data;
- const { target } = e.currentTarget.dataset;
- if (_disabled || readonly || (target === 'text' && contentDisabled))
- return;
- this.doChange();
- },
- doChange() {
- var _a;
- const { value, checked, allowUncheck } = this.data;
- const isAllowUncheck = Boolean(allowUncheck || ((_a = this.$parent) === null || _a === void 0 ? void 0 : _a.data.allowUncheck));
- if (this.$parent) {
- this.$parent.updateValue(checked && isAllowUncheck ? null : value);
- }
- else {
- this._trigger('change', { checked: isAllowUncheck ? !checked : true });
- }
- },
- init() {
- var _a, _b, _c, _d, _e, _f;
- const { icon } = this.data;
- const isIdArr = Array.isArray(((_a = this.$parent) === null || _a === void 0 ? void 0 : _a.icon) || icon);
- this.setData({
- customIcon: isIdArr,
- slotIcon: icon === 'slot',
- iconVal: isIdArr ? ((_b = this.$parent) === null || _b === void 0 ? void 0 : _b.icon) || icon : [],
- _placement: (_f = (_c = this.data.placement) !== null && _c !== void 0 ? _c : (_e = (_d = this.$parent) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.placement) !== null && _f !== void 0 ? _f : 'left',
- });
- },
- setDisabled(disabled) {
- this.setData({
- _disabled: this.data.disabled || disabled,
- });
- },
- };
- }
-};
-Radio = __decorate([
- wxComponent()
-], Radio);
-export default Radio;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.json
deleted file mode 100644
index f783dae7..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.wxml
deleted file mode 100644
index eb3ebead..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.wxml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{label}}
-
-
-
-
-
- {{content}}
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.wxss
deleted file mode 100644
index f8af3d8c..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/radio.wxss
+++ /dev/null
@@ -1,206 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.limit-title-row {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- overflow: hidden;
-}
-.t-radio {
- position: relative;
- display: inline-flex;
- vertical-align: middle;
- font-size: var(--td-radio-font-size, 32rpx);
- background: var(--td-radio-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-radio:focus {
- outline: 0;
-}
-.t-radio--block {
- display: flex;
- padding: var(--td-radio-vertical-padding, 32rpx);
-}
-.t-radio--right {
- flex-direction: row-reverse;
-}
-.t-radio__icon {
- position: relative;
- margin-top: calc((var(--td-radio-label-line-height, 48rpx) - var(--td-radio-icon-size, 48rpx)) / 2);
- width: var(--td-radio-icon-size, 48rpx);
- height: var(--td-radio-icon-size, 48rpx);
- font-size: var(--td-radio-icon-size, 48rpx);
- color: var(--td-radio-icon-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
- overflow: hidden;
-}
-.t-radio__icon:empty {
- display: none;
-}
-.t-radio__icon--left {
- margin-right: 16rpx;
-}
-.t-radio__icon--checked {
- color: var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-radio__icon--disabled {
- cursor: not-allowed;
- color: var(--td-radio-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-radio__icon-circle {
- width: var(--td-radio-icon-size, 48rpx);
- height: var(--td-radio-icon-size, 48rpx);
- box-sizing: border-box;
-}
-.t-radio__icon-circle::after {
- content: '';
- width: calc(200% - 6rpx);
- height: calc(200% - 6rpx);
- border-radius: 50%;
- border: 3px solid var(--td-radio-icon-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) scale(0.5);
- box-sizing: border-box;
-}
-.t-radio__icon-circle--disabled::after {
- background: var(--td-radio-icon-disabled-bg-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
-}
-.t-radio__icon-line::before,
-.t-radio__icon-line::after {
- content: '';
- display: block;
- position: absolute;
- width: 5rpx;
- border-radius: 2rpx;
- background: var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- transform-origin: top center;
-}
-.t-radio__icon-line::before {
- height: 16rpx;
- left: 8rpx;
- top: 22rpx;
- transform: rotate(-45deg);
-}
-.t-radio__icon-line::after {
- height: 26rpx;
- right: 8rpx;
- top: 14rpx;
- transform: rotate(45deg);
-}
-.t-radio__icon-line--disabled::before,
-.t-radio__icon-line--disabled::after {
- background: var(--td-radio-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-radio__icon-dot {
- width: calc((var(--td-radio-icon-size, 48rpx) - 6rpx) * 2);
- height: calc((var(--td-radio-icon-size, 48rpx) - 6rpx) * 2);
- border: 6rpx solid var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- border-radius: 50%;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) scale(0.5);
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.t-radio__icon-dot::after {
- content: '';
- display: block;
- width: var(--td-radio-icon-size, 48rpx);
- height: var(--td-radio-icon-size, 48rpx);
- background: var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- border-radius: 50%;
-}
-.t-radio__icon-dot--disabled {
- border-color: var(--td-radio-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-radio__icon-dot--disabled::after {
- background: var(--td-radio-icon-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-radio__image {
- line-height: var(--td-radio-icon-size, 48rpx);
-}
-.t-radio-icon__image {
- height: var(--td-radio-icon-size, 48rpx);
- width: var(--td-radio-icon-size, 48rpx);
- vertical-align: sub;
-}
-.t-radio__content {
- flex: 1;
-}
-.t-radio__content:empty {
- display: none;
-}
-.t-radio__title {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- overflow: hidden;
- color: var(--td-radio-label-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- line-height: var(--td-radio-label-line-height, 48rpx);
-}
-.t-radio__title--checked {
- color: var(--td-radio-label-checked-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
-}
-.t-radio__title--disabled {
- cursor: not-allowed;
- color: var(--td-radio-label-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
-}
-.t-radio__description {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- overflow: hidden;
- color: var(--td-radio-content-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
- font-size: var(--td-radio-content-font-size, 28rpx);
- line-height: var(--td-radio-content-line-height, 44rpx);
-}
-.t-radio__description--checked {
- color: var(--td-radio-content-checked-color, var(--td-text-color-secondary, var(--td-font-gray-2, rgba(0, 0, 0, 0.6))));
-}
-.t-radio__description--disabled {
- cursor: not-allowed;
- color: var(--td-radio-content-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
-}
-.t-radio__description:empty {
- display: none;
-}
-.t-radio__title + .t-radio__description {
- margin-top: 8rpx;
-}
-.t-radio__border {
- position: absolute;
- bottom: 0;
- height: 1px;
- background: var(--td-radio-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
- left: 96rpx;
- right: 0;
- transform: scaleY(0.5);
-}
-.t-radio__border--right {
- left: 32rpx;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/type.d.ts
deleted file mode 100644
index c39da7f6..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/type.d.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-export interface TdRadioProps {
- allowUncheck?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- block?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- checked?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- defaultChecked?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- content?: {
- type: StringConstructor;
- value?: string;
- };
- contentDisabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- icon?: {
- type: null;
- value?: 'circle' | 'line' | 'dot' | Array;
- };
- label?: {
- type: StringConstructor;
- value?: string;
- };
- maxContentRow?: {
- type: NumberConstructor;
- value?: number;
- };
- maxLabelRow?: {
- type: NumberConstructor;
- value?: number;
- };
- name?: {
- type: StringConstructor;
- value?: string;
- };
- placement?: {
- type: StringConstructor;
- value?: 'left' | 'right';
- };
- readonly?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- value?: {
- type: null;
- value?: T;
- };
-}
-export declare type RadioValue = string | number | boolean;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/radio/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/README.en-US.md
deleted file mode 100644
index 5076b361..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/README.en-US.md
+++ /dev/null
@@ -1,66 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-
-### Slider Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-colors | Array | [] | `deprecated`。Typescript:`Array` | N
-disabled | Boolean | undefined | \- | N
-disabled-color | Array | [] | `deprecated`。Typescript:`Array` | N
-label | String / Boolean | false | Typescript:`string \| boolean` | N
-marks | Object / Array | {} | Typescript:`Record \| Array` | N
-max | Number | 100 | \- | N
-min | Number | 0 | \- | N
-range | Boolean | false | \- | N
-show-extreme-value | Boolean | false | \- | N
-step | Number | 1 | \- | N
-theme | String | default | `0.30.0`。options: default/capsule | N
-value | Number / Array | 0 | Typescript:`SliderValue` `type SliderValue = number \| Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/slider/type.ts) | N
-default-value | Number / Array | undefined | uncontrolled property。Typescript:`SliderValue` `type SliderValue = number \| Array`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/slider/type.ts) | N
-vertical | Boolean | false | \- | N
-
-### Slider Events
-
-name | params | description
--- | -- | --
-change | `(value: SliderValue)` | \-
-dragend | `(value: SliderValue, e: TouchEvent)` | \-
-dragstart | `(e: TouchEvent)` | \-
-### Slider External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-bar | \-
-t-class-bar-active | \-
-t-class-bar-disabled | \-
-t-class-cursor | \-
-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-slider-active-color | @brand-color | -
---td-slider-bar-height | 8rpx | -
---td-slider-bar-width | 8rpx | -
---td-slider-capsule-bar-color | @bg-color-component | -
---td-slider-capsule-bar-heihgt | 48rpx | -
---td-slider-capsule-bar-width | 48rpx | -
---td-slider-capsule-line-heihgt | 36rpx | -
---td-slider-default-color | @bg-color-component | -
---td-slider-default-color | @bg-color-component-disabled | -
---td-slider-disabled-color | @brand-color-disabled | -
---td-slider-disabled-text-color | @text-color-disabled | -
---td-slider-dot-bg-color | #fff | -
---td-slider-dot-color | @component-border | -
---td-slider-dot-disabled-bg-color | #fff | -
---td-slider-dot-disabled-border-color | #f3f3f3 | -
---td-slider-dot-size | 40rpx | -
---td-slider-text-color | @text-color-primary | -
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/README.md
deleted file mode 100644
index 78686e94..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/README.md
+++ /dev/null
@@ -1,142 +0,0 @@
----
-title: Slider 滑动选择器
-description: 用于选择横轴上的数值、区间、档位。
-spline: data
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-slider": "tdesign-miniprogram/slider/slider"
-}
-```
-
-## 代码演示
-
-
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 组件类型
-
-单游标滑块
-
-{{ base }}
-
-双游标滑块
-
-{{ range }}
-
-带数值滑动选择器
-
-{{ label }}
-
-带刻度滑动选择器
-
-{{ step }}
-
-### 组件状态
-
-滑块禁用状态
-
-{{ disabled }}
-
-#### 特殊样式
-
-胶囊型滑块
-
-{{ capsule }}
-
-#### 垂直状态
-
-垂直方向的滑块
-
-{{ vertical }}
-
-
-## API
-
-
-### Slider Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-colors | Array | [] | 已废弃。颜色,[已选择, 未选择]。TS 类型:`Array` | N
-disabled | Boolean | undefined | 是否禁用组件 | N
-disabled-color | Array | [] | 已废弃。禁用状态滑动条的颜色,[已选, 未选]。TS 类型:`Array` | N
-label | String / Boolean | false | 滑块当前值文本。
值为 true 显示默认文案;值为 false 不显示滑块当前值文本;
值为 `${value}%` 则表示组件会根据占位符渲染文案;
值类型为函数时,参数 `value` 标识滑块值,参数 `position=start` 表示范围滑块的起始值,参数 `position=end` 表示范围滑块的终点值。TS 类型:`string \| boolean` | N
-marks | Object / Array | {} | 刻度标记,示例:`[0, 10, 40, 200]` 或者 `{ 5: '5¥', 10: '10%' }`。TS 类型:`Record \| Array` | N
-max | Number | 100 | 滑块范围最大值 | N
-min | Number | 0 | 滑块范围最小值 | N
-range | Boolean | false | 双游标滑块 | N
-show-extreme-value | Boolean | false | 是否边界值 | N
-step | Number | 1 | 步长 | N
-theme | String | default | `0.30.0`。滑块风格。可选项:default/capsule | N
-value | Number / Array | 0 | 滑块值。TS 类型:`SliderValue` `type SliderValue = number \| Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/slider/type.ts) | N
-default-value | Number / Array | undefined | 滑块值。非受控属性。TS 类型:`SliderValue` `type SliderValue = number \| Array`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/slider/type.ts) | N
-vertical | Boolean | false | 是否是垂直的滑块(渲染垂直滑块时,默认高度为400rpx,可通过修改`--td-slider-bar-height`来自定义高度) | N
-
-### Slider Events
-
-名称 | 参数 | 描述
--- | -- | --
-change | `(value: SliderValue)` | 滑块值变化时触发
-dragend | `(value: SliderValue, e: TouchEvent)` | 结束拖动时触发
-dragstart | `(e: TouchEvent)` | 开始拖动时触发
-### Slider External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-bar | 滑道底部样式类
-t-class-bar-active | 滑道激活态样式类
-t-class-bar-disabled | 滑道禁用态样式类
-t-class-cursor | 游标样式类
-
-## FAQ
-
-当 slider 外层使用 `hidden` 包裹,需要在 `hidden = false` 时,重新调用组件的 `init` 方法,才能正常渲染(在t-popup/t-dialog中同理)。如下:
-
-```html
-
-```
-
-```js
-const $slider = this.selectComponent('#slider');
-
-$slider.init();
-```
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-slider-active-color | @brand-color | -
---td-slider-bar-height | 8rpx | vertical为true时默认为400rpx
---td-slider-bar-width | 8rpx | vertical为true时有效
---td-slider-capsule-bar-color | @bg-color-component | -
---td-slider-capsule-bar-heihgt | 48rpx | -
---td-slider-capsule-bar-width | 48rpx | vertical为true时有效
---td-slider-capsule-line-heihgt | 36rpx | -
---td-slider-default-color | @bg-color-component | -
---td-slider-default-color | @bg-color-component-disabled | -
---td-slider-disabled-color | @brand-color-disabled | -
---td-slider-disabled-text-color | @text-color-disabled | -
---td-slider-dot-bg-color | #fff | -
---td-slider-dot-color | @component-border | -
---td-slider-dot-disabled-bg-color | #fff | -
---td-slider-dot-disabled-border-color | #f3f3f3 | -
---td-slider-dot-size | 40rpx | -
---td-slider-text-color | @text-color-primary | -
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/props.d.ts
deleted file mode 100644
index f6d03ac7..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdSliderProps } from './type';
-declare const props: TdSliderProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/props.js
deleted file mode 100644
index 291e43d5..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/props.js
+++ /dev/null
@@ -1,51 +0,0 @@
-const props = {
- disabled: {
- type: null,
- value: undefined,
- },
- label: {
- type: null,
- value: false,
- },
- marks: {
- type: null,
- value: {},
- },
- max: {
- type: Number,
- value: 100,
- },
- min: {
- type: Number,
- value: 0,
- },
- range: {
- type: Boolean,
- value: false,
- },
- showExtremeValue: {
- type: Boolean,
- value: false,
- },
- step: {
- type: Number,
- value: 1,
- },
- theme: {
- type: String,
- value: 'default',
- },
- value: {
- type: null,
- value: null,
- },
- defaultValue: {
- type: null,
- value: 0,
- },
- vertical: {
- type: Boolean,
- value: false,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.d.ts
deleted file mode 100644
index df8933d0..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.d.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-///
-import { SuperComponent } from '../common/src/index';
-import type { SliderValue } from './type';
-declare type dataType = {
- sliderStyles: string;
- classPrefix: string;
- initialLeft: number | null;
- initialRight: number | null;
- activeLeft: number;
- activeRight: number;
- maxRange: number;
- lineLeft: number;
- lineRight: number;
- dotTopValue: number[];
- blockSize: number;
- isScale: boolean;
- scaleArray: any[];
- scaleTextArray: any[];
- _value: SliderValue;
- prefix: string;
- isVisibleToScreenReader: boolean;
- identifier: number[];
- __inited: boolean;
-};
-export default class Slider extends SuperComponent {
- externalClasses: string[];
- options: {
- pureDataPattern: RegExp;
- };
- properties: import("./type").TdSliderProps;
- controlledProps: {
- key: string;
- event: string;
- }[];
- data: dataType;
- observers: {
- value(newValue: SliderValue): void;
- _value(newValue: SliderValue): void;
- marks(val: any): void;
- };
- lifetimes: {
- created(): void;
- attached(): void;
- };
- injectPageScroll(): void;
- observerScrollTop(rest: any): void;
- toggleA11yTips(): void;
- renderLine(val: any): void;
- triggerValue(value?: SliderValue): void;
- handlePropsChange(newValue: SliderValue): void;
- handleMark(marks: any): void;
- setSingleBarWidth(value: number): void;
- init(): Promise;
- stepValue(value: number): number;
- onSingleLineTap(e: WechatMiniprogram.TouchEvent): void;
- getSingleChangeValue(e: WechatMiniprogram.TouchEvent): number;
- convertPosToValue(posValue: number, dir: 0 | 1): number;
- onLineTap(e: WechatMiniprogram.TouchEvent): void;
- onTouchStart(e: WechatMiniprogram.TouchEvent): void;
- onTouchMoveLeft(e: WechatMiniprogram.TouchEvent): void;
- onTouchMoveRight(e: WechatMiniprogram.TouchEvent): void;
- setLineStyle(left: number, right: number): void;
- onTouchEnd(e: WechatMiniprogram.TouchEvent): void;
- getPagePosition(touch: any): any;
-}
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.js
deleted file mode 100644
index 65e1e5a5..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.js
+++ /dev/null
@@ -1,408 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import config from '../common/config';
-import { trimSingleValue, trimValue } from './tool';
-import props from './props';
-import { getRect } from '../common/utils';
-import Bus from '../common/bus';
-const { prefix } = config;
-const name = `${prefix}-slider`;
-let Slider = class Slider extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [
- `${prefix}-class`,
- `${prefix}-class-bar`,
- `${prefix}-class-bar-active`,
- `${prefix}-class-bar-disabled`,
- `${prefix}-class-cursor`,
- ];
- this.options = {
- pureDataPattern: /^__/,
- };
- this.properties = props;
- this.controlledProps = [
- {
- key: 'value',
- event: 'change',
- },
- ];
- this.data = {
- sliderStyles: '',
- classPrefix: name,
- initialLeft: null,
- initialRight: null,
- activeLeft: 0,
- activeRight: 0,
- maxRange: 0,
- lineLeft: 0,
- lineRight: 0,
- dotTopValue: [0, 0],
- _value: 0,
- blockSize: 20,
- isScale: false,
- scaleArray: [],
- scaleTextArray: [],
- prefix,
- isVisibleToScreenReader: false,
- identifier: [-1, -1],
- __inited: false,
- };
- this.observers = {
- value(newValue) {
- this.handlePropsChange(newValue);
- },
- _value(newValue) {
- this.bus.on('initial', () => this.renderLine(newValue));
- this.toggleA11yTips();
- },
- marks(val) {
- this.bus.on('initial', () => this.handleMark(val));
- },
- };
- this.lifetimes = {
- created() {
- this.bus = new Bus();
- },
- attached() {
- const { value } = this.properties;
- if (!value)
- this.handlePropsChange(0);
- this.init();
- this.injectPageScroll();
- },
- };
- }
- injectPageScroll() {
- const { range, vertical } = this.properties;
- if (!range || !vertical)
- return;
- const pages = getCurrentPages() || [];
- let curPage = null;
- if (pages && pages.length - 1 >= 0) {
- curPage = pages[pages.length - 1];
- }
- if (!curPage)
- return;
- const originPageScroll = curPage === null || curPage === void 0 ? void 0 : curPage.onPageScroll;
- curPage.onPageScroll = (rest) => {
- originPageScroll === null || originPageScroll === void 0 ? void 0 : originPageScroll.call(this, rest);
- this.observerScrollTop(rest);
- };
- }
- observerScrollTop(rest) {
- const { scrollTop } = rest || {};
- this.pageScrollTop = scrollTop;
- }
- toggleA11yTips() {
- this.setData({
- isVisibleToScreenReader: true,
- });
- setTimeout(() => {
- this.setData({
- isVisibleToScreenReader: false,
- });
- }, 2000);
- }
- renderLine(val) {
- const { min, max, range } = this.properties;
- const { maxRange } = this.data;
- if (range) {
- const left = (maxRange * (val[0] - Number(min))) / (Number(max) - Number(min));
- const right = (maxRange * (Number(max) - val[1])) / (Number(max) - Number(min));
- this.setLineStyle(left, right);
- }
- else {
- this.setSingleBarWidth(val);
- }
- }
- triggerValue(value) {
- if (this.preval === value)
- return;
- this.preval = value;
- this._trigger('change', {
- value: trimValue(value, this.properties),
- });
- }
- handlePropsChange(newValue) {
- const value = trimValue(newValue, this.properties);
- const setValueAndTrigger = () => {
- this.setData({
- _value: value,
- });
- };
- if (this.data.maxRange === 0) {
- this.init().then(setValueAndTrigger);
- return;
- }
- setValueAndTrigger();
- }
- handleMark(marks) {
- const calcPos = (arr) => {
- const { max, theme } = this.properties;
- const { blockSize, maxRange } = this.data;
- const margin = theme === 'capsule' ? blockSize / 2 : 0;
- return arr.map((item) => ({
- val: item,
- left: Math.round((item / Number(max)) * maxRange) + margin,
- }));
- };
- if ((marks === null || marks === void 0 ? void 0 : marks.length) && Array.isArray(marks)) {
- this.setData({
- isScale: true,
- scaleArray: calcPos(marks),
- scaleTextArray: [],
- });
- }
- if (Object.prototype.toString.call(marks) === '[object Object]') {
- const scaleArray = Object.keys(marks).map((item) => Number(item));
- const scaleTextArray = scaleArray.map((item) => marks[item]);
- this.setData({
- isScale: scaleArray.length > 0,
- scaleArray: calcPos(scaleArray),
- scaleTextArray,
- });
- }
- }
- setSingleBarWidth(value) {
- const { max, min, theme } = this.properties;
- const { maxRange, blockSize } = this.data;
- const halfBlock = theme === 'capsule' ? Number(blockSize) / 2 : 0;
- const percentage = (Number(value) - Number(min)) / (Number(max) - Number(min));
- const width = percentage * maxRange + halfBlock;
- this.setData({
- lineBarWidth: `${width}px`,
- });
- }
- init() {
- return __awaiter(this, void 0, void 0, function* () {
- if (this.data.__inited)
- return;
- const line = yield getRect(this, '#sliderLine');
- const { blockSize } = this.data;
- const { theme, vertical } = this.properties;
- const halfBlock = Number(blockSize) / 2;
- const { top, bottom, right, left } = line;
- let maxRange = vertical ? bottom - top : right - left;
- let initialLeft = vertical ? top : left;
- let initialRight = vertical ? bottom : right;
- if (initialLeft === 0 && initialRight === 0)
- return;
- if (theme === 'capsule') {
- maxRange = maxRange - Number(blockSize) - 6;
- initialLeft -= halfBlock;
- initialRight -= halfBlock;
- }
- this.setData({
- maxRange,
- initialLeft,
- initialRight,
- __inited: true,
- });
- this.bus.emit('initial');
- });
- }
- stepValue(value) {
- const { step, min, max } = this.properties;
- const decimal = String(step).indexOf('.') > -1 ? String(step).length - String(step).indexOf('.') - 1 : 0;
- const closestStep = trimSingleValue(Number((Math.round(value / Number(step)) * Number(step)).toFixed(decimal)), Number(min), Number(max));
- return closestStep;
- }
- onSingleLineTap(e) {
- const { disabled } = this.properties;
- if (disabled)
- return;
- const isSingleLineTap = this.data.identifier[0] === -1;
- if (isSingleLineTap) {
- const [touch] = e.changedTouches;
- this.data.identifier[0] = touch.identifier;
- }
- const value = this.getSingleChangeValue(e);
- if (isSingleLineTap) {
- this.data.identifier[0] = -1;
- }
- this.triggerValue(value);
- }
- getSingleChangeValue(e) {
- const { min, max, theme, vertical } = this.properties;
- const { initialLeft, maxRange, blockSize } = this.data;
- const touch = e.changedTouches.find((item) => item.identifier === this.data.identifier[0]);
- const pagePosition = this.getPagePosition(touch);
- let offset = 0;
- if (theme === 'capsule') {
- offset = Number(blockSize);
- if (vertical) {
- offset *= 2;
- }
- offset += 6;
- }
- else if (vertical) {
- offset = Number(blockSize);
- }
- const currentLeft = pagePosition - initialLeft - offset;
- let value = 0;
- if (currentLeft <= 0) {
- value = Number(min);
- }
- else if (currentLeft >= maxRange) {
- value = Number(max);
- }
- else {
- value = (currentLeft / maxRange) * (Number(max) - Number(min)) + Number(min);
- }
- return this.stepValue(value);
- }
- convertPosToValue(posValue, dir) {
- const { maxRange } = this.data;
- const { max, min } = this.properties;
- return dir === 0
- ? (posValue / maxRange) * (Number(max) - Number(min)) + Number(min)
- : Number(max) - (posValue / maxRange) * (Number(max) - Number(min));
- }
- onLineTap(e) {
- const { disabled, theme, vertical } = this.properties;
- const { initialLeft, initialRight, maxRange, blockSize } = this.data;
- if (disabled)
- return;
- const [touch] = e.changedTouches;
- const pagePosition = this.getPagePosition(touch);
- const halfBlock = theme === 'capsule' ? Number(blockSize) / 2 : 0;
- const currentLeft = pagePosition - initialLeft;
- const currentRight = -(pagePosition - initialRight);
- if (currentLeft < 0 || currentRight > maxRange + Number(blockSize))
- return;
- Promise.all([getRect(this, '#leftDot'), getRect(this, '#rightDot')]).then(([leftDot, rightDot]) => {
- const pageScrollTop = this.pageScrollTop || 0;
- const leftDotPosition = vertical ? leftDot.top + pageScrollTop : leftDot.left;
- const distanceLeft = Math.abs(pagePosition - leftDotPosition - halfBlock);
- const rightDotPosition = vertical ? rightDot.top + pageScrollTop : rightDot.left;
- const distanceRight = Math.abs(rightDotPosition - pagePosition + halfBlock);
- const isMoveLeft = distanceLeft < distanceRight;
- let offset = 0;
- if (theme === 'capsule') {
- offset = Number(blockSize);
- if (vertical) {
- offset *= 2;
- }
- offset += 6;
- }
- else if (vertical) {
- offset = Number(blockSize);
- }
- if (isMoveLeft) {
- const left = pagePosition - initialLeft - offset;
- const leftValue = this.convertPosToValue(left, 0);
- this.triggerValue([this.stepValue(leftValue), this.data._value[1]]);
- }
- else {
- let right = -(pagePosition - initialRight);
- if (vertical) {
- right += offset / 2;
- }
- const rightValue = this.convertPosToValue(right, 1);
- this.triggerValue([this.data._value[0], this.stepValue(rightValue)]);
- }
- });
- }
- onTouchStart(e) {
- this.triggerEvent('dragstart', { e });
- const [touch] = e.changedTouches;
- if (e.currentTarget.id === 'rightDot') {
- this.data.identifier[1] = touch.identifier;
- }
- else {
- this.data.identifier[0] = touch.identifier;
- }
- }
- onTouchMoveLeft(e) {
- const { disabled, theme, vertical } = this.properties;
- const { initialLeft, _value, blockSize } = this.data;
- if (disabled)
- return;
- const touch = e.changedTouches.find((item) => item.identifier === this.data.identifier[0]);
- const pagePosition = this.getPagePosition(touch);
- let offset = 0;
- if (theme === 'capsule') {
- offset += Number(blockSize);
- }
- if (vertical) {
- offset += Number(blockSize) + 6;
- }
- const currentLeft = pagePosition - initialLeft - offset;
- const newData = [..._value];
- const leftValue = this.convertPosToValue(currentLeft, 0);
- newData[0] = this.stepValue(leftValue);
- this.triggerValue(newData);
- }
- onTouchMoveRight(e) {
- const { disabled, vertical } = this.properties;
- const { initialRight, _value, blockSize } = this.data;
- if (disabled)
- return;
- const touch = e.changedTouches.find((item) => item.identifier === this.data.identifier[1]);
- const pagePosition = this.getPagePosition(touch);
- let offset = 0;
- if (vertical) {
- offset += Number(blockSize) / 2 + 6;
- }
- const currentRight = -(pagePosition - initialRight - offset);
- const newData = [..._value];
- const rightValue = this.convertPosToValue(currentRight, 1);
- newData[1] = this.stepValue(rightValue);
- this.triggerValue(newData);
- }
- setLineStyle(left, right) {
- const { theme } = this.properties;
- const { blockSize, maxRange } = this.data;
- const halfBlock = theme === 'capsule' ? Number(blockSize) / 2 : 0;
- const [a, b] = this.data._value;
- const cut = (v) => parseInt(v, 10);
- this.setData({
- dotTopValue: [a, b],
- });
- if (left + right <= maxRange) {
- this.setData({
- lineLeft: cut(left + halfBlock),
- lineRight: cut(right + halfBlock),
- });
- }
- else {
- this.setData({
- lineLeft: cut(maxRange + halfBlock - right),
- lineRight: cut(maxRange - left + halfBlock * 1.5),
- });
- }
- }
- onTouchEnd(e) {
- this.triggerEvent('dragend', { e, value: this.data._value });
- if (e.currentTarget.id === 'rightDot') {
- this.data.identifier[1] = -1;
- }
- else {
- this.data.identifier[0] = -1;
- }
- }
- getPagePosition(touch) {
- const { pageX, pageY } = touch;
- const { vertical } = this.properties;
- return vertical ? pageY : pageX;
- }
-};
-Slider = __decorate([
- wxComponent()
-], Slider);
-export default Slider;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.json
deleted file mode 100644
index 4f0a3f08..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {}
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.wxml
deleted file mode 100644
index 8658f19d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.wxml
+++ /dev/null
@@ -1,159 +0,0 @@
-
-
-
-
-
-
- {{ label ? t.getValue(label, min) : min}}
-
-
-
-
-
- {{scaleTextArray[index]}}
-
-
-
-
-
-
- {{t.getValue(label, _value) || _value}}
-
-
-
-
-
-
-
- {{ label ? t.getValue(label, max) : max}}
-
-
-
-
-
- {{min}}
-
-
-
-
- {{scaleTextArray[index]}}
-
-
-
-
-
- {{t.getValue(label, dotTopValue[0]) || dotTopValue[0]}}
-
-
-
-
-
- {{t.getValue(label, dotTopValue[1]) || dotTopValue[1]}}
-
-
-
-
-
-
-
- {{max}}
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.wxs b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.wxs
deleted file mode 100644
index b4be3ff9..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.wxs
+++ /dev/null
@@ -1,10 +0,0 @@
-var REGEXP = getRegExp('[$][{value}]{7}');
-
-function getValue(label, value) {
- if (label && label === 'true') return value;
- if (REGEXP.test(label)) return label.replace(REGEXP, value);
-}
-
-module.exports = {
- getValue: getValue,
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.wxss
deleted file mode 100644
index 5d620617..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/slider.wxss
+++ /dev/null
@@ -1,275 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-slider {
- width: 100%;
- font-size: 14px;
- display: flex;
- align-items: center;
-}
-.t-slider--disabled .t-slider__value,
-.t-slider--disabled .t-slider__range-extreme,
-.t-slider--disabled .t-slider__dot-value,
-.t-slider--disabled .t-slider__scale-desc {
- color: var(--td-slider-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
-}
-.t-slider--disabled .t-slider__dot {
- background-color: var(--td-slider-dot-disabled-bg-color, #fff);
- border-color: var(--td-slider-dot-disabled-border-color, #f3f3f3);
-}
-.t-slider--top {
- padding-top: 40rpx;
-}
-.t-slider__line {
- position: absolute;
- top: 0;
- height: var(--td-slider-bar-height, 8rpx);
- border-radius: calc(var(--td-slider-bar-height, 8rpx) / 2);
- background-color: var(--td-slider-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-slider__line--disabled {
- background-color: var(--td-slider-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-slider__line--capsule {
- height: var(--td-slider-capsule-line-heihgt, 36rpx);
-}
-.t-slider__line--capsule.t-slider__line--single {
- border-top-left-radius: calc(var(--td-slider-capsule-line-heihgt, 36rpx) / 2);
- border-bottom-left-radius: calc(var(--td-slider-capsule-line-heihgt, 36rpx) / 2);
-}
-.t-slider__dot {
- border-radius: 50%;
- border: 2rpx solid var(--td-slider-dot-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc)));
- position: absolute;
- top: 50%;
- right: 0;
- transform: translate3d(50%, -50%, 0);
- z-index: 2;
- background-color: var(--td-slider-dot-bg-color, #fff);
- width: var(--td-slider-dot-size, 40rpx);
- height: var(--td-slider-dot-size, 40rpx);
- box-shadow: var(--td-shadow-1, 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12));
- box-sizing: border-box;
-}
-.t-slider__dot--left {
- left: 0;
- transform: translate3d(-50%, -50%, 0);
-}
-.t-slider__dot-value {
- position: relative;
- left: 50%;
- transform: translateX(-50%);
- top: -52rpx;
- text-align: center;
- width: 96rpx;
- height: 44rpx;
- line-height: 44rpx;
-}
-.t-slider__value,
-.t-slider__range-extreme,
-.t-slider__dot-value {
- color: var(--td-slider-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
-}
-.t-slider__value--sr-only,
-.t-slider__range-extreme--sr-only,
-.t-slider__dot-value--sr-only {
- position: absolute;
- width: 1px;
- height: 1px;
- padding: 0;
- overflow: hidden;
- clip: rect(0, 0, 0, 0);
- white-space: nowrap;
- clip-path: inset(50%);
- border: 0;
-}
-.t-slider__dot-slider {
- width: 100%;
- height: 100%;
- position: absolute;
- left: 0;
- top: 0;
-}
-.t-slider__value--min {
- margin-left: 32rpx;
-}
-.t-slider__value--max {
- margin-right: 32rpx;
-}
-.t-slider__value--right {
- flex-basis: 80rpx;
-}
-.t-slider__value--right__value--text {
- margin-right: 32rpx;
- text-align: right;
- display: block;
-}
-.t-slider__bar {
- margin: 16rpx 32rpx;
- flex: 10;
- background-clip: content-box;
- height: var(--td-slider-bar-height, 8rpx);
- border-radius: calc(var(--td-slider-bar-height, 8rpx) / 2);
- position: relative;
- background-color: var(--td-slider-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-slider__bar--capsule {
- height: var(--td-slider-capsule-bar-heihgt, 48rpx);
- border-radius: calc(var(--td-slider-capsule-bar-heihgt, 48rpx) / 2);
- background-color: var(--td-slider-capsule-bar-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- border: 6rpx solid var(--td-slider-capsule-bar-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- box-sizing: border-box;
-}
-.t-slider__bar--marks {
- background-color: var(--td-slider-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-slider__bar--disabled {
- background-color: var(--td-slider-default-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
-}
-.t-slider__range-extreme--min {
- margin-left: 32rpx;
- text-align: left;
-}
-.t-slider__range-extreme--max {
- margin-right: 32rpx;
- text-align: right;
-}
-.t-slider__scale-item {
- background-color: var(--td-slider-default-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- width: var(--td-slider-bar-height, 8rpx);
- height: 16rpx;
- width: 16rpx;
- border-radius: 50%;
- position: absolute;
- top: 50%;
- margin-top: -8rpx;
- z-index: 1;
-}
-.t-slider__scale-item--active {
- background-color: var(--td-slider-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-slider__scale-item--disabled {
- background-color: var(--td-slider-default-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
-}
-.t-slider__scale-item--active.t-slider__scale-item--disabled {
- background-color: var(--td-slider-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-slider__scale-item--capsule {
- height: var(--td-slider-capsule-line-heihgt, 36rpx);
- width: 4rpx;
- border-radius: 0;
- background-color: var(--td-slider-capsule-bar-color, var(--td-bg-color-component, var(--td-gray-color-3, #e7e7e7)));
- margin-top: calc(-0.5 * var(--td-slider-capsule-line-heihgt, 36rpx));
-}
-.t-slider__scale-item--hidden {
- background-color: transparent;
-}
-.t-slider__scale-desc {
- position: absolute;
- left: 50%;
- color: var(--td-slider-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- transform: translateX(-50%);
- bottom: 32rpx;
-}
-.t-slider__scale-desc--capsule {
- bottom: 46rpx;
-}
-.t-slider--vertical {
- --td-slider-bar-height: 400rpx;
- height: var(--td-slider-bar-height, 8rpx);
- justify-content: center;
- position: relative;
-}
-.t-slider--vertical .t-slider__bar {
- flex: none;
- height: 100%;
- width: var(--td-slider-bar-width, 8rpx);
-}
-.t-slider--vertical .t-slider__bar--capsule {
- width: var(--td-slider-capsule-bar-width, 48rpx);
- border-radius: calc(var(--td-slider-capsule-bar-width, 48rpx) / 2);
-}
-.t-slider--vertical .t-slider__line {
- width: 100%;
- height: unset;
- left: 0;
- border-radius: calc(var(--td-slider-bar-width, 8rpx) / 2);
-}
-.t-slider--vertical .t-slider__line--capsule.t-slider__line--single {
- border-top-left-radius: calc(var(--td-slider-capsule-line-heihgt, 36rpx) / 2);
- border-top-right-radius: calc(var(--td-slider-capsule-line-heihgt, 36rpx) / 2);
-}
-.t-slider--vertical .t-slider__dot {
- left: 50%;
- top: 100%;
- transform: translate(-50%, -50%);
-}
-.t-slider--vertical .t-slider__dot--left {
- top: 0;
- transform: translate(-50%, -50%);
- left: 50%;
-}
-.t-slider--vertical .t-slider__dot--right {
- left: 50%;
- transform: translate(-50%, -50%);
- top: 100%;
-}
-.t-slider--vertical .t-slider__dot-value {
- left: 54rpx;
- top: 50%;
- transform: translate(0, -50%);
- width: auto;
-}
-.t-slider--vertical .t-slider__range-extreme {
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- margin: 0;
-}
-.t-slider--vertical .t-slider__range-extreme--min {
- top: 0;
-}
-.t-slider--vertical .t-slider__range-extreme--max {
- bottom: 0;
-}
-.t-slider--vertical .t-slider__scale-item {
- left: 50%;
- margin-top: 0;
-}
-.t-slider--vertical .t-slider__scale-item--capsule {
- height: 4rpx;
- width: var(--td-slider-capsule-line-heihgt, 36rpx);
-}
-.t-slider--vertical .t-slider__scale-desc {
- top: 50%;
- transform: translateY(-50%);
- bottom: unset;
- left: 38rpx;
-}
-.t-slider--vertical .t-slider__scale-desc--capsule {
- left: 52rpx;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/tool.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/tool.d.ts
deleted file mode 100644
index b9383e65..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/tool.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export declare const trimSingleValue: (value: any, min: number, max: number) => number;
-export declare const trimValue: (value: number | number[], props: any) => number | number[];
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/tool.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/tool.js
deleted file mode 100644
index 671ab5d0..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/tool.js
+++ /dev/null
@@ -1,23 +0,0 @@
-export const trimSingleValue = (value, min, max) => {
- if (value < min) {
- return min;
- }
- if (value > max) {
- return max;
- }
- return value;
-};
-export const trimValue = (value, props) => {
- const { min, max, range } = props;
- if (range && Array.isArray(value)) {
- value[0] = trimSingleValue(value[0], min, max);
- value[1] = trimSingleValue(value[1], min, max);
- return value[0] <= value[1] ? value : [value[1], value[0]];
- }
- if (range) {
- return [min, max];
- }
- if (!range) {
- return trimSingleValue(value, min, max);
- }
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/type.d.ts
deleted file mode 100644
index 099ed6cd..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/type.d.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-export interface TdSliderProps {
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- label?: {
- type: null;
- value?: string | boolean;
- };
- marks?: {
- type: null;
- value?: Record | Array;
- };
- max?: {
- type: NumberConstructor;
- value?: number;
- };
- min?: {
- type: NumberConstructor;
- value?: number;
- };
- range?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- showExtremeValue?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- step?: {
- type: NumberConstructor;
- value?: number;
- };
- theme?: {
- type: StringConstructor;
- value?: 'default' | 'capsule';
- };
- value?: {
- type: null;
- value?: SliderValue;
- };
- defaultValue?: {
- type: null;
- value?: SliderValue;
- };
- vertical?: {
- type: BooleanConstructor;
- value?: boolean;
- };
-}
-export declare type SliderValue = number | Array;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/slider/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/README.en-US.md
deleted file mode 100644
index 643e0e6a..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/README.en-US.md
+++ /dev/null
@@ -1,26 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Sticky Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-container | Function | - | \- | N
-disabled | Boolean | false | \- | N
-offset-top | String / Number | 0 | \- | N
-z-index | Number | 99 | \- | N
-
-### Sticky Events
-
-name | params | description
--- | -- | --
-scroll | `(detail: { scrollTop: number, isFixed: boolean })` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
-### Sticky External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-content | \-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/README.md
deleted file mode 100644
index d96f6655..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
----
-title: Sticky 吸顶
-description: 用于常驻页面顶部的信息、操作展示。
-spline: data
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-sticky": "tdesign-miniprogram/sticky/sticky"
-}
-```
-
-## 代码演示
-
-将内容包裹在 `Sticky` 组件内
-
-
-
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 基础吸顶
-
-{{ base }}
-
-
-### 吸顶距离
-
-{{ offset }}
-
-### 指定容器
-
-{{ container }}
-
-
-
-## API
-
-### Sticky Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-container | Function | - | 函数返回容器对应的 NodesRef 节点,将对应节点指定为组件的外部容器,滚动时组件会始终保持在容器范围内,当组件即将超出容器底部时,会返回原位置。 | N
-disabled | Boolean | false | 是否禁用组件 | N
-offset-top | String / Number | 0 | 吸顶时与顶部的距离,单位`px` | N
-z-index | Number | 99 | 吸顶时的 z-index | N
-
-### Sticky Events
-
-名称 | 参数 | 描述
--- | -- | --
-scroll | `(detail: { scrollTop: number, isFixed: boolean })` | 滚动时触发,scrollTop: 距离顶部位置,isFixed: 是否吸顶。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts)
-### Sticky External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-content | 内容样式类
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/index.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/index.d.ts
deleted file mode 100644
index a6df66d3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './props';
-export * from './type';
-export * from './sticky';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/index.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/index.js
deleted file mode 100644
index a6df66d3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './props';
-export * from './type';
-export * from './sticky';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/props.d.ts
deleted file mode 100644
index 175af72e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdStickyProps } from './type';
-declare const props: TdStickyProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/props.js
deleted file mode 100644
index 6dcdf7c0..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/props.js
+++ /dev/null
@@ -1,18 +0,0 @@
-const props = {
- container: {
- type: null,
- },
- disabled: {
- type: Boolean,
- value: false,
- },
- offsetTop: {
- type: null,
- value: 0,
- },
- zIndex: {
- type: Number,
- value: 99,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.d.ts
deleted file mode 100644
index 89ba546f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.d.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-import type { TdStickyProps } from './type';
-export interface StickyProps extends TdStickyProps {
-}
-export default class Sticky extends SuperComponent {
- externalClasses: string[];
- properties: TdStickyProps;
- behaviors: string[];
- observers: {
- 'offsetTop, disabled, container'(): void;
- };
- data: {
- prefix: string;
- classPrefix: string;
- containerStyle: string;
- contentStyle: string;
- };
- ready(): void;
- methods: {
- onScroll(event?: {
- scrollTop: number;
- }): void;
- setDataAfterDiff(data: {
- isFixed: boolean;
- height?: number;
- transform?: number;
- }): void;
- getContainerRect(): Promise;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.js
deleted file mode 100644
index a71da333..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.js
+++ /dev/null
@@ -1,116 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import props from './props';
-import config from '../common/config';
-import pageScrollMixin from '../mixins/page-scroll';
-import { getRect } from '../common/utils';
-const { prefix } = config;
-const name = `${prefix}-sticky`;
-const ContainerClass = `.${name}`;
-let Sticky = class Sticky extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`, `${prefix}-class-content`];
- this.properties = props;
- this.behaviors = [pageScrollMixin()];
- this.observers = {
- 'offsetTop, disabled, container'() {
- this.onScroll();
- },
- };
- this.data = {
- prefix,
- classPrefix: name,
- containerStyle: '',
- contentStyle: '',
- };
- this.methods = {
- onScroll(event) {
- const { scrollTop } = event || {};
- const { container, offsetTop, disabled } = this.properties;
- if (disabled) {
- this.setDataAfterDiff({
- isFixed: false,
- transform: 0,
- });
- return;
- }
- this.scrollTop = scrollTop || this.scrollTop;
- if (typeof container === 'function') {
- Promise.all([getRect(this, ContainerClass), this.getContainerRect()]).then(([root, container]) => {
- if (!root || !container)
- return;
- if (offsetTop + root.height > container.height + container.top) {
- this.setDataAfterDiff({
- isFixed: false,
- transform: container.height - root.height,
- });
- }
- else if (offsetTop >= root.top) {
- this.setDataAfterDiff({
- isFixed: true,
- height: root.height,
- transform: 0,
- });
- }
- else {
- this.setDataAfterDiff({ isFixed: false, transform: 0 });
- }
- });
- return;
- }
- getRect(this, ContainerClass).then((root) => {
- if (!root)
- return;
- if (offsetTop >= root.top) {
- this.setDataAfterDiff({ isFixed: true, height: root.height });
- this.transform = 0;
- }
- else {
- this.setDataAfterDiff({ isFixed: false });
- }
- });
- },
- setDataAfterDiff(data) {
- const { offsetTop } = this.properties;
- const { containerStyle: prevContainerStyle, contentStyle: prevContentStyle } = this.data;
- const { isFixed, height, transform } = data;
- wx.nextTick(() => {
- let containerStyle = '';
- let contentStyle = '';
- if (isFixed) {
- containerStyle += `height:${height}px;`;
- contentStyle += `position:fixed;top:${offsetTop}px;left:0;right:0;`;
- }
- if (transform) {
- const translate = `translate3d(0, ${transform}px, 0)`;
- contentStyle += `-webkit-transform:${translate};transform:${translate};`;
- }
- if (prevContainerStyle !== containerStyle || prevContentStyle !== contentStyle) {
- this.setData({ containerStyle, contentStyle });
- }
- this.triggerEvent('scroll', {
- scrollTop: this.scrollTop,
- isFixed,
- });
- });
- },
- getContainerRect() {
- const nodesRef = this.properties.container();
- return new Promise((resolve) => nodesRef.boundingClientRect(resolve).exec());
- },
- };
- }
- ready() {
- this.onScroll();
- }
-};
-Sticky = __decorate([
- wxComponent()
-], Sticky);
-export default Sticky;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.json
deleted file mode 100644
index 4f0a3f08..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {}
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.wxml
deleted file mode 100644
index eb83ecac..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.wxml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.wxss
deleted file mode 100644
index 9a1af97f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/sticky.wxss
+++ /dev/null
@@ -1,30 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-sticky {
- position: relative;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/type.d.ts
deleted file mode 100644
index 36195d91..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/type.d.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-export interface TdStickyProps {
- container?: {
- type: undefined;
- value?: null;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- offsetTop?: {
- type: null;
- value?: string | number;
- };
- zIndex?: {
- type: NumberConstructor;
- value?: number;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/sticky/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/README.en-US.md
deleted file mode 100644
index 1271e390..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/README.en-US.md
+++ /dev/null
@@ -1,61 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Switch Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-custom-value | Array | [true, false] | Typescript:`Array` | N
-disabled | Boolean | undefined | \- | N
-icon | Array | [] | `0.27.0`。Typescript:`string[]` | N
-label | Array | [] | `0.27.0`。Typescript:`string[]` | N
-loading | Boolean | false | `0.27.0` | N
-size | String | medium | `0.27.0`。options: small/medium/large | N
-value | String / Number / Boolean | null | Typescript:`SwitchValue` `type SwitchValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
-default-value | String / Number / Boolean | undefined | uncontrolled property。Typescript:`SwitchValue` `type SwitchValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
-
-### Switch Events
-
-name | params | description
--- | -- | --
-change | `(value: SwitchValue)` | \-
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-switch-checked-color | @brand-color | -
---td-switch-checked-disabled-color | @brand-color-disabled | -
---td-switch-dot-border-color | @bg-color-secondarycontainer | -
---td-switch-dot-horizontal-margin | 6rpx | -
---td-switch-dot-large-size | 52rpx | -
---td-switch-dot-plain-horizontal-margin | 10rpx | -
---td-switch-dot-plain-large-size | 44rpx | -
---td-switch-dot-plain-size | 36rpx | -
---td-switch-dot-plain-small-size | 28rpx | -
---td-switch-dot-shadow | @shadow-1 | -
---td-switch-dot-size | 44rpx | -
---td-switch-dot-small-size | 36rpx | -
---td-switch-height | 56rpx | -
---td-switch-icon-large-size | 48rpx | -
---td-switch-icon-size | 40rpx | -
---td-switch-icon-small-size | 32rpx | -
---td-switch-label-checked-color | @switch-checked-color | -
---td-switch-label-color | @font-gray-4 | -
---td-switch-label-font-size | 28rpx | -
---td-switch-label-large-font-size | 32rpx | -
---td-switch-label-small-font-size | 24rpx | -
---td-switch-large-height | 64rpx | -
---td-switch-large-radius | calc(@switch-large-height / 2) | -
---td-switch-large-width | 104rpx | -
---td-switch-radius | calc(@switch-height / 2) | -
---td-switch-small-height | 48rpx | -
---td-switch-small-radius | calc(@switch-small-height / 2) | -
---td-switch-small-width | 78rpx | -
---td-switch-unchecked-color | @font-gray-4 | -
---td-switch-unchecked-disabled-color | @bg-color-component-disabled | -
---td-switch-width | 90rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/README.md
deleted file mode 100644
index 5bbc9c3a..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/README.md
+++ /dev/null
@@ -1,105 +0,0 @@
----
-title: Switch 开关
-description: 用于控制某个功能的开启和关闭。
-spline: form
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-switch": "tdesign-miniprogram/switch/switch"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 基础开关
-
-{{ base }}
-
-### 带描述开关
-
-{{ label }}
-
-### 自定义颜色
-
-{{ color }}
-
-### 开关状态
-
-{{ status }}
-
-### 尺寸
-
-{{ size }}
-
-## API
-
-### Switch Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-custom-value | Array | [true, false] | 用于自定义开关的值,[打开时的值,关闭时的值]。默认为 [true, false]。示例:[1, 0]、['open', 'close']。TS 类型:`Array` | N
-disabled | Boolean | undefined | 是否禁用组件。优先级:Switch.disabled > Form.disabled | N
-icon | Array | [] | `0.27.0`。开关的图标;[打开时的图标,关闭时的图标]。TS 类型:`string[]` | N
-label | Array | [] | `0.27.0`。开关的标签;[打开时的标签,关闭时的标签]。TS 类型:`string[]` | N
-loading | Boolean | false | `0.27.0`。是否处于加载中状态 | N
-size | String | medium | `0.27.0`。开关尺寸。可选项:small/medium/large | N
-value | String / Number / Boolean | null | 开关值。TS 类型:`SwitchValue` `type SwitchValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
-default-value | String / Number / Boolean | undefined | 开关值。非受控属性。TS 类型:`SwitchValue` `type SwitchValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/switch/type.ts) | N
-
-### Switch Events
-
-名称 | 参数 | 描述
--- | -- | --
-change | `(value: SwitchValue)` | 数据发生变化时触发
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-switch-checked-color | @brand-color | -
---td-switch-checked-disabled-color | @brand-color-disabled | -
---td-switch-dot-border-color | @bg-color-secondarycontainer | -
---td-switch-dot-horizontal-margin | 6rpx | -
---td-switch-dot-large-size | 52rpx | -
---td-switch-dot-plain-horizontal-margin | 10rpx | -
---td-switch-dot-plain-large-size | 44rpx | -
---td-switch-dot-plain-size | 36rpx | -
---td-switch-dot-plain-small-size | 28rpx | -
---td-switch-dot-shadow | @shadow-1 | -
---td-switch-dot-size | 44rpx | -
---td-switch-dot-small-size | 36rpx | -
---td-switch-height | 56rpx | -
---td-switch-icon-large-size | 48rpx | -
---td-switch-icon-size | 40rpx | -
---td-switch-icon-small-size | 32rpx | -
---td-switch-label-checked-color | @switch-checked-color | -
---td-switch-label-color | @font-gray-4 | -
---td-switch-label-font-size | 28rpx | -
---td-switch-label-large-font-size | 32rpx | -
---td-switch-label-small-font-size | 24rpx | -
---td-switch-large-height | 64rpx | -
---td-switch-large-radius | calc(@switch-large-height / 2) | -
---td-switch-large-width | 104rpx | -
---td-switch-radius | calc(@switch-height / 2) | -
---td-switch-small-height | 48rpx | -
---td-switch-small-radius | calc(@switch-small-height / 2) | -
---td-switch-small-width | 78rpx | -
---td-switch-unchecked-color | @font-gray-4 | -
---td-switch-unchecked-disabled-color | @bg-color-component-disabled | -
---td-switch-width | 90rpx | -
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/props.d.ts
deleted file mode 100644
index 489f18a3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdSwitchProps } from './type';
-declare const props: TdSwitchProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/props.js
deleted file mode 100644
index c50b1288..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/props.js
+++ /dev/null
@@ -1,35 +0,0 @@
-const props = {
- customValue: {
- type: Array,
- value: [true, false],
- },
- disabled: {
- type: null,
- value: undefined,
- },
- icon: {
- type: Array,
- value: [],
- },
- label: {
- type: Array,
- value: [],
- },
- loading: {
- type: Boolean,
- value: false,
- },
- size: {
- type: String,
- value: 'medium',
- },
- value: {
- type: null,
- value: null,
- },
- defaultValue: {
- type: null,
- value: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.d.ts
deleted file mode 100644
index 7db80024..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { SuperComponent } from '../common/src/index';
-export default class Switch extends SuperComponent {
- externalClasses: string[];
- behaviors: string[];
- properties: import("./type").TdSwitchProps;
- data: {
- prefix: string;
- classPrefix: string;
- checked: boolean;
- };
- controlledProps: {
- key: string;
- event: string;
- }[];
- observers: {
- value(val: any): void;
- };
- methods: {
- handleSwitch(): void;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.js
deleted file mode 100644
index 8f9277e2..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.js
+++ /dev/null
@@ -1,53 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { wxComponent, SuperComponent } from '../common/src/index';
-import config from '../common/config';
-import props from './props';
-const { prefix } = config;
-const name = `${prefix}-switch`;
-let Switch = class Switch extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = ['t-class', 't-class-label', 't-class-body', 't-class-dot'];
- this.behaviors = ['wx://form-field'];
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- checked: false,
- };
- this.controlledProps = [
- {
- key: 'value',
- event: 'change',
- },
- ];
- this.observers = {
- value(val) {
- const [activeValue] = this.data.customValue;
- this.setData({
- checked: val === activeValue,
- });
- },
- };
- this.methods = {
- handleSwitch() {
- const { loading, disabled, value, customValue } = this.data;
- const [activeValue, inactiveValue] = customValue;
- if (loading || disabled)
- return;
- this._trigger('change', {
- value: value === activeValue ? inactiveValue : activeValue,
- });
- },
- };
- }
-};
-Switch = __decorate([
- wxComponent()
-], Switch);
-export default Switch;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.json
deleted file mode 100644
index a32e8cdf..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-icon": "../icon/icon",
- "t-loading": "../loading/loading"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.wxml
deleted file mode 100644
index df9f312e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.wxml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
- {{checked ? label[0] : label[1]}}
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.wxss
deleted file mode 100644
index d4f19490..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/switch.wxss
+++ /dev/null
@@ -1,161 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-switch {
- display: flex;
- align-items: center;
- overflow: hidden;
-}
-.t-switch__label {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-wrap: nowrap;
- font-size: var(--td-switch-label-font-size, 28rpx);
- color: var(--td-switch-label-color, var(--td-bg-color-secondarycontainer-active, var(--td-gray-color-4, #dcdcdc)));
- overflow: hidden;
-}
-.t-switch__label--checked {
- color: var(--td-switch-label-checked-color, var(--td-switch-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
-}
-.t-switch__label--disabled {
- color: var(--td-switch-unchecked-disabled-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
-}
-.t-switch__label--checked.t-switch__label--disabled {
- color: var(--td-switch-checked-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-switch__label--large {
- font-size: var(--td-switch-label-large-font-size, 32rpx);
-}
-.t-switch__label--small {
- font-size: var(--td-switch-label-small-font-size, 24rpx);
-}
-.t-switch__label:empty {
- display: none;
-}
-.t-switch__icon {
- font-size: var(--td-switch-icon-size, 40rpx);
-}
-.t-switch__icon--large {
- font-size: var(--td-switch-icon-large-size, 48rpx);
-}
-.t-switch__icon--small {
- font-size: var(--td-switch-icon-small-size, 32rpx);
-}
-.t-switch__loading {
- color: var(--td-switch-label-checked-color, var(--td-switch-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))));
-}
-.t-switch__body {
- vertical-align: middle;
- width: var(--td-switch-width, 90rpx);
- height: var(--td-switch-height, 56rpx);
- border-radius: var(--td-switch-radius, calc(var(--td-switch-height, 56rpx) / 2));
- background-color: var(--td-switch-unchecked-color, var(--td-bg-color-secondarycontainer-active, var(--td-gray-color-4, #dcdcdc)));
- position: relative;
- transition: all 0.3s ease;
- overflow: hidden;
-}
-.t-switch__body--checked {
- background-color: var(--td-switch-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-switch__body--disabled {
- background-color: var(--td-switch-unchecked-disabled-color, var(--td-bg-color-component-disabled, var(--td-gray-color-2, #eeeeee)));
-}
-.t-switch__body--checked.t-switch__body--disabled {
- background-color: var(--td-switch-checked-disabled-color, var(--td-brand-color-disabled, var(--td-primary-color-3, #b5c7ff)));
-}
-.t-switch__body--large {
- width: var(--td-switch-large-width, 104rpx);
- height: var(--td-switch-large-height, 64rpx);
- border-radius: var(--td-switch-large-radius, calc(var(--td-switch-large-height, 64rpx) / 2));
-}
-.t-switch__body--small {
- width: var(--td-switch-small-width, 78rpx);
- height: var(--td-switch-small-height, 48rpx);
- border-radius: var(--td-switch-small-radius, calc(var(--td-switch-small-height, 48rpx) / 2));
-}
-.t-switch__dot {
- position: absolute;
- left: var(--td-switch-dot-horizontal-margin, 6rpx);
- top: 50%;
- width: var(--td-switch-dot-size, 44rpx);
- height: var(--td-switch-dot-size, 44rpx);
- border-radius: 50%;
- background-color: var(--td-text-color-anti, var(--td-font-white-1, #ffffff));
- transition: all 0.3s;
- transform: translateY(-50%);
- box-shadow: var(--td-switch-dot-shadow, var(--td-shadow-1, 0 1px 10px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12)));
-}
-.t-switch__dot:after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- width: 200%;
- height: 200%;
- border: 1px solid var(--td-switch-dot-border-color, var(--td-gray-color-4, #dcdcdc));
- border-radius: 50%;
- transform: scale(0.5);
- transform-origin: 0 0;
- box-sizing: border-box;
-}
-.t-switch__dot--large {
- width: var(--td-switch-dot-large-size, 52rpx);
- height: var(--td-switch-dot-large-size, 52rpx);
-}
-.t-switch__dot--small {
- width: var(--td-switch-dot-small-size, 36rpx);
- height: var(--td-switch-dot-small-size, 36rpx);
-}
-.t-switch__dot--checked {
- left: calc(var(--td-switch-width, 90rpx) - var(--td-switch-dot-size, 44rpx) - var(--td-switch-dot-horizontal-margin, 6rpx));
-}
-.t-switch__dot--large.t-switch__dot--checked {
- left: calc(var(--td-switch-large-width, 104rpx) - var(--td-switch-dot-large-size, 52rpx) - var(--td-switch-dot-horizontal-margin, 6rpx));
-}
-.t-switch__dot--small.t-switch__dot--checked {
- left: calc(var(--td-switch-small-width, 78rpx) - var(--td-switch-dot-small-size, 36rpx) - var(--td-switch-dot-horizontal-margin, 6rpx));
-}
-.t-switch__dot--plain:not(.t-switch__dot--checked) {
- width: var(--td-switch-dot-plain-size, 36rpx);
- height: var(--td-switch-dot-plain-size, 36rpx);
- left: var(--td-switch-dot-plain-horizontal-margin, 10rpx);
-}
-.t-switch__dot--large.t-switch__dot--plain:not(.t-switch__dot--checked) {
- width: var(--td-switch-dot-plain-large-size, 44rpx);
- height: var(--td-switch-dot-plain-large-size, 44rpx);
-}
-.t-switch__dot--small.t-switch__dot--plain:not(.t-switch__dot--checked) {
- width: var(--td-switch-dot-plain-small-size, 28rpx);
- height: var(--td-switch-dot-plain-small-size, 28rpx);
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/type.d.ts
deleted file mode 100644
index eecf2531..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/type.d.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-export interface TdSwitchProps {
- customValue?: {
- type: ArrayConstructor;
- value?: Array;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- icon?: {
- type: ArrayConstructor;
- value?: string[];
- };
- label?: {
- type: ArrayConstructor;
- value?: string[];
- };
- loading?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- size?: {
- type: StringConstructor;
- value?: 'small' | 'medium' | 'large';
- };
- value?: {
- type: null;
- value?: SwitchValue;
- };
- defaultValue?: {
- type: null;
- value?: SwitchValue;
- };
-}
-export declare type SwitchValue = string | number | boolean;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/switch/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/props.d.ts
deleted file mode 100644
index 9329be0d..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdTabPanelProps } from './type';
-declare const props: TdTabPanelProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/props.js
deleted file mode 100644
index 36216ca4..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/props.js
+++ /dev/null
@@ -1,23 +0,0 @@
-const props = {
- badgeProps: {
- type: Object,
- },
- disabled: {
- type: Boolean,
- value: false,
- },
- icon: {
- type: null,
- },
- label: {
- type: String,
- value: '',
- },
- panel: {
- type: String,
- },
- value: {
- type: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.d.ts
deleted file mode 100644
index c146e28b..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.d.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-///
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-export default class TabPanel extends SuperComponent {
- externalClasses: string[];
- relations: RelationsOptions;
- options: {
- multipleSlots: boolean;
- };
- properties: import("./type").TdTabPanelProps;
- data: {
- prefix: string;
- classPrefix: string;
- active: boolean;
- hide: boolean;
- id: string;
- };
- setId(id: any): void;
- observers: {
- 'label, badgeProps, disabled, icon, panel, value'(): void;
- };
- getComputedName(): string;
- update(): void;
- render(active: Boolean, parent: WechatMiniprogram.Component.TrivialInstance): void;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.js
deleted file mode 100644
index 22d5c3d0..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.js
+++ /dev/null
@@ -1,62 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import props from './props';
-import config from '../common/config';
-const { prefix } = config;
-const name = `${prefix}-tab-panel`;
-let TabPanel = class TabPanel extends SuperComponent {
- constructor() {
- super(...arguments);
- this.externalClasses = [`${prefix}-class`];
- this.relations = {
- '../tabs/tabs': {
- type: 'ancestor',
- },
- };
- this.options = {
- multipleSlots: true,
- };
- this.properties = props;
- this.data = {
- prefix,
- classPrefix: name,
- active: false,
- hide: true,
- id: '',
- };
- this.observers = {
- 'label, badgeProps, disabled, icon, panel, value'() {
- this.update();
- },
- };
- }
- setId(id) {
- this.setData({ id });
- }
- getComputedName() {
- if (this.properties.value != null) {
- return `${this.properties.value}`;
- }
- return `${this.index}`;
- }
- update() {
- var _a;
- (_a = this.$parent) === null || _a === void 0 ? void 0 : _a.updateTabs();
- }
- render(active, parent) {
- this.initialized = this.initialized || active;
- this.setData({
- active,
- hide: !parent.data.animation && !active,
- });
- }
-};
-TabPanel = __decorate([
- wxComponent()
-], TabPanel);
-export default TabPanel;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.json
deleted file mode 100644
index 4f0a3f08..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {}
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.wxml
deleted file mode 100644
index 5327c0e6..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.wxml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- {{panel}}
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.wxss
deleted file mode 100644
index 444cf58b..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/tab-panel.wxss
+++ /dev/null
@@ -1,42 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-tab-panel {
- flex-shrink: 0;
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- overflow-y: auto;
- -webkit-overflow-scrolling: touch;
-}
-.t-tab-panel--active {
- height: auto;
-}
-.t-tab-panel--inactive {
- height: 0;
- overflow: visible;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/type.d.ts
deleted file mode 100644
index 09416176..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/type.d.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { TabValue } from '../tabs/index';
-export interface TdTabPanelProps {
- badgeProps?: {
- type: ObjectConstructor;
- value?: object;
- };
- disabled?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- icon?: {
- type: null;
- value?: string | object;
- };
- label?: {
- type: StringConstructor;
- value?: string;
- };
- panel?: {
- type: StringConstructor;
- value?: string;
- };
- value?: {
- type: null;
- value?: TabValue;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tab-panel/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/README.en-US.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/README.en-US.md
deleted file mode 100644
index 6373bd99..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/README.en-US.md
+++ /dev/null
@@ -1,75 +0,0 @@
-:: BASE_DOC ::
-
-## API
-
-### Tabs Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-animation | Object | - | Typescript:`TabAnimation` `type TabAnimation = { duration: number } & Record`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
-middle | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-show-bottom-line | Boolean | true | \- | N
-space-evenly | Boolean | true | \- | N
-split | Boolean | true | \- | N
-sticky | Boolean | false | \- | N
-sticky-props | Object | - | Typescript:`StickyProps`,[Sticky API Documents](./sticky?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
-swipeable | Boolean | true | \- | N
-theme | String | line | options: line/tag/card | N
-value | String / Number | - | Typescript:`TabValue` `type TabValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
-default-value | String / Number | undefined | uncontrolled property。Typescript:`TabValue` `type TabValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
-
-### Tabs Events
-
-name | params | description
--- | -- | --
-change | `(value: TabValue, label: string)` | \-
-click | `(value: TabValue, label: string)` | \-
-scroll | `(scrollTop: number, isFixed: boolean)` | \-
-### Tabs External Classes
-
-className | Description
--- | --
-t-class | \-
-t-class-active | \-
-t-class-content | \-
-t-class-item | \-
-t-class-track | \-
-
-
-### TabPanel Props
-
-name | type | default | description | required
--- | -- | -- | -- | --
-style | Object | - | CSS(Cascading Style Sheets) | N
-custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
-badge-props | Object | - | \- | N
-disabled | Boolean | false | \- | N
-icon | String / Object | - | \- | N
-label | String | - | \- | N
-panel | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-value | String / Number | - | Typescript:`TabValue`,[Tabs API Documents](./tabs?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-panel/type.ts) | N
-
-### CSS Variables
-
-The component provides the following CSS variables, which can be used to customize styles.
-Name | Default Value | Description
--- | -- | --
---td-tab-border-color | @component-stroke | -
---td-tab-font-size | 28rpx | -
---td-tab-icon-size | 36rpx | -
---td-tab-item-active-color | @brand-color | -
---td-tab-item-color | @font-gray-1 | -
---td-tab-item-disabled-color | @font-gray-4 | -
---td-tab-item-height | 96rpx | -
---td-tab-item-tag-active-bg | @brand-color-light | -
---td-tab-item-tag-bg | @bg-color-secondarycontainer | -
---td-tab-item-tag-height | 64rpx | -
---td-tab-item-vertical-height | 108rpx | -
---td-tab-item-vertical-width | 208rpx | -
---td-tab-nav-bg-color | @bg-color-container | -
---td-tab-track-color | @brand-color | -
---td-tab-track-radius | 8rpx | -
---td-tab-track-thickness | 6rpx | -
---td-tab-track-width | 32rpx | -
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/README.md b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/README.md
deleted file mode 100644
index 9a60ce79..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/README.md
+++ /dev/null
@@ -1,188 +0,0 @@
----
-title: Tabs 选项卡
-description: 用于内容分类后的展示切换。
-spline: navigation
-isComponent: true
----
-
-


-## 引入
-
-全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
-
-```json
-"usingComponents": {
- "t-tabs": "tdesign-miniprogram/tabs/tabs",
- "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel"
-}
-```
-
-## 代码演示
-
- 在开发者工具中预览效果
-
-
-Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"
-
-
-### 基础选项卡
-
-{{ base }}
-
-### 等距选项卡
-
-{{ scroll }}
-
-### 带图标选项卡
-
-{{ with-icon }}
-
-### 带徽章选项卡
-
-{{ with-badge }}
-
-### 带内容区选项卡
-
-{{ with-content }}
-
-### 选项卡状态
-
-{{ status }}
-
-### 选项卡尺寸
-
-{{ size }}
-
-### 选项卡样式
-
-使用 theme 属性可以变换风格,支持 line = 线条(默认);tag = 标签;card = 卡片
-
-{{ theme }}
-
-
-
-
-
-
-### 受控用法
-
-```html
-
- 标签一内容
- 标签二内容
-
-```
-
-```js
-Page({
- data: {
- value: '0',
- },
- onTabsChange(e) {
- this.setData({ value: e.detail.value })
- },
-});
-```
-
-### 与 Popup 使用
-
-```html
-
-
- 标签一内容
- 标签二内容
- 标签三内容
-
-
-```
-
-```js
-Page({
- data: {
- visible: false
- },
- showPopup() {
- this.setData({
- visible: true
- }, () => {
- const tabs = this.selectComponent('tabs');
-
- tabs.setTrack(); // 这一步很重要,因为小程序的无法正确执行生命周期,所以需要手动设置下 tabs 的滑块
- })
- }
-})
-```
-
-## API
-
-### Tabs Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-animation | Object | - | 动画效果设置。其中 duration 表示动画时长。(单位:秒)。TS 类型:`TabAnimation` `type TabAnimation = { duration: number } & Record`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
-middle | Slot | - | 中间内容,介于头部和内容之间。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-show-bottom-line | Boolean | true | 是否展示底部激活线条 | N
-space-evenly | Boolean | true | 选项卡头部空间是否均分 | N
-split | Boolean | true | `1.1.10`。是否展示分割线 | N
-sticky | Boolean | false | 是否开启粘性布局 | N
-sticky-props | Object | - | 透传至 Sticky 组件。TS 类型:`StickyProps`,[Sticky API Documents](./sticky?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
-swipeable | Boolean | true | 是否可以滑动切换 | N
-theme | String | line | 标签的样式。可选项:line/tag/card | N
-value | String / Number | - | 激活的选项卡值。TS 类型:`TabValue` `type TabValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
-default-value | String / Number | undefined | 激活的选项卡值。非受控属性。TS 类型:`TabValue` `type TabValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
-
-### Tabs Events
-
-名称 | 参数 | 描述
--- | -- | --
-change | `(value: TabValue, label: string)` | 激活的选项卡发生变化时触发
-click | `(value: TabValue, label: string)` | 点击选项卡时触发
-scroll | `(scrollTop: number, isFixed: boolean)` | 页面滚动时触发
-### Tabs External Classes
-
-类名 | 描述
--- | --
-t-class | 根节点样式类
-t-class-active | 激活态样式类
-t-class-content | 内容样式类
-t-class-item | 选项样式类
-t-class-track | 滚动条样式类
-
-
-### TabPanel Props
-
-名称 | 类型 | 默认值 | 描述 | 必传
--- | -- | -- | -- | --
-style | Object | - | 样式 | N
-custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
-badge-props | Object | - | 透传至 Badge 组件 | N
-disabled | Boolean | false | 是否禁用当前选项卡 | N
-icon | String / Object | - | `1.0.0-rc.1`。图标,传对象则透传至 Icon | N
-label | String | - | 选项卡名称 | N
-panel | String / Slot | - | 用于自定义选项卡面板内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
-value | String / Number | - | 选项卡的值,唯一标识。TS 类型:`TabValue`,[Tabs API Documents](./tabs?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-panel/type.ts) | N
-
-### CSS Variables
-
-组件提供了下列 CSS 变量,可用于自定义样式。
-名称 | 默认值 | 描述
--- | -- | --
---td-tab-border-color | @component-stroke | -
---td-tab-font-size | 28rpx | -
---td-tab-icon-size | 36rpx | -
---td-tab-item-active-color | @brand-color | -
---td-tab-item-color | @font-gray-1 | -
---td-tab-item-disabled-color | @font-gray-4 | -
---td-tab-item-height | 96rpx | -
---td-tab-item-tag-active-bg | @brand-color-light | -
---td-tab-item-tag-bg | @bg-color-secondarycontainer | -
---td-tab-item-tag-height | 64rpx | -
---td-tab-item-vertical-height | 108rpx | -
---td-tab-item-vertical-width | 208rpx | -
---td-tab-nav-bg-color | @bg-color-container | -
---td-tab-track-color | @brand-color | -
---td-tab-track-radius | 8rpx | -
---td-tab-track-thickness | 6rpx | -
---td-tab-track-width | 32rpx | -
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/index.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/index.d.ts
deleted file mode 100644
index 2f91d158..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './tabs';
-export * from './type';
-export * from './props';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/index.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/index.js
deleted file mode 100644
index 2f91d158..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './tabs';
-export * from './type';
-export * from './props';
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/props.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/props.d.ts
deleted file mode 100644
index 215fa49f..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/props.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { TdTabsProps } from './type';
-declare const props: TdTabsProps;
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/props.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/props.js
deleted file mode 100644
index 9caa438a..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/props.js
+++ /dev/null
@@ -1,43 +0,0 @@
-const props = {
- animation: {
- type: Object,
- },
- externalClasses: {
- type: Array,
- },
- showBottomLine: {
- type: Boolean,
- value: true,
- },
- spaceEvenly: {
- type: Boolean,
- value: true,
- },
- split: {
- type: Boolean,
- value: true,
- },
- sticky: {
- type: Boolean,
- value: false,
- },
- stickyProps: {
- type: Object,
- },
- swipeable: {
- type: Boolean,
- value: true,
- },
- theme: {
- type: String,
- value: 'line',
- },
- value: {
- type: null,
- value: null,
- },
- defaultValue: {
- type: null,
- },
-};
-export default props;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.d.ts
deleted file mode 100644
index 1efdbf60..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.d.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-import { SuperComponent, RelationsOptions } from '../common/src/index';
-import { TdTabsProps } from './type';
-export interface TabsProps extends TdTabsProps {
-}
-export default class Tabs extends SuperComponent {
- options: {
- pureDataPattern: RegExp;
- };
- behaviors: string[];
- externalClasses: string[];
- relations: RelationsOptions;
- properties: TdTabsProps;
- controlledProps: {
- key: string;
- event: string;
- }[];
- observers: {
- value(name: any): void;
- };
- data: {
- prefix: string;
- classPrefix: string;
- tabs: any[];
- currentLabels: any[];
- currentIndex: number;
- trackStyle: string;
- offset: number;
- scrollLeft: number;
- tabID: string;
- placement: string;
- };
- lifetimes: {
- created(): void;
- attached(): void;
- };
- initChildId(): void;
- methods: {
- onScroll(e: any): void;
- updateTabs(cb: any): void;
- setCurrentIndexByName(name: any): void;
- setCurrentIndex(index: number): void;
- getCurrentName(): any;
- calcScrollOffset(containerWidth: number, targetLeft: number, targetWidth: number, offset: number): number;
- getTabHeight(): Promise;
- getTrackSize(): Promise;
- setTrack(): Promise;
- onTabTap(event: any): void;
- onTouchStart(event: any): void;
- onTouchMove(event: any): void;
- onTouchEnd(): void;
- onTouchScroll(event: WechatMiniprogram.CustomEvent): void;
- changeIndex(index: any): void;
- getAvailableTabIndex(deltaX: number): any;
- };
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.js
deleted file mode 100644
index 25efd5ab..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.js
+++ /dev/null
@@ -1,287 +0,0 @@
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-import { SuperComponent, wxComponent } from '../common/src/index';
-import props from './props';
-import config from '../common/config';
-import touch from '../mixins/touch';
-import { getRect, uniqueFactory } from '../common/utils';
-import { getObserver } from '../common/wechat';
-const { prefix } = config;
-const name = `${prefix}-tabs`;
-const getUniqueID = uniqueFactory('tabs');
-let Tabs = class Tabs extends SuperComponent {
- constructor() {
- super(...arguments);
- this.options = {
- pureDataPattern: /^currentLabels$/,
- };
- this.behaviors = [touch];
- this.externalClasses = [
- `${prefix}-class`,
- `${prefix}-class-item`,
- `${prefix}-class-active`,
- `${prefix}-class-track`,
- `${prefix}-class-content`,
- ];
- this.relations = {
- '../tab-panel/tab-panel': {
- type: 'descendant',
- linked(target) {
- this.children.push(target);
- this.initChildId();
- target.index = this.children.length - 1;
- this.updateTabs();
- },
- unlinked(target) {
- this.children = this.children.filter((item) => item.index !== target.index);
- this.updateTabs(() => this.setTrack());
- this.initChildId();
- },
- },
- };
- this.properties = props;
- this.controlledProps = [
- {
- key: 'value',
- event: 'change',
- },
- ];
- this.observers = {
- value(name) {
- if (name !== this.getCurrentName()) {
- this.setCurrentIndexByName(name);
- }
- },
- };
- this.data = {
- prefix,
- classPrefix: name,
- tabs: [],
- currentLabels: [],
- currentIndex: -1,
- trackStyle: '',
- offset: 0,
- scrollLeft: 0,
- tabID: '',
- placement: 'top',
- };
- this.lifetimes = {
- created() {
- this.children = this.children || [];
- },
- attached() {
- wx.nextTick(() => {
- this.setTrack();
- });
- getRect(this, `.${name}`).then((rect) => {
- this.containerWidth = rect.width;
- });
- this.setData({
- tabID: getUniqueID(),
- });
- },
- };
- this.methods = {
- onScroll(e) {
- const { scrollLeft } = e.detail;
- this.setData({
- scrollLeft,
- });
- },
- updateTabs(cb) {
- const { children } = this;
- const tabs = children.map((child) => child.data);
- tabs.forEach((item) => {
- if (typeof item.icon === 'string') {
- item.icon = { name: item.icon };
- }
- });
- this.setData({ tabs }, cb);
- this.setCurrentIndexByName(this.properties.value);
- },
- setCurrentIndexByName(name) {
- const { children } = this;
- const index = children.findIndex((child) => child.getComputedName() === `${name}`);
- if (index > -1) {
- this.setCurrentIndex(index);
- }
- },
- setCurrentIndex(index) {
- if (index <= -1 || index >= this.children.length)
- return;
- const Labels = [];
- this.children.forEach((child, idx) => {
- const isActive = index === idx;
- if (isActive !== child.data.active || !child.initialized) {
- child.render(isActive, this);
- }
- Labels.push(child.data.label);
- });
- const { currentIndex, currentLabels } = this.data;
- if (currentIndex === index && currentLabels.join('') === Labels.join(''))
- return;
- this.setData({
- currentIndex: index,
- currentLabels: Labels,
- }, () => {
- this.setTrack();
- });
- },
- getCurrentName() {
- if (this.children) {
- const activeTab = this.children[this.data.currentIndex];
- if (activeTab) {
- return activeTab.getComputedName();
- }
- }
- },
- calcScrollOffset(containerWidth, targetLeft, targetWidth, offset) {
- return offset + targetLeft - (1 / 2) * containerWidth + targetWidth / 2;
- },
- getTabHeight() {
- return getRect(this, `.${name}`);
- },
- getTrackSize() {
- return new Promise((resolve, reject) => {
- if (this.trackWidth) {
- resolve(this.trackWidth);
- return;
- }
- getRect(this, `.${prefix}-tabs__track`)
- .then((res) => {
- if (res) {
- this.trackWidth = res.width;
- resolve(this.trackWidth);
- }
- })
- .catch(reject);
- });
- },
- setTrack() {
- return __awaiter(this, void 0, void 0, function* () {
- const { children } = this;
- if (!children)
- return;
- const { currentIndex } = this.data;
- if (currentIndex <= -1)
- return;
- try {
- const res = yield getRect(this, `.${prefix}-tabs__item`, true);
- const rect = res[currentIndex];
- if (!rect)
- return;
- let count = 0;
- let distance = 0;
- let totalSize = 0;
- res.forEach((item) => {
- if (count < currentIndex) {
- distance += item.width;
- count += 1;
- }
- totalSize += item.width;
- });
- if (this.containerWidth) {
- const offset = this.calcScrollOffset(this.containerWidth, rect.left, rect.width, this.data.scrollLeft);
- const maxOffset = totalSize - this.containerWidth;
- this.setData({
- offset: Math.min(Math.max(offset, 0), maxOffset),
- });
- }
- else if (!this._hasObserved) {
- this._hasObserved = true;
- getObserver(this, `.${name}`).then(() => this.setTrack());
- }
- if (this.data.theme === 'line') {
- const trackLineWidth = yield this.getTrackSize();
- distance += (rect.width - trackLineWidth) / 2;
- }
- this.setData({
- trackStyle: `-webkit-transform: translateX(${distance}px);
- transform: translateX(${distance}px);
- `,
- });
- }
- catch (err) {
- this.triggerEvent('error', err);
- }
- });
- },
- onTabTap(event) {
- const { index } = event.currentTarget.dataset;
- this.changeIndex(index);
- },
- onTouchStart(event) {
- if (!this.properties.swipeable)
- return;
- this.touchStart(event);
- },
- onTouchMove(event) {
- if (!this.properties.swipeable)
- return;
- this.touchMove(event);
- },
- onTouchEnd() {
- if (!this.properties.swipeable)
- return;
- const { direction, deltaX, offsetX } = this;
- const minSwipeDistance = 50;
- if (direction === 'horizontal' && offsetX >= minSwipeDistance) {
- const index = this.getAvailableTabIndex(deltaX);
- if (index !== -1) {
- this.changeIndex(index);
- }
- }
- },
- onTouchScroll(event) {
- this._trigger('scroll', event.detail);
- },
- changeIndex(index) {
- const currentTab = this.data.tabs[index];
- const { value, label } = currentTab;
- if (!(currentTab === null || currentTab === void 0 ? void 0 : currentTab.disabled) && index !== this.data.currentIndex) {
- this._trigger('change', { value, label });
- }
- this._trigger('click', { value, label });
- },
- getAvailableTabIndex(deltaX) {
- const step = deltaX > 0 ? -1 : 1;
- const { currentIndex, tabs } = this.data;
- const len = tabs.length;
- for (let i = step; currentIndex + step >= 0 && currentIndex + step < len; i += step) {
- const newIndex = currentIndex + i;
- if (newIndex >= 0 && newIndex < len && tabs[newIndex]) {
- if (!tabs[newIndex].disabled) {
- return newIndex;
- }
- }
- else {
- return currentIndex;
- }
- }
- return -1;
- },
- };
- }
- initChildId() {
- this.children.forEach((item, index) => {
- item.setId(`${this.data.tabID}_panel_${index}`);
- });
- }
-};
-Tabs = __decorate([
- wxComponent()
-], Tabs);
-export default Tabs;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.json b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.json
deleted file mode 100644
index f9b94dba..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "component": true,
- "styleIsolation": "apply-shared",
- "usingComponents": {
- "t-sticky": "../sticky/sticky",
- "t-badge": "../badge/badge",
- "t-icon": "../icon/icon"
- }
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.wxml b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.wxml
deleted file mode 100644
index 611045a2..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.wxml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.label}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.wxs b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.wxs
deleted file mode 100644
index b3f1e42e..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.wxs
+++ /dev/null
@@ -1,16 +0,0 @@
-/* eslint-disable */
-
-function animate(options) {
- var result = [];
-
- if (options.duration) {
- result.push('transition-duration: ' + options.duration + 's');
- result.push('transform: translate3d( ' + -100 * options.currentIndex + '%,0, 0)');
- }
-
- return result.join(';');
-}
-
-module.exports = {
- animate: animate,
-};
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.wxss b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.wxss
deleted file mode 100644
index d6d0a264..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/tabs.wxss
+++ /dev/null
@@ -1,210 +0,0 @@
-.t-float-left {
- float: left;
-}
-.t-float-right {
- float: right;
-}
-@keyframes tdesign-fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
-}
-.hotspot-expanded.relative {
- position: relative;
-}
-.hotspot-expanded::after {
- content: '';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- transform: scale(1.5);
-}
-.t-tabs {
- position: relative;
- font-size: var(--td-tab-font-size, 28rpx);
- background: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
- flex-wrap: wrap;
-}
-.t-tabs__wrapper {
- display: flex;
- overflow: hidden;
- background: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-tabs__wrapper--card {
- background: var(--td-tab-item-tag-bg, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
- --td-tab-border-color: transparent;
-}
-.t-tabs__item {
- position: relative;
- display: flex;
- flex: none;
- align-items: center;
- justify-content: center;
- font-weight: 400;
- color: var(--td-tab-item-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
- padding: 0 var(--td-spacer-2, 32rpx);
- box-sizing: border-box;
- white-space: nowrap;
- overflow: hidden;
- height: var(--td-tab-item-height, 96rpx);
-}
-.t-tabs__item--active {
- font-weight: 600;
- color: var(--td-tab-item-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-tabs__item--disabled {
- color: var(--td-tab-item-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
-}
-.t-tabs__item--evenly {
- flex: 1 0 auto;
-}
-.t-tabs__item-inner {
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.t-tabs__item-inner--tag {
- width: 100%;
- text-align: center;
- padding: 0 var(--td-spacer-2, 32rpx);
- line-height: var(--td-tab-item-tag-height, 64rpx);
- border-radius: calc(var(--td-tab-item-tag-height, 64rpx) / 2);
- background-color: var(--td-tab-item-tag-bg, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
-}
-.t-tabs__item-inner--active.t-tabs__item-inner--tag {
- background-color: var(--td-tab-item-tag-active-bg, var(--td-brand-color-light, var(--td-primary-color-1, #f2f3ff)));
-}
-.t-tabs__item--tag:not(.t-tabs__item--evenly) {
- padding: 0 calc(var(--td-spacer, 16rpx) / 2);
-}
-.t-tabs__item--tag:not(.t-tabs__item--evenly):first-child {
- margin-left: var(--td-spacer, 16rpx);
-}
-.t-tabs__item--tag:not(.t-tabs__item--evenly):last-child {
- padding-right: var(--td-spacer-1, 24rpx);
-}
-.t-tabs__item--tag {
- padding: 0 var(--td-spacer, 16rpx);
-}
-.t-tabs__item--card.t-tabs__item--active {
- background-color: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
- border-radius: var(--td-radius-large, 18rpx) var(--td-radius-large, 18rpx) 0 0;
-}
-.t-tabs__item--card.t-tabs__item--active:first-child {
- border-top-left-radius: 0;
-}
-.t-tabs__item--card.t-tabs__item--active:last-child {
- border-top-right-radius: 0;
-}
-.t-tabs__item--card.t-tabs__item--pre {
- border-bottom-right-radius: var(--td-radius-large, 18rpx);
-}
-.t-tabs__item-prefix,
-.t-tabs__item-suffix {
- position: absolute;
- bottom: 0;
- width: 18rpx;
- height: 18rpx;
- background-color: var(--td-tab-nav-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
-}
-.t-tabs__item-prefix::after,
-.t-tabs__item-suffix::after {
- content: '';
- display: block;
- width: 100%;
- height: 100%;
- background-color: var(--td-tab-item-tag-bg, var(--td-bg-color-secondarycontainer, var(--td-gray-color-1, #f3f3f3)));
-}
-.t-tabs__item-prefix {
- right: 0;
-}
-.t-tabs__item-prefix::after {
- border-bottom-right-radius: var(--td-radius-large, 18rpx);
-}
-.t-tabs__item-suffix {
- left: 0;
-}
-.t-tabs__item-suffix::after {
- border-bottom-left-radius: var(--td-radius-large, 18rpx);
-}
-.t-tabs__badge--active {
- --td-badge-content-text-color: var(--td-tab-item-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
-}
-.t-tabs__badge--disabled {
- --td-badge-content-text-color: var(--td-tab-item-disabled-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
-}
-.t-tabs__icon {
- font-size: var(--td-tab-icon-size, 36rpx);
- margin-right: calc(var(--td-spacer, 16rpx) / 4);
-}
-.t-tabs__content {
- overflow: hidden;
-}
-.t-tabs__nav {
- position: relative;
- user-select: none;
- display: flex;
- flex-wrap: nowrap;
- align-items: center;
-}
-.t-tabs__nav.t-tabs__nav--evenly {
- width: 100%;
-}
-.t-tabs__track {
- position: absolute;
- font-weight: 600;
- z-index: 1;
- transition-duration: 0.3s;
- background-color: var(--td-tab-track-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
- left: 0;
- bottom: 1rpx;
- width: var(--td-tab-track-width, 32rpx);
- height: var(--td-tab-track-thickness, 6rpx);
- border-radius: var(--td-tab-track-radius, 8rpx);
-}
-.t-tabs__scroll {
- position: relative;
- height: var(--td-tab-item-height, 96rpx);
-}
-.t-tabs__scroll--split {
- position: relative;
-}
-.t-tabs__scroll--split::after {
- content: '';
- display: block;
- position: absolute;
- top: unset;
- bottom: 0;
- left: unset;
- right: unset;
- background-color: var(--td-tab-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
-}
-.t-tabs__scroll--split::after {
- height: 1px;
- left: 0;
- right: 0;
- transform: scaleY(0.5);
-}
-.t-tabs__scroll::-webkit-scrollbar {
- display: none;
-}
-.t-tabs__content {
- width: 100%;
-}
-.t-tabs__content-inner {
- display: block;
-}
-.t-tabs__content--animated .t-tabs__content-inner {
- position: relative;
- width: 100%;
- height: 100%;
- display: flex;
- will-change: left;
- transition-property: transform;
-}
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/type.d.ts b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/type.d.ts
deleted file mode 100644
index 2e0a9464..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/type.d.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { StickyProps } from '../sticky/index';
-export interface TdTabsProps {
- animation?: {
- type: ObjectConstructor;
- value?: TabAnimation;
- };
- externalClasses?: {
- type: ArrayConstructor;
- value?: ['t-class', 't-class-item', 't-class-active', 't-class-track'];
- };
- showBottomLine?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- spaceEvenly?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- split?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- sticky?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- stickyProps?: {
- type: ObjectConstructor;
- value?: StickyProps;
- };
- swipeable?: {
- type: BooleanConstructor;
- value?: boolean;
- };
- theme?: {
- type: StringConstructor;
- value?: 'line' | 'tag' | 'card';
- };
- value?: {
- type: null;
- value?: TabValue;
- };
- defaultValue?: {
- type: null;
- value?: TabValue;
- };
-}
-export declare type TabAnimation = {
- duration: number;
-} & Record;
-export declare type TabValue = string | number;
diff --git a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/type.js b/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/type.js
deleted file mode 100644
index cb0ff5c3..00000000
--- a/miniprogram/packageChatTool/components/tdesign-miniprogram/tabs/type.js
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/miniprogram/packageChatTool/entry.js b/miniprogram/packageChatTool/entry.js
deleted file mode 100644
index 5f4ba0a6..00000000
--- a/miniprogram/packageChatTool/entry.js
+++ /dev/null
@@ -1,6 +0,0 @@
-wx.cloud.init({
- env: 'release-b86096',
- traceUser: true,
-})
-
-const enterOptions = wx.getEnterOptionsSync()
diff --git a/miniprogram/packageChatTool/pages/activity_create/index.js b/miniprogram/packageChatTool/pages/activity_create/index.js
deleted file mode 100644
index 4f64a1cc..00000000
--- a/miniprogram/packageChatTool/pages/activity_create/index.js
+++ /dev/null
@@ -1,295 +0,0 @@
-// pages/activity_create/index.js
-import { getChatToolInfo } from '../../util'
-
-// const defaultShareImage = 'https://p9.itc.cn/q_70/images03/20211124/d7dce66b866c4ccd805190a4925ff707.png'
-
-function checkTitle(str) {
- const regex = /^[\u4e00-\u9fa5a-zA-Z0-9]+$/
- let actualLength = 0
- for (let i = 0; i < str.length; i++) {
- actualLength += /[\u4e00-\u9fa5]/.test(str[i]) ? 2 : 1
- }
- if (actualLength === 0 || actualLength > 30) {
- return false
- }
- return regex.test(str)
-}
-
-Page({
-
- data: {
- title: '',
- shareImage: '',
- shareImageCloudFile: '',
- limitNumber: false,
- number: 0,
- dateTextStart: '2024-10-11',
- dateTextEnd: '2025-12-11',
-
- mode: '',
- dateVisible: false,
- date: new Date().getTime(), // 支持时间戳传入
-
- // 指定选择区间起始值
- start: '2024-01-01 00:00:00',
- end: '2030-09-09 12:12:12',
-
- dateOption: 'Start',
- participant: [],
- activityId: '',
- useAssigner: true,
- },
-
- onLoad(options) {
- this.createActivityID()
-
- getChatToolInfo()
- .then(resp => {
- console.info()
- })
- },
-
- createActivityID() {
- return wx.cloud.callFunction({
- name: 'openapi',
- data: {
- action: 'createActivityId',
- }
- }).then(resp => {
- if (resp.result) {
- this.data.activityId = resp.result.activityId
- }
- }).catch(err => {
- console.error('createActivityId fail : ', err)
- })
- },
-
- onTitleChange(e) {
- this.data.title = e.detail.value
- },
-
- showStartPicker(e) {
- this.data.dateOption = 'Start'
- this.showPicker(e)
- },
-
- showEndPicker(e) {
- this.data.dateOption = 'End'
- this.showPicker(e)
- },
-
- showPicker(e) {
- const { mode } = e.currentTarget.dataset
- this.setData({
- mode,
- [`${mode}Visible`]: true,
- })
- },
- hidePicker() {
- const { mode } = this.data
- this.setData({
- [`${mode}Visible`]: false,
- })
- },
- onConfirm(e) {
- const { value } = e.detail
- const { mode, dateOption } = this.data
-
- console.log('confirm', value)
-
- this.setData({
- [mode]: value,
- [`${mode}Text${dateOption}`]: value,
- })
-
- this.hidePicker()
- },
-
- onColumnChange(e) {
- console.log('pick', e.detail.value)
- },
-
- chooseShareImage() {
- const that = this
- wx.chooseImage({
- count: 1,
- success(res) {
- const shareImage = res.tempFilePaths[0]
- that.setData({
- shareImage,
- })
-
- wx.showLoading({
- title: '上传中...',
- })
-
- wx.cloud.uploadFile({
- cloudPath: `image-${Date.now()}.png`, // 上传至云端的路径
- filePath: shareImage,
- success: res => {
- // 返回文件 ID
- console.log('uploadFile: ', res.fileID)
- that.setData({
- shareImageCloudFile: res.fileID
- })
- },
- fail: console.error,
- complete(res) {
- wx.hideLoading()
- }
- })
- }
- })
- },
-
- changeLimitNumber() {
- this.setData({
- limitNumber: !this.data.limitNumber
- })
- },
-
- changeAssigner() {
- this.setData({
- useAssigner: !this.data.useAssigner
- })
- if (!this.data.useAssigner) {
- this.setData({
- participant: []
- })
- }
- },
-
- onNumberChange(e) {
- this.setData({
- number: e.detail.value
- })
- },
-
- chooseParticipant() {
- const that = this
- const { limitNumber, number } = this.data
- wx.selectGroupMembers({
- maxSelectCount: limitNumber ? number : -1,
- success(res) {
- that.setData({
- participant: res.members
- })
- },
- complete(res) {
- console.info('selectGroupMembers: ', res)
- }
- })
- },
-
- async publish() {
- const {
- title,
- shareImage,
- dateTextStart,
- dateTextEnd,
- participant,
- activityId,
- shareImageCloudFile,
- useAssigner,
- } = this.data
-
- if (!checkTitle(title)) {
- wx.showToast({
- title: '标题只能为中英文数字,长度小于30',
- icon: 'none'
- })
- return
- }
-
- if (!title || !dateTextStart || !dateTextEnd || !shareImage) {
- wx.showToast({
- icon: 'none',
- title: '表单未填写完',
- })
- return
- }
-
- if (useAssigner && !participant.length) {
- wx.showToast({
- icon: 'none',
- title: '参与者不能为空',
- })
- return
- }
-
- if (!activityId) {
- this.createActivityID(() => {
- this.publish()
- })
- }
-
- const that = this
- const coverImage = shareImageCloudFile
-
- wx.showLoading({})
-
- getChatToolInfo()
- .then(resp => {
- wx.cloud.callFunction({
- name: 'quickstartFunctions',
- data: {
- type: 'addRecord',
- activityId,
- roomid: resp.roomid,
- chatType: resp.chatType,
- title,
- coverImage,
- startTime: dateTextStart,
- endTime: dateTextEnd,
- participant,
- signIn: [],
- }
- }).then(resp => {
- const params = {
- withShareTicket: true,
- isUpdatableMessage: true,
- activityId,
- participant,
- useForChatTool: true,
- chooseType: useAssigner ? 1 : 2,
- templateInfo: {
- templateId: '4A68CBB88A92B0A9311848DBA1E94A199B166463'
- }
- }
- wx.updateShareMenu({
- ...params,
- success(res) {
- wx.shareAppMessageToGroup({
- title,
- path: `packageChatTool/pages/activity_detail/index?activityId=${activityId}`,
- imageUrl: shareImage,
- complete(res) {
- console.info('shareAppMessageToGroup: ', res)
- }
- })
- },
- fail(res) {
- console.info('updateShareMenu fail: ', res)
- wx.showToast({
- title: '分享失败',
- icon: 'none'
- })
- },
- complete(res) {
- wx.hideLoading({})
-
- that.data.activityId = ''
- that.createActivityID()
- console.info('updateShareMenu complete: ', res)
- }
- })
- })
- }).catch((err) => {
- console.error('publish fail: ', err)
- wx.showToast({
- icon: 'none',
- title: '发布失败',
- })
- })
- },
-})
diff --git a/miniprogram/packageChatTool/pages/activity_create/index.json b/miniprogram/packageChatTool/pages/activity_create/index.json
deleted file mode 100644
index eba0e065..00000000
--- a/miniprogram/packageChatTool/pages/activity_create/index.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "usingComponents": {
- "t-switch": "../../components/tdesign-miniprogram/switch/switch",
- "t-slider": "../../components/tdesign-miniprogram/slider/slider",
- "t-navbar": "../../components/tdesign-miniprogram/navbar/navbar",
- "t-cell": "../../components/tdesign-miniprogram/cell/cell",
- "t-cell-group": "../../components/tdesign-miniprogram/cell-group/cell-group",
- "t-button": "../../components/tdesign-miniprogram/button/button",
- "t-image": "../../components/tdesign-miniprogram/image/image",
- "t-icon": "../../components/tdesign-miniprogram/icon/icon"
- },
- "navigationStyle": "custom"
-}
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/pages/activity_create/index.wxml b/miniprogram/packageChatTool/pages/activity_create/index.wxml
deleted file mode 100644
index e2da1baa..00000000
--- a/miniprogram/packageChatTool/pages/activity_create/index.wxml
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
- 基础设置
-
-
-
-
- 时间设置
-
-
-
-
-
- 高级设置
-
-
-
-
-
-
-
-
-
-
-
-
- 选择参与人{{participant.length ? '(已选 ' + participant.length + ' 人)' : ''}}
-
-
-
-
-
- 分享设置
-
-
-
-
-
-
-
-
-
-
- 发布
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/pages/activity_create/index.wxss b/miniprogram/packageChatTool/pages/activity_create/index.wxss
deleted file mode 100644
index fcc0eae5..00000000
--- a/miniprogram/packageChatTool/pages/activity_create/index.wxss
+++ /dev/null
@@ -1,40 +0,0 @@
-/* pages/activity_create/index.wxss */
-
-page {
- background: rgb(237, 237, 237);
- height: 100vh;
- --td-navbar-bg-color: rgb(237, 237, 237);
-}
-
-.center {
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.page-container {
- height: 100%;
- width: 100%;
- box-sizing: border-box;
-}
-
-
-.card {
- margin: 0 32rpx;
- margin-bottom: 32rpx;
-}
-.card-title {
- padding: 32rpx 0;
- color: rgb(112, 107, 107);
-}
-
-.cell {
- background-color: #fff;
- height: 48rpx;
- line-height: 48rpx;
- padding: 32rpx;
-}
-
-.btn {
- width: 100% !important;
-}
diff --git a/miniprogram/packageChatTool/pages/activity_detail/index.js b/miniprogram/packageChatTool/pages/activity_detail/index.js
deleted file mode 100644
index adaca218..00000000
--- a/miniprogram/packageChatTool/pages/activity_detail/index.js
+++ /dev/null
@@ -1,324 +0,0 @@
-// pages/activity_create/index.js
-import { getChatToolInfo } from '../../util'
-
-const roleType = ['unkown', 'owner', 'participant', 'nonParticipant']
-
-const activityStatus = ['未开始', '进行中', '已结束']
-
-const { envVersion } = wx.getAccountInfoSync().miniProgram
-
-const getVersionType = () => {
- if (envVersion === 'release') {
- return 0
- } else if (envVersion === 'develop') {
- return 1
- } else if (envVersion === 'trial') {
- return 2
- }
-
- return 0
-}
-
-Page({
-
- data: {
- isOwner: false,
- members: [],
- role: roleType[0],
- activityId: '',
- activityInfo: {},
- signIn: [],
- notSignIn: [],
- participant: [],
-
- signInStatus: false,
- activityStatusStar: '',
-
- showProgress: false,
- percent: '0',
-
- groupInfo: null,
- progressImage: '',
- showBackBtn: false,
- triggered: false,
- },
-
- onLoad(options) {
- this.data.activityId = options.activityId
- this.fetchActivity()
-
- const pages = getCurrentPages()
- this.setData({
- showBackBtn: pages.length > 1
- })
- },
-
- onBack() {
- wx.navigateBack({ delta: 1 })
- },
-
- onRefresh() {
- if (this._freshing) return
- this._freshing = true
-
- this.fetchActivity().then(() => {
- this.setData({
- triggered: false,
- })
- this._freshing = false
- })
- },
-
- onRestore(e) {
- console.log('onRestore:', e)
- },
-
- onAbort(e) {
- console.log('onAbort', e)
- },
-
- onGoHome() {
- wx.reLaunch({
- url: '/packageAPI/pages/chattool/activity_assist/activity_assist',
- complete(res) {
- console.info('relaunch', res)
- }
- })
- },
-
- refreshData(activityInfo, groupInfo, useFake = true) {
- const {
- participant,
- signIn,
- creator,
- } = activityInfo
-
- const notSignIn = participant.filter(i => !signIn.includes(i))
-
- const { groupOpenID, roomid, openid } = groupInfo
-
- const percent = participant.length ? Math.ceil(signIn.length / participant.length * 100) : 0
- const isOwner = creator === openid
-
- let role
- if (roomid !== activityInfo.roomid) {
- role = roleType[3]
- } else {
- role = participant.includes(groupOpenID)
- ? roleType[2]
- : (isOwner ? roleType[1] : roleType[3])
- }
-
- if (participant.length === 0) {
- role = roleType[2]
- }
-
- this.setData({
- role,
- isOwner,
- signInStatus: signIn.includes(groupOpenID),
- activityInfo,
- members: signIn,
- signIn,
- notSignIn,
- participant,
- percent
- })
-
- this.updateProgressImage()
- },
-
- async fetchActivity() {
- const that = this
-
- await getChatToolInfo().then(groupInfo => {
- that.data.groupInfo = groupInfo
-
- wx.cloud.callFunction({
- name: 'quickstartFunctions',
- data: {
- type: 'selectRecord',
- activityId: this.data.activityId,
- }
- }).then(resp => {
- if (resp.result.success) {
- const activityInfo = resp.result.activityInfo
- that.refreshData(activityInfo, groupInfo)
- } else {
- wx.showToast({
- title: '活动未找到',
- icon: 'none'
- })
- }
- }).catch(err => {
- console.info('fetchActivity fail: ', err)
- })
- })
- },
-
- onTabsChange(e) {
- const type = e.detail.value
- this.setData({
- members: this.data[type]
- })
- },
-
- notifyNotSignIn() {
- const { activityId, notSignIn, activityInfo } = this.data
- if (!activityInfo._id) return
-
- wx.notifyGroupMembers({
- title: activityInfo.title,
- type: 'participate',
- members: notSignIn,
- entrancePath: `packageChatTool/pages/activity_detail/index?activityId=${activityId}`,
- complete(res) {
- console.info('notifyGroupMembers: ', res)
- }
- })
- },
-
- signIn() {
- const that = this
- const { signIn, activityInfo, groupInfo } = this.data
- const { roomid, groupOpenID } = groupInfo
-
- if (signIn.includes(groupOpenID)) {
- wx.showToast({
- title: '已签到',
- icon: 'none'
- })
- return
- }
-
- wx.cloud.callFunction({
- name: 'quickstartFunctions',
- data: {
- type: 'signIn',
- roomid,
- groupOpenID,
- activityId: this.data.activityId,
- }
- }).then(resp => {
- if (resp.result.success) {
- const { signIn } = activityInfo
- signIn.push(groupOpenID)
- that.refreshData(activityInfo, groupInfo, false)
- that.updateChatToolMsg({
- targetState: 1,
- parameterList: [{
- groupOpenID,
- state: 1,
- }]
- })
- } else {
- wx.showToast({
- title: '报名失败',
- icon: 'none'
- })
- }
- }).catch(err => {
- console.info('signIn fail: ', err)
- })
- },
-
- remindExpiration() {
- this.updateChatToolMsg({
- targetState: 2,
- })
- wx.showToast({
- title: '已触发',
- icon: 'none'
- })
- },
-
- earlyTerminate() {
- this.updateChatToolMsg({
- targetState: 3,
- })
- wx.showToast({
- title: '已触发',
- icon: 'none'
- })
- },
-
- updateChatToolMsg(params = {}) {
- const { targetState, parameterList } = params
- // const templateId = '2A84254B945674A2F88CE4970782C402795EB607' // 参与
- const templateId = '4A68CBB88A92B0A9311848DBA1E94A199B166463' // 完成
-
- wx.cloud.callFunction({
- name: 'openapi',
- data: {
- action: 'updateChatToolMsg',
- activityId: this.data.activityId,
- targetState: targetState || 1,
- templateId,
- parameterList: parameterList || [],
- versionType: getVersionType()
- }
- }).then(resp => {
- console.info('updateChatToolMsg: ', resp)
- }).catch(err => {
- console.info('updateChatToolMsg Fail: ', err)
- })
- },
-
- updateProgressImage() {
- const that = this
- setTimeout(() => {
- this.createSelectorQuery()
- .select('#target')
- .node()
- .exec(res => {
- const node = res[0].node
- node.takeSnapshot({
- type: 'file',
- format: 'png',
- success: (res) => {
- const imagePath = res.tempFilePath
- console.info('snapshot: ', imagePath)
- that.data.progressImage = imagePath
- },
- fail(res) {
- console.info('takeSnapshot fail: ', res)
- wx.showToast({
- title: '分享进度失败',
- icon: 'none'
- })
- }
- })
- })
- }, 20)
- },
-
- sendProgress() {
- const { progressImage, activityId } = this.data
- const entrancePath = `packageChatTool/pages/activity_detail/index?activityId=${activityId}`
- wx.shareImageToGroup({
- imagePath: progressImage,
- needShowEntrance: true,
- entrancePath,
- complete(res) {
- console.info('shareImageToGroup: ', res)
- }
- })
- },
-
- share() {
- const { activityInfo, activityId } = this.data
- if (!activityInfo._id) return
-
- wx.cloud.downloadFile({
- fileID: activityInfo.coverImage,
- success: res => {
- wx.shareAppMessageToGroup({
- title: activityInfo.title,
- imageUrl: res.tempFilePath,
- path: `packageChatTool/pages/activity_detail/index?activityId=${activityId}`,
- })
- },
- fail: console.error
- })
- },
-})
diff --git a/miniprogram/packageChatTool/pages/activity_detail/index.json b/miniprogram/packageChatTool/pages/activity_detail/index.json
deleted file mode 100644
index e9ce3fa9..00000000
--- a/miniprogram/packageChatTool/pages/activity_detail/index.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "usingComponents": {
- "t-switch": "../../components/tdesign-miniprogram/switch/switch",
- "t-slider": "../../components/tdesign-miniprogram/slider/slider",
- "t-navbar": "../../components/tdesign-miniprogram/navbar/navbar",
- "t-cell": "../../components/tdesign-miniprogram/cell/cell",
- "t-cell-group": "../../components/tdesign-miniprogram/cell-group/cell-group",
- "t-button": "../../components/tdesign-miniprogram/button/button",
- "t-image": "../../components/tdesign-miniprogram/image/image",
- "t-icon": "../../components/tdesign-miniprogram/icon/icon",
- "t-tabs": "../../components/tdesign-miniprogram/tabs/tabs",
- "t-tab-panel": "../../components/tdesign-miniprogram/tab-panel/tab-panel",
- "t-progress": "../../components/tdesign-miniprogram/progress/progress",
- "t-loading": "../../components/tdesign-miniprogram/loading/loading"
- },
- "navigationStyle": "custom"
-}
\ No newline at end of file
diff --git a/miniprogram/packageChatTool/pages/activity_detail/index.wxml b/miniprogram/packageChatTool/pages/activity_detail/index.wxml
deleted file mode 100644
index 5fb2bdb1..00000000
--- a/miniprogram/packageChatTool/pages/activity_detail/index.wxml
+++ /dev/null
@@ -1,185 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 活动标题
-
-
-
-
-
-
-
-
-
-
-
-
- 签到情况
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 提醒未参与用户
-
-
-
-
- 发送签到进度
-
-
-
-
-
-
- 活动签到
- 签到
-
-
-
-
-
-
- 活动签到
- 未参与该活动
-
-
-
-
-
-
- 活动签到
- 获取活动信息失败
-
-
-
-
-
-
-
-
- 系统消息指令
- 触发即将结束
-
-
- 触发活动结束
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageChatTool/pages/activity_detail/index.wxss b/miniprogram/packageChatTool/pages/activity_detail/index.wxss
deleted file mode 100644
index e3c99abd..00000000
--- a/miniprogram/packageChatTool/pages/activity_detail/index.wxss
+++ /dev/null
@@ -1,87 +0,0 @@
-/* pages/activity_create/index.wxss */
-
-.custom-capsule {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.custom-capsule__icon {
- flex: 1;
- position: relative;
-}
-
-.custom-capsule__icon.home:before {
- content: '';
- display: block;
- position: absolute;
- left: -1px;
- top: 50%;
- transform: translateY(-50%);
- width: 1px;
- height: 18px;
- background: #e7e7e7;
-}
-
-
-page {
- background: rgb(237, 237, 237);
- height: 100vh;
- --td-navbar-bg-color: rgb(237, 237, 237);
-}
-
-.center {
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.page-container {
- height: 100%;
- width: 100%;
- box-sizing: border-box;
-}
-
-.card {
- margin: 0 32rpx;
- margin-bottom: 32rpx;
-}
-.card-title {
- padding: 32rpx 0;
- padding-top: 0;
- color: rgb(112, 107, 107);
-}
-
-.card-content {
- background-color: #fff;
-}
-
-.cell {
- background-color: #fff;
- height: 48rpx;
- line-height: 48rpx;
- padding: 32rpx;
-}
-
-.member-list {
- background-color: #fff;
- padding-top: 32rpx;
-}
-
-.userinfo {
- display: flex;
- flex-direction: row;
- align-items: center;
- padding: 10px;
- /* border-bottom: 0.5px solid #ccc; */
-}
-.avatar {
- margin-right: 32rpx;
- width: 56px;
- height: 56px;
-}
-
-.btn {
- width: 100% !important;
-}
diff --git a/miniprogram/packageChatTool/util.js b/miniprogram/packageChatTool/util.js
deleted file mode 100644
index 258fa8fd..00000000
--- a/miniprogram/packageChatTool/util.js
+++ /dev/null
@@ -1,41 +0,0 @@
-export function getChatToolInfo() {
- return new Promise((resolve, reject) => {
- wx.getChatToolInfo({
- success(res) {
- const cloudID = res.cloudID
- wx.cloud.callFunction({
- name: 'quickstartFunctions',
- data: {
- type: 'getGroupEnterInfo',
- groupInfo: wx.cloud.CloudID(cloudID)
- }
- }).then(resp => {
- const groupInfo = resp.result.groupInfo
- if (groupInfo && groupInfo.data) {
- const openid = resp.result.openid
- const opengid = groupInfo.data.opengid
- const openSingleRoomID = groupInfo.data.open_single_roomid
- const groupOpenID = groupInfo.data.group_openid
- const data = {
- openid,
- groupOpenID,
- roomid: opengid || openSingleRoomID,
- chatType: groupInfo.data.chat_type
- }
- resolve(data)
- } else {
- reject()
- }
- }).catch(err => {
- reject(err)
- })
- },
- fail(res) {
- reject(res)
- },
- complete(res) {
- console.info('getChatToolInfo complete: ', res)
- }
- })
- })
-}
diff --git a/miniprogram/packageComponent/pages/form/button/button.js b/miniprogram/packageComponent/pages/form/button/button.js
deleted file mode 100644
index dd8a5a27..00000000
--- a/miniprogram/packageComponent/pages/form/button/button.js
+++ /dev/null
@@ -1,106 +0,0 @@
-const types = ['default', 'primary', 'warn']
-const pageObject = {
- data: {
- theme: 'light',
- defaultSize: 'default',
- primarySize: 'default',
- warnSize: 'default',
- disabled: false,
- plain: false,
- loading: false,
- canIUseGetUserProfile: false
- },
-
- onShareAppMessage() {
- return {
- title: 'button',
- path: 'packageComponent/pages/form/button/button'
- }
- },
-
- setDisabled() {
- this.setData({
- disabled: !this.data.disabled
- })
- },
-
- setPlain() {
- this.setData({
- plain: !this.data.plain
- })
- },
-
- setLoading() {
- this.setData({
- loading: !this.data.loading
- })
- },
-
- handleContact(e) {
- console.log(e.detail)
- },
-
- handleGetPhoneNumber(e) {
- console.log(e.detail)
- },
-
- handleOpenSetting(e) {
- console.log(e.detail.authSetting)
- },
-
- handleGetUserInfo(e) {
- console.log('getUserInfo: ', e.detail.userInfo)
- },
- handleGetUserProfile(e) {
- wx.getUserProfile({
- desc: '用于演示 wx.getUserProfile', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
- success: (res) => {
- console.log('wx.getUserProfile: ', res.userInfo)
- }
- })
- },
- handleChooseavatar(e) {
- console.log('handleChooseavatar', e)
- const avatarUrl = e.detail.avatarUrl
- // 把 url 提示出来
- wx.showToast({
- title: avatarUrl,
- icon: 'none',
- duration: 3000
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- if (wx.getUserProfile) {
- this.setData({
- canIUseGetUserProfile: true
- })
- }
- }
-}
-
-for (let i = 0; i < types.length; ++i) {
- (function (type) {
- pageObject[type] = function () {
- const key = `${type}Size`
- const changedData = {}
- changedData[key] = this.data[key] === 'default' ? 'mini' : 'default'
- this.setData(changedData)
- }
- }(types[i]))
-}
-
-Page(pageObject)
diff --git a/miniprogram/packageComponent/pages/form/button/button.json b/miniprogram/packageComponent/pages/form/button/button.json
deleted file mode 100644
index a5313830..00000000
--- a/miniprogram/packageComponent/pages/form/button/button.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "navigationBarTitleText": "button",
- "componentFramework": "glass-easel",
- "renderer": "skyline",
- "disableScroll": true,
- "navigationStyle": "custom"
-}
diff --git a/miniprogram/packageComponent/pages/form/button/button.wxml b/miniprogram/packageComponent/pages/form/button/button.wxml
deleted file mode 100644
index 9906542b..00000000
--- a/miniprogram/packageComponent/pages/form/button/button.wxml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageComponent/pages/form/button/button.wxss b/miniprogram/packageComponent/pages/form/button/button.wxss
deleted file mode 100644
index ec1ab825..00000000
--- a/miniprogram/packageComponent/pages/form/button/button.wxss
+++ /dev/null
@@ -1,24 +0,0 @@
-@import "../../../../common/reset.wxss";
-
-button{
- margin-top: 0px;
- margin-bottom: 15px;
-}
-.button-sp-area{
- margin: 0 auto;
- width: 60%;
-}
-.mini-btn{
- margin-right: 5px;
-}
-
-button[loading] {
- flex-direction: row;
- align-items: center;
-}
-
-button[loading]::before {
- margin: 0;
- flex-shrink: 0;
- font-size: 0;
-}
diff --git a/miniprogram/packageComponent/pages/form/checkbox/checkbox.js b/miniprogram/packageComponent/pages/form/checkbox/checkbox.js
deleted file mode 100644
index 9cd716b5..00000000
--- a/miniprogram/packageComponent/pages/form/checkbox/checkbox.js
+++ /dev/null
@@ -1,57 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'checkbox',
- path: 'packageComponent/pages/form/checkbox/checkbox'
- }
- },
-
- data: {
- theme: 'light',
- items: [
- { value: 'USA', name: '美国' },
- { value: 'CHN', name: '中国', checked: 'true' },
- { value: 'BRA', name: '巴西' },
- { value: 'JPN', name: '日本' },
- { value: 'ENG', name: '英国' },
- { value: 'FRA', name: '法国' }
- ]
- },
-
- checkboxChange(e) {
- console.log('checkbox发生change事件,携带value值为:', e.detail.value)
-
- const items = this.data.items
- const values = e.detail.value
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
-
- for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].value === values[j]) {
- items[i].checked = true
- break
- }
- }
- }
-
- this.setData({
- items
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageComponent/pages/form/checkbox/checkbox.json b/miniprogram/packageComponent/pages/form/checkbox/checkbox.json
deleted file mode 100644
index 22cddb60..00000000
--- a/miniprogram/packageComponent/pages/form/checkbox/checkbox.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "navigationBarTitleText": "checkbox",
- "componentFramework": "glass-easel",
- "renderer": "skyline",
- "disableScroll": true,
- "navigationStyle": "custom"
-}
\ No newline at end of file
diff --git a/miniprogram/packageComponent/pages/form/checkbox/checkbox.wxml b/miniprogram/packageComponent/pages/form/checkbox/checkbox.wxml
deleted file mode 100644
index 601995de..00000000
--- a/miniprogram/packageComponent/pages/form/checkbox/checkbox.wxml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
- 默认样式
-
-
-
-
- 推荐展示样式
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageComponent/pages/form/checkbox/checkbox.wxss b/miniprogram/packageComponent/pages/form/checkbox/checkbox.wxss
deleted file mode 100644
index 56a68111..00000000
--- a/miniprogram/packageComponent/pages/form/checkbox/checkbox.wxss
+++ /dev/null
@@ -1,8 +0,0 @@
-@import "../../../../common/reset.wxss";
-@import '../../../../common//lib/weui.wxss';
-.checkbox{
- margin-right: 10px;
-}
-.page-section-content{
- padding: 0 20px;
-}
diff --git a/miniprogram/packageComponent/pages/form/editor/assets/iconfont.wxss b/miniprogram/packageComponent/pages/form/editor/assets/iconfont.wxss
deleted file mode 100644
index 9ff2f5ca..00000000
--- a/miniprogram/packageComponent/pages/form/editor/assets/iconfont.wxss
+++ /dev/null
@@ -1,240 +0,0 @@
-@font-face {font-family: "iconfont";
- src: url('//at.alicdn.com/t/font_945958_zfsfjju1dim.eot?t=1547618146468'); /* IE9 */
- src: url('//at.alicdn.com/t/font_945958_zfsfjju1dim.eot?t=1547618146468#iefix') format('embedded-opentype'), /* IE6-IE8 */
- url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAABdkAAsAAAAALvAAABcWAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCKSgrBdLN+ATYCJAOBZAt0AAQgBYRtB4YRG7smRSQnqz4jqjWV7P9bAidjcG3cMssRirV6WRdYIhSPI7KwpqTEWqtc6K4YeK6yr9OvxbcdprxM/yib6gio0BZ+n7Rt/V9XwX9lINMYSgkPeG++5I+ba4GUClKqlqSIS6hYyq38QNv8d5x65OEhRh+sdQE7jL5NnPgnihL75TgDFuUqOW2WuvRY8VkVv8LJj8Zl6Y80f+Xx8HZ7/9/tWGoR13aUWBZEaSABZpQkkIVz9psLXwo4ADJiSk74UeimQCl/LdkLu3A5Lb9fLdiAfKs0jVd6s5bW0vrllU9aXUOpAIbgIBQAP4AF4GQAwNjv66z+twPSe3YyEXkJoUQ7zmyGcJHc2NVJ3y0N0HJgEQJLfBSQrqKmOVa8TZaSWNiEpAWmBqH+vylGDwgxZs4BANAGCCDwC//E1Xjv8RV9Igu2Cl/+HldFYWn3eMChdGNoISXOzb/OdLV8cYCdC0/AGw1beE226f8vwwcrF1k++JYDtkM61rHsAPEEG2Or7ysYCtZdilMAh63AY6e+jmP3qVBzmePWPyDU3kl9GHOfD1sDjzw0JUUixbX+Wp8hgFtelxinUgsImeg1AURf5lWDUKiZim3BSbAlb2vGLpQztwwCn/z74mMcDpJV0LsvzqI6oL+d0InD/qznq9VobgRW78AAXWBCntKlOKD+qsvgPvzOkJgBa0Wm9DtBKi1KPiNGnaXW2aLZ9/6ZPFXz5zLruHXfxERF2tTejuTtxONJF9iLS6Lns9rShlznoJfC2gm2xX10zPS5AVb8KQ8QMjwkL7egkJi0FB+/AJMlLCIqwebg5LJkiEvKyskrKCopq6iqqWtoamnr6OrpGxgaGZuYmplbQDTY9ALkba+XUBMYEFCpIAOlBR4oCkiofOCFMgI3lB0EoRgQgqoDMaglIA21FKSg1gEf1Bbgh2oGAajvgQn1H7BwnQzCuD4PIrhWgSiuf4IEbgywcasFDtzqgBM3B3DhXgeWeE4EBrQIxKEjQBJ6A8hCbwQ56E0gD+0CBWgWFKEbQAm6EZShm0AFuhlUoVtADboV1KHbTANqh2lCbpgWtBWmDW2D6UDbYbrQDpgetBOmD+2CGUAdMEOoE2YE7YYZQ3tgJtBemCl0BGYGeWHm0AmcsACwcl98APALuAfgvdCFePA6xwmWI0lmMIBucnImpQhjJZc8FHMoMUwEpuUSkFKxqXUhZwocJppG7g5lRWlxWeEco+wVN5zisZtVpL9w3/MmkyqHMS3ctynbem5lnk1RccrFpipqksYNMD3MamvcVFj6yWTix1lVdexd2SCkpCOw9pOuQSseVli8owDLTKAdNaS0se2Cp4NS1JQNF06dCWlCOUyC517Nm779nP/w50B+3UrlHq6eFtLRSX57SeoR2WIO5Q3XjCr2eaJbUCO66DgMmTb1BOYkuKlu70buw8ticceQVNc05DQpEuCABw184AcabEQOefRE/hwHIkVepip6kMQZQQo0ebgBAbKfymd6MNotLFMpQYZHhQkUCT7+2fi2InSE4aJe2sP8eAIUiBcdyC27w8VnqyVINaBDhRXwIDeOpOsHs353eqJMqTQx25TYU1RV/vp9Sod+qgNqOMwihEuRkCMSZsoc4vRco56qrzkzhvZnUSwDW1nY70k000Tr+VWu/DFz5vb/oZbf6NktJWx6SaXqra+UeKcpl6s733LySCl+JafnzaJROM8E4dFPE7zDP69EAixFSJj2ZQAoPvxxvGfgh0YmBDx6GkNmdmyHEYlYERlUaqS/Pko8V+ofO1Roslatoyp2g+E4MeoOpETSjpgokoDs9I/vVtUCLfAdPIM/Lg8+/nmid+inc3GQoRHrOxK4/yBer1J4RsDkC5iOkUTP3bfFscn+tv7iTPFqXs9NE64VjsYzLKfPVuRUsVxV0vV4Z3PiatYosFkHE8rbaM6stInu4+vXs2OTSbSjtTfLi3vL83ujdjnaSwirACuBMVaVXCm64lKjsmRJy0BJ7314dfp0m+iRxGdzBR6cZCBcG+P0X8eQOdruuQKlaiJeTY/qmVZzLTO2Hw+3Pi0so+Riq3g1raemAVnCO3NGLDh0LWNk8biRYZFN1B2TImSLE9ejVOnv1Sp1j5qepYSGFlA+83AiQJVEG+CGHsqQSIDlOkvjDovI1NLTprSVuGOylG62X46houlKqqjYNqLrxhr6ZgCzInWW3YkKHK9hqQix+/UciTqZaWwKCewnY25XWn5iPxCoWh3/F9HvzJLF0e7A/JFw+g8A7CdKkSAFyiCJGj9r05XHYChtdBxY0xduMvp0Oxp0Xeo3nCOVqu4vmvnRazMRTgf8SK5EjMtEsUne4DBLj67vIMM1HKYIcsKiDQeWNwvWcmtAj3mjovv9tY4MCFdyozy9+enB68WxvHEECXQLVFSAGhkI9I4JvEj0tKHMWUqx/WzAihA7ihXSPBBIIqwXvMcnMzvdwKPpPnuJI7JlI3LArKhi5605B2eTrzcILtSMeAMzVvC8ysh0wZRAR6RkrcX7NHwbtbGmvJJPCgn9fYVz/pBPE0qQh6MxEt02XYrqsblLQs032qCi+HA1wW5hn9s3LmBruJSVrhHb2wUs3j1sT5fxqLj7JHfU/vsNqkeFJ77BD1d3ii8OBYmVYhlK+zIzhCupUVxvq3U2lhpZMx0lI6WWl/QcWTOqdLpmWo+0WWcDL3/cM5h/0kvF8kLdC3kPr07UQLPRlXlaCKq1NiEKjZ5mZOTADd4oukwbvF2FjkuvH/y6XHz8/cTGLjUfEYnQbV1RGtdiDcG6M+Nb3cXtBiGrFm+T1bNxcAaSKN1hnAuRmiQTaEI1XKpse1AidbJsA5YjXG++jJ18PzHZP3Tr2SneGHSLczJhpSDAt1Iqvbzy+svxumxVNHNaq0iW96hVKmV4TorVaqWrpHjFqrpXLkEp02qR3NO2VzPGEWH/0bIZ4UL7ofeZulOWO+IL+etqvKGDwc8+MitrUOyt1ieNJadcDaAW4dj6SZET+CQmRL62ESmQjaNMPF2l8Boos1MpNBawRRMdD7a1q3G1VVY80qlNGVjjWEXnxoj8dlnWUYGyZj/UdNfL015l+rg49vYUoxIXfKK57+didGA53dRn3QBovyEDxTJ1raZ/3aH304JUpAEicsiBdg5VUcELiSTWNstiQ65ERAruxu8XNSrAZGUYzTTRc1oN4+BD/gHV35on54GrJiwf9ABac8CwO6hpQhDBuhHlFhMAjcgT59ULkNuylmRtG3j4fNovPZEqzS9P9XZFLvUPMNetDsUebGmPFJllMkY2i29cZ2uC0lLtvbSXl5bqEczDz5k2dzKfsq7EOpzhx9H2k53uG4rW1vFaktLeZg0+lDrbX+7zxg6q7tPRnp4nsTiwDOVffcwWyxhStloEnZPSUb5M9JJiPRqSfrZR2ev0Z81oN7coaQ51Yi8LmhJ44YRjj1uEHNFzR60biwfllwn0dskl54ybpKIHnplLMAZe8ZmD0JAWYA/GN373p4tm+T+vuqvpeuXPJp785TqAwIf+H8v/HBxzfdj148Ki48f08rNYifCMXH/9OGp5/BLhWewRdlbIB99aim3KNhH7CM+Ez9wirkdUGIW6ZnhgKME84RnRoss9qg/nplf0mIsVuFjanUyE/Rfa4V+WBdctK5wDq9UV3LbajizMq12Ya41sIf7vYW/ftt2aZE1JtaXetqR0LT6QVDxvuW29fc5qADuDFCMGu92AWDU8mmr1ag0Y5JrQGc+h/AOhc+rYuXPnVMqQqxXz7bODjJ9X9Z0WjGhOaUYEp/v7h+UZ5PUjsF5ksqvNFBKpwcjXSEzTYn52SVi+4ch1MkM+3Pi65YmUT/LSJ9uJeUTSt61PMrK37bOMHcDK8fIJA06iC2LwaB7LwPhEjOm+ZCaJlnSEPES/D7n1Pu4m5NaJkJCTAZYByLJf+UXv9rDbezs7b+/ZjgEK+rZ7t5s7S8skktLyjo4JuaUs606/h/bk4zsADWxW52fXgrK7suC1ivSK6OHoRbAo7El04JOYMC8dgPR1kXujn4TFJYNCYZjTfD27+iio9LOFQlWptIXrfagfLtzpr9JXZWXsaghFqiqVhdOaCivLdRfT+ZaHxT7xSPSIxCcZfr5FPShLj9eZ/MNhf8zHQtqYmcf7efw4zv+TRt5fFGmn/oyR875YsLRw7F9VMZefj4GXC4JeKp3ygtvxzbDJE/IDz3aWjebha0fElJeNg0Rw+SebTaXVaxU2ShSeW7WFyP8EeI9mECN4SYlJ23ErVPq+7fhn1upW+9HDJcURq4jJlUFHk2YznGk9ZQxvHCeRj+0Qjks9gkXFRDwbsbxCZdFGhYrUzznXI3At63DcT7FFFdXiqFCxqlmiDtEL7sLBq7NvJAbW5Tg34yGq9Tm2zeFOcLqyTG6mqrbtWjGzyLyBVH8zq1cBCe051v2fyJfBMo1Fbda88/3UcRZ/W45t/+vyT4A0qy0Kapy8MNnz7hk5lUzJz7zrIalENyxcfVB1MGvADQefzWdUrnPTtQVzrTPWtSUVRy82rx9lEQan+Li/fpnSQpUHwwz+tuzl2v5PIywqOqRchoVrPCpPpoE7kSIPBk7n5+B04GByYSIE36oQDU7MvyjUX/zW8jtXeC9mDRiqye2iHybeM2RdnPS/wvLBS9H+NVKQ5khAys8jyZHC08gGYAwxy3mlr614X5cYY4VihimGuXjTY8/P630E827ZGGIM880/YgX0n/sYAtJ2f2HVhnFMY9u7lnfbGhkuTGsVcsJcjKt/qZ7DcoUcneTCurBpb9BvTOMW15LA+KGdMYWJXuxr7DkVBt8tKQG9nJPrey24xWrT42dxawrGyT3YJMwj57Cm4yUGa7QHLwr2sRYZW1ImMZxcnYS56tZjqRcqknugjeIZc48Ysm7EI4g67omXEvePUNLPHT2J2/VdoD7QsyzQEdi1y+THCRxYnd/Ub+oIsnSUIQi09ZFMGBvGZNZI+rTmeZwJEyL5vOY0LesOGyYiZzTPCMmIqNtitdZuGZMREh4wpjYO9T2dpsRbZYoEhWzhcpkqQbXnmC2BwJcvlCni1bKtuOp8yS0fAVEC70xWd7t9beHyGHgDY+Oq5eVkuQlZfj9fQb1sJ80OtMeMr9iQFSsRm4OytyG6byWPo4YkRs4oVjGPxUZWPBQ17HbqaMRmAxponiuN6GbzD78WHVGucTjXKtc6HGsjhyPXcg+9Q1FDoCUVDucaJa9cyz3quNE7HnFJUOOIysJ8Sp9EDYO1L0/w4uA37Bug6fBvk+kZMHDtcVKSlIgnZEloFzlgCoZ8GxqM+iYqGPoXLnlNf4XTtPWIjPP5uLjpsV3bt9vtXCwVy61e0wVXe8jwIMIgwXBiIi5i7RjJFAb6sqtkZ8lR2Uca2nh6L7uHyo4eozuOBHLk1wLXiACyBaMBE07gLNNMAQ0btfEtXZnJZyrTHVQdcWKcRmvojl/i5TKfTB5f+vKmx3Wa7M6wnnMHJ3yhbw2ahj885z8/Of7ty9L5sxv3I7qAvnGt5zy7plCmq9lHG4fkSxMQzqEf0ASRYoYu0Wyz3EktpHJEJZWta+LXJLRIrQk7xm2uK2lOP3ezcQRvQVHjNiNC/P+CoXkKjcPOUvncFWDMEUaa/JAZby6LI3SKRZD55Vlzzc+xzrK6iim1FaVZLynyDNmzFS8Z8hfZEkPwe+YC6XrVSv/02dLSfENW1dJnEmleY479ucxpSffy5lumprNTbImTIRORiVadm/9qe2mVXqb795+LX//2GT0mAnsfLabSHWvgOASgoIdm61PXxzLsNVbp2pV81PynrjVg52nGKXcVeHFwnbTSql0xS6Nsul8QauwZnz6XMVZdQBc8m8FmuB3WlihSMlIUJZz9KduXXuQmWfbiV6QelUzxkcUFN4ci5gIOyk4yBUiU7g75918zcTcQwaCD56scH3rvHgr2CSJoV9b8U/rKy3G7xl6PYL3Pt15YMADvETTEDAEdLkj+7oNNYF+9chVUxi6pGhoAZ/7HO9+fAcOjDP9F72t0X85Ero5cnQl5+mrIuL4VZNMwHIDJaP0srX6UrPfXk/9s6yHiZYw4hm3KOT++TbuR2IO98NOySsGzXKHb1Ufeb30h+1ktaTq6q+Oie3z6LDpvVaxzLt6iCtcTUSKYipJsgGWsSG/AyzDAW5oFly4Jmrl6DrHU11sSIwMAw0sEzX+HfW2cEUkNmkKSJPNNz7PETdbgc7/tmZNYlLYjzokoqZRnlREpzpmnttbaj+zwTVp/Mb3Ilqd668uQ21+FXIJy75W/IKbxQvlTxd1fBYq4oO6+Prr/xugF5AI/F9myBZkrUPASDFKPPCauydSya8SHi0eFXJQkd/X9+m1XHL02tfnaHH3rbK1K3yP7pRNcnDrOHTuhnT1QOeZhbfxADg7j3RQVV9VF6WyKrtjpcRwl0PXunvi5Tkfpus6OOEDjgscGNGgNqhm4fuooTuBCFs9f2BVr6B0PkWWTJ8aXdHf7MnrHj7XrslIcy14KZjZ2e3L3n8jes8AtUsW5CwoLz/TMOg+ZbBIgArXDocc5XG8wHA7ZL8bhJJQoKlASjnmFMk6qN5QcRpZ21+lAkAgUQd56wHQJKaKXErpxt7DdzUH1EpSwC+8S6jEOczKsfyXA9QdPq9igxwRQ7rou4HkQgqAZAJYbZBUFO4naBHfIbNlm/BZ0FK0noi8FCwD4bu+hMzGWR98VBPRPPTJVF/AQNUEqu9QV99HpMBosRl2oucaPamRen6Bf97uWtsaF6lBj1WQbQl8ouGXS60VpUPq7KCOGTjVlFNqP+KO3vF9UC/5t99AJMn/TYl7BKPeLbE2VST92T5HptwRek8BRETWDVCimEzuCktDQahWlxQT/GZaY+B+RaCou/EYDqkDJ8NI3fVGVAPSvBJdQ6hD87g0IrtT5uNG5f9lnBs37IpVdnvubED0io6v/9OYcPz7uc4dfgJP8IyjE3/F87j+p3KFjAJHV9n4G1btRcWtkf7rqvwZyg8ev/OIyJHA7h8Bf/cvD/naLEtNGLnEKvtVEySE30eBUlUxPd6LFYzrR5nSY6Nbx7vM9IoJDovoM2n5aE4Wg3xMlvy9iyDx/iAnPy0RL3D9sMyBjottrkyI96r23XwUEQZ3l24yU5yIqpO21fY8mOQgksPikzxgiec4uzy7O9e+QMZjIEVfmSqTIiuCr7K2VBZ3zWR18iUrOLHX10/l5sfkOZ8pXe20XAQICaZnc1p2ZKB4rzizakb/+PWQkDgiKLR5m/gwFEd185tKZCw3pHWOtLVbFGq0YV4TwQsbWD7xK5i3hyDk1XqaWd1ZCijhjUxi1J+dkT4UuOyteqeYlY/RtlRZeJUUJRIsRK078bw6UPwv+xKSUSkhYRFRMXEJSSlpGVk5eQVFJWUVVTV1DU0tbR1dP38DQyNjE1MzcwtLKuqMVtT9KrP0JsUaWhk/CabMH/1WRdjgofKhATi2CxnB6Kc7qZla3Xb1rvDmEkOpGHXBFuD7SINgxnJYb5Z0PvcQI6jT0SOp4dn91nRNwSUta6ARsfSrT/P5vrM0kdBlqntqCG1lks6Vi93QlOr5u97aonh1FOcnBq8QdR4wqExkrzaW5f7AmNj1NAZWQ59MgTpjaSWhFdE8Bzh0XaWepES2wsqlbKXHE5wTUKpANbiJqQ1/wLpp3lYWQnFrDTohLqtfi9jptUg3kCLtlZoZno1PtjMaWeGvjTgYTSTOQE0StHQlpoAqaOVCfpXzbpCRQaWD7KwT3FdwTiSlf2LcJ8qJC/TVUrrYJNqlXbggl6/ttgSM2d8kX1mqbHHAnBUpPOkmB6pCGS0w1xScmAefUjxbZ1IAvot2ro1f15aBkAFI/1KCIzd4e') format('woff2'),
- url('//at.alicdn.com/t/font_945958_zfsfjju1dim.woff?t=1547618146468') format('woff'),
- url('//at.alicdn.com/t/font_945958_zfsfjju1dim.ttf?t=1547618146468') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
- url('//at.alicdn.com/t/font_945958_zfsfjju1dim.svg?t=1547618146468#iconfont') format('svg'); /* iOS 4.1- */
-}
-
-.iconfont {
- font-family: "iconfont" !important;
- font-size: 16px;
- font-style: normal;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-.icon-redo:before {
- content: "\e627";
-}
-
-.icon-undo:before {
- content: "\e633";
-}
-
-.icon-indent:before {
- content: "\eb28";
-}
-
-.icon-outdent:before {
- content: "\e6e8";
-}
-
-.icon-fontsize:before {
- content: "\e6fd";
-}
-
-.icon-format-header-1:before {
- content: "\e860";
-}
-
-.icon-format-header-4:before {
- content: "\e863";
-}
-
-.icon-format-header-5:before {
- content: "\e864";
-}
-
-.icon-format-header-6:before {
- content: "\e865";
-}
-
-.icon-clearup:before {
- content: "\e64d";
-}
-
-.icon-preview:before {
- content: "\e631";
-}
-
-.icon-date:before {
- content: "\e63e";
-}
-
-.icon-fontbgcolor:before {
- content: "\e678";
-}
-
-.icon-clearedformat:before {
- content: "\e67e";
-}
-
-.icon-font:before {
- content: "\e684";
-}
-
-.icon-723bianjiqi_duanhouju:before {
- content: "\e65f";
-}
-
-.icon-722bianjiqi_duanqianju:before {
- content: "\e660";
-}
-
-.icon-text_color:before {
- content: "\e72c";
-}
-
-.icon-format-header-2:before {
- content: "\e75c";
-}
-
-.icon-format-header-3:before {
- content: "\e75d";
-}
-
-.icon--checklist:before {
- content: "\e664";
-}
-
-.icon-baocun:before {
- content: "\ec09";
-}
-
-.icon-line-height:before {
- content: "\e7f8";
-}
-
-.icon-quanping:before {
- content: "\ec13";
-}
-
-.icon-direction-rtl:before {
- content: "\e66e";
-}
-
-.icon-direction-ltr:before {
- content: "\e66d";
-}
-
-.icon-selectall:before {
- content: "\e62b";
-}
-
-.icon-fuzhi:before {
- content: "\ec7a";
-}
-
-.icon-shanchu:before {
- content: "\ec7b";
-}
-
-.icon-bianjisekuai:before {
- content: "\ec7c";
-}
-
-.icon-fengexian:before {
- content: "\ec7f";
-}
-
-.icon-dianzan:before {
- content: "\ec80";
-}
-
-.icon-charulianjie:before {
- content: "\ec81";
-}
-
-.icon-charutupian:before {
- content: "\ec82";
-}
-
-.icon-wuxupailie:before {
- content: "\ec83";
-}
-
-.icon-juzhongduiqi:before {
- content: "\ec84";
-}
-
-.icon-yinyong:before {
- content: "\ec85";
-}
-
-.icon-youxupailie:before {
- content: "\ec86";
-}
-
-.icon-youduiqi:before {
- content: "\ec87";
-}
-
-.icon-zitidaima:before {
- content: "\ec88";
-}
-
-.icon-xiaolian:before {
- content: "\ec89";
-}
-
-.icon-zitijiacu:before {
- content: "\ec8a";
-}
-
-.icon-zitishanchuxian:before {
- content: "\ec8b";
-}
-
-.icon-zitishangbiao:before {
- content: "\ec8c";
-}
-
-.icon-zitibiaoti:before {
- content: "\ec8d";
-}
-
-.icon-zitixiahuaxian:before {
- content: "\ec8e";
-}
-
-.icon-zitixieti:before {
- content: "\ec8f";
-}
-
-.icon-zitiyanse:before {
- content: "\ec90";
-}
-
-.icon-zuoduiqi:before {
- content: "\ec91";
-}
-
-.icon-zitiyulan:before {
- content: "\ec92";
-}
-
-.icon-zitixiabiao:before {
- content: "\ec93";
-}
-
-.icon-zuoyouduiqi:before {
- content: "\ec94";
-}
-
-.icon-duigoux:before {
- content: "\ec9e";
-}
-
-.icon-guanbi:before {
- content: "\eca0";
-}
-
-.icon-shengyin_shiti:before {
- content: "\eca5";
-}
-
-.icon-Character-Spacing:before {
- content: "\e964";
-}
diff --git a/miniprogram/packageComponent/pages/form/editor/editor.js b/miniprogram/packageComponent/pages/form/editor/editor.js
deleted file mode 100644
index c09469e1..00000000
--- a/miniprogram/packageComponent/pages/form/editor/editor.js
+++ /dev/null
@@ -1,162 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'editor',
- path: 'packageComponent/pages/form/editor/editor'
- }
- },
- data: {
- formats: {},
- readOnly: false,
- placeholder: '开始输入...',
- editorHeight: 300,
- keyboardHeight: 0,
- isIOS: false,
- safeHeight: 0,
- toolBarHeight: 50,
- },
- readOnlyChange() {
- this.setData({
- readOnly: !this.data.readOnly
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- const {
- platform, safeArea, screenHeight
- } = wx.getSystemInfoSync()
- let safeHeight
- if (safeArea) {
- safeHeight = (screenHeight - safeArea.bottom)
- } else {
- safeHeight = 32
- }
- this._safeHeight = safeHeight
- const 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)
- })
- },
- updatePosition(keyboardHeight) {
- const toolbarHeight = 50
- const { windowHeight } = wx.getSystemInfoSync()
- let editorHeight = windowHeight
- if (keyboardHeight > 0) {
- editorHeight = windowHeight - keyboardHeight - toolbarHeight
- }
- if (keyboardHeight === 0) {
- this.setData({
- editorHeight,
- keyboardHeight,
- toolBarHeight: this.data.isIOS ? 50 + this._safeHeight : 50,
- safeHeight: this._safeHeight,
- })
- } else {
- 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()
- },
- blur() {
- this.editorCtx.blur()
- },
- format(e) {
- const { 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 })
- },
- insertDivider() {
- this.editorCtx.insertDivider({
- success() {
- console.log('insert divider success')
- }
- })
- },
- clear() {
- this.editorCtx.clear({
- success() {
- console.log('clear success')
- }
- })
- },
- removeFormat() {
- this.editorCtx.removeFormat()
- },
- insertDate() {
- const date = new Date()
- const formatDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`
- this.editorCtx.insertText({
- text: formatDate
- })
- },
- insertImage() {
- const that = this
- wx.chooseImage({
- count: 1,
- success(res) {
- that.editorCtx.insertImage({
- src: res.tempFilePaths[0],
- data: {
- id: 'abcd',
- role: 'god'
- },
- width: '80%',
- success() {
- console.log('insert image success')
- }
- })
- }
- })
- }
-})
diff --git a/miniprogram/packageComponent/pages/form/editor/editor.json b/miniprogram/packageComponent/pages/form/editor/editor.json
deleted file mode 100644
index e6fb1a5a..00000000
--- a/miniprogram/packageComponent/pages/form/editor/editor.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "navigationBarTitleText": "editor",
- "disableScroll": true,
- "renderer": "webview"
-}
\ No newline at end of file
diff --git a/miniprogram/packageComponent/pages/form/editor/editor.wxml b/miniprogram/packageComponent/pages/form/editor/editor.wxml
deleted file mode 100644
index 470ee034..00000000
--- a/miniprogram/packageComponent/pages/form/editor/editor.wxml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageComponent/pages/form/editor/editor.wxss b/miniprogram/packageComponent/pages/form/editor/editor.wxss
deleted file mode 100644
index a4305db9..00000000
--- a/miniprogram/packageComponent/pages/form/editor/editor.wxss
+++ /dev/null
@@ -1,57 +0,0 @@
-/* @import "../../../weui/components/weui-wxss/dist/style/weui.wxss"; */
-@import "./assets/iconfont.wxss";
-
-page>view {
- max-width: 100%;
-}
-
-.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;
- -webkit-overflow-scrolling: touch; /* 惯性滚动 */
-}
-
-.ql-active {
- color: #22C704;
-}
-
-.iconfont {
- display: inline-block;
- width: 30px;
- height: 30px;
- cursor: pointer;
- font-size: 20px;
-}
-
-.toolbar {
- box-sizing: border-box;
- padding: 0 10px;
- height: 50px;
- width: 100%;
- 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;
- padding-bottom: constant(safe-area-inset-bottom);
- padding-bottom: env(safe-area-inset-bottom);
-}
-
diff --git a/miniprogram/packageComponent/pages/form/form/form.js b/miniprogram/packageComponent/pages/form/form/form.js
deleted file mode 100644
index f105bd3c..00000000
--- a/miniprogram/packageComponent/pages/form/form/form.js
+++ /dev/null
@@ -1,62 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'form',
- path: 'packageComponent/pages/form/form/form'
- }
- },
-
- data: {
- theme: 'light',
- pickerHidden: true,
- chosen: ''
- },
-
- pickerConfirm(e) {
- this.setData({
- pickerHidden: true
- })
- this.setData({
- chosen: e.detail.value
- })
- },
-
- pickerCancel() {
- this.setData({
- pickerHidden: true
- })
- },
-
- pickerShow() {
- this.setData({
- pickerHidden: false
- })
- },
-
- formSubmit(e) {
- console.log('form发生了submit事件,携带数据为:', e.detail.value)
- },
-
- formReset(e) {
- console.log('form发生了reset事件,携带数据为:', e.detail.value)
- this.setData({
- chosen: ''
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageComponent/pages/form/form/form.json b/miniprogram/packageComponent/pages/form/form/form.json
deleted file mode 100644
index 4982c645..00000000
--- a/miniprogram/packageComponent/pages/form/form/form.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "navigationBarTitleText": "form",
- "componentFramework": "glass-easel",
- "renderer": "skyline",
- "navigationStyle": "custom"
-}
\ No newline at end of file
diff --git a/miniprogram/packageComponent/pages/form/form/form.wxml b/miniprogram/packageComponent/pages/form/form/form.wxml
deleted file mode 100644
index 7424f70e..00000000
--- a/miniprogram/packageComponent/pages/form/form/form.wxml
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/miniprogram/packageComponent/pages/form/form/form.wxss b/miniprogram/packageComponent/pages/form/form/form.wxss
deleted file mode 100644
index b993d1a7..00000000
--- a/miniprogram/packageComponent/pages/form/form/form.wxss
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '../../../../common/lib/weui.wxss';
-@import "../../../../common/reset.wxss";
-
-label {
- display: inline-block;
- min-width: 235px;
- margin-right: 10px;
-}
-form{
- width: 100%;
-}
-.picker-text {
- margin-left: 10px;
- position: relative;
-}
diff --git a/miniprogram/packageComponent/pages/form/input/input.js b/miniprogram/packageComponent/pages/form/input/input.js
deleted file mode 100644
index c324031b..00000000
--- a/miniprogram/packageComponent/pages/form/input/input.js
+++ /dev/null
@@ -1,65 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'input',
- path: 'packageComponent/pages/form/input/input'
- }
- },
-
- data: {
- theme: 'light',
- focus: false,
- inputValue: '',
- style: { color: '#F76260', fontSize: 16 },
- },
-
- bindKeyInput(e) {
- this.setData({
- inputValue: e.detail.value
- })
- },
-
- bindReplaceInput(e) {
- const value = e.detail.value
- let pos = e.detail.cursor
- let left
- if (pos !== -1) {
- // 光标在中间
- left = e.detail.value.slice(0, pos)
- // 计算光标的位置
- pos = left.replace(/11/g, '2').length
- }
-
- // 直接返回对象,可以对输入进行过滤处理,同时可以控制光标的位置
- return {
- value: value.replace(/11/g, '2'),
- cursor: pos
- }
-
- // 或者直接返回字符串,光标在最后边
- // return value.replace(/11/g,'2'),
- },
-
- bindHideKeyboard(e) {
- if (e.detail.value === '123') {
- // 收起键盘
- wx.hideKeyboard()
- }
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageComponent/pages/form/input/input.json b/miniprogram/packageComponent/pages/form/input/input.json
deleted file mode 100644
index bea1e192..00000000
--- a/miniprogram/packageComponent/pages/form/input/input.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "navigationBarTitleText": "input",
- "componentFramework": "glass-easel",
- "renderer": "skyline",
- "disableScroll": true,
- "navigationStyle": "custom"
-}
diff --git a/miniprogram/packageComponent/pages/form/input/input.wxml b/miniprogram/packageComponent/pages/form/input/input.wxml
deleted file mode 100644
index 30cd86f4..00000000
--- a/miniprogram/packageComponent/pages/form/input/input.wxml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- 可以自动聚焦的input
-
-
-
-
-
-
-
- 控制最大输入长度的input
-
-
-
-
-
-
-
- 实时获取输入值:{{inputValue}}
-
-
-
-
-
-
-
- 控制输入的input
-
-
-
-
-
-
-
- 控制键盘的input
-
-
-
-
-
-
-
- 数字输入的input
-
-
-
-
-
-
-
- 密码输入的input
-
-
-
-
-
-
-
- 带小数点的input
-
-
-
-
-
-
-
- 身份证输入的input
-
-
-
-
-
-
-
- 控制占位符颜色的input
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageComponent/pages/form/input/input.wxss b/miniprogram/packageComponent/pages/form/input/input.wxss
deleted file mode 100644
index a81a8880..00000000
--- a/miniprogram/packageComponent/pages/form/input/input.wxss
+++ /dev/null
@@ -1,23 +0,0 @@
-@import "../../../../common/reset.wxss";
-
-.page-section{
- margin-bottom: 10px;
-}
-
-.placeholder {
- color: #F76260;
-}
-/* input {
- border: .5px solid green!important;
-} */
-
-.weui-input {
- width: 100%;
- border: 0;
- outline: 0;
- background-color: transparent;
- font-size: inherit;
- color: inherit;
- height: 24px;
- line-height: 1.41176471;
-}
diff --git a/miniprogram/packageComponent/pages/form/label/label.js b/miniprogram/packageComponent/pages/form/label/label.js
deleted file mode 100644
index 2b220b9e..00000000
--- a/miniprogram/packageComponent/pages/form/label/label.js
+++ /dev/null
@@ -1,67 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'label',
- path: 'packageComponent/pages/form/label/label'
- }
- },
-
- data: {
- theme: 'light',
- checkboxItems: [
- { name: 'USA', value: '美国' },
- { name: 'CHN', value: '中国', checked: 'true' }
- ],
- radioItems: [
- { name: 'USA', value: '美国' },
- { name: 'CHN', value: '中国', checked: 'true' }
- ],
- hidden: false
- },
-
- checkboxChange(e) {
- const checked = e.detail.value
- const changed = {}
- for (let i = 0; i < this.data.checkboxItems.length; i++) {
- if (checked.indexOf(this.data.checkboxItems[i].name) !== -1) {
- changed[`checkboxItems[${i}].checked`] = true
- } else {
- changed[`checkboxItems[${i}].checked`] = false
- }
- }
- this.setData(changed)
- },
-
- radioChange(e) {
- const checked = e.detail.value
- const changed = {}
- for (let i = 0; i < this.data.radioItems.length; i++) {
- if (checked.indexOf(this.data.radioItems[i].name) !== -1) {
- changed[`radioItems[${i}].checked`] = true
- } else {
- changed[`radioItems[${i}].checked`] = false
- }
- }
- this.setData(changed)
- },
-
- tapEvent() {
- console.log('按钮被点击')
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageComponent/pages/form/label/label.json b/miniprogram/packageComponent/pages/form/label/label.json
deleted file mode 100644
index 88db0fa2..00000000
--- a/miniprogram/packageComponent/pages/form/label/label.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "label",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageComponent/pages/form/label/label.wxml b/miniprogram/packageComponent/pages/form/label/label.wxml
deleted file mode 100644
index 656af2fc..00000000
--- a/miniprogram/packageComponent/pages/form/label/label.wxml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
- 表单组件在label内
-
-
-
-
-
-
-
-
- label用for标识表单组件
-
-
-
-
-
-
-
-
-
- label内有多个时选中第一个
-
-
-
-
-
-
diff --git a/miniprogram/packageComponent/pages/form/label/label.wxss b/miniprogram/packageComponent/pages/form/label/label.wxss
deleted file mode 100644
index 2cd13d98..00000000
--- a/miniprogram/packageComponent/pages/form/label/label.wxss
+++ /dev/null
@@ -1,11 +0,0 @@
-.label-1, .label-2{
- margin: 15px 0;
-}
-.label-3-text{
- color: #576B95;
- font-size: 14px;
-}
-.checkbox-3{
- display: block;
- margin: 15px 0;
-}
\ No newline at end of file
diff --git a/miniprogram/packageComponent/pages/form/picker-view/picker-view.js b/miniprogram/packageComponent/pages/form/picker-view/picker-view.js
deleted file mode 100644
index f25dabdf..00000000
--- a/miniprogram/packageComponent/pages/form/picker-view/picker-view.js
+++ /dev/null
@@ -1,63 +0,0 @@
-const date = new Date()
-const years = []
-const months = []
-const days = []
-
-for (let i = 1990; i <= date.getFullYear(); i++) {
- years.push(i)
-}
-
-for (let i = 1; i <= 12; i++) {
- months.push(i)
-}
-
-for (let i = 1; i <= 31; i++) {
- days.push(i)
-}
-
-Page({
- onShareAppMessage() {
- return {
- title: 'picker-view',
- path: 'packageComponent/pages/form/picker-view/picker-view'
- }
- },
-
- data: {
- theme: 'light',
- years,
- year: date.getFullYear(),
- months,
- month: 2,
- days,
- day: 2,
- value: [9999, 1, 1],
- isDaytime: true,
- },
-
- bindChange(e) {
- const val = e.detail.value
- this.setData({
- year: this.data.years[val[0]],
- month: this.data.months[val[1]],
- day: this.data.days[val[2]],
- isDaytime: !val[3]
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageComponent/pages/form/picker-view/picker-view.json b/miniprogram/packageComponent/pages/form/picker-view/picker-view.json
deleted file mode 100644
index a844696f..00000000
--- a/miniprogram/packageComponent/pages/form/picker-view/picker-view.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "picker-view",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageComponent/pages/form/picker-view/picker-view.wxml b/miniprogram/packageComponent/pages/form/picker-view/picker-view.wxml
deleted file mode 100644
index 5c2598df..00000000
--- a/miniprogram/packageComponent/pages/form/picker-view/picker-view.wxml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
- {{year}}年{{month}}月{{day}}日{{isDaytime ? "白天" : "夜晚"}}
-
-
- {{item}}年
-
-
- {{item}}月
-
-
- {{item}}日
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageComponent/pages/form/picker-view/picker-view.wxss b/miniprogram/packageComponent/pages/form/picker-view/picker-view.wxss
deleted file mode 100644
index 1135b804..00000000
--- a/miniprogram/packageComponent/pages/form/picker-view/picker-view.wxss
+++ /dev/null
@@ -1,16 +0,0 @@
-.selected-date {
- text-align: center;
- margin: 15px;
-}
-
-.icon-container {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-
-.picker-icon {
- width: 25px;
- height: 25px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageComponent/pages/form/picker/picker.js b/miniprogram/packageComponent/pages/form/picker/picker.js
deleted file mode 100644
index 610cdf25..00000000
--- a/miniprogram/packageComponent/pages/form/picker/picker.js
+++ /dev/null
@@ -1,51 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'picker',
- path: 'packageComponent/pages/form/picker/picker'
- }
- },
-
- data: {
- theme: 'light',
- array: ['中国', '美国', '巴西', '日本'],
- index: 0,
- date: '2016-09-01',
- time: '12:01'
- },
-
- bindPickerChange(e) {
- console.log('picker发送选择改变,携带值为', e.detail.value)
- this.setData({
- index: e.detail.value
- })
- },
-
- bindDateChange(e) {
- this.setData({
- date: e.detail.value
- })
- },
-
- bindTimeChange(e) {
- this.setData({
- time: e.detail.value
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageComponent/pages/form/picker/picker.json b/miniprogram/packageComponent/pages/form/picker/picker.json
deleted file mode 100644
index ba96da09..00000000
--- a/miniprogram/packageComponent/pages/form/picker/picker.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "navigationBarTitleText": "picker",
- "componentFramework": "glass-easel",
- "renderer": "skyline",
- "disableScroll": true,
- "navigationStyle": "custom"
-}
diff --git a/miniprogram/packageComponent/pages/form/picker/picker.wxml b/miniprogram/packageComponent/pages/form/picker/picker.wxml
deleted file mode 100644
index 9fc41da1..00000000
--- a/miniprogram/packageComponent/pages/form/picker/picker.wxml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- 地区选择器
-
-
-
- 当前选择
-
-
-
- {{array[index]}}
-
-
-
-
-
- 时间选择器
-
-
-
- 当前选择
-
-
-
- {{time}}
-
-
-
-
-
- 日期选择器
-
-
-
- 当前选择
-
-
-
- {{date}}
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageComponent/pages/form/picker/picker.wxss b/miniprogram/packageComponent/pages/form/picker/picker.wxss
deleted file mode 100644
index 16827ec6..00000000
--- a/miniprogram/packageComponent/pages/form/picker/picker.wxss
+++ /dev/null
@@ -1,24 +0,0 @@
-@import "../../../../common/reset.wxss";
-
-.flex-wrp{
- margin-top: 30px;
- display:flex;
- width: 100vw;
- align-items: center;
-}
-.flex-item{
- width: 100px;
- height: 150px;
- font-size: 13px;
-}
-.flex-item-V{
- /* skyline不支持auto,改为 align-items: center; */
- /* margin: 0 auto; */
- width: 150px;
- height: 100px;
-}
-
-.picker{
- padding: 10px 13px;
- background-color: #FFFFFF;
-}
diff --git a/miniprogram/packageComponent/pages/form/radio/radio.js b/miniprogram/packageComponent/pages/form/radio/radio.js
deleted file mode 100644
index fcc918d7..00000000
--- a/miniprogram/packageComponent/pages/form/radio/radio.js
+++ /dev/null
@@ -1,49 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'radio',
- path: 'packageComponent/pages/form/radio/radio'
- }
- },
-
- data: {
- theme: 'light',
- items: [
- { value: 'USA', name: '美国' },
- { value: 'CHN', name: '中国', checked: 'true' },
- { value: 'BRA', name: '巴西' },
- { value: 'JPN', name: '日本' },
- { value: 'ENG', name: '英国' },
- { value: 'FRA', name: '法国' },
- ]
- },
-
- radioChange(e) {
- console.log('radio发生change事件,携带value值为:', e.detail.value)
-
- const items = this.data.items
- for (let i = 0, len = items.length; i < len; ++i) {
- items[i].checked = items[i].value === e.detail.value
- }
-
- this.setData({
- items
- })
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageComponent/pages/form/radio/radio.json b/miniprogram/packageComponent/pages/form/radio/radio.json
deleted file mode 100644
index bc7add03..00000000
--- a/miniprogram/packageComponent/pages/form/radio/radio.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "radio",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageComponent/pages/form/radio/radio.wxml b/miniprogram/packageComponent/pages/form/radio/radio.wxml
deleted file mode 100644
index 89329934..00000000
--- a/miniprogram/packageComponent/pages/form/radio/radio.wxml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
- 默认样式
-
-
-
-
-
-
- 推荐展示样式
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageComponent/pages/form/radio/radio.wxss b/miniprogram/packageComponent/pages/form/radio/radio.wxss
deleted file mode 100644
index f22a2e0f..00000000
--- a/miniprogram/packageComponent/pages/form/radio/radio.wxss
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-.radio {
- margin-right: 10px;
-}
diff --git a/miniprogram/packageComponent/pages/form/slider/slider.js b/miniprogram/packageComponent/pages/form/slider/slider.js
deleted file mode 100644
index d960adfe..00000000
--- a/miniprogram/packageComponent/pages/form/slider/slider.js
+++ /dev/null
@@ -1,37 +0,0 @@
-const pageData = {
- data: {
- theme: 'light'
- },
- onShareAppMessage() {
- return {
- title: 'slider',
- path: 'packageComponent/pages/form/slider/slider'
- }
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-}
-
-for (let i = 1; i < 5; ++i) {
- (function (index) {
- pageData[`slider${index}change`] = function (e) {
- console.log(`slider${index}发生change事件,携带值为`, e.detail.value)
- }
- }(i))
-}
-
-Page(pageData)
diff --git a/miniprogram/packageComponent/pages/form/slider/slider.json b/miniprogram/packageComponent/pages/form/slider/slider.json
deleted file mode 100644
index 006504c6..00000000
--- a/miniprogram/packageComponent/pages/form/slider/slider.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "slider",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageComponent/pages/form/slider/slider.wxml b/miniprogram/packageComponent/pages/form/slider/slider.wxml
deleted file mode 100644
index d8b4dc81..00000000
--- a/miniprogram/packageComponent/pages/form/slider/slider.wxml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
- 设置step
-
-
-
-
-
-
- 显示当前value
-
-
-
-
-
-
- 设置最小/最大值
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageComponent/pages/form/slider/slider.wxss b/miniprogram/packageComponent/pages/form/slider/slider.wxss
deleted file mode 100644
index 8e9940b7..00000000
--- a/miniprogram/packageComponent/pages/form/slider/slider.wxss
+++ /dev/null
@@ -1,5 +0,0 @@
-/* packageComponent/pages/form/slider/slider.wxss */
-
-slider {
- margin: 0;
-}
\ No newline at end of file
diff --git a/miniprogram/packageComponent/pages/form/switch/switch.js b/miniprogram/packageComponent/pages/form/switch/switch.js
deleted file mode 100644
index ae2d5e06..00000000
--- a/miniprogram/packageComponent/pages/form/switch/switch.js
+++ /dev/null
@@ -1,35 +0,0 @@
-Page({
- data: {
- theme: 'light'
- },
- onShareAppMessage() {
- return {
- title: 'switch',
- path: 'packageComponent/pages/form/switch/switch'
- }
- },
-
- switch1Change(e) {
- console.log('switch1 发生 change 事件,携带值为', e.detail.value)
- },
-
- switch2Change(e) {
- console.log('switch2 发生 change 事件,携带值为', e.detail.value)
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageComponent/pages/form/switch/switch.json b/miniprogram/packageComponent/pages/form/switch/switch.json
deleted file mode 100644
index 21448db6..00000000
--- a/miniprogram/packageComponent/pages/form/switch/switch.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "switch",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageComponent/pages/form/switch/switch.wxml b/miniprogram/packageComponent/pages/form/switch/switch.wxml
deleted file mode 100644
index 492f20d7..00000000
--- a/miniprogram/packageComponent/pages/form/switch/switch.wxml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
- 默认样式
-
-
-
-
-
-
-
- 推荐展示样式
-
-
- 开启中
-
-
-
-
-
- 关闭
-
-
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageComponent/pages/form/switch/switch.wxss b/miniprogram/packageComponent/pages/form/switch/switch.wxss
deleted file mode 100644
index e69de29b..00000000
diff --git a/miniprogram/packageComponent/pages/form/textarea/textarea.js b/miniprogram/packageComponent/pages/form/textarea/textarea.js
deleted file mode 100644
index 9f58017b..00000000
--- a/miniprogram/packageComponent/pages/form/textarea/textarea.js
+++ /dev/null
@@ -1,33 +0,0 @@
-Page({
- onShareAppMessage() {
- return {
- title: 'textarea',
- path: 'packageComponent/pages/form/textarea/textarea'
- }
- },
-
- data: {
- theme: 'light',
- focus: false
- },
-
- bindTextAreaBlur(e) {
- console.log(e.detail.value)
- },
- onUnload() {
- if (wx.offThemeChange) {
- wx.offThemeChange()
- }
- },
- onLoad() {
- this.setData({
- theme: getApp().globalData.theme || 'light'
- })
-
- if (wx.onThemeChange) {
- wx.onThemeChange(({ theme }) => {
- this.setData({ theme })
- })
- }
- }
-})
diff --git a/miniprogram/packageComponent/pages/form/textarea/textarea.json b/miniprogram/packageComponent/pages/form/textarea/textarea.json
deleted file mode 100644
index 2e4527c5..00000000
--- a/miniprogram/packageComponent/pages/form/textarea/textarea.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "textarea",
- "renderer": "webview"
-}
diff --git a/miniprogram/packageComponent/pages/form/textarea/textarea.wxml b/miniprogram/packageComponent/pages/form/textarea/textarea.wxml
deleted file mode 100644
index eaebb102..00000000
--- a/miniprogram/packageComponent/pages/form/textarea/textarea.wxml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
- 输入区域高度自适应,不会出现滚动条
-
-
-
-
-
-
- 这是一个可以自动聚焦的textarea
-
-
-
-
-
-
-
-
diff --git a/miniprogram/packageComponent/pages/form/textarea/textarea.wxss b/miniprogram/packageComponent/pages/form/textarea/textarea.wxss
deleted file mode 100644
index f0ab763e..00000000
--- a/miniprogram/packageComponent/pages/form/textarea/textarea.wxss
+++ /dev/null
@@ -1,7 +0,0 @@
-textarea {
- width: 350px;
- padding: 13px 0;
-}
-.textarea-wrp {
- padding: 0 13px;
-}
\ No newline at end of file
diff --git a/miniprogram/packageExtend/pages/extend/recycle-view/recycle-view.json b/miniprogram/packageExtend/pages/extend/recycle-view/recycle-view.json
index fda8765d..3072c785 100644
--- a/miniprogram/packageExtend/pages/extend/recycle-view/recycle-view.json
+++ b/miniprogram/packageExtend/pages/extend/recycle-view/recycle-view.json
@@ -4,5 +4,5 @@
"recycle-item": "miniprogram-recycle-view/recycle-item"
},
"renderer": "webview",
-"navigationBarTitleText": "recycle-view"
+ "navigationBarTitleText": "recycle-view"
}
\ No newline at end of file
diff --git a/miniprogram/packageXRFrame/pages/index/index.js b/miniprogram/packageXRFrame/pages/index/index.js
index e2d2aa24..fce4d60a 100644
--- a/miniprogram/packageXRFrame/pages/index/index.js
+++ b/miniprogram/packageXRFrame/pages/index/index.js
@@ -62,5 +62,6 @@ Page({
},
})
}
+
}
})
diff --git a/project.private.config.json b/project.private.config.json
index 7858c828..15d386fd 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -1,213 +1,3 @@
{
- "libVersion": "3.7.6",
- "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
- "setting": {
- "urlCheck": false,
- "compileHotReLoad": false,
- "lazyloadPlaceholderEnable": false,
- "skylineRenderEnable": true
- "coverView": true,
- },
- "projectname": "miniprogram-demo-master",
- "condition": {
- "miniprogram": {
- "list": [
- {
- "name": "packageChatTool/pages/activity_create/index",
- "pathName": "packageChatTool/pages/activity_create/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "聊天工具-签到助手",
- "pathName": "packageAPI/pages/chattool/activity_assist/activity_assist",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "packageAPI/pages/chattool/material_view/material_view",
- "pathName": "packageAPI/pages/chattool/material_view/material_view",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "packageAPI/pages/chattool/material_open/material_open",
- "pathName": "packageAPI/pages/chattool/material_open/material_open",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "聊天工具-活动详情",
- "pathName": "packageChatTool/pages/activity_detail/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "聊天工具-创建活动",
- "pathName": "packageChatTool/pages/activity_create/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "gaussian-splatting-ar",
- "pathName": "packageAPI/pages/ar/gaussian-splatting/gaussian-splatting-ar",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "gaussian-splatting",
- "pathName": "packageAPI/pages/ar/gaussian-splatting/gaussian-splatting",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "ar-cameraBuffer-jpg",
- "pathName": "packageAPI/pages/ar/cameraBuffer-jpg/cameraBuffer-jpg",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "plane-ar-v2-options",
- "pathName": "packageAPI/pages/ar/plane-ar-v2-options/plane-ar-v2-options",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "packageSkylineExamples/examples/app-bar/pages/index/index",
- "pathName": "packageSkylineExamples/examples/app-bar/pages/index/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "photo-idcard-detect",
- "pathName": "packageAPI/pages/ar/photo-idcard-detect/photo-idcard-detect",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "ar-plane-v2",
- "pathName": "packageAPI/pages/ar/plane-ar-v2/plane-ar-v2",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "ar-v2-depth",
- "pathName": "packageAPI/pages/ar/plane-ar-v2-depth/plane-ar-v2-depth",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "ar-depth-detect",
- "pathName": "packageAPI/pages/ar/depth-detect/depth-detect",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "ar-3dmarker",
- "pathName": "packageAPI/pages/ar/3dmarker-ar/3dmarker-ar",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "ar-photo-shoe-detect",
- "pathName": "packageAPI/pages/ar/photo-shoe-detect/photo-shoe-detect",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "ar-shoe-detect",
- "pathName": "packageAPI/pages/ar/shoe-detect/shoe-detect",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "ar-2dmarker",
- "pathName": "packageAPI/pages/ar/2dmarker-ar/2dmarker-ar",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "page/API/pages/storage/storage",
- "pathName": "page/API/pages/storage/storage",
- "query": "",
- "scene": null
- },
- {
- "name": "card_transition",
- "pathName": "packageSkylineExamples/examples/card_transition/pages/list/list",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "card_transition/detail",
- "pathName": "packageSkylineExamples/examples/card_transition/pages/detail/detail",
- "query": "index=1&url=https%253A%252F%252Fpicsum.photos%252F300%252F400%253Frandom%253D1&content=%E6%8E%A8%E8%8D%90%20Skyline%EF%BC%8C%E4%BD%BF%E7%94%A8%E5%90%8E%E4%BD%93%E9%AA%8C%E6%B5%81%E7%95%85%E5%BE%88%E5%A4%9A~&ratio=0.75",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "page/animation/index",
- "pathName": "page/animation/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "",
- "pathName": "packageSkyline/pages/scroll-view/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "product-list",
- "pathName": "packageSkylineExamples/examples/product-list/pages/index/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "expanded-scroll-view",
- "pathName": "packageSkylineExamples/examples/expanded-scroll-view/pages/index/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "demo-1",
- "pathName": "packageComponent/pages/view/grid-view/demo-1/demo-1",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "",
- "pathName": "page/component/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- }
- ]
- }
- }
+ "libVersion": "3.8.4"
}
\ No newline at end of file