├── .editorconfig ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.js ├── package.json ├── postcss.config.js ├── public └── index.html ├── screenshot ├── app-plus-apps.jpg ├── app-plus-donate.jpg ├── app-plus-index.jpg ├── electron.png ├── h5.png ├── mp-alipay.png ├── mp-toutiao.png ├── mp-weixin.png └── 运行环境截图.md ├── src-builds ├── config.ts ├── electron.ts └── utils.ts ├── src ├── App.vue ├── assets │ └── css │ │ ├── aiplat.css │ │ ├── cmreset.css │ │ └── cmstyle.css ├── components │ ├── ani-copyright.vue │ ├── ani-header1.vue │ ├── ani-image.vue │ ├── ani-jifenqi-table.vue │ ├── ani-list01.vue │ ├── ani-no-data.vue │ ├── ani-pop-confirm.vue │ └── ani-pop-win.vue ├── electron │ ├── main.js │ ├── package.json │ ├── preload.js │ └── utils.js ├── lib.d.ts ├── main.ts ├── pages │ ├── aiplat │ │ ├── apps.vue │ │ ├── donate.vue │ │ └── index.vue │ ├── common │ │ ├── about.vue │ │ ├── find.vue │ │ ├── h5.vue │ │ ├── mine.vue │ │ └── userAgent.vue │ └── index.vue ├── plugins.d.ts ├── plugins │ ├── cmapp.class.ts │ ├── index.ts │ ├── lib │ │ ├── axios.ts │ │ ├── canvas2Image.ts │ │ ├── loadFiles.ts │ │ ├── qrcode.ts │ │ └── setFileObject.ts │ └── uniAjax.ts ├── projects │ └── aiplat │ │ ├── builds │ │ └── selfConfig.ts │ │ ├── manifest │ │ ├── pro │ │ │ └── manifest.json │ │ ├── uat │ │ │ └── manifest.json │ │ └── ver │ │ │ └── manifest.json │ │ ├── selfConfig.ts │ │ └── selfPages.json ├── service │ ├── api.ts │ ├── apis │ │ └── sign.ts │ ├── config.ts │ └── config │ │ └── map.ts ├── sfc.d.ts ├── static │ ├── aiplat │ │ ├── 72x72.png │ │ ├── cm_back.png │ │ ├── cm_close.png │ │ ├── cm_loading.gif │ │ ├── cm_right.png │ │ ├── donate_WX.png │ │ ├── donate_ZFB.png │ │ ├── icon.png │ │ ├── icon1024.png │ │ ├── icon2.png │ │ └── metro_icon.png │ ├── cmDemo1 │ │ ├── 1.jpg │ │ ├── 2.jpg │ │ └── 3.jpg │ ├── img │ │ ├── sy_01.png │ │ ├── sy_01on.png │ │ ├── sy_01on_zfb.png │ │ ├── sy_02.png │ │ ├── sy_02on.png │ │ ├── sy_02on_zfb.png │ │ ├── sy_03.png │ │ ├── sy_03on.png │ │ ├── sy_03on_zfb.png │ │ ├── sy_04.png │ │ ├── sy_04on.png │ │ └── sy_04on_zfb.png │ └── logo.png └── vuex │ ├── commonModule │ └── index.ts │ ├── donateModule │ └── index.ts │ └── store.ts ├── tsconfig.json ├── unpackage └── res │ └── icons │ ├── 120x120.png │ ├── 144x144.png │ ├── 152x152.png │ ├── 167x167.png │ ├── 180x180.png │ ├── 192x192.png │ ├── 20x20.png │ ├── 29x29.png │ ├── 40x40.png │ ├── 48x48.png │ ├── 58x58.png │ ├── 60x60.png │ ├── 72x72.png │ ├── 76x76.png │ ├── 80x80.png │ ├── 87x87.png │ └── 96x96.png └── vue.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # *.ts linguist-language=TypeScript+Vue 2 | # *.vue linguist-language=TypeScript+Vue 3 | # *.js linguist-language=TypeScript+Vue 4 | # *.css linguist-language=TypeScript+Vue 5 | # *.less linguist-language=TypeScript+Vue 6 | # *.scss linguist-language=TypeScript+Vue 7 | # *.html linguist-language=TypeScript+Vue -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | test/ 4 | .idea/ 5 | .vs/ 6 | .vscode/ 7 | nbproject/ 8 | .history/ 9 | /src/builds 10 | /src/manifest.json 11 | /src/pages.json 12 | .DS_Store 13 | 14 | # local env files 15 | .env.local 16 | .env.*.local 17 | 18 | # Log files 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | 23 | # Editor directories and files 24 | .project 25 | .idea 26 | .vscode 27 | *.suo 28 | *.ntvs* 29 | *.njsproj 30 | *.sln 31 | *.sw* 32 | 33 | yarn.lock 34 | package-lock.json 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # uniapp vue-cli4 typescript版本 2 | 3 | - vue-cli4 + vuex + cmui + html5 + css3 + typescript + electron 4 | - 一次开发,同时打包成Android版app、iOS版app、H5版、微信小程序版、支付宝小程序版、头条小程序、PC安装包平台这几个平台,界面统一,功能一致。 5 | - 新引入electron用于支持打包PC端(Windows、Mac、Linux)安装包, 后续也关注鸿蒙系统 6 | - cmui仓库为https://github.com/aiplat/cmui.git 7 | - 代码示例为 https://aiplat.com 的版本 http://uniapp.aiplat.com 8 | - 基于 https://uniapp.dcloud.io/ 的uni-app 9 | - 基于本仓库所开发的‘娱乐计分器’已经成功上线微信、头条、支付宝三大程序,暂不开源。各框架在升级中。 10 | 11 | --- 12 | 13 | # 代码目录结构 14 | - dist ------打包目录 15 | - public 16 | index.html ------入口公共html 17 | - screenshot ------运行环境截图 18 | - src 19 | - assets ------静态css文件目录 20 | - builds ------运行构建时目录(git已忽略,不可手动修改) 21 | - components ------公共组件目录 22 | - electron ------electron目录, 用于支持打包PC安装包 23 | - pages ------视图目录 24 | - aiplat ------aiplat项目视图目录 25 | - common ------公共页面目录 26 | - *** ------若有多个项目,请在这新增不同目录区分 27 | - plugins ------公共函数或插件目录 28 | - lib ------第三方库目录 29 | - cmapp.class.ts ------公共$cmapp配置 30 | - uniAjax.ts ------公共$uniAjax配置 31 | - projects ------多个小程序各配置目录 32 | - aiplat ------aiplat配置信息目录 33 | - *** ------若有多个项目,请在这新增不同目录区分 34 | - service ------配置目录 35 | - apis ------api扩展配置目录 36 | - config ------config扩展配置目录 37 | - api.ts ------公共$api配置 38 | - config.ts ------公共$config配置 39 | - static ------静态资源目录 40 | - vuex ------vuex目录 41 | - App.vue ------vue应用承载文件 42 | - lib.d.ts ------typescript声明文件 43 | - main.ts ------vue应用入口文件 44 | - manifest.json ------应用配置文件(运行构建时生成,git已忽略,不可手动修改) 45 | - pages.json ------页面配置文件(运行构建时生成,git已忽略,不可手动修改) 46 | - plugins.d.ts ------typescript声明文件 47 | - sfc.d.ts ------typescript声明文件 48 | - src-builds ------框架运行构建时修改配置目录 49 | - config.ts ------修改配置文件 50 | - electron.ts ------electron相关执行文件 51 | - utils.ts ------公共工具类 52 | 53 | --- 54 | 55 | # clone 56 | - $ git clone https://github.com/aiplat/uniapp.git 57 | 58 | # 安装依赖 59 | - $ cd uniapp 60 | - $ npm install 61 | 62 | # 开发模式 63 | - $ npm run dev (默认h5开发) h5运行默认打开 http://localhost:2016/#/ 64 | - $ npm run dev:mp-weixin (微信小程序开发) 65 | - 打开微信开发者工具->小程序->导入项目->选择dist/dev/mp-weixin 66 | - 若有多个项目同一个仓库,$ npm run dev --env=uat --type=** 区分 67 | 68 | 69 | # 打包项目 70 | - $ npm run build (默认构建h5) 71 | - $ npm run build:mp-weixin (微信小程序构建) 72 | - 单个项目(默认aiplat)代码打包到了dist/build/mp-weixin 73 | - 若有多个项目同一个仓库,$ npm run build --env=uat --type=** 区分 74 | 75 | --- 76 | 77 | # 注意 78 | - 开发工具为任意,不一定要HbuilderX.如果也要同时打包成app,再导入项目到HbuilderX打包。 79 | - 开发或构建成其他平台命令: 80 | - dev为开发模式,build为构建模式 81 | - 参数--env=uat为环境参数,默认uat。 82 | - 参数--type=aiplat为项目名,默认aiplat。 83 | - 例如: 84 | - $ npm run dev:mp-weixin --env=uat --type=** 为微信小程序平台->uat环境(测试环境)->开发模式 85 | - $ npm run dev:mp-weixin --env=ver --type=** 为微信小程序平台->ver环境(预生产环境)->开发模式 86 | - $ npm run dev:mp-weixin --env=pro --type=** 为微信小程序平台->pro环境(生产环境)->开发模式 87 | - $ npm run build:mp-weixin --env=uat --type=** 为微信小程序平台->uat环境(测试环境)->构建模式 88 | - $ npm run build:mp-weixin --env=ver --type=** 为微信小程序平台->ver环境(预生产环境)->构建模式 89 | - $ npm run build:mp-weixin --env=pro --type=** 为微信小程序平台->pro环境(生产环境)->构建模式 90 | 91 | #### 运行环境截图,screenshot目录,示例为aiplat项目 92 | #### 平台标识: 后面主要适配这几个平台, 如果也能适配到鸿蒙系统是最好 93 | - app-plus: android、ios 94 | - electron: PC安装包平台 95 | - h5: h5(pc web、mobile web) 96 | - mp-alipay: 支付宝小程序 97 | - mp-toutiao: 头条小程序 98 | - mp-weixin: 微信小程序 99 | - 注意:百度小程序、QQ小程序、快应用、360小程序这4个平台uni-app也是支持的,本示例没有运行与构建这4个平台论证。 100 | 101 | --- 102 | 103 | # projects -- 多个小程序各配置目录 104 | ## 默认aiplat,文件结构 105 | - manifest目录下还有uat/ver/pro(三个环境目录) 106 | - manifest.json -- uni-app应用的配置文件,用于指定应用的名称、图标、权限等。运行微信和头条小程序时请先将其中的appid改为自己可用的。 107 | - selfConfig.ts -- aiplat配置信息 108 | - selfPages.json -- 用于对 uni-app 进行全局配置,决定页面文件的路径、窗口表现、设置多 tab 等 109 | - 运行构建APP前先执行一次dev或build命令,使src目录里有以上对应的三个文件。 110 | 111 | ## 当有其他项目时如jifenqi(娱乐计分器,后续开源): 112 | - 开发命令为npm run dev --env=uat --type=jifenqi 113 | - 构建命令为npm run build --env=uat --type=jifenqi 114 | 115 | --- 116 | 117 | # 关于electron运行、构建、打包 118 | 119 | #### h5运行默认http://localhost:2016/#/ 120 | ## 运行:首先运行h5版本,再运行electron 121 | #### 运行h5,单独git bash窗口1 122 | - $ npm run dev:h5 --env=uat --type=aiplat 123 | #### 运行h5之后,单独git bash窗口2 124 | - $ npm run dev:electron --env=uat --type=aiplat 125 | - 此时h5运行时项目运行到electron环境 126 | 127 | ## 构建:首先构建h5版本,再构建electron,再打包(待添加完善) 128 | #### 构建h5 129 | - $ npm run build:h5 --env=uat --type=aiplat 130 | #### 构建h5之后继续执行 131 | - $ npm run build:electron --env=uat --type=aiplat 132 | - 此时h5构建时项目运行到electron环境 133 | 134 | #### 打包PC安装包(待添加完善) 135 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | const plugins = [] 2 | 3 | if (process.env.UNI_OPT_TREESHAKINGNG) { 4 | plugins.push(require('@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js')) 5 | } 6 | 7 | if ( 8 | ( 9 | process.env.UNI_PLATFORM === 'app-plus' && 10 | process.env.UNI_USING_V8 11 | ) || 12 | ( 13 | process.env.UNI_PLATFORM === 'h5' && 14 | process.env.UNI_H5_BROWSER === 'builtin' 15 | ) 16 | ) { 17 | const path = require('path') 18 | 19 | const isWin = /^win/.test(process.platform) 20 | 21 | const normalizePath = path => (isWin ? path.replace(/\\/g, '/') :path) 22 | 23 | const input = normalizePath(process.env.UNI_INPUT_DIR) 24 | try { 25 | plugins.push([ 26 | require('@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console'), 27 | { 28 | file (file) { 29 | file = normalizePath(file) 30 | if (file.indexOf(input) === 0) { 31 | return path.relative(input, file) 32 | } 33 | return false 34 | } 35 | } 36 | ]) 37 | } catch (e) {} 38 | } 39 | 40 | process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui'] 41 | process.UNI_LIBRARIES.forEach(libraryName => { 42 | plugins.push([ 43 | 'import', 44 | { 45 | 'libraryName':libraryName, 46 | 'customName':(name) => { 47 | return `${libraryName}/lib/${name}/${name}` 48 | } 49 | } 50 | ]) 51 | }) 52 | module.exports = { 53 | presets:[ 54 | [ 55 | '@vue/app', 56 | { 57 | modules:'commonjs', 58 | useBuiltIns:process.env.UNI_PLATFORM === 'h5' ? 'usage' :'entry' 59 | } 60 | ] 61 | ], 62 | plugins 63 | } 64 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aiplat.com-miniprogram", 3 | "version": "2.0.0", 4 | "private": true, 5 | "scripts": { 6 | "build": "npm run build:h5", 7 | "build:app-plus": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build", 8 | "build:custom": "ts-node src-builds/config.ts && cross-env NODE_ENV=production uniapp-cli custom", 9 | "build:h5": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build", 10 | "build:mp-360": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=mp-360 vue-cli-service uni-build", 11 | "build:mp-alipay": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build", 12 | "build:mp-baidu": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build", 13 | "build:mp-qq": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=mp-qq vue-cli-service uni-build", 14 | "build:mp-toutiao": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build", 15 | "build:mp-weixin": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build", 16 | "build:quickapp-native": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=quickapp-native vue-cli-service uni-build", 17 | "build:quickapp-webview": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview vue-cli-service uni-build", 18 | "build:quickapp-webview-huawei": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build", 19 | "build:quickapp-webview-union": "ts-node src-builds/config.ts && cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build", 20 | "build:electron": "ts-node src-builds/electron.ts && electron dist/build/h5/main.js", 21 | "dev": "npm run dev:h5", 22 | "dev:app-plus": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch", 23 | "dev:custom": "ts-node src-builds/config.ts && cross-env NODE_ENV=development uniapp-cli custom", 24 | "dev:h5": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve", 25 | "dev:mp-360": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=mp-360 vue-cli-service uni-build --watch", 26 | "dev:mp-alipay": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch", 27 | "dev:mp-baidu": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch", 28 | "dev:mp-qq": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch", 29 | "dev:mp-toutiao": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch", 30 | "dev:mp-weixin": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch", 31 | "dev:quickapp-native": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=quickapp-native vue-cli-service uni-build --watch", 32 | "dev:quickapp-webview": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview vue-cli-service uni-build --watch", 33 | "dev:quickapp-webview-huawei": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build --watch", 34 | "dev:quickapp-webview-union": "ts-node src-builds/config.ts && cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build --watch", 35 | "dev:electron": "electron src/electron/main.js", 36 | "info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js", 37 | "serve:quickapp-native": "node node_modules/@dcloudio/uni-quickapp-native/bin/serve.js", 38 | "test:android": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=android jest -i", 39 | "test:h5": "cross-env UNI_PLATFORM=h5 jest -i", 40 | "test:ios": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=ios jest -i", 41 | "test:mp-baidu": "cross-env UNI_PLATFORM=mp-baidu jest -i", 42 | "test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i" 43 | }, 44 | "dependencies": { 45 | "@dcloudio/uni-app-plus": "^2.0.0-31920210709003", 46 | "@dcloudio/uni-h5": "^2.0.0-31920210709003", 47 | "@dcloudio/uni-helper-json": "*", 48 | "@dcloudio/uni-i18n": "^2.0.0-31920210709003", 49 | "@dcloudio/uni-mp-360": "^2.0.0-31920210709003", 50 | "@dcloudio/uni-mp-alipay": "^2.0.0-31920210709003", 51 | "@dcloudio/uni-mp-baidu": "^2.0.0-31920210709003", 52 | "@dcloudio/uni-mp-kuaishou": "^2.0.0-31920210709003", 53 | "@dcloudio/uni-mp-qq": "^2.0.0-31920210709003", 54 | "@dcloudio/uni-mp-toutiao": "^2.0.0-31920210709003", 55 | "@dcloudio/uni-mp-vue": "^2.0.0-31920210709003", 56 | "@dcloudio/uni-mp-weixin": "^2.0.0-31920210709003", 57 | "@dcloudio/uni-quickapp-native": "^2.0.0-31920210709003", 58 | "@dcloudio/uni-quickapp-webview": "^2.0.0-31920210709003", 59 | "@dcloudio/uni-stat": "^2.0.0-31920210709003", 60 | "@vue/shared": "^3.0.0", 61 | "core-js": "^3.6.5", 62 | "html2canvas": "^1.0.0-rc.5", 63 | "regenerator-runtime": "^0.12.1", 64 | "vue": "^2.6.11", 65 | "vue-class-component": "^6.3.2", 66 | "vue-property-decorator": "^8.5.1", 67 | "vuex": "^3.2.0", 68 | "weixin-js-sdk": "^1.6.0" 69 | }, 70 | "devDependencies": { 71 | "@babel/plugin-syntax-typescript": "^7.2.0", 72 | "@babel/runtime": "~7.12.0", 73 | "@dcloudio/types": "*", 74 | "@dcloudio/uni-automator": "^2.0.0-31920210709003", 75 | "@dcloudio/uni-cli-shared": "^2.0.0-31920210709003", 76 | "@dcloudio/uni-migration": "^2.0.0-31920210709003", 77 | "@dcloudio/uni-template-compiler": "^2.0.0-31920210709003", 78 | "@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.0-31920210709003", 79 | "@dcloudio/vue-cli-plugin-uni": "^2.0.0-31920210709003", 80 | "@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-31920210709003", 81 | "@dcloudio/webpack-uni-mp-loader": "^2.0.0-31920210709003", 82 | "@dcloudio/webpack-uni-pages-loader": "^2.0.0-31920210709003", 83 | "@vue/cli-plugin-babel": "~4.5.0", 84 | "@vue/cli-plugin-typescript": "*", 85 | "@vue/cli-service": "~4.5.0", 86 | "axios": "^0.21.1", 87 | "babel-plugin-import": "^1.11.0", 88 | "compression-webpack-plugin": "^3.1.0", 89 | "cross-env": "^7.0.2", 90 | "crypto-js": "^3.1.9-1", 91 | "css-minimizer-webpack-plugin": "^1.2.0", 92 | "jest": "^25.4.0", 93 | "less": "^3.12.2", 94 | "less-loader": "^6.2.0", 95 | "mini-css-extract-plugin": "^2.1.0", 96 | "mini-types": "*", 97 | "miniprogram-api-typings": "*", 98 | "postcss-comment": "^2.0.0", 99 | "qrcode": "^1.4.4", 100 | "shelljs": "^0.8.3", 101 | "ts-node": "^8.10.2", 102 | "typescript": "^3.0.0", 103 | "vue-class-component": "^6.3.2", 104 | "vue-template-compiler": "^2.6.11", 105 | "vuex-class": "^0.3.2", 106 | "webpack-bundle-analyzer": "^4.4.2" 107 | }, 108 | "browserslist": [ 109 | "Android >= 4", 110 | "ios >= 8" 111 | ], 112 | "uni-app": { 113 | "scripts": {} 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | module.exports = { 3 | parser:require('postcss-comment'), 4 | plugins:[ 5 | require('postcss-import')({ 6 | resolve (id) { 7 | if (id.startsWith('~@/')) { 8 | return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3)) 9 | } else if (id.startsWith('@/')) { 10 | return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2)) 11 | } else if (id.startsWith('/') && !id.startsWith('//')) { 12 | return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1)) 13 | } 14 | return id 15 | } 16 | }), 17 | require('autoprefixer')({ 18 | remove:process.env.UNI_PLATFORM !== 'h5' 19 | }), 20 | require('@dcloudio/vue-cli-plugin-uni/packages/postcss') 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <%= htmlWebpackPlugin.options.title %> 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 40 | 41 | 42 | 43 | 44 | 47 |
48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /screenshot/app-plus-apps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiplat/uniapp/acc88661224ddf8e81a77dc98132226563dfd39b/screenshot/app-plus-apps.jpg -------------------------------------------------------------------------------- /screenshot/app-plus-donate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiplat/uniapp/acc88661224ddf8e81a77dc98132226563dfd39b/screenshot/app-plus-donate.jpg -------------------------------------------------------------------------------- /screenshot/app-plus-index.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiplat/uniapp/acc88661224ddf8e81a77dc98132226563dfd39b/screenshot/app-plus-index.jpg -------------------------------------------------------------------------------- /screenshot/electron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiplat/uniapp/acc88661224ddf8e81a77dc98132226563dfd39b/screenshot/electron.png -------------------------------------------------------------------------------- /screenshot/h5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiplat/uniapp/acc88661224ddf8e81a77dc98132226563dfd39b/screenshot/h5.png -------------------------------------------------------------------------------- /screenshot/mp-alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiplat/uniapp/acc88661224ddf8e81a77dc98132226563dfd39b/screenshot/mp-alipay.png -------------------------------------------------------------------------------- /screenshot/mp-toutiao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiplat/uniapp/acc88661224ddf8e81a77dc98132226563dfd39b/screenshot/mp-toutiao.png -------------------------------------------------------------------------------- /screenshot/mp-weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiplat/uniapp/acc88661224ddf8e81a77dc98132226563dfd39b/screenshot/mp-weixin.png -------------------------------------------------------------------------------- /screenshot/运行环境截图.md: -------------------------------------------------------------------------------- 1 | # 运行环境截图,示例为aiplat项目 2 | ## 后面主要适配这几个平台 3 | - app-plus: android、ios 4 | - electron: PC安装包平台 5 | - h5: h5(pc web、mobile web) 6 | - mp-alipay: 支付宝小程序 7 | - mp-toutiao: 头条小程序 8 | - mp-weixin: 微信小程序 -------------------------------------------------------------------------------- /src-builds/config.ts: -------------------------------------------------------------------------------- 1 | class configClass{ 2 | public utils = require('./utils'); 3 | constructor() { 4 | } 5 | async initStart() { 6 | const utilsClass = new this.utils(); 7 | const utilsParams = utilsClass.getParams(); 8 | 9 | let appTypeName:any = utilsParams.buildType.split(':'); 10 | appTypeName = appTypeName && appTypeName.length > 1 ? appTypeName[1] : 'h5'; 11 | 12 | const runDir = utilsParams.buildType.includes('build') ? 'build' :'dev'; 13 | utilsParams.shell.rm('-rf', `${utilsParams.currentDir}/dist/${runDir}/${appTypeName}`); 14 | utilsParams.shell.rm('-rf', `${utilsParams.currentDir}/dist/${runDir}/.automator/${appTypeName}`); 15 | utilsParams.shell.rm('-rf', `${utilsParams.currentDir}/dist/${runDir}/.sourcemap/${appTypeName}`); 16 | 17 | const buildsDir = `${utilsParams.currentDir}/src/builds`; 18 | utilsParams.shell.rm('-rf', buildsDir); 19 | utilsParams.shell.mkdir('-p', buildsDir); 20 | 21 | appTypeName = utilsClass.getAppTypeName(appTypeName); 22 | 23 | console.log(''); 24 | const isDevTxt = utilsParams.buildType.includes('build') ? '构建' :'开发'; 25 | console.log(`------${appTypeName}平台-${utilsParams.envTxt[utilsParams.envType]}环境-${isDevTxt}-${utilsParams.type}------`); 26 | console.log(''); 27 | 28 | await utilsClass.writeFile({ 29 | file:`${utilsParams.currentDir}/src/builds/envType.ts`, 30 | content:`const envType:string = '${utilsParams.envType}';export default envType;`, 31 | }); 32 | 33 | utilsClass.buildFile({ 34 | oldFile:`${utilsParams.currentDir}/src/projects/${utilsParams.type}/selfPages.json`, 35 | newFile:`${utilsParams.currentDir}/src/pages.json`, 36 | }); 37 | utilsClass.buildFile({ 38 | oldFile:`${utilsParams.currentDir}/src/projects/${utilsParams.type}/manifest/${utilsParams.envType}/manifest.json`, 39 | newFile:`${utilsParams.currentDir}/src/manifest.json`, 40 | }); 41 | utilsClass.buildFile({ 42 | oldFile:`${utilsParams.currentDir}/src/projects/${utilsParams.type}/builds/selfConfig.ts`, 43 | newFile:`${utilsParams.currentDir}/src/builds/selfConfig.ts`, 44 | }); 45 | console.log(''); 46 | console.log('------Building now------'); 47 | console.log(''); 48 | } 49 | } 50 | 51 | const configClassTarget = new configClass(); 52 | configClassTarget.initStart(); 53 | -------------------------------------------------------------------------------- /src-builds/electron.ts: -------------------------------------------------------------------------------- 1 | class electronClass{ 2 | public utils = require('./utils'); 3 | constructor() { 4 | } 5 | async initStart() { 6 | const utilsClass = new this.utils(); 7 | const utilsParams = utilsClass.getParams(); 8 | 9 | utilsClass.buildFile({ 10 | oldFile:`${utilsParams.currentDir}/src/electron/main.js`, 11 | newFile:`${utilsParams.currentDir}/dist/build/h5/main.js`, 12 | }); 13 | utilsClass.buildFile({ 14 | oldFile:`${utilsParams.currentDir}/src/electron/package.json`, 15 | newFile:`${utilsParams.currentDir}/dist/build/h5/package.json`, 16 | }); 17 | utilsClass.buildFile({ 18 | oldFile:`${utilsParams.currentDir}/src/electron/preload.js`, 19 | newFile:`${utilsParams.currentDir}/dist/build/h5/preload.js`, 20 | }); 21 | utilsClass.buildFile({ 22 | oldFile:`${utilsParams.currentDir}/src/electron/utils.js`, 23 | newFile:`${utilsParams.currentDir}/dist/build/h5/utils.js`, 24 | }); 25 | console.log(''); 26 | console.log('------electron build ok------'); 27 | console.log(''); 28 | } 29 | } 30 | 31 | const electronClassTarget = new electronClass(); 32 | electronClassTarget.initStart(); 33 | -------------------------------------------------------------------------------- /src-builds/utils.ts: -------------------------------------------------------------------------------- 1 | interface fileData{ 2 | file:string, 3 | content:string, 4 | } 5 | 6 | interface buildFileData{ 7 | oldFile:string, 8 | newFile:string, 9 | } 10 | 11 | interface envData{ 12 | runId:number, 13 | envType:string, 14 | type:string, 15 | buildType:string, 16 | } 17 | 18 | class utilsClass{ 19 | public fs = require('fs'); 20 | public shell = require('shelljs'); 21 | public currentDir = '.'; 22 | public buildInfo:envData; 23 | public envTxt:any = { 24 | sit:'SIT', 25 | uat:'UAT', 26 | ver:'VER', 27 | pro:'生产', 28 | }; 29 | constructor() { 30 | this.buildInfo = { 31 | runId:0, 32 | buildType:'dev', 33 | envType:'uat', 34 | type:'aiplat', 35 | }; 36 | this.getEnv(); 37 | } 38 | writeFile(fileData:fileData) { 39 | return new Promise((resolve) => { 40 | this.fs.writeFile(fileData.file, fileData.content, (err:any) => { 41 | if (err) { 42 | console.error(err); 43 | } else { 44 | console.log(`------Build ./${fileData.file}------`); 45 | } 46 | resolve(true); 47 | }); 48 | }); 49 | } 50 | readFile(fileData:fileData) { 51 | return new Promise((resolve) => { 52 | this.fs.readFile(fileData.file, 'utf8', (err:any, data:string) => { 53 | if (err) { 54 | console.error(err); 55 | } 56 | resolve(data); 57 | }); 58 | }); 59 | } 60 | isIn(value:string, key:string, defaultValue:string) { 61 | value = value.includes(key) ? `${value.split(key)[1]}` :defaultValue; 62 | return value; 63 | } 64 | buildFile(data:buildFileData) { 65 | this.shell.cp('-R', data.oldFile, data.newFile); 66 | console.log(`------Build ${data.newFile}------`); 67 | } 68 | getEnv() { 69 | return new Promise((resolve) => { 70 | let argv = process.env.npm_config_argv; 71 | if (!argv) { 72 | resolve(false); 73 | return false; 74 | } 75 | argv = JSON.parse(argv); 76 | 77 | let runId = argv.original.indexOf('run'); 78 | const buildType = argv.original[runId + 1]; 79 | let envType = argv.original[runId + 2]; 80 | envType = envType ? this.isIn(envType, 'env=', 'uat') :'uat'; 81 | let type = argv.original[runId + 3]; 82 | type = type ? this.isIn(type, 'type=', 'aiplat') :'aiplat'; 83 | this.buildInfo = { 84 | runId, 85 | buildType, 86 | envType, 87 | type, 88 | } 89 | resolve(true); 90 | }); 91 | } 92 | getAppTypeName(type = 'h5') { 93 | const appType:any = { 94 | 'app-plus':'APP', 95 | 'h5':'H5', 96 | 'custom':'custom', 97 | 'mp-360':'360小程序', 98 | 'mp-alipay':'支付宝小程序', 99 | 'mp-baidu':'百度小程序', 100 | 'mp-qq':'QQ小程序', 101 | 'mp-toutiao':'今日头条小程序', 102 | 'mp-weixin':'微信小程序', 103 | }; 104 | return appType[type]; 105 | } 106 | getParams() { 107 | return { 108 | fs: this.fs, 109 | shell: this.shell, 110 | currentDir: this.currentDir, 111 | envTxt: this.envTxt, 112 | ...this.buildInfo 113 | } 114 | } 115 | } 116 | 117 | module.exports = utilsClass -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 27 | -------------------------------------------------------------------------------- /src/assets/css/aiplat.css: -------------------------------------------------------------------------------- 1 | /* 2 | ----------------------------------------------------------------- 3 | *文 件 名:aiplat.css 4 | *修 改 人:梁超明 womendi@qq.com 5 | *最近修改:2019.01.24 6 | ----------------------------------------------------------------- 7 | */ 8 | .cm_c1b{background:#FD1414!important;} 9 | .cm_c1c{color:#FD1414!important;}/*c1*/ 10 | .cm_c2b{background:rgb(0,0,0)!important;} 11 | .cm_c2c{color:rgb(0,0,0)!important;}/*c2*/ 12 | .cm_c3b{background:rgb(105,104,103)!important;} 13 | .cm_c3c{color:rgb(105,104,103)!important;}/*c3*/ 14 | .cm_c4b{background:rgb(155,155,155)!important;} 15 | .cm_c4c{color:rgb(155,155,155)!important;}/*c4*/ 16 | .cm_c5b{background:rgb(223,221,218)!important;} 17 | .cm_c5c{color:rgb(223,221,218)!important;}/*c5*/ 18 | .cm_c6b{background:rgb(239,239,238)!important;} 19 | .cm_c6c{color:rgb(239,239,238)!important;}/*c6*/ 20 | .cm_c7b{background:rgb(255,255,255)!important;} 21 | .cm_c7c{color:rgb(255,255,255)!important;}/*c7*/ 22 | .cm_c8b{background:#22BF22!important;} 23 | .cm_c8c{color:#22BF22!important;}/*c8*/ 24 | .cm_c9b{background:#1890FF!important;} 25 | .cm_c9c{color:#1890FF!important;}/*c9*/ 26 | 27 | .ulMain{ 28 | width: 100vw; 29 | min-height: 100vh; 30 | } 31 | .jifenView{ 32 | width: 100vw; 33 | height: 100vh; 34 | } 35 | .jifenTitle{ 36 | border:1px solid #FD1414; 37 | color:#FD1414; 38 | } 39 | .jifenTitleAli{ 40 | border:1px solid #1890FF; 41 | color:#1890FF; 42 | } 43 | -------------------------------------------------------------------------------- /src/assets/css/cmreset.css: -------------------------------------------------------------------------------- 1 | /* 2 | ----------------------------------------------------------------- 3 | *文 件 名:cmreset.css 4 | *修 改 人:梁超明 womendi@qq.com 5 | *最近修改:2019.01.24 6 | ----------------------------------------------------------------- 7 | */ 8 | html { 9 | margin: 0; 10 | padding: 0; 11 | border: 0; 12 | font-size:1em!important; 13 | } 14 | body, 15 | div, 16 | span, 17 | object, 18 | iframe, 19 | h1, 20 | h2, 21 | h3, 22 | h4, 23 | h5, 24 | h6, 25 | p, 26 | blockquote, 27 | pre, 28 | a, 29 | abbr, 30 | acronym, 31 | address, 32 | code, 33 | del, 34 | dfn, 35 | em, 36 | q, 37 | dl, 38 | dt, 39 | dd, 40 | ol, 41 | ul, 42 | li, 43 | fieldset, 44 | form, 45 | legend, 46 | caption, 47 | tbody, 48 | tfoot, 49 | thead, 50 | article, 51 | aside, 52 | dialog, 53 | figure, 54 | footer, 55 | header, 56 | hgroup, 57 | nav, 58 | section, 59 | button, 60 | input, 61 | optgroup, 62 | select, 63 | textarea, 64 | view, 65 | image{ 66 | margin: 0; 67 | padding: 0; 68 | border: 0; 69 | font: inherit; 70 | vertical-align: baseline; 71 | -webkit-box-sizing: border-box; 72 | -moz-box-sizing: border-box; 73 | box-sizing: border-box; 74 | -webkit-appearance: none!important; 75 | } 76 | body { 77 | font-size: 1em!important; 78 | background: #fff; 79 | font-family: 'Microsoft YaHei'; 80 | word-break: break-all; 81 | word-wrap: break-word; 82 | } 83 | article, 84 | aside, 85 | details, 86 | figcaption, 87 | figure, 88 | footer, 89 | header, 90 | hgroup, 91 | main, 92 | nav, 93 | section, 94 | summary { 95 | display: block; 96 | } 97 | audio, 98 | canvas, 99 | progress, 100 | video { 101 | display: inline-block; 102 | vertical-align: baseline; 103 | } 104 | ul, 105 | ol, 106 | li{ 107 | list-style: none; 108 | } 109 | -------------------------------------------------------------------------------- /src/components/ani-copyright.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 37 | -------------------------------------------------------------------------------- /src/components/ani-header1.vue: -------------------------------------------------------------------------------- 1 | 11 | 22 | -------------------------------------------------------------------------------- /src/components/ani-image.vue: -------------------------------------------------------------------------------- 1 | 5 | 18 | -------------------------------------------------------------------------------- /src/components/ani-jifenqi-table.vue: -------------------------------------------------------------------------------- 1 | 39 | 55 | 62 | -------------------------------------------------------------------------------- /src/components/ani-list01.vue: -------------------------------------------------------------------------------- 1 | 17 | 34 | -------------------------------------------------------------------------------- /src/components/ani-no-data.vue: -------------------------------------------------------------------------------- 1 | 8 | 23 | -------------------------------------------------------------------------------- /src/components/ani-pop-confirm.vue: -------------------------------------------------------------------------------- 1 | 40 | 62 | -------------------------------------------------------------------------------- /src/components/ani-pop-win.vue: -------------------------------------------------------------------------------- 1 | 18 | 35 | -------------------------------------------------------------------------------- /src/electron/main.js: -------------------------------------------------------------------------------- 1 | const { app, BrowserWindow } = require('electron') 2 | const path = require('path') 3 | const utils = require('./utils.js'); 4 | 5 | async function createWindow() { 6 | const win = new BrowserWindow({ 7 | width: 1024, 8 | height: 800, 9 | webPreferences: { 10 | preload: path.join(__dirname, 'preload.js') 11 | } 12 | }) 13 | const buildInfo = await utils.getBuildInfo(); 14 | if (buildInfo && buildInfo.buildType.includes('build')) { 15 | win.loadFile('index.html') // build模式 16 | } else { 17 | win.loadURL('http://localhost:2016/#/') // dev模式 18 | } 19 | } 20 | 21 | app.whenReady().then(() => { 22 | createWindow() 23 | 24 | app.on('activate', () => { 25 | if (BrowserWindow.getAllWindows().length === 0) { 26 | createWindow() 27 | } 28 | }) 29 | }) 30 | 31 | app.on('window-all-closed', () => { 32 | if (process.platform !== 'darwin') { 33 | app.quit() 34 | } 35 | }) -------------------------------------------------------------------------------- /src/electron/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aiplat.com-electron", 3 | "version": "0.0.1", 4 | "author": "aiplat.com", 5 | "description": "electron app", 6 | "scripts": { 7 | "build:electron": "electron ./main.js" 8 | } 9 | } -------------------------------------------------------------------------------- /src/electron/preload.js: -------------------------------------------------------------------------------- 1 | window.addEventListener('DOMContentLoaded', () => { 2 | const replaceText = (selector, text) => { 3 | const element = document.getElementById(selector) 4 | if (element) element.innerText = text 5 | } 6 | 7 | for (const type of ['chrome', 'node', 'electron']) { 8 | replaceText(`${type}-version`, process.versions[type]) 9 | } 10 | }) -------------------------------------------------------------------------------- /src/electron/utils.js: -------------------------------------------------------------------------------- 1 | const utils = function () { 2 | this.isIn = function(value, key, defaultValue) { 3 | value = value.includes(key) ? `${value.split(key)[1]}` : defaultValue; 4 | return value; 5 | } 6 | this.getBuildInfo = function () { 7 | return new Promise((resolve) => { 8 | let argv = process.env.npm_config_argv; 9 | if (!argv) { 10 | resolve(null); 11 | return false; 12 | } 13 | argv = JSON.parse(argv); 14 | 15 | let runId = argv.original.indexOf('run'); 16 | const buildType = argv.original[runId + 1]; 17 | let envType = argv.original[runId + 2]; 18 | envType = envType ? this.isIn(envType, 'env=', 'uat') : 'uat'; 19 | let type = argv.original[runId + 3]; 20 | type = type ? this.isIn(type, 'type=', 'aiplat') : 'aiplat'; 21 | resolve({ 22 | runId, 23 | buildType, 24 | envType, 25 | type, 26 | }); 27 | }); 28 | } 29 | return this; 30 | } 31 | 32 | module.exports = utils(); -------------------------------------------------------------------------------- /src/lib.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'crypto-js/hmac-sha256'; 2 | // #ifdef H5 3 | declare module 'weixin-js-sdk'; 4 | declare var window: Window & typeof globalThis; 5 | declare module 'qrcode'; 6 | // #endif 7 | declare var plus; // h5+ 8 | declare var uni; // uni 9 | declare var getCurrentPages; // uni 10 | declare var require; // nodejs 11 | declare var process; // nodejs 12 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import App from '@/App.vue'; 3 | import plugins from '@/plugins/index'; 4 | 5 | Vue.config.productionTip = false; 6 | Vue.use(plugins); 7 | 8 | new App().$mount(); 9 | -------------------------------------------------------------------------------- /src/pages/aiplat/apps.vue: -------------------------------------------------------------------------------- 1 | 44 | 141 | 143 | -------------------------------------------------------------------------------- /src/pages/aiplat/donate.vue: -------------------------------------------------------------------------------- 1 | 53 | 100 | 102 | -------------------------------------------------------------------------------- /src/pages/aiplat/index.vue: -------------------------------------------------------------------------------- 1 | 67 | 150 | 152 | -------------------------------------------------------------------------------- /src/pages/common/about.vue: -------------------------------------------------------------------------------- 1 | 20 | 49 | 51 | -------------------------------------------------------------------------------- /src/pages/common/find.vue: -------------------------------------------------------------------------------- 1 | 37 | 85 | -------------------------------------------------------------------------------- /src/pages/common/h5.vue: -------------------------------------------------------------------------------- 1 | 12 | 44 | -------------------------------------------------------------------------------- /src/pages/common/mine.vue: -------------------------------------------------------------------------------- 1 | 58 | 110 | 115 | -------------------------------------------------------------------------------- /src/pages/common/userAgent.vue: -------------------------------------------------------------------------------- 1 |