|
|
@@ -1,122 +1,137 @@
|
|
|
# 开发环境配置
|
|
|
-* 中行支付对接需调用32位系统的插件。所以需要使用`32位`的node版本。[关于windows安装多版本nodejs](https://raythunder.cn/multiple-versions-node-on-windows/)
|
|
|
|
|
|
-* 编译windows原生模块,一键安装所需构建工具。[安装windows-build-tools](https://www.npmjs.com/package/windows-build-tools)
|
|
|
-* 安装原生依赖模块后(如node-ffi),需要把该模块编译成对应electron版本的原生模块。默认情况下会自动编译。
|
|
|
+- 中行支付对接需调用 32 位系统的插件。所以需要使用`32位`的 node 版本。[关于 windows 安装多版本 nodejs](https://raythunder.cn/multiple-versions-node-on-windows/)
|
|
|
|
|
|
- 如果有什么报错继续执行`npm run rebuild`
|
|
|
-* 配置vue.config.js
|
|
|
- ```
|
|
|
- ....
|
|
|
- pluginOptions: {
|
|
|
- electronBuilder: {
|
|
|
- externals: ['ffi'], // 这里填入原生模块
|
|
|
- // If you are using Yarn Workspaces, you may have multiple node_modules folders
|
|
|
- // List them all here so that VCP Electron Builder can find them
|
|
|
- nodeModulesPath: ['../../node_modules', './node_modules'],
|
|
|
- ...
|
|
|
- ```
|
|
|
+- 编译 windows 原生模块,一键安装所需构建工具。[安装 windows-build-tools](https://www.npmjs.com/package/windows-build-tools)
|
|
|
+- 安装原生依赖模块后(如 node-ffi),需要把该模块编译成对应 electron 版本的原生模块。默认情况下会自动编译。
|
|
|
|
|
|
+ 如果有什么报错继续执行`npm run rebuild`
|
|
|
+
|
|
|
+- 配置 vue.config.js
|
|
|
+ ```
|
|
|
+ ....
|
|
|
+ pluginOptions: {
|
|
|
+ electronBuilder: {
|
|
|
+ externals: ['ffi'], // 这里填入原生模块
|
|
|
+ // If you are using Yarn Workspaces, you may have multiple node_modules folders
|
|
|
+ // List them all here so that VCP Electron Builder can find them
|
|
|
+ nodeModulesPath: ['../../node_modules', './node_modules'],
|
|
|
+ ...
|
|
|
+ ```
|
|
|
|
|
|
# 开发步骤
|
|
|
-> 注意先切换至32位nodejs
|
|
|
+
|
|
|
+> 注意先切换至 32 位 nodejs
|
|
|
|
|
|
## 安装项目的全部依赖
|
|
|
+
|
|
|
```
|
|
|
yarn // 或 npm i
|
|
|
```
|
|
|
|
|
|
# 项目运行
|
|
|
+
|
|
|
## 测试环境
|
|
|
+
|
|
|
```
|
|
|
yarn run electron:serve // 或 npm run electron:serve
|
|
|
```
|
|
|
+
|
|
|
## 打包
|
|
|
+
|
|
|
```
|
|
|
yarn run electron:build // 或 npm run electron:build
|
|
|
```
|
|
|
|
|
|
-# .npmrc文件修改了相关软件包的源地址
|
|
|
-electron测试环境首次启动时,需要安装chrome内核的相关开发者插件,可能需要翻墙安装。否则会导致启动失败
|
|
|
+# .npmrc 文件修改了相关软件包的源地址
|
|
|
+
|
|
|
+electron 测试环境首次启动时,需要安装 chrome 内核的相关开发者插件,可能需要翻墙安装。否则会导致启动失败
|
|
|
|
|
|
# TODO
|
|
|
+
|
|
|
- [ ] 身份证读取数据时,有空数据先更新空数据,否则新增数据
|
|
|
-- [ ] IP地址获取错误
|
|
|
+- [ ] IP 地址获取错误
|
|
|
|
|
|
# 相关文档
|
|
|
-* [vue-echart](https://github.com/ecomfe/vue-echarts/blob/master/README.zh_CN.md)
|
|
|
-* [配置原生模块](https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/guide.html#native-modules)
|
|
|
-* [关于在electron中调用C++动态库的经验总结](https://blog.csdn.net/wang839305939/article/details/83780789)
|
|
|
-* [node-ffi使用指南](https://juejin.im/post/5b58038d5188251b186bc902)
|
|
|
-* [process和child_process使用详解](https://www.php.cn/js-tutorial-390359.html)
|
|
|
-* [FileSaver.js 介绍](https://www.cnblogs.com/yunser/p/7629399.html)
|
|
|
-
|
|
|
-
|
|
|
|
|
|
+- [vue-echart](https://github.com/ecomfe/vue-echarts/blob/master/README.zh_CN.md)
|
|
|
+- [配置原生模块](https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/guide.html#native-modules)
|
|
|
+- [关于在 electron 中调用 C++动态库的经验总结](https://blog.csdn.net/wang839305939/article/details/83780789)
|
|
|
+- [node-ffi 使用指南](https://juejin.im/post/5b58038d5188251b186bc902)
|
|
|
+- [process 和 child_process 使用详解](https://www.php.cn/js-tutorial-390359.html)
|
|
|
+- [FileSaver.js 介绍](https://www.cnblogs.com/yunser/p/7629399.html)
|
|
|
|
|
|
# 其他
|
|
|
+
|
|
|
1. 二维码扫码机。注意关闭回车符设置
|
|
|
-2. ○窗
|
|
|
+2. ○ 窗
|
|
|
|
|
|
## yarn 安装
|
|
|
-https://yarnpkg.com/lang/zh-hans/docs/install/
|
|
|
|
|
|
+https://yarnpkg.com/lang/zh-hans/docs/install/
|
|
|
|
|
|
ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/ npm install --save-dev electron
|
|
|
|
|
|
## yarn 常用命令
|
|
|
+
|
|
|
### 添加依赖包
|
|
|
+
|
|
|
```
|
|
|
yarn add [package]
|
|
|
yarn add [package]@[version]
|
|
|
yarn add [package]@[tag]
|
|
|
```
|
|
|
+
|
|
|
### 将依赖项添加到不同依赖项类别
|
|
|
|
|
|
分别添加到 devDependencies、peerDependencies 和 optionalDependencies:
|
|
|
+
|
|
|
```
|
|
|
yarn add [package] --dev
|
|
|
yarn add [package] --peer
|
|
|
yarn add [package] --optional
|
|
|
```
|
|
|
+
|
|
|
### 升级依赖包
|
|
|
+
|
|
|
```
|
|
|
yarn upgrade [package]
|
|
|
yarn upgrade [package]@[version]
|
|
|
yarn upgrade [package]@[tag]
|
|
|
```
|
|
|
+
|
|
|
### 移除依赖包
|
|
|
+
|
|
|
```
|
|
|
yarn remove [package]
|
|
|
```
|
|
|
|
|
|
+# iconv-lite 关于报错\_webpack_require()的解决方法
|
|
|
|
|
|
+到 node_modules 中找到 iconv-lite 文件夹,lib 文件夹,打开 index.js,最下方有两个 require 的后一个参数括号去掉,如下:
|
|
|
|
|
|
-# iconv-lite 关于报错_webpack_require()的解决方法
|
|
|
-到node_modules中找到iconv-lite文件夹,lib文件夹,打开index.js,最下方有两个require的后一个参数括号去掉,如下:
|
|
|
-``` js
|
|
|
-var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node;
|
|
|
+```js
|
|
|
+var nodeVer =
|
|
|
+ typeof process !== "undefined" && process.versions && process.versions.node;
|
|
|
if (nodeVer) {
|
|
|
-
|
|
|
- // Load streaming support in Node v0.10+
|
|
|
- var nodeVerArr = nodeVer.split(".").map(Number);
|
|
|
- if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {
|
|
|
- require("./streams");//修改这个
|
|
|
- }
|
|
|
-
|
|
|
- // Load Node primitive extensions.
|
|
|
- require("./extend-node");//修改这个
|
|
|
+ // Load streaming support in Node v0.10+
|
|
|
+ var nodeVerArr = nodeVer.split(".").map(Number);
|
|
|
+ if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {
|
|
|
+ require("./streams"); //修改这个
|
|
|
+ }
|
|
|
+
|
|
|
+ // Load Node primitive extensions.
|
|
|
+ require("./extend-node"); //修改这个
|
|
|
}
|
|
|
```
|
|
|
|
|
|
+# 修改支付测试需要修改的地方
|
|
|
|
|
|
+根据景点名称修改,配置文件的 mock 参数,以及:
|
|
|
|
|
|
-# 修改支付测试需要修改的地方
|
|
|
-根据景点名称修改,配置文件的mock参数,以及:
|
|
|
-1. @/utils/index.js getPayResponse
|
|
|
+1. @/utils/index.js getPayResponse
|
|
|
2. @/utils/choosePay.js
|
|
|
|
|
|
-
|
|
|
# 涉及支付的页面
|
|
|
|
|
|
/ticketSale/retail
|
|
|
@@ -125,46 +140,49 @@ if (nodeVer) {
|
|
|
/ticketSale/preOrderGroup
|
|
|
/ticketSale/discountSales
|
|
|
/membership/memberSales
|
|
|
-/membership/memberPreSales iccardCheckout
|
|
|
+/membership/memberPreSales iccardCheckout
|
|
|
/membership/memberRecharge
|
|
|
|
|
|
-
|
|
|
# 注册到全局的组件
|
|
|
+
|
|
|
路径:src/components/GlobalComponents/
|
|
|
|
|
|
-- `ChannelTag` 渠道标签,传入渠道id。
|
|
|
- - value: [number]
|
|
|
+- `ChannelTag` 渠道标签,传入渠道 id。
|
|
|
+ - value: [number]
|
|
|
- `OrderStatusTag` 订单或票的状态标签,传入状态。
|
|
|
- - value: [string]
|
|
|
+ - value: [string]
|
|
|
- `Ellipsis` 定长文字
|
|
|
- - type: 'tooltips'/'popover'
|
|
|
- - content: [string]
|
|
|
- - length: [number]
|
|
|
+ - type: 'tooltips'/'popover'
|
|
|
+ - content: [string]
|
|
|
+ - length: [number]
|
|
|
- `Tip` 图标文字提示
|
|
|
- - msg: [string]
|
|
|
+ - msg: [string]
|
|
|
- `QRReader` 二维码摄像头识别组件
|
|
|
- - v-model: [string]
|
|
|
-
|
|
|
+ - v-model: [string]
|
|
|
|
|
|
# 日志生成工具
|
|
|
+
|
|
|
```
|
|
|
npm install -g conventional-changelog-cli
|
|
|
```
|
|
|
+
|
|
|
不会重写之前的日志,在前一个标签基础上生成
|
|
|
+
|
|
|
```
|
|
|
conventional-changelog -p angular -i ./public/CHANGELOG.md -s
|
|
|
-r 10 生成10个版本
|
|
|
```
|
|
|
|
|
|
-# 安装node 引擎报错
|
|
|
+# 安装 node 引擎报错
|
|
|
|
|
|
```bash
|
|
|
yarn install --ignore-engines
|
|
|
```
|
|
|
|
|
|
# 同步远程分支
|
|
|
+
|
|
|
```
|
|
|
git fetch origin --prune
|
|
|
```
|
|
|
-# 终端配置
|
|
|
|
|
|
+# 终端配置
|