diff --git a/LICENSE b/LICENSE index 261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64..883ad5610608d7841d079d13c63c3c6c2695a6f3 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright [2020-2024] [macrozheng] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 13b3b46f7aee5412f7b2a15de56ece963cb2add6..53569cc625a013d65145c56ff8c58f62758e2c09 100644 --- a/README.md +++ b/README.md @@ -17,15 +17,21 @@ ### 项目演示 -项目在线演示地址:[http://www.macrozheng.com/app/](http://www.macrozheng.com/app/) +项目在线演示地址:[https://www.macrozheng.com/app/](https://www.macrozheng.com/app/) -![](../images/mall_app_web_preview_01.png)![](../images/mall_app_web_preview_02.png) +### 效果展示 -![](../images/mall_app_web_preview_03.png)![](../images/mall_app_web_preview_04.png) +![](http://img.macrozheng.com/mall/project/mall_app_web_preview_01.png)![](http://img.macrozheng.com/mall/project/mall_app_web_preview_02.png) + +![](http://img.macrozheng.com/mall/project/mall_app_web_preview_03.png)![](http://img.macrozheng.com/mall/project/mall_app_web_preview_04.png) + +![](http://img.macrozheng.com/mall/project/mall_app_web_preview_05.png)![](http://img.macrozheng.com/mall/project/mall_app_web_preview_06.png) + +![](http://img.macrozheng.com/mall/project/mall_app_web_preview_07.png)![](http://img.macrozheng.com/mall/project/mall_app_web_preview_08.png) + +![](http://img.macrozheng.com/mall/project/mall_app_web_preview_09.png)![](http://img.macrozheng.com/mall/project/mall_app_web_preview_10.png) -![](../images/mall_app_web_preview_05.png)![](../images/mall_app_web_preview_06.png) -![](../images/mall_app_web_preview_07.png)![](../images/mall_app_web_preview_08.png) ### 技术选型 @@ -69,7 +75,7 @@ src -- 源码目录 - 本项目使用了`uni-app`专用开发工具`HBuilder X`(App开发版)开发,下载地址:https://www.dcloud.io/hbuilderx.html - 该项目为前后端分离项目,访问本地访问接口需搭建后台环境,搭建请参考后端项目[传送门](https://github.com/macrozheng/mall); - 注意由于`mall-app-web`中的接口都在`mall-portal`模块中,所以一定要启动该模块; -- 访问在线接口无需搭建后台环境,只需将`utils/requestUtil.js`文件中的`config.baseUrl`改为线上地址即可:http://portal-api.macrozheng.com +- 访问在线接口无需搭建后台环境,只需将`utils/requestUtil.js`文件中的`config.baseUrl`改为线上地址即可:https://portal-api.macrozheng.com - 克隆源代码到本地,使用`HBuilder X`打开; - 在`HBuilder X`中使用`运行->运行到浏览器->Chrome`运行项目,运行成功后会自动打开下面地址(将浏览器改为手机模式):http://localhost:8080 - 如果浏览器没有启动的话,可以直接访问如下地址访问:http://localhost:8080 @@ -84,6 +90,6 @@ src -- 源码目录 ## 许可证 -[Apache License 2.0](https://github.com/macrozheng/mall/blob/master/LICENSE) +[Apache License 2.0](https://github.com/macrozheng/mall-app-web/blob/master/LICENSE) -Copyright (c) 2020-2021 macrozheng \ No newline at end of file +Copyright (c) 2020-2024 macrozheng \ No newline at end of file diff --git a/api/order.js b/api/order.js index 4d34ab8e3ca8bdd955c21e94380a7e58259be268..b719ea1307b1312c52a55f9966bf0ed7cc4769c8 100644 --- a/api/order.js +++ b/api/order.js @@ -73,4 +73,12 @@ export function deleteUserOrder(data) { }, data: data }) +} + +export function fetchAliapyStatus(params) { + return request({ + method: 'GET', + url: '/alipay/query', + params: params + }) } \ No newline at end of file diff --git a/images/mall_app_web_preview_01.png b/images/mall_app_web_preview_01.png new file mode 100644 index 0000000000000000000000000000000000000000..c8d02719762af4bcf1437b6faa227750b5806b93 Binary files /dev/null and b/images/mall_app_web_preview_01.png differ diff --git a/images/mall_app_web_preview_02.png b/images/mall_app_web_preview_02.png new file mode 100644 index 0000000000000000000000000000000000000000..20f4a5f2c73f22431b8bd9c6aeb73de0be9ff105 Binary files /dev/null and b/images/mall_app_web_preview_02.png differ diff --git a/images/mall_app_web_preview_03.png b/images/mall_app_web_preview_03.png new file mode 100644 index 0000000000000000000000000000000000000000..0c6eac827de50ef1a12a35101921ddb26af88ede Binary files /dev/null and b/images/mall_app_web_preview_03.png differ diff --git a/images/mall_app_web_preview_04.png b/images/mall_app_web_preview_04.png new file mode 100644 index 0000000000000000000000000000000000000000..94ec254ff91f4ba0b76c717b87384f924f253be9 Binary files /dev/null and b/images/mall_app_web_preview_04.png differ diff --git a/images/mall_app_web_preview_05.png b/images/mall_app_web_preview_05.png new file mode 100644 index 0000000000000000000000000000000000000000..57a28b2133a9fb28be37cbcd9bd9ee2cb84bb478 Binary files /dev/null and b/images/mall_app_web_preview_05.png differ diff --git a/images/mall_app_web_preview_06.png b/images/mall_app_web_preview_06.png new file mode 100644 index 0000000000000000000000000000000000000000..765247ff2dbcc96aac187fcd319f0439d7bf9d1b Binary files /dev/null and b/images/mall_app_web_preview_06.png differ diff --git a/images/mall_app_web_preview_07.png b/images/mall_app_web_preview_07.png new file mode 100644 index 0000000000000000000000000000000000000000..909e97b65a1fe027f8987d72f7b1925682d52c9f Binary files /dev/null and b/images/mall_app_web_preview_07.png differ diff --git a/images/mall_app_web_preview_08.png b/images/mall_app_web_preview_08.png new file mode 100644 index 0000000000000000000000000000000000000000..72e428ba564568e0b1457a73c0105947451fe1ee Binary files /dev/null and b/images/mall_app_web_preview_08.png differ diff --git a/images/mall_app_web_preview_09.png b/images/mall_app_web_preview_09.png new file mode 100644 index 0000000000000000000000000000000000000000..b596b9c43bd2f63b4973144472c088c8a64074c9 Binary files /dev/null and b/images/mall_app_web_preview_09.png differ diff --git a/images/mall_app_web_preview_10.png b/images/mall_app_web_preview_10.png new file mode 100644 index 0000000000000000000000000000000000000000..d339ef7f01c8a2165b0bad9848c86b58228279ea Binary files /dev/null and b/images/mall_app_web_preview_10.png differ diff --git a/pages.json b/pages.json index f3f96e6ee63d71fa344bf83cca6528a2597b299c..e0e6fcc8ab4feb121334247be53115edfb663e5f 100644 --- a/pages.json +++ b/pages.json @@ -77,6 +77,16 @@ "animationType": "slide-in-bottom" } } + }, { + "path": "pages/public/register", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom", + "app-plus": { + "titleNView": false, + "animationType": "slide-in-bottom" + } + } }, { "path": "pages/user/user", "style": { diff --git a/pages/address/addressManage.vue b/pages/address/addressManage.vue index 5ac212711d59798715013f27a2a8eb0146046f67..67624a3ee7db295ffd8a848e0ccb0dd4f74e2d7b 100644 --- a/pages/address/addressManage.vue +++ b/pages/address/addressManage.vue @@ -12,12 +12,16 @@ 邮政编码 - + + + 所在区域 + 详细地址 @@ -49,7 +53,8 @@ default: false, province: '', city: '', - region: '' + region: '', + prefixAddress: '' } } }, @@ -59,6 +64,7 @@ title = '编辑收货地址' fetchAddressDetail(option.id).then(response=>{ this.addressData = response.data; + this.addressData.prefixAddress = this.addressData.province+this.addressData.city+this.addressData.region; }); } this.manageType = option.type; @@ -106,8 +112,13 @@ this.$api.msg('请输入正确的手机号码'); return; } + if (!data.prefixAddress) { + this.$api.msg('请输入区域'); + return; + } + this.covertAdderss(data.prefixAddress); if (!data.province) { - this.$api.msg('请在地图选择所在位置'); + this.$api.msg('请输入正确的省份'); return; } if (!data.detailAddress) { diff --git a/pages/money/pay.vue b/pages/money/pay.vue index b369d8464660af47936f55e074b0470e7e1a219d..04d242d970ecd3cdc58f26a5472f68b521dd7c24 100644 --- a/pages/money/pay.vue +++ b/pages/money/pay.vue @@ -6,25 +6,24 @@ - - - + + - 微信支付 - 推荐使用微信支付 + 支付宝支付 + 推荐使用支付宝支付 - - + + - 支付宝支付 + 微信支付 @@ -39,11 +38,12 @@ fetchOrderDetail, payOrderSuccess } from '@/api/order.js'; + import { API_BASE_URL, USE_ALIPAY } from '@/utils/appConfig.js'; export default { data() { return { orderId: null, - payType: 2, + payType: 1, orderInfo: {} }; }, @@ -60,14 +60,26 @@ }, //确认支付 confirm: async function() { - payOrderSuccess({ - orderId: this.orderId, - payType: this.payType - }).then(response => { - uni.redirectTo({ - url: '/pages/money/paySuccess' - }) - }); + if(USE_ALIPAY){ + if(this.payType!=1){ + uni.showToast({ + title:"暂不支持微信支付!", + icon:"none" + }) + return; + } + window.location.href = API_BASE_URL+"/alipay/webPay?outTradeNo=" + this.orderInfo.orderSn + "&subject=" + this.orderInfo.receiverName + "的商品订单" + "&totalAmount=" + this.orderInfo.totalAmount + }else{ + payOrderSuccess({ + orderId: this.orderId, + payType: this.payType + }).then(response => { + uni.redirectTo({ + url: '/pages/money/paySuccess' + }) + }); + } + }, } } diff --git a/pages/money/paySuccess.vue b/pages/money/paySuccess.vue index 06ef07e35b9007cffa1dd3b87428dc5e26a25ddf..9138b5945266eb41a1cda18d869d9e28a2a40119 100644 --- a/pages/money/paySuccess.vue +++ b/pages/money/paySuccess.vue @@ -1,7 +1,7 @@ + + diff --git a/static/qrcode_for_macrozheng_258.jpg b/static/qrcode_for_macrozheng_258.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d250c38fee4660c2b9019a43d1712e806789322c Binary files /dev/null and b/static/qrcode_for_macrozheng_258.jpg differ diff --git a/utils/appConfig.js b/utils/appConfig.js new file mode 100644 index 0000000000000000000000000000000000000000..3c7cedb12b6e0ea97f858cf54cb503a5e3ca5c11 --- /dev/null +++ b/utils/appConfig.js @@ -0,0 +1,6 @@ +// appConfig.js + +//配置API请求的基础路径 +export const API_BASE_URL = 'http://localhost:8085'; +//是否启用支付宝支付 +export const USE_ALIPAY = false; \ No newline at end of file diff --git a/utils/requestUtil.js b/utils/requestUtil.js index 226150904d5e35cb158b210199cdbdf299cedca1..77f1ecb81f8a68072329ce085a11f55f216a3528 100644 --- a/utils/requestUtil.js +++ b/utils/requestUtil.js @@ -1,9 +1,10 @@ import Request from '@/js_sdk/luch-request/request.js' +import { API_BASE_URL} from '@/utils/appConfig.js'; const http = new Request() http.setConfig((config) => { /* 设置全局配置 */ - config.baseUrl = 'http://localhost:8085' /* 根域名不同 */ + config.baseUrl = API_BASE_URL /* 根域名不同 */ config.header = { ...config.header }