|
|
hai 1 mes | |
|---|---|---|
| .husky | hai 1 mes | |
| .vscode | hai 1 mes | |
| config | hai 1 mes | |
| scripts | hai 1 mes | |
| src | hai 1 mes | |
| types | hai 1 mes | |
| .editorconfig | hai 1 mes | |
| .env.development | hai 1 mes | |
| .env.production | hai 1 mes | |
| .env.test | hai 1 mes | |
| .eslintrc | hai 1 mes | |
| .gitignore | hai 1 mes | |
| .prettierrc | hai 1 mes | |
| README.md | hai 1 mes | |
| babel.config.js | hai 1 mes | |
| commitlint.config.mjs | hai 1 mes | |
| nutui-usage.spec.md | hai 1 mes | |
| package-lock.json | hai 1 mes | |
| package.json | hai 1 mes | |
| project.config.json | hai 1 mes | |
| stylelint.config.mjs | hai 1 mes | |
| tsconfig.json | hai 1 mes |
payment-mini 是一个基于 Taro React 的支付宝小程序项目,主要用于企业扫码支付管理平台。项目使用 TypeScript、React、Zustand 状态管理,并遵循 Taro 小程序开发规范。
npm install
npm run dev:alipay
npm run build:alipay
npm run lintnpm run formatstylelint.config.mjs项目采用 commitlint 进行提交信息校验,遵循 Conventional Commits 规范,例如:
git commit -m "feat(login): add agree dialog before login"
常用类型包括:
feat:新功能fix:修复 bugdocs:文档变更style:代码格式或风格调整refactor:重构test:测试相关chore:构建/工具/依赖等杂项src/
app.ts
app.less
pages/
login/
index/
mine/
components/
schemas/
stores/
config/
index.ts
.babelrc
.eslintrc
.stylelint.config.mjs
.prettierrc
.commitlint.config.mjs
.husky/
dist 目录和 .taro 缓存后重试。zod,改为本地校验逻辑,避免支付宝小程序运行时兼容性问题。Q: 支付宝小程序编译出错:TypeError: Constructor Map requires 'new'?
A:
把 dist/taro.js 中的 EventSource ES6写法:
class EventSource extends Map {
removeNode(child) {
const {
sid,
uid
} = child;
this.delete(sid);
if (uid !== sid && uid) this.delete(uid);
}
removeNodeTree(child) {
this.removeNode(child);
const {
childNodes
} = child;
childNodes.forEach(node => this.removeNodeTree(node));
}
}
替换成
class EventSource {
data = {};
get(id) {
return this.data[id];
}
set(id, value) {
this.data[id] = value;
}
delete(id) {
delete this.data[id];
}
has(id) {
return id in this.data;
}
removeNode(child) {
const { sid, uid } = child;
this.delete(sid);
if (uid !== sid && uid) this.delete(uid);
}
removeNodeTree(child) {
this.removeNode(child);
const { childNodes } = child;
childNodes.forEach((node) => this.removeNodeTree(node));
}
}