diff --git a/README.md b/README.md index 6cac505..a9b61fe 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -86,4 +86,9 @@ feature feature - 增加 春雨个性化定制 '@/views/chunyu/AliPayForm' - 增加 Checkbox 组件, '@/components/checkbox' -- 增加 AgreementDialog 组件, '@/components/AgreementDialog' \ No newline at end of file +- 增加 AgreementDialog 组件, '@/components/AgreementDialog' + +### v1.0.3 +`2022.05.09` +feature +- 增加 支付宝花呗支付页面 \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index ef212b3..b1fafa0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,7 @@ @@ -43,6 +43,7 @@ export default { text-align: center; color: #2c3e50; height: 100vh; - width: 100vw; + width: 100%; + background-color: #f7f8fa; } diff --git a/src/api/alipay.js b/src/api/alipay.js index 0450017..bee8608 100644 --- a/src/api/alipay.js +++ b/src/api/alipay.js @@ -1,7 +1,7 @@ /* * @Date: 2022-02-14 15:18:50 * @LastEditors: JinxChen - * @LastEditTime: 2022-03-04 10:50:22 + * @LastEditTime: 2022-04-13 17:08:21 * @FilePath: \AntpayFrontEnd\src\api\alipay.js * @description: axios封装 */ @@ -11,16 +11,19 @@ export const APIAlipay = { getGoodsDetails, //首页获取商品数据 getAlipayForm, // 调起支付宝收银台 getAlipayResult, //获取支付结果 + getUserTemplate, //获取用户模板 + getQRCode, //获取商品二维码图片 }; export default APIAlipay; // post请求 -function getGoodsDetails(goodsNo) { +function getGoodsDetails(goodsNo, userId) { return request({ url: '/api/get/goods', method: 'get', params: { - goodsNo + goodsNo, + userId }, }); } @@ -40,6 +43,21 @@ function getAlipayResult(params) { data: params, }); } +function getUserTemplate (userId) { + return request({ + url: '/api/get/goodsTemplate', + method: 'get', + params: {userId}, + }); +} + +function getQRCode (userId, spuId) { + return request({ + url: 'api/get/QRCodeImageUrl', + method: 'get', + params: {userId, spuId}, + }); +} // get请求 示例 /* function getPolygonFence(serialNo) { diff --git a/src/assets/css/public.scss b/src/assets/css/public.scss new file mode 100644 index 0000000..0c463b3 --- /dev/null +++ b/src/assets/css/public.scss @@ -0,0 +1,42 @@ + + +// 公共css样式 + +// 24号字体 +.font-24 { + font-size: 24px; +} +// 16号字体 +.font-16 { + font-size: 16px; +} +// 红色字体 +.font-red { + color: red; +} +// 蓝色字体 +.font-blue { + color: #1989fa; +} +// 白色字体 +.font-white { + color: #fff; +} +// 居中flex-column布局 +.pos-flex-cen-column { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} +// 居中flex无column布局 +.pos-flex-cen { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} +// 下划线 +.underline { + text-decoration: underline; +} \ No newline at end of file diff --git a/src/assets/img/dealers_form_banner.jpg b/src/assets/img/dealers_form_banner.jpg new file mode 100644 index 0000000..0d273ee Binary files /dev/null and b/src/assets/img/dealers_form_banner.jpg differ diff --git a/src/config/models.js b/src/config/models.js index 742a8b0..9b7042a 100644 --- a/src/config/models.js +++ b/src/config/models.js @@ -1,11 +1,11 @@ /* * @Date: 2021-11-20 10:26:39 * @LastEditors: JinxChen - * @LastEditTime: 2022-03-04 11:38:20 + * @LastEditTime: 2022-05-09 11:30:58 * @FilePath: \AntpayFrontEnd\src\config\models.js * @description: */ -export const VERSION_MODEL = '1.0.2'; //版本号 +export const VERSION_MODEL = '1.0.3'; //版本号 export const IMAGE_URL = { production: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/', diff --git a/src/main.js b/src/main.js index 2f14456..9102d62 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,7 @@ /* * @Date: 2022-01-19 10:08:26 * @LastEditors: JinxChen - * @LastEditTime: 2022-03-04 15:00:32 + * @LastEditTime: 2022-04-12 15:07:40 * @FilePath: \AntpayFrontEnd\src\main.js * @description: */ @@ -38,6 +38,11 @@ import { Area, Cascader, Picker, + NoticeBar, + Icon, + ImagePreview, + Switch, + Tag, } from 'vant'; //按需加载vant组件 Vue @@ -67,6 +72,11 @@ Vue .use(Popup) .use(Picker) .use(Cascader) + .use(Tag) + .use(NoticeBar) + .use(Icon) + .use(ImagePreview) + .use(Switch) .use(Tabs); Vue.config.productionTip = false; diff --git a/src/router/index.js b/src/router/index.js index 22d2b63..f352ce6 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-28 09:47:42 + * @LastEditTime: 2022-04-13 11:15:53 * @FilePath: \AntpayFrontEnd\src\router\index.js * @description: */ @@ -23,6 +23,17 @@ const routes = [ { path: '/chunyuForm', name: 'chunyuForm', component: resolve => require(['@/views/chunyu/AliPayForm'], resolve) }, // 组件测试页面 { path: '/compTest', name: 'compTest', component: resolve => require(['@/views/ComponentsTest'], resolve) }, + // 新首页 + { path: '/index-new', name: 'index-new', component: resolve => require(['@/views/AlipayIndexNew'], resolve) }, + { path: '/form-new', name: 'form-new', component: resolve => require(['@/views/AliPayFormNew'], resolve) }, + + // 分销商模式- 首页 + { path: '/index-dealers', name: 'index-dealers', component: resolve => require(['@/views/alipay-dealers/AlipayIndexDealers'], resolve) }, + + // 分销商模式- 信息录入 + { path: '/form-dealers', name: 'form-dealers', component: resolve => require(['@/views/alipay-dealers/AlipayFormDealers'], resolve) }, + + ]; diff --git a/src/utils/index.js b/src/utils/index.js index 24c2dcd..db99691 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,7 +1,7 @@ /* * @Date: 2022-01-19 16:39:51 * @LastEditors: JinxChen - * @LastEditTime: 2022-02-25 16:55:56 + * @LastEditTime: 2022-04-13 16:22:59 * @FilePath: \AntpayFrontEnd\src\utils\index.js * @description: 工具类 */ @@ -50,3 +50,42 @@ export function isAndroid(userAgent) { return false; } } + + +// 初始化分期数数组, 1. 如果 分数数组面 包含有 '1' 并且还有其它'12' '24'两个分期, 则把 '1'删掉 +// 2. 否则直接返回该数组 +export function intCount(array) { + let index = array.some(item => item === '1'); + if( index) { + // 大于-1表示存在 + let newArray = array.splice(1, 2); + return newArray; + // 存在就删除 + } else { + return array; + } +} + + +// 通过接口返回的数组判读是否显示花呗或者支付宝,, 1. 1 12 24 都存在则支付宝花呗全都显示 +// 2. 只有 1 则 只显示支付宝 +// 3. 没有 1 则显示花呗 +export function isShowAlipay(array) { + let index = array.indexOf('1'); + if(index > -1 && array.length === 1 ) { + return true; + } else if (index > -1 && array.length > 2) { + return true; + } else { + return false; + } +} + +export function isShowAntpay(array) { + let index = array.indexOf('1'); + if(index < 0 && array.length >= 1) { + return true; + } else { + return false; + } +} \ No newline at end of file diff --git a/src/views/AliPayForm.vue b/src/views/AliPayForm.vue index 47e9be0..da7e784 100644 --- a/src/views/AliPayForm.vue +++ b/src/views/AliPayForm.vue @@ -1,7 +1,7 @@ @@ -14,11 +14,12 @@

