diff --git a/README.md b/README.md index 2868fee..6cac505 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # alipay-scan-code-front-end ## 项目说明 @@ -23,10 +23,27 @@ npm run dev npm run build ``` +### 项目本地调试 + +``` +运行成功后 本地调试首次进入会进入到 http://localhost:8080/#/404 404页面 +因为当前url还没有参数, 此时需要手动在url后面添加需要的参数, +例子: http://localhost:8080/#/index?goodsNo=889&userId=1 +其中 goodsNo是商品的no, userId是用户的id, 这两个参数后面接口都会用到 +以上在线上环境不需要配置,因为二维码会自动把这两个参数添加上去 +``` + ### 项目代码编写规范(暂时想到这些,后面根据项目情况补充说明) - css类名: 小写驼峰 中间用 - 隔开 - js函数方法: 开头小写后面开头大写驼峰 - .vue 文件命名: 统一大写驼峰 +- 常量命名: 全部大写 以_拼接, 具体例子见: /src/config/models下的文件 + + +### 项目分支管理 +- master: 不可在此分支做任何修改, 只能合并develop分支, git merge --no-ff develop ; 且部署上线时对应production环境,不可混肴 +- develop: 平时开发使用此分支, 需另开分支并说明是做什么的, 比如fix bug, git checkout -b fix-xxxx, 开发完成自测无问题后合并到develop分支, +- test: 如不必要不在此分支做任何修改, 合并develpo分支, git merge --no-ff develop ; 部署上线时对应test环境,不可混肴 ### git 提交规范 - feature 新增一个功能 @@ -43,14 +60,30 @@ npm run build 。 ### 版本控制以及版本迭代说明 + ### v1.0.0 `2022.02.23` build - 初版发布 - 完成 项目搭建 -- 完成 项目迁移 从documentFrontEndWeb 到 AlipayFrontendWeb +- 完成 项目迁移 从documentFrontEndWeb 到 AntpayFrontEnd - 增加 docker部署脚本 - 增加 环境设置脚本 - 增加 nginx.conf文件 fix -- 修复 路由history模式原因引起的页面空白的问题 \ No newline at end of file +- 修复 路由history模式原因引起的页面空白的问题 + +### v1.0.1 +`2022.02.25` +feature +- 增加 非支付宝浏览环境下扫码切换支付宝弹窗提示 +- 增加 android和ios设备支付宝下载链接 +- 增加 android设备复制粘贴下载链接功能 + + +### v1.0.2 +`2022.03.04` +feature +- 增加 春雨个性化定制 '@/views/chunyu/AliPayForm' +- 增加 Checkbox 组件, '@/components/checkbox' +- 增加 AgreementDialog 组件, '@/components/AgreementDialog' \ No newline at end of file diff --git a/antpay_frontend_web_run.sh b/antpay_frontend_web_run.sh index cb60b1f..6ff264e 100644 --- a/antpay_frontend_web_run.sh +++ b/antpay_frontend_web_run.sh @@ -2,9 +2,9 @@ ### # @Date: 2021-11-15 09:37:49 # @LastEditors: JinxChen - # @LastEditTime: 2022-02-25 11:36:46 + # @LastEditTime: 2022-03-04 10:47:47 # @FilePath: \AntpayFrontEnd\antpay_frontend_web_run.sh - # @description: docker部署脚本 + # @description: docker部署脚本, 根据项目具体情况来 修改 docker run -p 8804:80 ### environment=$1 version=$2 diff --git a/package-lock.json b/package-lock.json index e7acc8a..50a360b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,8 +5,10 @@ "requires": true, "packages": { "": { + "name": "alipay-scan-code-front-end", "version": "0.1.0", "dependencies": { + "@vant/area-data": "^1.2.2", "axios": "^0.26.0", "core-js": "^3.6.5", "nprogress": "^0.2.0", @@ -2492,6 +2494,11 @@ "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", "dev": true }, + "node_modules/@vant/area-data": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vant/area-data/-/area-data-1.2.2.tgz", + "integrity": "sha512-efv7Yl/OTHjyy0irhJJPtgZb5mJZmroEtVOa8vkGRNTLY93+NgEcVuIBaC35hYCMsTrPHDQRvQGnI9Hyhtto0Q==" + }, "node_modules/@vant/icons": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/@vant/icons/-/icons-1.7.3.tgz", @@ -21439,6 +21446,11 @@ "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", "dev": true }, + "@vant/area-data": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vant/area-data/-/area-data-1.2.2.tgz", + "integrity": "sha512-efv7Yl/OTHjyy0irhJJPtgZb5mJZmroEtVOa8vkGRNTLY93+NgEcVuIBaC35hYCMsTrPHDQRvQGnI9Hyhtto0Q==" + }, "@vant/icons": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/@vant/icons/-/icons-1.7.3.tgz", diff --git a/package.json b/package.json index 9600648..d5ffd6e 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "test:unit": "vue-cli-service test:unit" }, "dependencies": { + "@vant/area-data": "^1.2.2", "axios": "^0.26.0", "core-js": "^3.6.5", "nprogress": "^0.2.0", diff --git a/src/App.vue b/src/App.vue index 1b58adb..ef212b3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,8 +1,8 @@ + + diff --git a/src/components/Checkbox.vue b/src/components/Checkbox.vue new file mode 100644 index 0000000..e887ae0 --- /dev/null +++ b/src/components/Checkbox.vue @@ -0,0 +1,76 @@ + + + + + + \ No newline at end of file diff --git a/src/config/customize.js b/src/config/customize.js new file mode 100644 index 0000000..9c6f92f --- /dev/null +++ b/src/config/customize.js @@ -0,0 +1,13 @@ +/* + * @Date: 2022-02-26 15:09:25 + * @LastEditors: JinxChen + * @LastEditTime: 2022-03-04 10:58:12 + * @FilePath: \AntpayFrontEnd\src\config\customize.js + * @description: 个性化定制, 根据不同的商家定制个性化的界面 + * 注意: 后期可以根据接口来实现 + */ +import store from '../store/index'; + +export const CUSTOMIZE_SERVICE = { + isChunyu:() => store.getters.goodsNo === 889, +}; \ No newline at end of file diff --git a/src/config/models.js b/src/config/models.js index 92b184b..742a8b0 100644 --- a/src/config/models.js +++ b/src/config/models.js @@ -1,13 +1,21 @@ /* * @Date: 2021-11-20 10:26:39 * @LastEditors: JinxChen - * @LastEditTime: 2022-02-23 17:36:43 - * @FilePath: \AlipayFrontEnd\src\config\models.js + * @LastEditTime: 2022-03-04 11:38:20 + * @FilePath: \AntpayFrontEnd\src\config\models.js * @description: */ -export const VersionModel = '1.0.0'; -export const ImageUrl = { +export const VERSION_MODEL = '1.0.2'; //版本号 +export const IMAGE_URL = { production: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/', development: 'http://zfb.ssjlai.com/web/' }; +//用户设备 +export const USER_AGENT = window.navigator.userAgent; + +// 支付宝下载链接 +export const ALIPAY_DOWN_URL = { + android: 'https://d.alipay.com', + ios: 'https://itunes.apple.com/cn/app/zhi-fu-bao-qian-bao-yu-e-bao/id333206289?mt=8' +}; diff --git a/src/main.js b/src/main.js index adb9ce5..2f14456 100644 --- a/src/main.js +++ b/src/main.js @@ -1,8 +1,8 @@ /* * @Date: 2022-01-19 10:08:26 * @LastEditors: JinxChen - * @LastEditTime: 2022-02-15 17:22:45 - * @FilePath: \alipay-scan-code-front-end\src\main.js + * @LastEditTime: 2022-03-04 15:00:32 + * @FilePath: \AntpayFrontEnd\src\main.js * @description: */ import Vue from "vue"; @@ -33,7 +33,12 @@ import { Empty, Notify, Loading, -} from 'vant'; + Toast, + Popup, + Area, + Cascader, + Picker, +} from 'vant'; //按需加载vant组件 Vue .use(Button) @@ -57,10 +62,15 @@ Vue .use(Empty) .use(Notify) .use(Loading) + .use(Toast) + .use(Area) + .use(Popup) + .use(Picker) + .use(Cascader) .use(Tabs); Vue.config.productionTip = false; - +Vue.prototype.$bus = new Vue(); new Vue({ router, store, diff --git a/src/router/index.js b/src/router/index.js index 53398ca..22d2b63 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,7 +1,7 @@ /* * @Date: 2022-01-19 10:08:26 * @LastEditors: JinxChen - * @LastEditTime: 2022-02-25 15:26:05 + * @LastEditTime: 2022-02-28 09:47:42 * @FilePath: \AntpayFrontEnd\src\router\index.js * @description: */ @@ -19,6 +19,10 @@ const routes = [ { path: '/redirect', name: 'redirect', component: resolve => require(['@/views/AliPayRedirect'], resolve) }, { path: '/result', name: 'result', component: resolve => require(['@/views/AliPayResult'], resolve) }, { path: '/404', name: 'page-not-found', component: resolve => require(['@/views/page-not-found/index'], resolve) }, + // 春雨 + { path: '/chunyuForm', name: 'chunyuForm', component: resolve => require(['@/views/chunyu/AliPayForm'], resolve) }, + // 组件测试页面 + { path: '/compTest', name: 'compTest', component: resolve => require(['@/views/ComponentsTest'], resolve) }, ]; diff --git a/src/utils/bus.js b/src/utils/bus.js new file mode 100644 index 0000000..fbd053e --- /dev/null +++ b/src/utils/bus.js @@ -0,0 +1,10 @@ +/* + * @Date: 2022-02-28 15:30:40 + * @LastEditors: JinxChen + * @LastEditTime: 2022-02-28 15:30:43 + * @FilePath: \AntpayFrontEnd\src\utils\bus.js + * @description: + */ +import Vue from 'vue'; +const bus = new Vue(); +export default bus; \ No newline at end of file diff --git a/src/utils/index.js b/src/utils/index.js index 0b58264..24c2dcd 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,3 +1,10 @@ +/* + * @Date: 2022-01-19 16:39:51 + * @LastEditors: JinxChen + * @LastEditTime: 2022-02-25 16:55:56 + * @FilePath: \AntpayFrontEnd\src\utils\index.js + * @description: 工具类 + */ /** @@ -20,4 +27,26 @@ export function isNull(o) { */ export function isNotNull(o) { return !isNull(o); -} \ No newline at end of file +} + +// 判断用户是否是支付宝浏览器 +export function isAlipayBrowser(userAgent) { + if (/AlipayClient/.test(userAgent)) { + console.log("当前浏览器是支付宝浏览器"); + return true; + } else { + console.log("当前浏览器是非支付宝浏览器"); + return false; + } +} + +// 判断用户的设备是否是android +export function isAndroid(userAgent) { + if (userAgent.indexOf('Android') > -1 || userAgent.indexOf('Linux') > -1) { + console.log("当前用户设备是android"); + return true; + } else if (userAgent.indexOf('iPhone') > -1) { + console.log("当前用户设备是ios"); + return false; + } +} diff --git a/src/views/AliPayForm.vue b/src/views/AliPayForm.vue index 4321484..47e9be0 100644 --- a/src/views/AliPayForm.vue +++ b/src/views/AliPayForm.vue @@ -1,22 +1,30 @@ diff --git a/src/views/AliPayIndex.vue b/src/views/AliPayIndex.vue index 2cd27e9..a365721 100644 --- a/src/views/AliPayIndex.vue +++ b/src/views/AliPayIndex.vue @@ -1,8 +1,8 @@ + + diff --git a/src/views/chunyu/AliPayForm.vue b/src/views/chunyu/AliPayForm.vue new file mode 100644 index 0000000..f840a75 --- /dev/null +++ b/src/views/chunyu/AliPayForm.vue @@ -0,0 +1,501 @@ + + + + + +