Skip to content

Commit

Permalink
1.0.0-rc.1 (#1524)
Browse files Browse the repository at this point in the history
* Fix/upload/slot (#1507)

* fix(upload): update add-content slot

* docs(upload): update add-content description

* fix(upload): enable add-content property

* fix(cascader): enable multiple slot (#1508)

* feat(picker): upate ux (#1513)

* feat(picker): upate ux

* test: update snapshot

* chore: update qrcode (#1503)

* docs: add faq for image (#1512)

* docs: add faq for image

* docs: update faq

* feat(Cell): enrich CSS Variables (#1515)

* feat(Cell): enrich CSS Variables

* fix(Cell): fix cr

* fix(dialog): remove built-in input style (#1516)

* fix(dialog): remove built-in input style

* test: update snapshot

* feat(input): add new css variables

* feat(Cell): enrich CSS Variables (#1517)

* feat(NoticeBar): update demo (#1514)

* feat(NoticeBar): update demo

* fix(NoticeBar): fix cr

* fix(Swiper): fix swiper-item switching error when autoplay state (#1494)

* fix(Swiper): fix swiper-item switching error when autoplay state

* fix(Swiper): fix cr

* feat(sidebar): finish support icon (#1520)

* Feat/tabs/add icon (#1519)

* feat(tabs): support icon

* feat(tabs): finish support icon

* docs: update intro

* test(tabs): update snapshot

* chore: publish v1.0.0-rc.1 (#1522)

* docs: update changelog

Co-authored-by: Y <anly_yaw@163.com>
  • Loading branch information
LeeJim and anlyyao authored Jan 19, 2023
1 parent 6414081 commit fecea35
Show file tree
Hide file tree
Showing 102 changed files with 1,524 additions and 713 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ toc: false
docClass: timeline
---

## 🌈 1.0.0-rc.1 `2023-01-18`
### ❗ BREAKING CHANGES
- `Dialog`: 移除内置的 input 样式 @LeeJim ([#1516](https://github.com/Tencent/tdesign-miniprogram/pull/1516))
- `Input`: 优化 DOM,移除外置的 wapper 元素 @LeeJim ([#1516](https://github.com/Tencent/tdesign-miniprogram/pull/1516))

### 🚀 Features
- `Cell`: 新增底边框左右边距 CSS Variables @anlyyao ([#1515](https://github.com/Tencent/tdesign-miniprogram/pull/1515))
- `Cell`: 补充 CSS Variables @anlyyao ([#1517](https://github.com/Tencent/tdesign-miniprogram/pull/1517))
- `SideBar`: 支持传入 Icon @LeeJim ([#1520](https://github.com/Tencent/tdesign-miniprogram/pull/1520))
- `Tabs`: 支持传入 icon @LeeJim ([#1519](https://github.com/Tencent/tdesign-miniprogram/pull/1519))
### 🐞 Bug Fixes
- `Upload`: 修复 add-content 不生效的问题 @LeeJim ([#1507](https://github.com/Tencent/tdesign-miniprogram/pull/1507))
- `Upload`: 优化插槽渲染,不再需要传入 add-content = 'slot' @LeeJim ([#1507](https://github.com/Tencent/tdesign-miniprogram/pull/1507))
- `Cascader`: 修复 slot 无法使用的问题 @LeeJim ([#1508](https://github.com/Tencent/tdesign-miniprogram/pull/1508))
- `Picker`: 修复样式、优化布局以及交互体验 @LeeJim ([#1513](https://github.com/Tencent/tdesign-miniprogram/pull/1513))
- `Swiper`: 修复 `autoplay` 状态下,`swiper` 偶现左右抖动问题 @anlyyao ([#1494](https://github.com/Tencent/tdesign-miniprogram/pull/1494))

## 🌈 1.0.0-rc `2023-01-12`
### ❗ Breaking Changes
- 全部组件开启 vritualHost,当基础库版本低于 2.19.2 自动关闭 @LeeJim ([#1495](https://github.com/Tencent/tdesign-miniprogram/pull/1495))
Expand Down
2 changes: 1 addition & 1 deletion example/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"subpackages": [
{
"root": "pages/side-bar/",
"pages": ["side-bar", "base/index", "switch/index", "custom/index"]
"pages": ["side-bar", "base/index", "switch/index", "custom/index", "with-icon/index"]
},
{
"root": "pages/action-sheet/",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tdesign-miniprogram",
"purename": "tdesign",
"version": "1.0.0-rc",
"version": "1.0.0-rc.1",
"description": "tdesign-miniprogram",
"title": "tdesign-ßminiprogram",
"main": "miniprogram_dist/index.js",
Expand Down
95 changes: 66 additions & 29 deletions script/qrcode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,45 @@ const fs = require('fs');
const path = require('path');
const { getAccessToken, getUnlimitedQRCode } = require('./api');

// 去读 app.json 中 pages 字段
const { pages } = require('../../example/app.json');

const APP_ID = process.argv[process.argv.indexOf('--APP_ID') + 1]; // 在 --APP_ID 后面
const APP_SECRET = process.argv[process.argv.indexOf('--APP_SECRET') + 1]; // --APP_SECRET 后面

// 去读 app.json 中 pages && subpackages 字段
const { pages, subpackages } = require('../../example/app.json');

const isExistStr = (str, arr) => {
const temp = [...new Set(str.split('/').slice(1))].join('-');
return arr.includes(temp);
};

const getImageList = () => {
const imageFolderDir = path.resolve(__dirname, `../../site/public/assets/qrcode`);
const images = fs.readdirSync(imageFolderDir);
const imageOldList = [];
images.forEach((item) => {
imageOldList.push(item.split('.')[0]);
});
return imageOldList;
};

const getNewPageList = (list) => {
const pageList = [];
const imageOldList = getImageList();
list.forEach((item) => {
if (Object.prototype.toString.call(item) === '[object Object]') {
item.pages.forEach((subItem) => {
if (!isExistStr(item.root + subItem, imageOldList)) {
pageList.push(item.root + subItem);
}
});
} else if (!isExistStr(item, imageOldList)) {
pageList.push(item);
}
});

return pageList;
};

const getUnlimitedQRCodeImage = (appid, appSecret) => {
getAccessToken(appid, appSecret).then((e) => {
if (e.access_token) {
Expand All @@ -22,42 +55,46 @@ const getUnlimitedQRCodeImage = (appid, appSecret) => {
responseType: 'arraybuffer',
};

const pageList = getNewPageList(pages.concat(subpackages));

// 循环 pages, 获取相应小程序码
pages.forEach((item, index) => {
pageList.forEach((item, index) => {
const temp = [...new Set(item.split('/').slice(1))];
const fileName = temp.join('-');

const specialParameter = {
page: item, // 扫码进入的小程序页面路径
scene: `name=${temp[0]}`, // 标识
};
getUnlimitedQRCode(token, { ...specialParameter, ...baseParameter }, { ...baseConfig }).then((res) => {
// 因为微信接口 getwxacodeunlimit 成功时返回的是 Buffer ,失败时返回 JSON 结构。这里把返回数据全部当成 Buffer 处理,所以 res.length < 200, 则表示获取失败。
if (res.length < 200) {
const { errcode, errmsg } = JSON.parse(res.toString());
// eslint-disable-next-line no-console
console.log('===小程序码获取失败===', item, { errcode, errmsg });
return;
}
getUnlimitedQRCode(token, JSON.stringify({ ...specialParameter, ...baseParameter }), { ...baseConfig }).then(
(res) => {
// 因为微信接口 getwxacodeunlimit 成功时返回的是 Buffer ,失败时返回 JSON 结构。这里把返回数据全部当成 Buffer 处理,所以 res.length < 200, 则表示获取失败。
if (res.length < 200) {
const { errcode, errmsg } = JSON.parse(res.toString());
// eslint-disable-next-line no-console
console.log('===小程序码获取失败===', item, { errcode, errmsg });
return;
}

const buffer = Buffer.from(res, 'base64');
const destPath = path.resolve(__dirname, `../../site/public/assets/qrcode/${fileName}.png`);
const buffer = Buffer.from(res, 'base64');
const destPath = path.resolve(__dirname, `../../site/public/assets/qrcode/${fileName}.png`);

fs.writeFile(
destPath,
buffer,
{
encoding: 'binary',
flag: 'w+',
},
(err) => {
if (err) {
// eslint-disable-next-line no-console
console.log('===小程序码图片存储错误===', err);
}
},
);
});
fs.writeFile(
destPath,
buffer,
{
encoding: 'binary',
flag: 'w+',
},
(err) => {
if (err) {
// eslint-disable-next-line no-console
console.log('===小程序码图片存储错误===', err);
}
},
);
},
);
});
}
});
Expand Down
Binary file added site/public/assets/qrcode/calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/public/assets/qrcode/cascader.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/public/assets/qrcode/indexes-base-index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/public/assets/qrcode/link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/public/assets/qrcode/side-bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/public/assets/qrcode/tree-select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/cascader/cascader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const defaultOptionLabel = '选择选项';
export default class Cascader extends SuperComponent {
externalClasses = [`${prefix}-class`];

options: WechatMiniprogram.Component.ComponentOptions = {
multipleSlots: true,
};

properties = props;

data = {
Expand Down
Loading

0 comments on commit fecea35

Please sign in to comment.