- 套餐名字: + 套餐名字:

{{goodsData.mainTitle}}

+

- 月套餐费: + 月套餐费:

¥{{ (goodsData.price/goodsData.count).toFixed(2) }} x diff --git a/src/views/AliPayFormNew.vue b/src/views/AliPayFormNew.vue new file mode 100644 index 0000000..68fcf68 --- /dev/null +++ b/src/views/AliPayFormNew.vue @@ -0,0 +1,425 @@ + + + + + + diff --git a/src/views/AliPayIndex.vue b/src/views/AliPayIndex.vue index a365721..515cb1c 100644 --- a/src/views/AliPayIndex.vue +++ b/src/views/AliPayIndex.vue @@ -1,7 +1,7 @@ @@ -145,7 +145,7 @@ export default { antpayIconpath: require('../assets/antpay.png'), //花呗支付图片 alipayIconPath: require('../assets/alipay.png'), //支付宝图片 checked: false, //是否已经勾选协议 - isAlipayShow: false, //是否显示支付宝选项 + isAlipayShow: true, //是否显示支付宝选项 goodsNo: '', //商品id countList: null, //分期数数组 isAmountShow: true, //是否显示总数, 默认显示,部分客户不需要显示则false @@ -199,7 +199,7 @@ export default { this.isNewCustom = false; this.isAmountShow = true; } else if (goodsNo === '889') { - this.isChunyu = true; + this.isChunyu = false; this.submitText = '下一步'; this.switchPayType = '支付方案' } @@ -357,15 +357,15 @@ export default { .index-banner{ height: 40vh; width: 100vw; - padding: 5px 5px 0 5px; + /* padding: 5px 5px 0 5px; */ .img-contanier { - height: calc(40vh - 5px); - width: calc(100vw - 10px); + height: 40vh; + width: 100vw; } } .index-body { flex: 1; - margin: 0 5px 5px 5px; + /* margin: 0 5px 5px 5px; */ padding: 0 10px 10px 10px; overflow: scroll; box-shadow: rgba(0, 0, 0, 0.09) 0px 2px 1px, rgba(0, 0, 0, 0.09) 0px 4px 2px, rgba(0, 0, 0, 0.09) 0px 8px 4px, rgba(0, 0, 0, 0.09) 0px 16px 8px, rgba(0, 0, 0, 0.09) 0px 32px 16px; diff --git a/src/views/AliPayResult.vue b/src/views/AliPayResult.vue index 1bb37f3..f86673a 100644 --- a/src/views/AliPayResult.vue +++ b/src/views/AliPayResult.vue @@ -1,31 +1,31 @@ @@ -42,5 +43,8 @@ export default { diff --git a/src/views/alipay-dealers/AlipayFormDealers.vue b/src/views/alipay-dealers/AlipayFormDealers.vue new file mode 100644 index 0000000..9611ba9 --- /dev/null +++ b/src/views/alipay-dealers/AlipayFormDealers.vue @@ -0,0 +1,338 @@ + + + + + + diff --git a/src/views/alipay-dealers/AlipayIndexDealers.vue b/src/views/alipay-dealers/AlipayIndexDealers.vue new file mode 100644 index 0000000..eee95b2 --- /dev/null +++ b/src/views/alipay-dealers/AlipayIndexDealers.vue @@ -0,0 +1,231 @@ + + + + + +// 此处不加 scoped是为了修改vant的默认样式 + + diff --git a/src/views/page-not-found/index.vue b/src/views/page-not-found/index.vue index 8fce652..25c1236 100644 --- a/src/views/page-not-found/index.vue +++ b/src/views/page-not-found/index.vue @@ -1,13 +1,13 @@ diff --git a/vue.config.js b/vue.config.js index 2593cb0..0fffe71 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,10 +1,10 @@ /* * @Author: your name * @Date: 2020-04-15 10:00:32 - * @LastEditTime: 2022-02-23 17:36:48 + * @LastEditTime: 2022-04-08 15:01:09 * @LastEditors: JinxChen * @Description: In User Settings Edit - * @FilePath: \AlipayFrontEnd\vue.config.js + * @FilePath: \AntpayFrontEnd\vue.config.js */ const port = process.env.port || process.env.npm_config_port || 8080;/* 7788 */ // dev port @@ -32,7 +32,12 @@ module.exports = { // 允许生成 CSS source maps? sourceMap: true, // pass custom options to pre-processor loaders. e.g. to pass options to // sass-loader, use { sass: { ... } } - loaderOptions: {}, + loaderOptions: { + sass: { + // 比如你可以这样向所有 Sass/Less 样式传入共享的全局变量 + prependData: `@import "@/assets/css/public.scss";` + }, + }, // Enable CSS modules for all css / pre-processor files. // This option does not affect *.vue files. requireModuleExtension: true },